9 changed files with 177 additions and 10 deletions
@ -0,0 +1,27 @@ |
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 修改密码 |
|||
* @author: wangtong |
|||
* @create: 2020-05-07 14:15 |
|||
**/ |
|||
@Data |
|||
public class ModifyPwdDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(value = "原密码") |
|||
@NotBlank(message="{sysuser.password.require}") |
|||
private String oldPwd; |
|||
|
|||
@ApiModelProperty(value = "新密码") |
|||
@NotBlank(message="{sysuser.password.require}") |
|||
private String newPwd; |
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.ModifyPwdDTO; |
|||
import com.elink.esua.epdc.service.SysUserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 用户管理相关接口 |
|||
* |
|||
* @author wangtong |
|||
* @date 2020/5/7 9:44 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("sys/user") |
|||
public class ApiSysUserController { |
|||
|
|||
@Autowired |
|||
private SysUserService sysUserService; |
|||
|
|||
|
|||
|
|||
/** |
|||
* @describe: 修改用户密码 |
|||
* @author wangtong |
|||
* @date 2020/5/7 9:44 |
|||
* @param [dto] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
@PostMapping("modifyPwd") |
|||
public Result modifyPwd(@RequestBody ModifyPwdDTO dto) { |
|||
return sysUserService.modifyPwd(dto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.ModifyPwdDTO; |
|||
|
|||
/** |
|||
* @author wangtong |
|||
* @date 2020/5/7 9:44 |
|||
*/ |
|||
public interface SysUserService { |
|||
|
|||
|
|||
/** |
|||
* @describe: 修改用户密码 |
|||
* @author wangtong |
|||
* @date 2020/5/7 9:47 |
|||
* @param [dto] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
Result modifyPwd(ModifyPwdDTO dto); |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.ModifyPwdDTO; |
|||
import com.elink.esua.epdc.feign.AdminFeignClient; |
|||
import com.elink.esua.epdc.service.SysUserService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* @author wangtong |
|||
* @date 2020/5/7 9:50 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class SysUserServiceImpl implements SysUserService { |
|||
private static final Logger logger = LoggerFactory.getLogger(SysUserServiceImpl.class); |
|||
|
|||
|
|||
@Autowired |
|||
private AdminFeignClient adminFeignClient; |
|||
|
|||
|
|||
@Override |
|||
public Result modifyPwd(ModifyPwdDTO dto) { |
|||
return adminFeignClient.modifyPwd(dto); |
|||
} |
|||
} |
Loading…
Reference in new issue