forked from rongchao/epmet-cloud-rizhao
28 changed files with 495 additions and 26 deletions
@ -0,0 +1,65 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/21 9:53 |
|||
*/ |
|||
@Data |
|||
public class QueryOperUserResultDto implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String realName; |
|||
|
|||
|
|||
/** |
|||
* 头像 |
|||
*/ |
|||
private String headUrl; |
|||
|
|||
/** |
|||
* 性别 0:男 1:女 2:保密 |
|||
*/ |
|||
private Integer gender; |
|||
|
|||
/** |
|||
* 邮箱 |
|||
*/ |
|||
private String email; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String phone; |
|||
|
|||
/** |
|||
* 微信openId |
|||
*/ |
|||
private String wxOpenId; |
|||
|
|||
/** |
|||
* 超级管理员 0:否 1:是 |
|||
*/ |
|||
private Integer superAdmin; |
|||
|
|||
/** |
|||
* 状态 0:停用 1:正常 |
|||
*/ |
|||
private Integer status; |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.feign.fallback.OperRoleUserFeignClientFallBack; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/20 17:19 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperRoleUserFeignClientFallBack.class) |
|||
public interface OperRoleUserFeignClient { |
|||
|
|||
/** |
|||
* 获取权限id列表 |
|||
* @param id 用户id |
|||
* @return List<String> |
|||
* @author zhaoqifeng |
|||
*/ |
|||
@GetMapping("/oper/access/operroleuser/getRoleIdList/{id}") |
|||
Result<List<String>> getRoleIdList(@PathVariable("id") String id); |
|||
|
|||
/** |
|||
* 保存更新权限 |
|||
* @param userId 用户id |
|||
* @param roleIdList 权限列表 |
|||
* @author zhaoqifeng |
|||
*/ |
|||
@PostMapping("/oper/access/operroleuser/saveOrUpdateRole") |
|||
Result saveOrUpdate(@RequestParam("userId") String userId, @RequestBody List<String> roleIdList); |
|||
|
|||
/** |
|||
* 根据用户ids,删除角色用户关系 |
|||
* @param ids 户ids |
|||
* @return Result |
|||
*/ |
|||
@PostMapping("/oper/access/operroleuser/deleteByUserIds") |
|||
Result deleteByUserIds(@RequestBody String[] ids); |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.feign.fallback; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.ModuleUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.feign.OperRoleUserFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
import sun.misc.Contended; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/3/20 17:27 |
|||
*/ |
|||
@Component |
|||
public class OperRoleUserFeignClientFallBack implements OperRoleUserFeignClient { |
|||
@Override |
|||
public Result<List<String>> getRoleIdList(String id) { |
|||
return ModuleUtils.feignConError(ServiceConstant.OPER_ACCESS_SERVER, "getRoleIdList",id); |
|||
} |
|||
|
|||
@Override |
|||
public Result saveOrUpdate(String userId, List<String> roleIdList) { |
|||
return ModuleUtils.feignConError(ServiceConstant.OPER_ACCESS_SERVER, "saveOrUpdate",userId); |
|||
} |
|||
|
|||
@Override |
|||
public Result deleteByUserIds(String[] ids) { |
|||
return ModuleUtils.feignConError(ServiceConstant.OPER_ACCESS_SERVER, "deleteByUserId",ids); |
|||
} |
|||
} |
Loading…
Reference in new issue