16 changed files with 325 additions and 7 deletions
@ -0,0 +1,44 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; |
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.CommonUserIdFormDTO; |
|||
import com.epmet.dto.result.ExtUserInfoResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName OpenUpUserController |
|||
* @Auth wangc |
|||
* @Date 2020-08-21 17:56 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("user") |
|||
public class OpenUpUserController { |
|||
|
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* @Description 查找当前用户的信息 |
|||
* @param |
|||
* @return |
|||
* @author wangc |
|||
* @date 2020.08.17 10:30 |
|||
**/ |
|||
@ExternalAppRequestAuth |
|||
@PostMapping("userinfo") |
|||
Result<ExtUserInfoResultDTO> userInfo(@LoginUser TokenDto token){ |
|||
CommonUserIdFormDTO userParam = new CommonUserIdFormDTO(); |
|||
userParam.setUserId(token.getUserId()); |
|||
ValidatorUtils.validateEntity(userParam, CommonUserIdFormDTO.CommonUserIdGroup.class); |
|||
return epmetUserOpenFeignClient.extUserInfo(userParam); |
|||
} |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ExtUserInfoResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-21 17:09 |
|||
*/ |
|||
@Data |
|||
public class ExtUserInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 5888986115026957874L; |
|||
|
|||
/** |
|||
* 当前用户id |
|||
* */ |
|||
private String userId = ""; |
|||
/** |
|||
* 工作人员昵称 |
|||
* */ |
|||
private String nickname = ""; |
|||
|
|||
/** |
|||
* 工作人员头像 |
|||
* */ |
|||
private String profile = ""; |
|||
|
|||
/** |
|||
* |
|||
* */ |
|||
private String realName = ""; |
|||
|
|||
/** |
|||
* 客户Id |
|||
* */ |
|||
private String customerId = ""; |
|||
|
|||
/** |
|||
* 客户名称 |
|||
* */ |
|||
private String customerName = ""; |
|||
|
|||
/** |
|||
* 机关Id |
|||
* */ |
|||
private String agencyId = ""; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
* */ |
|||
private String agencyName = ""; |
|||
|
|||
/** |
|||
* 机关路径Id |
|||
* */ |
|||
private String agencyIdPath = ""; |
|||
|
|||
/** |
|||
* 机关路径名称 |
|||
* */ |
|||
private String agencyNamePath = ""; |
|||
|
|||
/** |
|||
* 网格Id |
|||
* */ |
|||
private String gridId = ""; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
* */ |
|||
private String gridName = ""; |
|||
|
|||
/** |
|||
* 用户角色列表 |
|||
* */ |
|||
private List<ExtRoleMapResultDTO> roleList = new ArrayList<>(); |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description userId |
|||
* @ClassName CommonUserIdFormDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-21 17:14 |
|||
*/ |
|||
@Data |
|||
public class CommonUserIdFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 3934409262981136977L; |
|||
public interface CommonUserIdGroup extends CustomerClientShowGroup{} |
|||
|
|||
@NotBlank(message = "用户Id不可为空", groups = CommonUserIdGroup.class) |
|||
private String userId; |
|||
} |
Loading…
Reference in new issue