jiangping
2024-09-09 c47f7b9c4899036c52ad0e4f46c4aff7102110bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.doumee.api.cloud;
 
import com.doumee.api.BaseController;
import com.doumee.biz.system.SystemUserBiz;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.dao.system.dto.UpdatePwdDto;
import com.doumee.service.system.SystemLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author Eva.Caesar Liu
 * @date 2023/03/21 14:49
 */
@Api(tags = "系统功能")
@Trace(exclude = true)
@Slf4j
@RestController
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/system")
public class SystemCloudController extends BaseController {
 
    @Autowired
    private SystemUserBiz systemUserBiz;
 
    @Autowired
    private SystemLoginService systemLoginService;
 
    @Trace(withRequestParameters = false)
    @ApiOperation("修改当前用户密码")
    @PostMapping("/updatePwd")
    public ApiResponse updatePwd (@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated @RequestBody UpdatePwdDto dto) {
        dto.setUserId(this.getLoginUser(token).getId());
        systemUserBiz.updatePwd(dto);
        return ApiResponse.success(null);
    }
 
}