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
eeaf8f45
Commit
eeaf8f45
authored
Jun 28, 2019
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息系统增加异步发送支持
parent
c7b84071
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
82 deletions
+58
-82
ucenter_message.php
example/ucenter_message.php
+4
-1
Message.php
src/ucenter/Message.php
+45
-81
Track.php
src/ucenter/Track.php
+9
-0
No files found.
example/ucenter_message.php
View file @
eeaf8f45
...
...
@@ -38,5 +38,8 @@ Message::setDebug();
//$info = \internalApi\ucenter\Message::pushMsg(1,0,0,'bbs','theme',0);
//print_r($info);
$ret
=
Message
::
sendSystemMessage
(
'assistant'
,
0
,
12
,
Message
::
TYPE_TEXT
,
[
'msg'
=>
'新消息测试'
]);
$ret
=
Message
::
sendSystemMessageAsync
(
'remind'
,
0
,
12
,
Message
::
TYPE_REMIND
,
[
'title'
=>
'测试的标题'
,
'text'
=>
'新消息测试'
.
uniqid
()
]);
print_r
(
$ret
);
src/ucenter/Message.php
View file @
eeaf8f45
...
...
@@ -66,6 +66,20 @@ class Message extends Client
return
self
::
call
(
'message.sendTemplateSms'
,
compact
(
'tel'
,
'templateId'
,
'templateParams'
,
'signature'
));
}
/**
* 向指定手机号发送模板短信
*
* @param string|array $tel 单个或多个号码数组
* @param string $templateId 内部短信模板ID
* @param array $templateParams 短信模板变量内容
* @param string $signature 短信签名
* @return int|false
*/
public
static
function
sendTemplateSmsAsync
(
$tel
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
{
return
self
::
emit
(
'message.sendTemplateSms'
,
func_get_args
());
}
/**
* 向指定用户发送模板短信
*
...
...
@@ -80,87 +94,19 @@ class Message extends Client
return
self
::
call
(
'message.sendTemplateSmsByUid'
,
compact
(
'uid'
,
'templateId'
,
'templateParams'
,
'signature'
));
}
/***
* @param $userId
* @param $title
* @param $sourceUrl
* @param $from 0:xue 1:bbs 2:s
* @param $type 0:评论 1:帖子
* @param $commentId
* @param $replyUserId
* @param string $replyedComment
* @param string $extra
* @return mixed
* @deprecated
*/
public
static
function
addComment
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$commentId
,
$replyUserId
,
$replyedComment
=
''
,
$extra
=
''
)
{}
/**
* @param $userId
* @param $title
* @param $sourceUrl
* @param $from
* @param $type
* @param $sourceId 点赞的评论id
* @param $likeUserId
* @param $likedComment
* @return mixed
* @deprecated
*/
public
static
function
addLike
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$sourceId
,
$likeUserId
,
$likedComment
=
''
)
{}
/**
* @param $userId
* @param $title
* @param $desc
* @param $from
* @param $type
* @param string $content
* @param int $toUser 0系统消息其它为用户id,多个用户id数组
* @return mixed
* @deprecated
*/
public
static
function
add
(
$userId
,
$title
,
$desc
,
$from
,
$type
,
$content
=
''
,
$toUser
=
0
)
{}
/**
* 删除评论消息
* @param $userId
* @param $from
* @param $type
* @param $commentId
* @return mixed
* @deprecated
*/
public
static
function
deleteComment
(
$userId
,
$from
,
$type
,
$commentId
)
{}
/**
* 删除点赞
* @param $userId
* @param $from
* @param $type
* @param $sourceId
* @return mixed
* @deprecated
*/
public
static
function
deleteLiked
(
$userId
,
$from
,
$type
,
$sourceId
)
{}
/**
* @param $title 消息标题
* @param $url
* @param $desc 描述
* @param int $userId 用户id 0=>代表全部
* @param string $from 来自
* @param int $type 0 早报 1 求助 2 系统推送
* @return mixed
* @deprecated
*/
public
static
function
pushMsg
(
$title
,
$url
,
$desc
,
$userId
=
0
,
$from
=
'u'
,
$type
=
0
)
{}
/**
* 向指定用户发送模板短信
*
* @param int $uid
* @param string $templateId 内部短信模板ID
* @param array $templateParams 短信模板变量内容
* @param string $signature 短信签名
* @return int|false
*/
public
static
function
sendTemplateSmsByUidAsync
(
$uid
,
$templateId
,
$templateParams
=
[],
$signature
=
null
)
{
return
self
::
emit
(
'message.sendTemplateSmsByUid'
,
func_get_args
());
}
/**
* 以系统会话发送消息
...
...
@@ -172,6 +118,7 @@ class Message extends Client
* @param array $content 消息内容
* @param array $ext 消息扩展属性
* @return array
* @see http://dzzoffice.banshouhui.com/index.php?mod=corpus&op=list&cid=3#fid_1146
* @throws \internalApi\base\ApiException
*/
public
static
function
sendSystemMessage
(
$systemSessionId
,
$from
,
$to
,
$type
,
$content
,
$ext
=
[])
...
...
@@ -179,5 +126,22 @@ class Message extends Client
return
self
::
call
(
'message.sendSystemMessage'
,
compact
(
'systemSessionId'
,
'from'
,
'to'
,
'type'
,
'content'
,
'ext'
));
}
/**
* 以系统会话发送消息
*
* @param int|string $systemSessionId 系统会话的ID或别名
* @param int $from 发送用户,系统用户请指定0
* @param int $to 接收用户
* @param int $type 消息类型
* @param array $content 消息内容
* @param array $ext 消息扩展属性
* @return int|false
* @see http://dzzoffice.banshouhui.com/index.php?mod=corpus&op=list&cid=3#fid_1146
*/
public
static
function
sendSystemMessageAsync
(
$systemSessionId
,
$from
,
$to
,
$type
,
$content
,
$ext
=
[])
{
return
self
::
emit
(
'message.sendSystemMessage'
,
func_get_args
());
}
}
src/ucenter/Track.php
View file @
eeaf8f45
...
...
@@ -31,6 +31,15 @@ class Track extends Client
return
self
::
call
(
'track.track'
,
compact
(
'event'
,
'uid'
,
'time'
,
'props'
));
}
/**
* 添加事件
*
* @param string $event 事件、32个字符以内
* @param int $uid 用户UID,0代表访客
* @param int|null $time 时间,默认为当前时间
* @param array $props 属性键值列表 (键32个字符以内,值128字符以内)
* @return int|false
*/
public
static
function
trackAsync
(
$event
,
$uid
=
0
,
$time
=
null
,
$props
=
[])
{
return
self
::
emit
(
'track.track'
,
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