Пример #1
0
 /**
  * 获取图片集列表
  *
  * @param  string time
  * @param  string uuid
  * @param  string page_Index 当前页数
  * @param  string pageSize	 每页显示页数
  * @return string
  */
 public function get_pic_list(req $req, res $res, $args)
 {
     if (isset($_GET['time']) && isset($_GET['uuid']) && isset($_GET['pageIndex']) && isset($_GET['pageSize'])) {
         //验证sign
         $time = $_GET['time'];
         $uuid = $_GET['uuid'];
         $str = $time . $uuid;
         $sign = $req->getQueryParam('sign');
         if ($sign) {
             $signs = $this->des->decrypt($sign);
             if ($str !== $signs) {
                 return $res->error(-101, 'sign值无效');
             }
         } else {
             return $res->error(-1004, 'sign值不能为空');
         }
         $pic = new \App\Model\Pics();
         $page_Index = $req->getQueryParam('pageIndex');
         $page_Size = $req->getQueryParam('pageSize');
         if ($result['list'] = $pic->pic_list($page_Index, $page_Size)) {
             return $res->success($result);
         } else {
             return $res->error(-1004, '请求数据为空');
         }
     } else {
         return $res->error(-1, 'time和uuid与pageIndex跟pageSize不能为空');
     }
 }