xiaogang 4 éve
szülő
commit
058ac42de8

+ 74 - 0
app/Admin/Controllers/BannerController.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Banner;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class BannerController extends AdminController
+{
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(new Banner(), function (Grid $grid) {
+            $grid->column('id')->sortable();
+            $grid->column('title');
+            $grid->column('img_url');
+            $grid->column('site');
+            $grid->column('status');
+            $grid->column('created_at');
+            $grid->column('updated_at')->sortable();
+        
+            $grid->filter(function (Grid\Filter $filter) {
+                $filter->equal('id');
+        
+            });
+        });
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        return Show::make($id, new Banner(), function (Show $show) {
+            $show->field('id');
+            $show->field('title');
+            $show->field('img_url');
+            $show->field('site');
+            $show->field('status');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new Banner(), function (Form $form) {
+            $form->display('id');
+            $form->text('title');
+            $form->text('img_url');
+            $form->text('site');
+            $form->text('status');
+        
+            $form->display('created_at');
+            $form->display('updated_at');
+        });
+    }
+}

+ 10 - 7
app/Http/Controllers/Api/AuthorizationsController.php

@@ -30,7 +30,7 @@ class AuthorizationsController extends Controller
      * @param Request $request
      * @param Request $request
      * @return \Illuminate\Http\JsonResponse
      * @return \Illuminate\Http\JsonResponse
      */
      */
