完成用户管理的功能开发
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
### /user/page 成功
|
||||
GET {{baseUrl}}/user/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
### /user/update 成功
|
||||
POST {{baseUrl}}/user/update
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
id=31&username=user02&password=buzhidao&name=测试管理员&departmentId=1
|
||||
|
||||
### /user/update-status 成功
|
||||
POST {{baseUrl}}/user/update-status
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
userId=243&status=2
|
||||
|
||||
### /user/update-status 失败,参数缺失
|
||||
POST {{baseUrl}}/user/update-status
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
userId=31
|
||||
|
||||
###
|
||||
@@ -14,7 +14,7 @@ public class UserUpdateStatusReqVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true)
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Integer id;
|
||||
private Integer userId;
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.iocoder.mall.userservice.rpc.user.dto.UserPageReqDTO;
|
||||
import cn.iocoder.mall.userservice.rpc.user.dto.UserRespDTO;
|
||||
import cn.iocoder.mall.userservice.rpc.user.dto.UserUpdateReqDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
@@ -28,6 +29,7 @@ public interface UserConvert {
|
||||
|
||||
PageResult<UserRespVO> convertPage(PageResult<UserRespDTO> bean);
|
||||
|
||||
@Mapping(source = "userId", target = "id")
|
||||
UserUpdateReqDTO convert(UserUpdateStatusReqVO bean);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
@Service
|
||||
public class UserManager {
|
||||
|
||||
@Reference(version = "$ {dubbo.consumer.UserRpc.version}", validation = "false")
|
||||
@Reference(version = "${dubbo.consumer.UserRpc.version}", validation = "false")
|
||||
private UserRpc userRpc;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user