/* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package com.vci.ubcs.system.feign; import com.vci.ubcs.system.entity.*; import com.vci.ubcs.system.service.*; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.vo.RoleVO; import lombok.AllArgsConstructor; import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.List; /** * 系统服务Feign实现类 * * @author Chill */ @NonDS @ApiIgnore @RestController @AllArgsConstructor public class SysClient implements ISysClient { private final IDeptService deptService; private final IPostService postService; private final IRoleService roleService; private final IMenuService menuService; private final ITenantService tenantService; private final ITenantPackageService tenantPackageService; private final IParamService paramService; private final IRegionService regionService; private final IStrategyService strategyService; private final ICombinationService combinationService; private final IMdmCountConfigService mdmCountConfigService; @Override @GetMapping(MENU) public R getMenu(Long id) { return R.data(menuService.getById(id)); } /** * 根据code查询菜单信息 * @param codes * @return */ @Override @GetMapping(MENU_BY_CODES) public R> getMenuByCodes(List codes) { return R.data(menuService.getMenuByCodes(codes)); } @Override @GetMapping(MENU_BUTTON) public R> getMenuButtonByType(String btmType) { return R.data(menuService.getMenuButtonByType(btmType)); } @Override @GetMapping(DEPT) public R getDept(Long id) { return R.data(deptService.getById(id)); } @Override public R getDeptIds(String tenantId, String deptNames) { return R.data(deptService.getDeptIds(tenantId, deptNames)); } @Override public R> tree(String tenantId) { return R.data(deptService.tree(tenantId)); } @Override public R> deptList(String tenantId) { return R.data(deptService.deptList(tenantId)); } @Override public R getDeptIdsByFuzzy(String tenantId, String deptNames) { return R.data(deptService.getDeptIdsByFuzzy(tenantId, deptNames)); } @Override @GetMapping(DEPT_NAME) public R getDeptName(Long id) { return R.data(deptService.getById(id).getDeptName()); } @Override @GetMapping(DEPT_NAMES) public R> getDeptNames(String deptIds) { return R.data(deptService.getDeptNames(deptIds)); } @Override @GetMapping(DEPT_CHILD) public R> getDeptChild(Long deptId) { return R.data(deptService.getDeptChild(deptId)); } @Override public R getPost(Long id) { return R.data(postService.getById(id)); } @Override public R getPostIds(String tenantId, String postNames) { return R.data(postService.getPostIds(tenantId, postNames)); } @Override public R getPostIdsByFuzzy(String tenantId, String postNames) { return R.data(postService.getPostIdsByFuzzy(tenantId, postNames)); } @Override public R getPostName(Long id) { return R.data(postService.getById(id).getPostName()); } @Override public R> getPostNames(String postIds) { return R.data(postService.getPostNames(postIds)); } @Override @GetMapping(ROLE) public R getRole(Long id) { return R.data(roleService.getById(id)); } @Override public R getRoleIds(String tenantId, String roleNames) { return R.data(roleService.getRoleIds(tenantId, roleNames)); } @Override public R> roleTree(String tenantId) { return R.data(roleService.tree(tenantId)); } @Override public R> roleList(String tenantId) { return R.data(roleService.roleList(tenantId)); } @Override @GetMapping(ROLE_NAME) public R getRoleName(Long id) { return R.data(roleService.getById(id).getRoleName()); } @Override @GetMapping(ROLE_ALIAS) public R getRoleAlias(Long id) { return R.data(roleService.getById(id).getRoleAlias()); } @Override @GetMapping(ROLE_NAMES) public R> getRoleNames(String roleIds) { return R.data(roleService.getRoleNames(roleIds)); } @Override @GetMapping(ROLE_ALIASES) public R> getRoleAliases(String roleIds) { return R.data(roleService.getRoleAliases(roleIds)); } @Override @GetMapping(TENANT) public R getTenant(Long id) { return R.data(tenantService.getById(id)); } @Override @GetMapping(TENANT_ID) public R getTenant(String tenantId) { return R.data(tenantService.getByTenantId(tenantId)); } @Override @GetMapping(TENANT_PACKAGE) public R getTenantPackage(String tenantId) { Tenant tenant = tenantService.getByTenantId(tenantId); return R.data(tenantPackageService.getById(tenant.getPackageId())); } @Override @GetMapping(PARAM) public R getParam(Long id) { return R.data(paramService.getById(id)); } @Override @GetMapping(PARAM_VALUE) public R getParamValue(String paramKey) { return R.data(paramService.getValue(paramKey)); } @Override @GetMapping(REGION) public R getRegion(String code) { return R.data(regionService.getById(code)); } @Override @PostMapping(STRATEGY) public R getByTenantIdAndName(String tenantId, String name) { return R.data(strategyService.queryByNameAndTenantId(tenantId,name)); } @Override @PostMapping(STRATEGYBYID) public R getByUserId(Long userId) { return R.data(strategyService.queryByUserId(userId)); } @Override @PostMapping(REGEX) public R getRegex(@RequestBody List combinationIds) { return R.data(combinationService.getRegex(combinationIds)); } @Override @PostMapping(REGEXONE) public R> getRegexByList(List combinationIds) { return R.data(combinationService.getRegexList(combinationIds)); } @Override @GetMapping(MDM_COUNT_CONFIG) public R getMdmCountConfig (String userId) { return R.data(mdmCountConfigService.getMdmCountConfig(userId)); } }