getUser(); /* * 我的关注人数,我的粉丝,收藏 * 点赞?徽章? * */ $data1 = $user->myCareNum; $data2 = $user->myFens; $data3 = $user->myCollection; $data4 = $user->UserDream; $my_care_num = count($data1); $my_fens_num = count($data2); $my_collection_num = count($data3); $my_dream_num = count($data4);//发帖数 return $this->api(compact('my_care_num','my_fens_num','my_collection_num','my_dream_num','user')); } /** * @api {get} /api/my/persona 个人信息(persona) * @apiDescription 个人信息(persona) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK *{ *"status": true, *"status_code": 0, *"message": "", *"data": { *"user": { *"id": 1, * "tel": "13880642880",手机 *"nickname": "",昵称 *"sex": 1,性别 *"job": "", 职业 *"emotion": 1,情感状态 *"address": "", *"detail_address": "", *"status": 1, *"tall": 1, 身高 *} * } *} * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request *{ *"status": true, *"status_code": 0, *"message": "", *"data": { *"user": null * } *} */ public function persona() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/recharge 充值(recharge) * @apiDescription 充值(recharge) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function recharge() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/system_info 系统消息(systemInfo) * @apiDescription 系统消息(systemInfo) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK *{ *"status": true, *"status_code": 0, *"message": "", * "data": { *"data": [ *{ *"nickname": "",充值人 *"pivot": { *"coin": 0 捐赠梦想币数量 *} * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request * { *"status": true, *"status_code": 0, *"message": "", *"data": { *"data": [] *} *} *} */ public function systemInfo() { $user = $this->getUser(); $data = $user->SystemInfo; return $this->api(compact('data')); } /** * @api {get} /api/my/reply_my 回复我的(replyMy) * @apiDescription 回复我的(replyMy) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function replyMy() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/my_reply 我的回复(myReply) * @apiDescription 我的回复(recharge) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function myReply() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/dream 我的梦想(dream) * @apiDescription 我的梦想(recharge) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function dream() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/collection 我的收藏(collection) * @apiDescription 我的收藏(recharge) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function collection() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/setting 设置(setting) * @apiDescription 设置(setting) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function setting() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/add_dream 发布梦想(addDream) * @apiDescription 发布梦想(recharge) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function addDream() { $user = $this->getUser(); return $this->api(compact('user')); } /** * @api {get} /api/my/dream_about 梦想介绍(dreamAbout) * @apiDescription 梦想介绍(dreamAbout) * @apiGroup Auth * @apiPermission Passport * @apiVersion 0.1.0 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * @apiErrorExample {json} Error-Response: * HTTP/1.1 400 Bad Request */ public function dreamAbout() { $user = $this->getUser(); return $this->api(compact('user')); } }