-    public function loginByMobile(Request $request)
+    public function login_by_mobile(Request $request)
     {
     {
         $validator = Validator::make($request->all(), [
         $validator = Validator::make($request->all(), [
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
@@ -60,7 +60,7 @@ class AuthorizationsController extends Controller
         ]);
         ]);
 
 
         if (!$user->ycode) {
         if (!$user->ycode) {
-            $user->ycode = $this->createCode();
+            $user->ycode = $this->create_code();
         }
         }
 
 
         if (!$user->tencent_im_user_id) {
         if (!$user->tencent_im_user_id) {
@@ -72,6 +72,7 @@ class AuthorizationsController extends Controller
 
 
         $resdata['token'] = $token;
         $resdata['token'] = $token;
         $resdata['sex'] = $user->sex;
         $resdata['sex'] = $user->sex;
+        $resdata['password'] = $user->password?1:0;
         return response()->json($resdata);
         return response()->json($resdata);
     }
     }
 
 
@@ -80,7 +81,7 @@ class AuthorizationsController extends Controller
      * @param $user_id
      * @param $user_id
      * @return string
      * @return string
      */
      */
-   public function createCode() {
+   public function create_code() {
        $code =  create_invite_code();
        $code =  create_invite_code();
        if(User::where(['ycode'=>$code])->first()){
        if(User::where(['ycode'=>$code])->first()){
            $code =  create_invite_code();
            $code =  create_invite_code();
@@ -93,7 +94,7 @@ class AuthorizationsController extends Controller
      * @param Request $request
      * @param Request $request
      * @return \Illuminate\Http\JsonResponse|void
      * @return \Illuminate\Http\JsonResponse|void
      */
      */
-    public function loginByAccountPassword(Request $request)
+    public function login_by_account_password(Request $request)
     {
     {
         $validator = Validator::make($request->all(), [
         $validator = Validator::make($request->all(), [
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
@@ -116,7 +117,7 @@ class AuthorizationsController extends Controller
         }
         }
 
 
         if (!$user->ycode) {
         if (!$user->ycode) {
-            $user->ycode = $this->createCode();
+            $user->ycode = $this->create_code();
         }
         }
 
 
         if (!$user->tencent_im_user_id) {
         if (!$user->tencent_im_user_id) {
@@ -127,14 +128,16 @@ class AuthorizationsController extends Controller
 
 
         $resdata['token'] = $token;
         $resdata['token'] = $token;
         $resdata['sex'] = $user->sex;
         $resdata['sex'] = $user->sex;
+        $resdata['password'] = $user->password?1:0;
         return response()->json($resdata);
         return response()->json($resdata);
     }
     }
 
 
+
+
     /**
     /**
      * 注册账号
      * 注册账号
      */
      */
     public function register(Request $request){
     public function register(Request $request){
-       // return $this->response->accepted(null,'该手机号码已使用');
         $validator = Validator::make($request->all(), [
         $validator = Validator::make($request->all(), [
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
             'password' => 'bail|required',
             'password' => 'bail|required',
@@ -166,7 +169,7 @@ class AuthorizationsController extends Controller
     /**
     /**
      * 忘记密码
      * 忘记密码
      */
      */
-    public function forgetPassword(Request $request){
+    public function forget_password(Request $request){
         $validator = Validator::make($request->all(), [
         $validator = Validator::make($request->all(), [
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
             'mobile' => ['required', 'regex:/^1[3456789]\d{9}$/'],
             'verifyKey' => 'bail|required|string',
             'verifyKey' => 'bail|required|string',

+ 104 - 23
app/Http/Controllers/Api/DynamicController.php

@@ -4,6 +4,10 @@
 namespace App\Http\Controllers\Api;
 namespace App\Http\Controllers\Api;
 
 
 
 
+use App\Http\Params\DynamicParam;
+use App\Http\Params\DynamicZanParam;
+use App\Http\Params\UserReportParam;
+use App\Models\Banner;
 use App\Services\DynamicService;
 use App\Services\DynamicService;
 use Illuminate\Http\Request;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\DB;
@@ -22,10 +26,12 @@ class DynamicController extends Controller
      * 获取话题列表
      * 获取话题列表
      */
      */
     public function get_tag_list(Request $request){
     public function get_tag_list(Request $request){
-
-
-        $data = DB::table("dynamic_tag")->where("title","like","%{$request->keyword}%")->orderBy("hot","desc")->limit(20)->get();
-        return response()->json($data)->setStatusCode(201);
+        try {
+            $data = $this->dynamicService->tag_list($request->keyword);
+        }catch (\Exception $exception){
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return response()->json($data);
     }
     }
 
 
 
 
@@ -33,7 +39,6 @@ class DynamicController extends Controller
      * 发布动态
      * 发布动态
      */
      */
     public function release(Request $request){
     public function release(Request $request){
-        $user = auth('api')->user();
         $validator = Validator::make($request->all(), [
         $validator = Validator::make($request->all(), [
             'content' => 'required',
             'content' => 'required',
         ], [
         ], [
@@ -42,60 +47,136 @@ class DynamicController extends Controller
         if ($validator->fails()) {
         if ($validator->fails()) {
             return $this->response()->errorForbidden($validator->messages()->first());
             return $this->response()->errorForbidden($validator->messages()->first());
         }
         }
-
         DB::beginTransaction();
         DB::beginTransaction();
-
         try {
         try {
-            //如果设置了话题
-            if(isset($request->tag) && !empty($request->tag)){
-
+            $user = auth('api')->user();
+            $dynamicParam = new DynamicParam();
+            $dynamicParam->user_id = $user->id;
+            $dynamicParam->content = htmlspecialchars($request->post('content'));
+            $dynamicParam->img_url = $request->post('img_url');
+            $dynamicParam->type = $request->post('type');
+            $dynamicParam->status = 1;
+            $dynamicParam->zan_num = 0;
+            $dynamicParam->site = $request->post('site');
+            $dynamicParam->tag = $request->post('tag');
+            $this->dynamicService->release($dynamicParam);
+            DB::commit();
+        }catch (\Exception $exception){
+            DB::rollBack();
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return $this->response->noContent();
+    }
 
 
+    /**
+     * 动态banner,话题,风险提示
+     */
+    public function dynamic_info(){
+        try {
+            $oss_config = config("filesystems.disks.oss");
+            $banner = Banner::where(["site"=>1,"status"=>1])->orderBy("sort",'asc')->limit(3)->get(['id','img_url']);
+            foreach ($banner as $k=>$v){
+                $banner[$k]['img_url'] = "https://".$oss_config['bucket'].'.'.$oss_config['endpoint'].'/'.$v['img_url'];
             }
             }
-
-        }catch (\Exception $e){
-
+            $res['banner'] = $banner;
+            $res['tag'] = DB::table("dynamic_tag")->orderBy('hot','desc')->limit(10)->get();
+        }catch (\Exception $exception){
+            return $this->response->errorForbidden($exception->getMessage());
         }
         }
-
-
-
-
+        return response()->json($res);
     }
     }
 
 
-
     /**
     /**
      * 动态列表
      * 动态列表
      */
      */
     public function get_list(Request $request){
     public function get_list(Request $request){
 
 
+        $where = array();
+        $where['type'] = $request->post('type',1); //类型  type 1全部  2关注  3附近
+        $where['look_type'] =$request->post('look_type',3);//查看类型  type 1只看男士  2只看女士  3全部
+        $where['tag_id'] =$request->post('tag_id',0); //话题标签
+        $where['user_id'] =0;
+        try {
+            $list = $this->dynamicService->dynamic_list($where);
+        }catch (\Exception $exception){
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return response()->json($list);
     }
     }
 
 
+
+
     /**
     /**
      * 我的动态
      * 我的动态
      */
      */
     public function my_list(Request $request){
     public function my_list(Request $request){
+        $user = auth('api')->user();
+        $where = array();
+        $where['type'] = $request->post('type',1); //类型  type 1全部  2关注  3附近
+        $where['look_type'] =$request->post('look_type',3);//查看类型  type 1只看男士  2只看女士  3全部
+        $where['tag_id'] =$request->post('tag_id',0); //话题标签
 
 
+        $where['user_id'] =$user->id;
+
+        try {
+            $list = $this->dynamicService->dynamic_list($where);
+        }catch (\Exception $exception){
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return response()->json($list);
     }
     }
 
 
     /**
     /**
      * 动态点赞
      * 动态点赞
      */
      */
     public function zan(Request $request){
     public function zan(Request $request){
-
+        DB::beginTransaction();
+        try {
+            $user = auth('api')->user();
+            $dynamic_zan_param = new DynamicZanParam();
+            $dynamic_zan_param->user_id = $user->id;
+            $dynamic_zan_param->dynamic_id = $request->id;
+            $this->dynamicService->zan($dynamic_zan_param);
+            DB::commit();
+        }catch (\Exception $exception){
+            DB::rollBack();
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return $this->response->noContent();
     }
     }
 
 
     /**
     /**
      * 删除动态
      * 删除动态
      */
      */
     public function del(Request $request){
     public function del(Request $request){
-
-
+        try {
+            $DynamicParam = new DynamicParam();
+            $DynamicParam->id = $request->id;
+            $this->dynamicService->del($DynamicParam);
+        }catch (\Exception $exception){
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return $this->response->noContent();
     }
     }
 
 
     /**
     /**
      * 举报动态
      * 举报动态
      */
      */
     public function report(Request $request){
     public function report(Request $request){
-
-
+        try {
+            $user = auth('api')->user();
+            $UserReportParam = new UserReportParam();
+            $UserReportParam->type = 2;
+            $UserReportParam->user_id = $user->id;
+            $UserReportParam->content = $request->post('content');
+            $UserReportParam->report_id = $request->post('id');
+            $UserReportParam->status = 0;
+            $UserReportParam->img_url = $request->post('img_url');
+            $UserReportParam->info = $request->post('info',"");
+            $this->dynamicService->report($UserReportParam);
+        }catch (\Exception $exception){
+            return $this->response->errorForbidden($exception->getMessage());
+        }
+        return $this->response->noContent();
     }
     }
 }
 }

+ 22 - 0
app/Http/Controllers/Api/UserController.php

@@ -11,6 +11,28 @@ use Illuminate\Support\Facades\Validator;
 
 
 class UserController extends Controller
 class UserController extends Controller
 {
 {
+
+    /**
+     * 设置密码
+     */
+    public function setpass(Request $request){
+        $validator = Validator::make($request->all(), [
+            'password' => 'required|string',
+        ],[
+            'password.required'=>"密码必须",
+        ]);
+        if ($validator->fails()) {
+            return $this->response()->errorForbidden($validator->messages()->first());
+        }
+        $user = auth('api')->user();
+        $user->password = $request->password;
+        if($user->save()){
+            return response()->json(['message'=>"设置成功"]);
+        }else{
+            return $this->response->errorForbidden("设置失败");
+        }
+    }
+
     /**
     /**
      * 选择性别
      * 选择性别
      */
      */

+ 15 - 0
app/Http/Params/DynamicParam.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Http\Params;
+class DynamicParam
+{
+    public $id;
+    public $user_id;
+    public $content;
+    public $img_url;
+    public $type;
+    public $status;
+    public $zan_num;
+    public $site;
+    public $tag;
+}

+ 11 - 0
app/Http/Params/DynamicZanParam.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Http\Params;
+class DynamicZanParam
+{
+    public $id;
+    public $user_id;
+    public $dynamic_id;
+    public $satus;
+    public $atime;
+}

+ 14 - 0
app/Http/Params/UserReportParam.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Http\Params;
+class UserReportParam
+{
+    public $id;
+    public $user_id;
+    public $report_id;
+    public $content;
+    public $img_url;
+    public $info;
+    public $status;
+    public $type;
+}

+ 14 - 0
app/Models/Banner.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Banner extends Model
+{
+	use HasDateTimeFormatter;
+    protected $table = 'banner';
+    
+}

+ 22 - 0
app/Models/DynamicModel.php

@@ -0,0 +1,22 @@
+<?php
+
+
+namespace App\Models;
+
+
+class DynamicModel extends BaseModel
+{
+    protected $table = 'dynamic';
+    protected $fillable = ['user_id', 'content','img_url','type','status','zan_num','site','tag'];
+
+
+    public function users()
+    {
+        return $this->belongsTo(User::class,'user_id','id');
+    }
+
+    public function users_info()
+    {
+        return $this->belongsTo(UserInfoModel::class,'user_id','user_id');
+    }
+}

+ 23 - 0
app/Models/DynamicZanModel.php

@@ -0,0 +1,23 @@
+<?php
+
+
+namespace App\Models;
+
+
+class DynamicZanModel extends BaseModel
+{
+    protected $table = 'dynamic_zan';
+    public $timestamps = false;
+    protected $fillable = ['user_id', 'dynamic_id','status','atime'];
+
+
+    public function users()
+    {
+        return $this->belongsTo(User::class,'user_id','id');
+    }
+
+    public function users_info()
+    {
+        return $this->belongsTo(UserInfoModel::class,'user_id','user_id');
+    }
+}

+ 12 - 0
app/Models/UserReportModel.php

@@ -0,0 +1,12 @@
+<?php
+
+
+namespace App\Models;
+
+
+class UserReportModel extends BaseModel
+{
+    protected $table = 'users_report';
+    protected $fillable = ['user_id', 'report_id','content','info','img_url','status','type'];
+
+}

+ 167 - 0
app/Services/DynamicService.php

@@ -4,7 +4,16 @@
 namespace App\Services;
 namespace App\Services;
 
 
 
 
+use App\Http\Params\DynamicParam;
+use App\Http\Params\DynamicZanParam;
+use App\Http\Params\UserReportParam;
+use App\Models\DynamicModel;
+use App\Models\DynamicZanModel;
+use App\Models\User;
+use App\Models\UserReportModel;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\DB;
+use PHPUnit\Util\Exception;
+use function PHPUnit\Framework\isEmpty;
 
 
 class DynamicService
 class DynamicService
 {
 {
@@ -17,4 +26,162 @@ class DynamicService
             ->get();
             ->get();
         return $data;
         return $data;
     }
     }
+
+    /**
+     * 发布动态
+     */
+    public function release(DynamicParam $dynamicParam){
+        //如果设置了标签   新标签则添加  否则就热度加1
+        $tag_ins = '';
+        if(!empty($dynamicParam->tag)){
+            $tag = json_decode($dynamicParam->tag,true);
+
+            foreach ($tag as $v){
+                if($v['id']==0){
+                    $id = DB::table('dynamic_tag')->insertGetId([
+                        "title"=>htmlspecialchars($v['title']),
+                        "hot"=>1
+                    ]);
+                    $tag_ins.=$id.',';
+                }else{
+                    DB::table('dynamic_tag')->where(['id'=>$v['id']])->increment('hot',1);
+                    $tag_ins.=$v['id'].',';
+                }
+            }
+        }
+        $data = [
+          "content"=>$dynamicParam->content,
+          "img_url"=>$dynamicParam->img_url,
+          "status"=>$dynamicParam->status,
+          "type"=>$dynamicParam->type,
+          "tag"=>$tag_ins,
+          "site"=>$dynamicParam->site,
+          "user_id"=>$dynamicParam->user_id,
+        ];
+        DynamicModel::create($data);
+        return true;
+    }
+
+    /**
+     * 动态列表
+     */
+    public function dynamic_list($where){
+        $dynamic = DynamicModel::query();
+        $dynamic = $dynamic->with(["users"=>function($query){
+                $query->select('id','sex','is_vip');
+            },'users_info']);
+        //查询条件
+        //类型  type 1全部  2关注  3附近
+        if($where['type']==2){
+            //关注
+
+        }elseif ($where['type']==3){
+            //附近
+
+        }
+
+        //男,女,全部
+        if($where['look_type']!=3){
+          //  $dynamic = $dynamic->where('users.sex','=',$where['look_type']);
+        }
+        //标签
+        if($where['tag_id']!=0){
+            $dynamic = $dynamic->where('tag','=',$where['user_id']);
+        }
+
+        //用户id
+        if($where['user_id']!=0){
+            $dynamic = $dynamic->where('user_id','=',$where['user_id']);
+        }
+
+        $dynamic = $dynamic->orderByDesc('id')
+            ->paginate(request('perPage',10));
+        $dynamic = $dynamic->toArray();
+        foreach ($dynamic['data'] as $k=>$v){
+            $dynamic['data'][$k]['img_url'] = json_decode($v['img_url'],true);
+            $dynamic['data'][$k]['tag'] = json_decode($v['tag'],true);
+            if(!empty($v['site'])){
+                $dynamic['data'][$k]['site'] = json_decode($v['site'],true);
+                $site = json_decode($v['site'],true);
+            }else{
+
+            }
+            //计算距离 如果设置了位置,使用设置位置  否则使用定位位置
+            $dynamic['data'][$k]['distance'] = 0;
+        }
+
+        return $dynamic;
+    }
+
+    //点赞  如果已经点赞 则取消点赞
+    public function zan(DynamicZanParam $dynamicZanParam){
+        if(empty($dynamicZanParam->dynamic_id)){
+            throw new Exception('参数错误');
+        }
+        $dynamic = DynamicModel::where(['id'=>$dynamicZanParam->dynamic_id])->first();
+        if(!$dynamic){
+            throw new Exception("动态不存在");
+        }
+        if($dynamic_zan = DynamicZanModel::query()->where(['user_id'=>$dynamicZanParam->user_id,'dynamic_id'=>$dynamicZanParam->dynamic_id])->first()){
+            //已点赞  取消点赞
+            DynamicModel::query()->where('id',$dynamicZanParam->dynamic_id)->decrement('zan_num',1);
+            $dynamic_zan->delete();
+        }else{
+            //点赞
+            DynamicModel::query()->where('id',$dynamicZanParam->dynamic_id)->increment('zan_num',1);
+            DynamicZanModel::query()->create([
+                'user_id'=>$dynamicZanParam->user_id,
+                'dynamic_id'=>$dynamicZanParam->dynamic_id,
+                'status'=>0,
+                'atime'=>date('Y-m-d H:i:s'),
+            ]);
+        }
+        return true;
+    }
+
+    //删除动态
+    public function del(DynamicParam $dynamicParam){
+        if(empty($dynamicParam->id)){
+            throw new Exception('参数错误');
+        }
+        $dynamic = DynamicModel::query()->where(['id'=>$dynamicParam->id])->first();
+        if(!$dynamic){
+            throw new Exception("动态不存在");
+        }
+        $dynamic->delete();
+        return true;
+    }
+
+    //举报动态
+    public function report(UserReportParam $userReportParam){
+        if(empty($userReportParam->report_id)){
+            throw new Exception('参数错误');
+        }
+
+        if(empty($userReportParam->content)){
+            throw new Exception('请输入举报内容');
+        }
+
+        if($userReportParam->type==2){
+            $dynamic = DynamicModel::query()->where(['id'=>$userReportParam->report_id])->first();
+            if(!$dynamic){
+                throw new Exception("动态不存在");
+            }
+        }else{
+            $user = User::query()->where('id',$userReportParam->report_id)->first();
+            if(!$user){
+                throw new Exception("用户不存在");
+            }
+        }
+        UserReportModel::query()->create([
+           "user_id"=>$userReportParam->user_id,
+           "report_id"=>$userReportParam->report_id,
+           "type"=>$userReportParam->type,
+           "content"=>htmlspecialchars($userReportParam->content),
+           "info"=>htmlspecialchars($userReportParam->info),
+           "status"=>0,
+           "img_url"=>$userReportParam->img_url,
+        ]);
+        return true;
+    }
 }
 }

+ 5 - 3
routes/api.php

@@ -29,9 +29,9 @@ $api->version('v1', [
         |--------------------------------------------------------------
         |--------------------------------------------------------------
         */
         */
         $api->group(['prefix' => 'login'], function ($api) {
         $api->group(['prefix' => 'login'], function ($api) {
-            $api->post('/loginByMobile', 'AuthorizationsController@loginByMobile')->name('login.mobile');
-            $api->post('/loginByPassword', 'AuthorizationsController@loginByAccountPassword')->name('login.password');
-            $api->post('/forgetPassword', 'AuthorizationsController@forgetPassword')->name('login.forget');
+            $api->post('/login_by_mobile', 'AuthorizationsController@login_by_mobile')->name('login.mobile');
+            $api->post('/login_by_password', 'AuthorizationsController@login_by_password')->name('login.password');
+            $api->post('/forget_password', 'AuthorizationsController@forget_password')->name('login.forget');
             $api->post('/register', 'AuthorizationsController@register')->name('login.register');
             $api->post('/register', 'AuthorizationsController@register')->name('login.register');
             $api->get('/xieyi', 'AuthorizationsController@xieyi')->name('login.xieyi');
             $api->get('/xieyi', 'AuthorizationsController@xieyi')->name('login.xieyi');
         });
         });
@@ -69,6 +69,7 @@ $api->version('v1', [
             $api->post('/checksex', 'UserController@checksex')->name('user.checksex');
             $api->post('/checksex', 'UserController@checksex')->name('user.checksex');
             //设置资料(初次注册进入时)
             //设置资料(初次注册进入时)
             $api->post('/setinfo', 'UserController@setinfo')->name('user.setinfo');
             $api->post('/setinfo', 'UserController@setinfo')->name('user.setinfo');
+            $api->post('/setpass', 'UserController@setpass')->name('user.setpass');
             $api->get('/getinfo', 'UserController@getinfo')->name('user.getinfo');
             $api->get('/getinfo', 'UserController@getinfo')->name('user.getinfo');
             $api->get('/getext', 'UserController@getext')->name('user.getext');
             $api->get('/getext', 'UserController@getext')->name('user.getext');
             $api->post('/updateinfo', 'UserController@updateinfo')->name('user.updateinfo');
             $api->post('/updateinfo', 'UserController@updateinfo')->name('user.updateinfo');
@@ -89,6 +90,7 @@ $api->version('v1', [
             $api->post('/zan', 'DynamicController@zan')->name('dynamic.zan');
             $api->post('/zan', 'DynamicController@zan')->name('dynamic.zan');
             $api->post('/del', 'DynamicController@del')->name('dynamic.del');
             $api->post('/del', 'DynamicController@del')->name('dynamic.del');
             $api->post('/report', 'DynamicController@report')->name('dynamic.report');
             $api->post('/report', 'DynamicController@report')->name('dynamic.report');
+            $api->get('/dynamic_info', 'DynamicController@dynamic_info')->name('dynamic.dynamic_info');
         });
         });