package com.tuoheng.miniprogram.controller;

import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.entity.dto.ResetPwdDto;
import com.tuoheng.miniprogram.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;




/**
 * @Author ChengWang
 * @Date 2022/11/21
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService iUserService;

    /**
     * 获取用户信息
     * @return
     */
   @GetMapping("/userInfo")
    public JsonResult userInfo(){
       return iUserService.getUserInfo();
   }

    /**
     * 修改密码
     * @param dto
     * @return
     */
   @PutMapping("/restPassword")
    public JsonResult restPwd(@RequestBody ResetPwdDto dto){
       return iUserService.resetPwd(dto);
   }






}
