Commit eaac8b8f authored by 夏彬's avatar 夏彬

添加消息相关的api

parent 95ec28f3
<?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
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment