1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\api\controller;
- use app\common\controller\UserApi;
- use app\common\model\Comment;
- use app\common\model\Info;
- use app\common\model\Like;
- use app\common\model\Notification;
- use app\common\model\UserAddress;
- /**
- * 消息模块
- */
- class NotificationController extends UserApi
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = '*';
- /**
- * 列表
- * @ApiParams (name=page,description=page)
- * @ApiParams (name=limit,description=limit)
- * @ApiReturnParams (name=id,description=id)
- * @ApiReturnParams (name=notice_type,description="like点赞,comment评论")
- * @ApiReturnParams (name=title,description="标题")
- * @ApiReturnParams (name=created_at,description="时间")
- * @ApiReturnParams (name=notice[body],description="如果是评论的话就是评论内容")
- * @ApiReturnParams (name=notice[commentable],description="如果是评论的话就是评论的帖子对象")
- * @ApiReturnParams (name=notice[like],description="如果是点赞的话就是点赞的帖子对象")
- */
- public function list(){
- $list=$this->auth
- ->getUser()
- ->notification()
- ->order('id','desc')
- ->with('from_user')
- ->paginate(input('limit',10));
- $this->success('',$list);
- }
- }
|