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
eaac8b8f
Commit
eaac8b8f
authored
Sep 01, 2017
by
夏彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加消息相关的api
parent
95ec28f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
30 deletions
+92
-30
ucenter_message.php
example/ucenter_message.php
+33
-0
Message.php
src/ucenter/Message.php
+59
-30
No files found.
example/ucenter_message.php
0 → 100644
View file @
eaac8b8f
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 31/08/2017
* Time: 4:52 PM
*/
use
internalApi\ucenter\Member
;
use
internalApi\ucenter\Message
;
require
__DIR__
.
'/_init.php'
;
Message
::
setDebug
();
//$name = uniqid('dev_');
//$info = \internalApi\ucenter\Message::add(1,0,0,'bbs','system',0,0);
//print_r($info);
//
//$info = \internalApi\ucenter\Message::addComment(1,0,0,'bbs','theme',0,0,'');
//print_r($info);
//$info = \internalApi\ucenter\Message::addLike(1,0,0,'bbs','theme',0,0,'');
//print_r($info);
//$info = \internalApi\ucenter\Message::deleteComment(1,'bbs','theme',0);
//print_r($info);
$info
=
\internalApi\ucenter\Message
::
deleteLiked
(
1
,
'bbs'
,
'theme'
,
0
);
print_r
(
$info
);
\ No newline at end of file
src/ucenter/Message.php
View file @
eaac8b8f
...
@@ -18,31 +18,31 @@ use internalApi\base\Client;
...
@@ -18,31 +18,31 @@ use internalApi\base\Client;
class
Message
extends
Client
class
Message
extends
Client
{
{
/**
/**
* 向指定号码发送短信
* 向指定号码发送短信
*
*
* @param string $tel
* @param string $tel
* @param string $content
* @param string $content
* @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
)
{
{
return
self
::
call
(
'message.sendSms'
,
compact
(
'tel'
,
'content'
,
'signature'
));
return
self
::
call
(
'message.sendSms'
,
compact
(
'tel'
,
'content'
,
'signature'
));
}
}
/**
/**
* 向指定用户发送短信
* 向指定用户发送短信
*
*
* @param int $uid
* @param int $uid
* @param string $content
* @param string $content
* @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
)
{
{
return
self
::
call
(
'message.sendSmsByUid'
,
compact
(
'uid'
,
'content'
,
'signature'
));
return
self
::
call
(
'message.sendSmsByUid'
,
compact
(
'uid'
,
'content'
,
'signature'
));
}
}
/***
/***
...
@@ -56,8 +56,9 @@ class Message extends Client
...
@@ -56,8 +56,9 @@ class Message extends Client
* @param string $replyedComment
* @param string $replyedComment
* @return mixed
* @return mixed
*/
*/
public
static
function
addComment
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$commentId
,
$replyUserId
,
$replyedComment
=
''
){
public
static
function
addComment
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$commentId
,
$replyUserId
,
$replyedComment
=
''
)
return
self
::
call
(
'message.addComment'
,
compact
(
'userId,'
,
'title'
,
'sourceUrl'
,
'from'
,
'type'
,
'commentId'
,
'replyUserId'
,
'replyedComment'
));
{
return
self
::
call
(
'message.addComment'
,
compact
(
'userId'
,
'title'
,
'sourceUrl'
,
'from'
,
'type'
,
'commentId'
,
'replyUserId'
,
'replyedComment'
));
}
}
/**
/**
...
@@ -71,8 +72,9 @@ class Message extends Client
...
@@ -71,8 +72,9 @@ class Message extends Client
* @param $likedComment
* @param $likedComment
* @return mixed
* @return mixed
*/
*/
public
static
function
addLike
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$sourceId
,
$likeUserId
,
$likedComment
){
public
static
function
addLike
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$sourceId
,
$likeUserId
,
$likedComment
)
return
self
::
call
(
'message.addLike'
,
compact
(
'userId,'
,
'title'
,
'sourceUrl'
,
'from'
,
'type'
,
'sourceId'
,
'likeUserId'
,
'likedComment'
));
{
return
self
::
call
(
'message.addLike'
,
compact
(
'userId'
,
'title'
,
'sourceUrl'
,
'from'
,
'type'
,
'sourceId'
,
'likeUserId'
,
'likedComment'
));
}
}
/**
/**
...
@@ -85,7 +87,34 @@ class Message extends Client
...
@@ -85,7 +87,34 @@ class Message extends Client
* @param int $toUser 0系统消息其它为用户id,多个用户id数组
* @param int $toUser 0系统消息其它为用户id,多个用户id数组
* @return mixed
* @return mixed
*/
*/
public
static
function
add
(
$userId
,
$title
,
$desc
,
$from
,
$type
,
$content
=
''
,
$toUser
=
0
){
public
static
function
add
(
$userId
,
$title
,
$desc
,
$from
,
$type
,
$content
=
''
,
$toUser
=
0
)
return
self
::
call
(
'message.add'
,
'userId'
,
'title'
,
'desc'
,
'from'
,
'type'
,
'content'
,
'toUser'
);
{
return
self
::
call
(
'message.add'
,
compact
(
'userId'
,
'title'
,
'desc'
,
'from'
,
'type'
,
'content'
,
'toUser'
));
}
/**
* 删除评论消息
* @param $userId
* @param $from
* @param $type
* @param $commentId
* @return mixed
*/
public
static
function
deleteComment
(
$userId
,
$from
,
$type
,
$commentId
)
{
return
self
::
call
(
'message.deleteComment'
,
compact
(
'userId'
,
'from'
,
'type'
,
'commentId'
));
}
/**
* 删除点赞
* @param $userId
* @param $from
* @param $type
* @param $sourceId
* @return mixed
*/
public
static
function
deleteLiked
(
$userId
,
$from
,
$type
,
$sourceId
)
{
return
self
::
call
(
'message.deleteLiked'
,
compact
(
'userId'
,
'from'
,
'type'
,
'sourceId'
));
}
}
}
}
\ No newline at end of file
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