| xqd
@@ -222,6 +222,63 @@ class MyController extends Controller
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * @api {get} /api/my/reply 回复我的
|
|
|
+ * @apiDescription 回复我的
|
|
|
+ * @apiGroup My
|
|
|
+ * @apiPermission Passport
|
|
|
+ * @apiVersion 0.1.0
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
+ *{
|
|
|
+ * "status": true,
|
|
|
+ * "status_code": 0,
|
|
|
+ * "message": "",
|
|
|
+ * "data": [
|
|
|
+ * {
|
|
|
+ * ....
|
|
|
+ * }
|
|
|
+ * ]
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
+ * HTTP/1.1 400 Bad Request
|
|
|
+ */
|
|
|
+ public function reply()
|
|
|
+ {
|
|
|
+ $user = $this->getUser();
|
|
|
+ $data = CommentInfoModel::where('user_id',$user->id)->orderBy('id','desc')->get();
|
|
|
+
|
|
|
+ foreach ($data as $item){ //访问接口 标记已读
|
|
|
+ $item->update(['is_read'=>1]);
|
|
|
+ }
|
|
|
+ return $this->api($data);
|
|
|
+ } /**
|
|
|
+ * @api {get} /api/my/letter 私信
|
|
|
+ * @apiDescription 私信
|
|
|
+ * @apiGroup My
|
|
|
+ * @apiPermission Passport
|
|
|
+ * @apiVersion 0.1.0
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
+ *{
|
|
|
+ * "status": true,
|
|
|
+ * "status_code": 0,
|
|
|
+ * "message": "",
|
|
|
+ * "data": [
|
|
|
+ * {
|
|
|
+ * ....
|
|
|
+ * }
|
|
|
+ * ]
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
+ * HTTP/1.1 400 Bad Request
|
|
|
+ */
|
|
|
+ public function letter()
|
|
|
+ {
|
|
|
+ $user = $this->getUser();
|
|
|
+ $data = SystemInfoModel::where('user_id',$user->id)->whereNotNull('to_user_id')->orderBy('id','desc')->get();
|
|
|
+ foreach ($data as $item){ //访问接口 标记已读
|
|
|
+ $item->update(['is_read'=>1]);
|
|
|
+ }
|
|
|
+ return $this->api($data);
|
|
|
+ } /**
|
|
|
* @api {get} /api/my/system_info 系统消息
|
|
|
* @apiDescription 系统消息
|
|
|
* @apiGroup My
|
| xqd
@@ -233,19 +290,22 @@ class MyController extends Controller
|
|
|
* "status": true,
|
|
|
* "status_code": 0,
|
|
|
* "message": "",
|
|
|
- * "data": {
|
|
|
- * "data": [
|
|
|
- * ...
|
|
|
- * ]
|
|
|
- *}
|
|
|
+ * "data": [
|
|
|
+ * {
|
|
|
+ * ....
|
|
|
+ * }
|
|
|
+ * ]
|
|
|
* @apiErrorExample {json} Error-Response:
|
|
|
* HTTP/1.1 400 Bad Request
|
|
|
*/
|
|
|
public function systemInfo()
|
|
|
{
|
|
|
$user = $this->getUser();
|
|
|
- $data = SystemInfoModel::where('user_id',$user->id)->orderBy('id','desc')->get();
|
|
|
- return $this->api(compact('data'));
|
|
|
+ $data = SystemInfoModel::where('user_id',$user->id)->whereNull('to_user_id')->orderBy('id','desc')->get();
|
|
|
+ foreach ($data as $item){ //访问接口 标记已读
|
|
|
+ $item->update(['is_read'=>1]);
|
|
|
+ }
|
|
|
+ return $this->api($data);
|
|
|
}
|
|
|
|
|
|
/**
|