123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <?php
- namespace App\Http\Controllers\Api\V1;
- use Illuminate\Http\Request;
- class MyController extends Controller
- {
- /**
- * @api {get} /api/my/index 个人首页(index)
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- {
- "status": true,
- "status_code": 0,
- "message": "",
- "data": {
- "my_care_num": 4,关注
- "my_fens_num": 3,粉丝
- "my_collection_num": 2,收藏
- "my_dream_num": 1,发帖
- "user": {
- "id": 1,
- "tel": "13880642880",
- "password": "",
- "nickname": "",
- "pic": "",
- "sign": 0,
- "money": 0,余额
- "sex": 1,
- "signture": "",个性签名
- "tall": "",
- "job": "",
- "emotion": 1,
- "address": "",
- "detail_address": "",
- "status": 1,
- "remember_token": "",
- "created_at": "2017-06-02 02:30:12",
- "updated_at": "2017-06-02 02:30:12",
- "deleted_at": null,
- }
- */
- public function index()
- {
- $user = $this->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'));
- }
- }
|