Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
c3f61713
Commit
c3f61713
authored
Dec 10, 2019
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异步短信服务
parent
0b53f27e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
18 deletions
+22
-18
ucenter_basic.php
example/ucenter_basic.php
+2
-2
ucenter_message.php
example/ucenter_message.php
+10
-6
HyperfJsonRpc.php
src/base/HyperfJsonRpc.php
+1
-1
Express.php
src/ucenter/Express.php
+0
-1
Message.php
src/ucenter/Message.php
+9
-8
No files found.
example/ucenter_basic.php
View file @
c3f61713
...
@@ -34,8 +34,8 @@ Member::setDebug();
...
@@ -34,8 +34,8 @@ Member::setDebug();
//print_r($rt);
//print_r($rt);
$a
=
microtime
(
true
);
$a
=
microtime
(
true
);
//
$ret = Express::query('4302644653361', 'yd');
$ret
=
Express
::
query
(
'4302644653361'
,
'yd'
);
$ret
=
Express
::
company
();
//
$ret = Express::company();
$t
=
bcsub
(
microtime
(
true
),
$a
,
4
);
$t
=
bcsub
(
microtime
(
true
),
$a
,
4
);
print_r
(
$ret
);
print_r
(
$ret
);
echo
$t
;
echo
$t
;
example/ucenter_message.php
View file @
c3f61713
...
@@ -13,7 +13,11 @@ require __DIR__.'/_init.php';
...
@@ -13,7 +13,11 @@ require __DIR__.'/_init.php';
Message
::
setDebug
();
Message
::
setDebug
();
//$ret = Message::sendTemplateSmsByUid('12', 'default_code', ['code'=>rand(1000, 9999)]);
//$ret = Message::sendTemplateSmsByUidAsync('12', 'default_code', ['code'=>rand(1000, 9999)]);
$ret
=
Message
::
sendSms
(
'18019580609'
,
'Hello World 3'
);
var_dump
(
$ret
);
//$ret = Message::sendTemplateSms('18019580609', 'default_code', ['code'=>rand(1000, 9999)]);
//var_dump($ret);
//var_dump($ret);
//$name = uniqid('dev_');
//$name = uniqid('dev_');
...
@@ -38,8 +42,8 @@ Message::setDebug();
...
@@ -38,8 +42,8 @@ Message::setDebug();
//$info = \internalApi\ucenter\Message::pushMsg(1,0,0,'bbs','theme',0);
//$info = \internalApi\ucenter\Message::pushMsg(1,0,0,'bbs','theme',0);
//print_r($info);
//print_r($info);
$ret
=
Message
::
sendSystemMessageAsync
(
'remind'
,
0
,
12
,
Message
::
TYPE_REMIND
,
[
//
$ret = Message::sendSystemMessageAsync('remind', 0, 12, Message::TYPE_REMIND, [
'title'
=>
'测试的标题'
,
//
'title' => '测试的标题',
'text'
=>
'新消息测试'
.
uniqid
()
//
'text'=>'新消息测试'.uniqid()
]);
//
]);
print_r
(
$ret
);
//
print_r($ret);
src/base/HyperfJsonRpc.php
View file @
c3f61713
...
@@ -175,7 +175,7 @@ class HyperfJsonRpc
...
@@ -175,7 +175,7 @@ class HyperfJsonRpc
if
(
!
empty
(
$ret
[
'error'
]))
{
if
(
!
empty
(
$ret
[
'error'
]))
{
$this
->
_error
(
$ret
[
'error'
][
'message'
]);
$this
->
_error
(
$ret
[
'error'
][
'message'
]);
return
false
;
throw
new
ApiException
(
$ret
[
'error'
][
'message'
],
$ret
[
'error'
][
'code'
])
;
}
}
return
$ret
[
'result'
];
return
$ret
[
'result'
];
...
...
src/ucenter/Express.php
View file @
c3f61713
...
@@ -43,6 +43,5 @@ class Express extends Client
...
@@ -43,6 +43,5 @@ class Express extends Client
return
self
::
invoke
(
'/express/company'
,
func_get_args
());
return
self
::
invoke
(
'/express/company'
,
func_get_args
());
}
}
}
}
src/ucenter/Message.php
View file @
c3f61713
...
@@ -34,9 +34,9 @@ class Message extends Client
...
@@ -34,9 +34,9 @@ class Message extends Client
* @param string $signature 短信签名,中括号【】中的内容
* @param string $signature 短信签名,中括号【】中的内容
* @return bool|string 成功返回 true,失败返回错误文本
* @return bool|string 成功返回 true,失败返回错误文本
*/
*/
public
static
function
sendSms
(
$tel
,
$content
,
$signature
)
public
static
function
sendSms
(
$tel
,
$content
,
$signature
=
null
)
{
{
return
self
::
call
(
'message.sendSms'
,
compact
(
'tel'
,
'content'
,
'signature'
));
return
self
::
invoke
(
'/sms/send'
,
func_get_args
(
));
}
}
/**
/**
...
@@ -47,9 +47,9 @@ class Message extends Client
...
@@ -47,9 +47,9 @@ class Message extends Client
* @param string $signature 短信签名,中括号【】中的内容
* @param string $signature 短信签名,中括号【】中的内容
* @return bool|string 成功返回 true,失败返回错误文本
* @return bool|string 成功返回 true,失败返回错误文本
*/
*/
public
static
function
sendSmsByUid
(
$uid
,
$content
,
$signature
)
public
static
function
sendSmsByUid
(
$uid
,
$content
,
$signature
=
null
)
{
{
return
self
::
call
(
'message.sendSmsByUid'
,
compact
(
'uid'
,
'content'
,
'signature'
));
return
self
::
invoke
(
'/sms/sendByUid'
,
func_get_args
(
));
}
}
/**
/**
...
@@ -63,7 +63,8 @@ class Message extends Client
...
@@ -63,7 +63,8 @@ class Message extends Client
*/
*/
public
static
function
sendTemplateSms
(
$tel
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
public
static
function
sendTemplateSms
(
$tel
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
{
{
return
self
::
call
(
'message.sendTemplateSms'
,
compact
(
'tel'
,
'templateId'
,
'templateParams'
,
'signature'
));
//return self::call('message.sendTemplateSms', compact('tel', 'templateId', 'templateParams', 'signature'));
return
self
::
invoke
(
'/sms/sendTemplateSms'
,
func_get_args
());
}
}
/**
/**
...
@@ -77,7 +78,7 @@ class Message extends Client
...
@@ -77,7 +78,7 @@ class Message extends Client
*/
*/
public
static
function
sendTemplateSmsAsync
(
$tel
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
public
static
function
sendTemplateSmsAsync
(
$tel
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
{
{
return
self
::
emit
(
'
message.sendTemplateSms
'
,
func_get_args
());
return
self
::
emit
(
'
/sms/sendTemplateSmsAsync
'
,
func_get_args
());
}
}
/**
/**
...
@@ -91,7 +92,7 @@ class Message extends Client
...
@@ -91,7 +92,7 @@ class Message extends Client
*/
*/
public
static
function
sendTemplateSmsByUid
(
$uid
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
public
static
function
sendTemplateSmsByUid
(
$uid
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
{
{
return
self
::
call
(
'message.sendTemplateSmsByUid'
,
compact
(
'uid'
,
'templateId'
,
'templateParams'
,
'signature'
));
return
self
::
invoke
(
'/sms/sendTemplateByUid'
,
func_get_args
(
));
}
}
/**
/**
...
@@ -105,7 +106,7 @@ class Message extends Client
...
@@ -105,7 +106,7 @@ class Message extends Client
*/
*/
public
static
function
sendTemplateSmsByUidAsync
(
$uid
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
public
static
function
sendTemplateSmsByUidAsync
(
$uid
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
{
{
return
self
::
emit
(
'message.sendTemplateSmsByUid
'
,
func_get_args
());
return
self
::
invoke
(
'/sms/sendTemplateByUidAsync
'
,
func_get_args
());
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment