123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848 |
- <?php
- namespace App\Http\Controllers\Api\V1;
- use App\Models\BaseDictionaryOptionModel;
- use App\Models\BaseSettingsModel;
- use App\Models\DreamImages;
- use App\Models\DreamInfoModel;
- use App\Models\ReplyCommentsInfo;
- use App\Models\UserDream;
- use Illuminate\Http\Request;
- use App\Services\Base\ErrorCode;
- class MyController extends Controller
- {
- /**
- * @api {get} /api/my/index 个人首页(index)
- * @apiDescription 个人首页(index)
- * @apiGroup My
- * @apiPermission Passport
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 O* "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": "",
- * }
- * }
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- *{
- * "status": true,
- * "status_code": 0,
- * "message": "",
- * "data": {
- * "user": 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 My
- * @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 {post} /api/my/nickname 修改昵称(nickname)
- * @apiDescription 修改昵称(nickname)
- * @apiGroup My
- * @apiParam {string} nickname 昵称
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- */
- public function nickname(Request $request)
- {
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'nickname' => 'required',
- ],
- [
- 'nickname.required' => '昵称不能为空',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $nickname = $request->nickname;
- $user->nickname = $nickname;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {post} /api/my/sex 修改性别(sex get or post)
- * @apiDescription 修改性别(sex)
- * @apiGroup My
- * @apiParam {sex} sex 性别
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * get
- *{
- * "status": true,
- * "status_code": 0,
- * "message": "",
- * "data": [
- * {
- * "value": "0",
- * "name": "男"
- * },
- * {
- * "value": "1",
- * "name": "女"
- * }
- * ]
- *}
- * post
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- */
- public function sex(Request $request)
- {
- if ($request->method() == 'GET') {
- $data = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
- where('dictionary_code','sex')->get();
- return $this->api($data);
- }
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'sex' => 'required',
- ],
- [
- 'sex.required' => '性别不能为空',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $sex = $request->sex;
- $user->sex = $sex;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {post} /api/my/signture 个性签名(signture)
- * @apiDescription 个性签名(signture)
- * @apiGroup My
- * @apiParam {string} signture 个性签名
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * 保存
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- * 提交
- * {
- * "status": false,
- * "status_code": 1000,
- * "message": "个性签名不能为空",
- * "data": null
- *}
- */
- public function signture(Request $request)
- {
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'signture' => 'required',
- ],
- [
- 'signture.required' => '个性签名不能为空',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $signture = $request->signture;
- $user->signture = $signture;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {post} /api/my/tel 修改手机号(tel)
- * @apiDescription 修改手机号(tel)
- * @apiGroup My
- * @apiParam {int} tel 修改手机号
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- */
- public function tel(Request $request)
- {
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'tel' => 'required|regex:/^1[34578][0-9]{9}$/',
- ],
- [
- 'tel.required' => '手机号不能为空',
- 'tel.regex' => '手机号格式不正确',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $tel = $request->tel;
- $user->tel = $tel;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {post} /api/my/job 工作类型(job get or post)
- * @apiDescription 工作类型(job)
- * @apiGroup My
- * @apiParam {string} job 工作类型
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- */
- public function job(Request $request)
- {
- if ($request->method() == 'GET') {
- $data = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
- where('dictionary_code','job')->get();
- return $this->api($data);
- }
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'job' => 'required',
- ],
- [
- 'job.required' => '工作类型不能为空',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $job = $request->job;
- $user->job = $job;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {post} /api/my/job 情感状态(emotion get or post)
- * @apiDescription 情感状态(job)
- * @apiGroup My
- * @apiParam {int} emotion 情感状态
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- */
- public function emotion(Request $request)
- {
- if ($request->method() == 'GET') {
- $data = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
- where('dictionary_code','emotion')->get();
- return $this->api($data);
- }
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'emotion' => 'required',
- ],
- [
- 'emotion.required' => '情感状态不能为空',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $emotion = $request->emotion;
- $user->emotion = $emotion;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {post} /api/my/tall 身高
- * @apiDescription 身高
- * @apiGroup My
- * @apiParam {int} tall 身高
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * " status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- */
- public function tall(Request $request)
- {
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'tall' => 'required|integer',
- ],
- [
- 'tall.required' => '身高不能为空',
- 'tall.integer' => '身高只能填写数字',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $tall = $request->tall;
- $user->tall = $tall;
- $ok = $user->save();
- if ($ok) return $this->api('');
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- /**
- * @api {get} /api/my/recharge 充值(recharge)
- * @apiDescription 充值(recharge)
- * @apiGroup My
- * @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 My
- * @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 My
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- *
- * {
- * "status": true,
- * "status_code": 0,
- * "message": "",
- * "data": {
- * "comments_infos": [
- * {
- * "id": 1,
- * "dream_id": 2,
- * "user_id": 2,
- * "level": 2,
- * "content": "啊哈", 评论内容
- * "created_at": null, 评论时间
- * "updated_at": null,
- * "deleted_at": null,
- * "dream_name": "去旅游去旅游2", 梦想介绍
- * "dream_pic": "aaaaa", 梦想图片
- * "progress": 0, 进度
- * "reviewer": "22222", 评论者
- * "reviewer_pic": "22222pic", 评论者头像
- * }
- * ]
- * }
- * }
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- */
- public function replyMy()
- {
- $user = $this->getUser();
- // 梦想
- $dreams = $user->UserDream;
- if (count($dreams) == 0)
- return $this->error(ErrorCode::DREAM_NOT_EXIST);
- foreach ($dreams as $dream){
- $comments_infos = $dream->DreamInfo;
- if (count($comments_infos) > 0) {
- foreach ($comments_infos as $k => $value) {
- $value->dream_name = $dream->dream;
- $value->dream_about = $dream->about;
- $value->dream_pic = count($dream->dreamImgsFirst) > 0 ? $dream->dreamImgsFirst->pic : '';
- $value->progress = $dream->money == 0 ? 0 : floor($dream->get_money/$dream->money);
- $value->reviewer = $value->CommentUser->nickname;
- $value->reviewer_pic = $value->CommentUser->pic;
- }
- }
- }
- return $this->api(compact('comments_infos'));
- }
- /**
- * @api {post} /api/my/my_reply 我的回复(myReply)
- * @apiDescription 我的回复(recharge)
- * @apiGroup My
- * @apiParam {text} content 回复内容
- * @apiParam {int} comment_id 评论ID
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * {
- * "status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * HTTP/1.1 200 OK
- * @apiErrorExample {json} Error-Response:
- * {
- * "status": false,
- * "status_code": 1000,
- * "message": "输入不正确",
- * "data": null
- *}
- *{
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- *}
- * HTTP/1.1 400 Bad Request
- */
- public function myReply(Request $request)
- {
- $user = $this->getUser();
- $data = $request->except('_token');
- $data['user_id'] = $user->id;
- if (!$request->content)
- return $this->error(ErrorCode::CLIENT_WRONG_PARAMS);
- $ok = ReplyCommentsInfo::create($data);
- if ($ok) {
- return $this->api('');
- }else{
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- }
- /**
- * @api {get} /api/my/dream 我的梦想(dream)
- * @apiDescription 我的梦想(recharge)
- * @apiGroup My
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * {
- * "status": true,
- * "status_code": 0,
- * "message": "",
- * "data": {
- * "dreams": [
- * {
- * "id": 2,
- * "dream": "去旅游去旅游2",
- * "about": "欧冠胡234",
- * "dream_pic": "aaaaa",
- * "progress": 0, 进度
- * ]
- * }
- * }
- * HTTP/1.1 200 OK
- * @apiErrorExample {json} Error-Response:
- * HTTP/1.1 400 Bad Request
- */
- public function dream()
- {
- $user = $this->getUser();
- // 梦想
- $dreams = $user->UserDream;
- if (count($dreams) == 0)
- return $this->error(ErrorCode::DREAM_NOT_EXIST);
- foreach ($dreams as $dream){
- $dream->dream_pic = count($dream->dreamImgsFirst) > 0 ? $dream->dreamImgsFirst->pic : '';
- $dream->progress = $dream->money == 0 ? 0 : floor($dream->get_money/$dream->money);
- }
- return $this->api(compact('dreams'));
- }
- /**
- * @api {get} /api/my/collection 我的收藏(collection)
- * @apiDescription 我的收藏(recharge)
- * @apiGroup My
- * @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 My
- * @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 {post} /api/my/add_dream 发布梦想(addDream)
- * @apiDescription 发布梦想(addDream)
- * @apiParam {string} pic 梦想图片 数组
- * @apiParam {string} videos 梦想视频
- * @apiParam {string} dream 梦想标题
- * @apiParam {string} about 梦想介绍
- * @apiParam {int} money 梦想币
- * @apiParam {int} time 实现时间默认21*3600
- * @apiGroup My
- * @apiPermission Passport
- * @apiVersion 0.1.0
- * @apiSuccessExample {json} Success-Response:
- * {
- * "status": true,
- * "status_code": 0,
- * "message": "",
- * "data": ""
- *}
- * HTTP/1.1 200 OK
- * @apiErrorExample {json} Error-Response:
- * {
- * "status": false,
- * "status_code": 600,
- * "message": "保存用户数据失败",
- * "data": null
- * }
- * HTTP/1.1 400 Bad Request
- */
- public function addDream(Request $request)
- {
- $user = $this->getUser();
- $validator = \Validator::make($request->all(),
- [
- 'dream' => 'required',
- 'about' => 'required',
- 'money' => 'required|integer',
- 'time' => 'required|integer',
- ],
- [
- 'dream.required' => '梦想标题必填',
- 'about.required' => '梦想介绍必填',
- 'money.required' => '梦想币必填',
- 'time.required' => '实现时间必填',
- 'money.integer' => '梦想币必须是正整数',
- 'time.integer' => '实现时间必须是正整数',
- ]
- );
- if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
- $data2 = $user->myCareNum;
- $care_num = count($data2);
- $key = BaseSettingsModel::where('category','paihang')->first();
- $a = $key ->key;
- $b = $key ->value;
- $t = 21*3600 / 60;
- $data = $request->except('_token','pic');
- $data['score'] = (log($care_num) + ($a/$t) + $b)*100000000 ;
- $data['created_at'] = date('Y-m-d H:i:s');
- $data['updated_at'] = date('Y-m-d H:i:s');
- $dream_id = DreamInfoModel::insertGetId($data);
- if ($dream_id) {
- $data1['dream_id'] = $dream_id;
- $data1['user_id'] = $user->id;
- $data1['created_at'] = date('Y-m-d H:i:s');
- $data1['updated_at'] = date('Y-m-d H:i:s');
- $arr = $request->pic;
- $videos = $request->videos;
- if (empty($arr) && empty($videos)) return $this->error(ErrorCode::ATTACHMENT_NOT_EXIST);
- $ok = UserDream::create($data1);
- $arr1 = [];
- if ($ok) {
- if (is_array($arr)) {
- foreach ($arr as $k => $v){
- $arr1[] = [
- 'dream_id'=>$dream_id,
- 'pic' => $v,
- 'created_at' =>date('Y-m-d H:i:s'),
- 'updated_at' =>date('Y-m-d H:i:s'),
- ];
- }
- DreamImages::insert($arr1);
- }
- return $this->api('');
- }else{
- DreamInfoModel::destroy($dream_id);
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- }else{
- return $this->error(ErrorCode::SAVE_USER_FAILED);
- }
- }
- /**
- * @api {get} /api/my/dream_about 梦想介绍(dreamAbout)
- * @apiDescription 梦想介绍(dreamAbout)
- * @apiGroup My
- * @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'));
- }
- }
|