<?php

namespace app\controller\api\v1;

use support\Request;

use App\Utils\ApiResponse;
use hg\apidoc\annotation as Apidoc;

use Tinywan\Jwt\JwtToken;
use App\model\Message;



/**
 * @Apidoc\Title("消息提醒控制器")
 */
class MessageController{
    /**
     * @Apidoc\Title("1.0 获取所有消息")
     * @Apidoc\Url("api/v1/message/get_list")
     * @Apidoc\Method("POST")
     * @Apidoc\Returned("list", type="object", desc="用户消息列表")
     */
    public function get_list(Request $request){
        $user = $request->data;
        $userid=$user['id'];
        /**
         * 通过中间件获取userid
         */
        $userid=$user['id'];
        $res = Message::where('userid',$userid)->get();
        return ApiResponse::success(200,$res);
    }
}