消息转发功能

This commit is contained in:
kuaifan
2022-06-03 10:43:46 +08:00
parent a2dcd69efd
commit c08240db42
3 changed files with 105 additions and 1 deletions

View File

@@ -650,6 +650,35 @@ class DialogController extends AbstractController
]);
}
/**
* @api {get} api/dialog/msg/forward 13. 转发消息给
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup dialog
* @apiName msg__forward
*
* @apiParam {Number} msg_id 消息ID
* @apiParam {Array} userids 转发给的成员
*
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function msg__forward()
{
$user = User::auth();
//
$msg_id = intval(Request::input("msg_id"));
$userids = Request::input('userids');
//
$msg = WebSocketDialogMsg::whereId($msg_id)->whereUserid($user->userid)->first();
if (empty($msg)) {
return Base::retError("消息不存在或已被删除");
}
return $msg->forwardMsg($userids, $user->userid);
}
/**
* @api {get} api/dialog/group/add 16. 新增群组
*