11 changed files with 189 additions and 7 deletions
@ -0,0 +1,23 @@ |
|||
package com.epmet.dto.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.feign.fallback.GovAccessFeignClientFallBack; |
|||
import com.epmet.dto.form.InitDefaultOperationsFormDTO; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovAccessFeignClientFallBack.class)
|
|||
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovAccessFeignClientFallBack.class, url = "localhost:8099") |
|||
public interface GovAccessFeignClient { |
|||
|
|||
/** |
|||
* 批量为角色ID初始化操作权限列表 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping("/gov/access/role/initdefaultoperationsforroles") |
|||
Result initDefaultOperationsForRoles(@RequestBody InitDefaultOperationsFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dto.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.dto.feign.GovAccessFeignClient; |
|||
import com.epmet.dto.form.InitDefaultOperationsFormDTO; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author sun |
|||
*/ |
|||
@Component |
|||
public class GovAccessFeignClientFallBack implements GovAccessFeignClient { |
|||
|
|||
|
|||
@Override |
|||
public Result initDefaultOperationsForRoles(InitDefaultOperationsFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "initDefaultOperationsForRoles", formDTO); |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class InitDefaultOperationsFormDTO { |
|||
|
|||
private List<InitDefaultOpesRoleDTO> roles; |
|||
|
|||
@Data |
|||
public static class InitDefaultOpesRoleDTO { |
|||
public InitDefaultOpesRoleDTO() { |
|||
} |
|||
|
|||
private String roleId; |
|||
private String roleKey; |
|||
} |
|||
} |
Loading…
Reference in new issue