system改造
This commit is contained in:
@@ -31,6 +31,10 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminVerifyPasswordDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface AdminFeign {
|
||||
@PostMapping("/system/admin/verifyPassword")
|
||||
public CommonResult<AdminVO> verifyPassword(@RequestBody AdminVerifyPasswordDTO verifyPasswordDTO) ;
|
||||
|
||||
@PostMapping("/system/admin/createAdmin")
|
||||
public CommonResult<Integer> createAdmin(@RequestBody AdminCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/admin/updateAdmin")
|
||||
public CommonResult<Boolean> updateAdmin(@RequestBody AdminUpdateDTO updateDTO) ;
|
||||
|
||||
@PostMapping("/system/admin/pageAdmin")
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(@RequestBody AdminPageDTO pageDTO);
|
||||
|
||||
@GetMapping("/system/admin/getAdmin")
|
||||
public CommonResult<AdminVO> getAdmin(@RequestParam("adminId") Integer adminId) ;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminVerifyPasswordDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
|
||||
/**
|
||||
* 管理员 RPC 接口
|
||||
*/
|
||||
public interface AdminRpc {
|
||||
|
||||
CommonResult<AdminVO> verifyPassword(AdminVerifyPasswordDTO verifyPasswordDTO);
|
||||
|
||||
CommonResult<Integer> createAdmin(AdminCreateDTO createDTO);
|
||||
|
||||
CommonResult<Boolean> updateAdmin(AdminUpdateDTO updateDTO);
|
||||
|
||||
CommonResult<PageResult<AdminVO>> pageAdmin(AdminPageDTO pageDTO);
|
||||
|
||||
CommonResult<AdminVO> getAdmin(Integer adminId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface DepartmentFeign {
|
||||
@PostMapping("/system/department/createDepartment")
|
||||
public CommonResult<Integer> createDepartment(@RequestBody DepartmentCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/department/updateDepartment")
|
||||
public CommonResult<Boolean> updateDepartment(@RequestBody DepartmentUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/department/deleteDepartment")
|
||||
public CommonResult<Boolean> deleteDepartment(@RequestParam("departmentId")Integer departmentId);
|
||||
|
||||
@GetMapping("/system/department/getDepartment")
|
||||
public CommonResult<DepartmentVO> getDepartment(@RequestParam("departmentId") Integer departmentId) ;
|
||||
|
||||
@GetMapping("/system/department/listDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments(@RequestParam("departmentIds")Collection<Integer> departmentIds) ;
|
||||
|
||||
@GetMapping("/system/department/listAllDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments();
|
||||
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
public interface DepartmentRpc {
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*
|
||||
* @param createDTO 创建部门 DTO
|
||||
* @return 部门编号
|
||||
*/
|
||||
CommonResult<Integer> createDepartment(DepartmentCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
*
|
||||
* @param updateDTO 更新部门 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateDepartment(DepartmentUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*
|
||||
* @param departmentId 部门编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteDepartment(Integer departmentId);
|
||||
|
||||
/**
|
||||
* 获得部门
|
||||
*
|
||||
* @param departmentId 部门编号
|
||||
* @return 部门
|
||||
*/
|
||||
CommonResult<DepartmentVO> getDepartment(Integer departmentId);
|
||||
|
||||
/**
|
||||
* 获得部门列表
|
||||
*
|
||||
* @param departmentIds 部门编号列表
|
||||
* @return 部门列表
|
||||
*/
|
||||
CommonResult<List<DepartmentVO>> listDepartments(Collection<Integer> departmentIds);
|
||||
|
||||
/**
|
||||
* 获得部门全列表
|
||||
*
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<DepartmentVO>> listDepartments();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.datadict;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface DataDictFeign {
|
||||
@PostMapping("/system/datadict/createDataDict")
|
||||
public CommonResult<Integer> createDataDict(@RequestBody DataDictCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/datadict/updateDataDict")
|
||||
public CommonResult<Boolean> updateDataDict(@RequestBody DataDictUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/datadict/deleteDataDict")
|
||||
public CommonResult<Boolean> deleteDataDict(@RequestParam("dataDictId") Integer dataDictId);
|
||||
|
||||
@GetMapping("/system/datadict/getDataDict")
|
||||
public CommonResult<DataDictVO> getDataDict(@RequestParam("dataDictId") Integer dataDictId);
|
||||
|
||||
@GetMapping("/system/datadict/listAllDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts() ;
|
||||
|
||||
@GetMapping("/system/datadict/listDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts(@RequestParam("dataDictIds") List<Integer> dataDictIds);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.datadict;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据字典 Rpc 接口
|
||||
*/
|
||||
public interface DataDictRpc {
|
||||
|
||||
/**
|
||||
* 创建数据字典
|
||||
*
|
||||
* @param createDTO 创建数据字典 DTO
|
||||
* @return 数据字典编号
|
||||
*/
|
||||
CommonResult<Integer> createDataDict(DataDictCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新数据字典
|
||||
*
|
||||
* @param updateDTO 更新数据字典 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateDataDict(DataDictUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除数据字典
|
||||
*
|
||||
* @param dataDictId 数据字典编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteDataDict(Integer dataDictId);
|
||||
|
||||
/**
|
||||
* 获得数据字典
|
||||
*
|
||||
* @param dataDictId 数据字典编号
|
||||
* @return 数据字典
|
||||
*/
|
||||
CommonResult<DataDictVO> getDataDict(Integer dataDictId);
|
||||
|
||||
/**
|
||||
* 获得全部数据字典
|
||||
*
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
CommonResult<List<DataDictVO>> listDataDicts();
|
||||
|
||||
/**
|
||||
* 获得数据字典列表
|
||||
*
|
||||
* @param dataDictIds 数据字典编号列表
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
CommonResult<List<DataDictVO>> listDataDicts(List<Integer> dataDictIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeAutoGenerateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface ErrorCodeFeign {
|
||||
|
||||
@GetMapping("/system/errorcode/listErrorCodes")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("group") String group, @RequestParam("minUpdateTime") Date minUpdateTime) ;
|
||||
|
||||
@PostMapping("/system/errorcode/autoGenerateErrorCodes")
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(@RequestBody List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs);
|
||||
|
||||
@PostMapping("/system/errorcode/createErrorCode")
|
||||
public CommonResult<Integer> createErrorCode(@RequestBody ErrorCodeCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/errorcode/updateErrorCode")
|
||||
public CommonResult<Boolean> updateErrorCode(@RequestBody ErrorCodeUpdateDTO updateDTO) ;
|
||||
|
||||
@GetMapping("/system/errorcode/deleteErrorCode")
|
||||
public CommonResult<Boolean> deleteErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) ;
|
||||
|
||||
@GetMapping("/system/errorcode/getErrorCode")
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) ;
|
||||
|
||||
@GetMapping("/system/errorcode/listErrorCodesByIds")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("errorCodeIds")List<Integer> errorCodeIds) ;
|
||||
|
||||
@PostMapping("/system/errorcode/pageErrorCode")
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(@RequestBody ErrorCodePageDTO pageDTO);
|
||||
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeAutoGenerateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface ErrorCodeRpc {
|
||||
|
||||
/**
|
||||
* 获得指定分组下的错误码列表
|
||||
*
|
||||
* @param group 错误码分组
|
||||
* @param minUpdateTime 最小更新时间,允许为空。
|
||||
* 通过该参数,我们可以增量获取超过 minUpdateTime 时间的错误码
|
||||
* @return 错误码列表
|
||||
*/
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodes(@NotNull(message = "错误码分组不能为空") String group, Date minUpdateTime);
|
||||
|
||||
/**
|
||||
* 自动生成错误码
|
||||
*
|
||||
* @param autoGenerateDTOs 自动生成信息 DTO
|
||||
*/
|
||||
CommonResult<Boolean> autoGenerateErrorCodes(List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs);
|
||||
|
||||
/**
|
||||
* 创建错误码
|
||||
*
|
||||
* @param createDTO 创建错误码 DTO
|
||||
* @return 错误码编号
|
||||
*/
|
||||
CommonResult<Integer> createErrorCode(ErrorCodeCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新错误码
|
||||
*
|
||||
* @param updateDTO 更新错误码 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateErrorCode(ErrorCodeUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除错误码
|
||||
*
|
||||
* @param errorCodeId 错误码编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteErrorCode(Integer errorCodeId);
|
||||
|
||||
/**
|
||||
* 获得错误码
|
||||
*
|
||||
* @param errorCodeId 错误码编号
|
||||
* @return 错误码
|
||||
*/
|
||||
CommonResult<ErrorCodeVO> getErrorCode(Integer errorCodeId);
|
||||
|
||||
/**
|
||||
* 获得错误码列表
|
||||
*
|
||||
* @param errorCodeIds 错误码编号列表
|
||||
* @return 错误码列表
|
||||
*/
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodes(List<Integer> errorCodeIds);
|
||||
|
||||
/**
|
||||
* 获得错误码分页
|
||||
*
|
||||
* @param pageDTO 错误码分页查询
|
||||
* @return 错误码分页结果
|
||||
*/
|
||||
CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(ErrorCodePageDTO pageDTO);
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
|
||||
public interface OAuth2Rpc {
|
||||
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2CreateAccessTokenReqDTO createAccessTokenDTO);
|
||||
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(String accessToken);
|
||||
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO);
|
||||
|
||||
CommonResult<Boolean> removeToken(OAuth2RemoveTokenByUserReqDTO removeTokenDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface OAuthFeign {
|
||||
|
||||
@PostMapping("ccreateAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@RequestBody OAuth2CreateAccessTokenReqDTO createAccessTokenDTO);
|
||||
|
||||
@PostMapping("/system/oauthcheckAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(@RequestParam("accessToken") String accessToken) ;
|
||||
|
||||
@PostMapping("/system/oauthrefreshAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestBody OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO);
|
||||
@PostMapping("/system/oauthremoveToken")
|
||||
public CommonResult<Boolean> removeToken(@RequestBody OAuth2RemoveTokenByUserReqDTO removeTokenDTO);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface PermissionFeign {
|
||||
|
||||
@GetMapping("/system/permission/listRoleResourceIds")
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(@RequestParam("roleId")Integer roleId) ;
|
||||
|
||||
@PostMapping("/system/permission/assignRoleResource")
|
||||
public CommonResult<Boolean> assignRoleResource(@RequestBody PermissionAssignRoleResourceDTO assignRoleResourceDTO);
|
||||
|
||||
@GetMapping("/system/permission/listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId")Integer adminId);
|
||||
|
||||
@GetMapping("/system/permission/mapAdminRoleIds")
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(@RequestParam("adminIds") Collection<Integer> adminIds);
|
||||
|
||||
@PostMapping("/system/permission/assignAdminRole")
|
||||
public CommonResult<Boolean> assignAdminRole(@RequestBody PermissionAssignAdminRoleDTO assignAdminRoleDTO);
|
||||
|
||||
@PostMapping("/system/permission/scheckPermission")
|
||||
public CommonResult<Boolean> checkPermission(@RequestBody PermissionCheckDTO checkDTO) ;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 权限 Rpc 接口
|
||||
*/
|
||||
public interface PermissionRpc {
|
||||
|
||||
/**
|
||||
* 获得角色拥有的资源编号
|
||||
*
|
||||
* @param roleId 角色编号
|
||||
* @return 资源编号列表
|
||||
*/
|
||||
CommonResult<Set<Integer>> listRoleResourceIds(Integer roleId);
|
||||
|
||||
/**
|
||||
* 赋予角色资源
|
||||
*
|
||||
* @param assignRoleResourceDTO 赋予角色资源 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> assignRoleResource(PermissionAssignRoleResourceDTO assignRoleResourceDTO);
|
||||
|
||||
/**
|
||||
* 获得管理员拥有的角色编号列表
|
||||
*
|
||||
* @param adminId 管理员编号
|
||||
* @return 资源编号列表
|
||||
*/
|
||||
CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId);
|
||||
|
||||
/**
|
||||
* 获得每个管理员拥有的角色编号
|
||||
* 返回的结果,key 为管理员编号
|
||||
*
|
||||
* @param adminIds 管理员编号列表
|
||||
* @return 每个管理员拥有的角色编号
|
||||
*/
|
||||
CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(Collection<Integer> adminIds);
|
||||
|
||||
/**
|
||||
* 赋予管理员角色
|
||||
*
|
||||
* @param assignAdminRoleDTO 赋予管理员角色 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> assignAdminRole(PermissionAssignAdminRoleDTO assignAdminRoleDTO);
|
||||
|
||||
/**
|
||||
* 校验管理员是否拥有指定权限。
|
||||
*
|
||||
* 如果没有,则抛出 {@link cn.iocoder.common.framework.exception.ServiceException} 异常
|
||||
*
|
||||
* @param checkDTO 校验权限 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> checkPermission(PermissionCheckDTO checkDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface ResourceFeign {
|
||||
|
||||
@PostMapping("/system/resource/createResource")
|
||||
public CommonResult<Integer> createResource(@RequestBody ResourceCreateDTO createDTO);
|
||||
|
||||
@PostMapping("/system/resource/updateResource")
|
||||
public CommonResult<Boolean> updateResource(@RequestBody ResourceUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/resource/deleteResource")
|
||||
public CommonResult<Boolean> deleteResource(@RequestParam("resourceId") Integer resourceId) ;
|
||||
@GetMapping("/system/resource/getResource")
|
||||
public CommonResult<ResourceVO> getResource(@RequestParam("resourceId") Integer resourceId);
|
||||
|
||||
@GetMapping("/system/resource/listAllResource")
|
||||
public CommonResult<List<ResourceVO>> listResource() ;
|
||||
|
||||
@GetMapping("/system/resource/listResource")
|
||||
public CommonResult<List<ResourceVO>> listResource(@RequestParam("resourceIds") List<Integer> resourceIds);
|
||||
|
||||
@GetMapping("/system/resource/listRoleResource")
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(@RequestParam("roleIds") Collection<Integer> roleIds, @RequestParam("type") Integer type) ;
|
||||
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源 Rpc 接口
|
||||
*/
|
||||
public interface ResourceRpc {
|
||||
|
||||
/**
|
||||
* 创建资源
|
||||
*
|
||||
* @param createDTO 创建资源 DTO
|
||||
* @return 资源
|
||||
*/
|
||||
CommonResult<Integer> createResource(ResourceCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新资源
|
||||
*
|
||||
* @param updateDTO 更新资源 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateResource(ResourceUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除资源
|
||||
*
|
||||
* @param resourceId 资源编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteResource(Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获得资源
|
||||
*
|
||||
* @param resourceId 资源编号
|
||||
* @return 资源
|
||||
*/
|
||||
CommonResult<ResourceVO> getResource(Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获得资源全列表
|
||||
*
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listResource();
|
||||
|
||||
/**
|
||||
* 获得资源列表
|
||||
*
|
||||
* @param resourceIds 资源编号列表
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listResource(List<Integer> resourceIds);
|
||||
|
||||
/**
|
||||
* 获得指定角色的资源列表
|
||||
*
|
||||
* @param roleIds 角色编号列表
|
||||
* @param type 资源类型
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listRoleResource(@NotNull(message = "角色编号列表不能为空") Collection<Integer> roleIds, Integer type);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface RoleFeign {
|
||||
|
||||
|
||||
@PostMapping("/system/role/createRole")
|
||||
public CommonResult<Integer> createRole(@RequestBody RoleCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/role/updateRole")
|
||||
public CommonResult<Boolean> updateRole(@RequestBody RoleUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/role/deleteRole")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("roleId")Integer roleId) ;
|
||||
|
||||
@GetMapping("/system/role/getRole")
|
||||
public CommonResult<RoleVO> getRole(@RequestParam("roleId")Integer roleId);
|
||||
|
||||
@GetMapping("/system/role/listAllRoles")
|
||||
public CommonResult<List<RoleVO>> listAllRoles() ;
|
||||
|
||||
@GetMapping("/system/role/listRoles")
|
||||
public CommonResult<List<RoleVO>> listRoles(@RequestParam("roleIds")Collection<Integer> roleIds) ;
|
||||
|
||||
@PostMapping("/system/role/pageRole")
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(@RequestBody RolePageDTO pageDTO);
|
||||
|
||||
@GetMapping("/system/role/listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId") Integer adminId) ;
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 角色 Rpc 接口
|
||||
*/
|
||||
public interface RoleRpc {
|
||||
|
||||
/**
|
||||
* 创建角色
|
||||
*
|
||||
* @param createDTO 创建角色 DTO
|
||||
* @return 角色编号
|
||||
*/
|
||||
CommonResult<Integer> createRole(RoleCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新角色
|
||||
*
|
||||
* @param updateDTO 更新角色 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateRole(RoleUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*
|
||||
* @param roleId 角色编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteRole(Integer roleId);
|
||||
|
||||
/**
|
||||
* 获得角色
|
||||
*
|
||||
* @param roleId 角色编号
|
||||
* @return 角色
|
||||
*/
|
||||
CommonResult<RoleVO> getRole(Integer roleId);
|
||||
|
||||
/**
|
||||
* 获得所有角色
|
||||
*
|
||||
* @return 角色列表
|
||||
*/
|
||||
CommonResult<List<RoleVO>> listAllRoles();
|
||||
|
||||
/**
|
||||
* 获得角色列表
|
||||
*
|
||||
* @param roleIds 角色编号列表
|
||||
* @return 角色列表
|
||||
*/
|
||||
CommonResult<List<RoleVO>> listRoles(Collection<Integer> roleIds);
|
||||
|
||||
/**
|
||||
* 获得角色分页
|
||||
*
|
||||
* @param pageDTO 角色分页查询
|
||||
* @return 角色分页结果
|
||||
*/
|
||||
CommonResult<PageResult<RoleVO>> pageRole(RolePageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 获得管理员拥有的角色编号列表
|
||||
*
|
||||
* @param adminId 管理员编号
|
||||
* @return 角色编号列表
|
||||
*/
|
||||
CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface SystemAccessLogFeign {
|
||||
|
||||
@PostMapping("/system/accesslog/createSystemAccessLog")
|
||||
public CommonResult<Boolean> createSystemAccessLog(@RequestBody SystemAccessLogCreateDTO createDTO);
|
||||
|
||||
@PostMapping("/system/accesslog/pageSystemAccessLog")
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(@RequestBody SystemAccessLogPageDTO pageDTO);
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO;
|
||||
|
||||
/**
|
||||
* 系统访问日志 Rpc 接口
|
||||
*/
|
||||
public interface SystemAccessLogRpc {
|
||||
|
||||
/**
|
||||
* 创建系统访问日志
|
||||
*
|
||||
* @param createDTO 创建系统访问日志 DTO
|
||||
* @return 系统访问日志编号
|
||||
*/
|
||||
CommonResult<Boolean> createSystemAccessLog(SystemAccessLogCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 获得系统访问日志分页
|
||||
*
|
||||
* @param pageDTO 系统访问日志分页查询
|
||||
* @return 系统访问日志分页结果
|
||||
*/
|
||||
CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(SystemAccessLogPageDTO pageDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface SystemExceptionLogFeign {
|
||||
|
||||
@PostMapping("/system/exceptionlog/createSystemExceptionLog")
|
||||
public CommonResult<Boolean> createSystemExceptionLog(@RequestBody SystemExceptionLogCreateDTO createDTO);
|
||||
|
||||
@GetMapping("/system/exceptionlog/getSystemExceptionLog")
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(@RequestParam("systemExceptionLogId") Integer systemExceptionLogId);
|
||||
@PostMapping("/system/exceptionlog/pageSystemExceptionLog")
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(@RequestBody SystemExceptionLogPageDTO pageDTO) ;
|
||||
|
||||
@PostMapping("/system/exceptionlog/processSystemExceptionLog")
|
||||
public CommonResult<Boolean> processSystemExceptionLog(@RequestBody SystemExceptionLogProcessDTO processDTO) ;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO;
|
||||
|
||||
/**
|
||||
* 系统异常日志 Rpc 接口
|
||||
*/
|
||||
public interface SystemExceptionLogRpc {
|
||||
|
||||
/**
|
||||
* 创建系统异常日志
|
||||
*
|
||||
* @param createDTO 创建系统异常日志 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> createSystemExceptionLog(SystemExceptionLogCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 获得系统异常日志
|
||||
*
|
||||
* @param systemExceptionLogId 系统异常日志编号
|
||||
* @return 系统异常日志
|
||||
*/
|
||||
CommonResult<SystemExceptionLogVO> getSystemExceptionLog(Integer systemExceptionLogId);
|
||||
|
||||
/**
|
||||
* 获得系统异常日志分页
|
||||
*
|
||||
* @param pageDTO 系统异常日志分页查询
|
||||
* @return 系统异常日志分页结果
|
||||
*/
|
||||
CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(SystemExceptionLogPageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 处理系统异常日志,完成或者忽略
|
||||
*
|
||||
* @param processDTO 处理 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> processSystemExceptionLog(SystemExceptionLogProcessDTO processDTO);
|
||||
|
||||
}
|
||||
@@ -86,7 +86,10 @@
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -2,8 +2,12 @@ package cn.iocoder.mall.systemservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages = {"cn.iocoder.mall.systemservice.rpc"})
|
||||
public class SystemServiceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@@ -8,41 +8,49 @@ import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminVerifyPasswordDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Service(version = "${dubbo.provider.AdminRpc.version}")
|
||||
public class AdminRpcImpl implements AdminRpc {
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/admin")
|
||||
public class AdminController {
|
||||
@Autowired
|
||||
private AdminManager adminManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminVO> verifyPassword(AdminVerifyPasswordDTO verifyPasswordDTO) {
|
||||
|
||||
@PostMapping("verifyPassword")
|
||||
public CommonResult<AdminVO> verifyPassword(@RequestBody AdminVerifyPasswordDTO verifyPasswordDTO) {
|
||||
return success(adminManager.verifyPassword(verifyPasswordDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createAdmin(AdminCreateDTO createDTO) {
|
||||
@PostMapping("createAdmin")
|
||||
public CommonResult<Integer> createAdmin(@RequestBody AdminCreateDTO createDTO) {
|
||||
AdminVO adminVO = adminManager.createAdmin(createDTO);
|
||||
return success(adminVO.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateAdmin(AdminUpdateDTO updateDTO) {
|
||||
@PostMapping("updateAdmin")
|
||||
public CommonResult<Boolean> updateAdmin(@RequestBody AdminUpdateDTO updateDTO) {
|
||||
adminManager.updateAdmin(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(AdminPageDTO pageDTO) {
|
||||
@PostMapping("pageAdmin")
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(@RequestBody AdminPageDTO pageDTO) {
|
||||
return success(adminManager.pageAdmin(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminVO> getAdmin(Integer adminId) {
|
||||
@GetMapping("getAdmin")
|
||||
public CommonResult<AdminVO> getAdmin(@RequestParam("adminId") Integer adminId) {
|
||||
return success(adminManager.getAdmin(adminId));
|
||||
}
|
||||
|
||||
@@ -1,55 +1,59 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.datadict;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.datadict.DataDictManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 数据字典 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.DataDictRpc.version}")
|
||||
public class DataDictRpcImpl implements DataDictRpc {
|
||||
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/datadict")
|
||||
public class DataDictController {
|
||||
@Autowired
|
||||
private DataDictManager dataDictManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createDataDict(DataDictCreateDTO createDTO) {
|
||||
@PostMapping("createDataDict")
|
||||
public CommonResult<Integer> createDataDict(@RequestBody DataDictCreateDTO createDTO) {
|
||||
return success(dataDictManager.createDataDict(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateDataDict(DataDictUpdateDTO updateDTO) {
|
||||
@PostMapping("updateDataDict")
|
||||
public CommonResult<Boolean> updateDataDict(@RequestBody DataDictUpdateDTO updateDTO) {
|
||||
dataDictManager.updateDataDict(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteDataDict(Integer dataDictId) {
|
||||
@GetMapping("deleteDataDict")
|
||||
public CommonResult<Boolean> deleteDataDict(@RequestParam("dataDictId") Integer dataDictId) {
|
||||
dataDictManager.deleteDataDict(dataDictId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DataDictVO> getDataDict(Integer dataDictId) {
|
||||
@GetMapping("getDataDict")
|
||||
public CommonResult<DataDictVO> getDataDict(@RequestParam("dataDictId") Integer dataDictId) {
|
||||
return success(dataDictManager.getDataDict(dataDictId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("listAllDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts() {
|
||||
return success(dataDictManager.listDataDicts());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DataDictVO>> listDataDicts(List<Integer> dataDictIds) {
|
||||
@GetMapping("listDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts(@RequestParam("dataDictIds") List<Integer> dataDictIds) {
|
||||
return success(dataDictManager.listDataDicts(dataDictIds));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.admin.DepartmentManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.*;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/department")
|
||||
public class DepartmentController {
|
||||
@Autowired
|
||||
private DepartmentManager departmentManager;
|
||||
|
||||
@PostMapping("createDepartment")
|
||||
public CommonResult<Integer> createDepartment(@RequestBody DepartmentCreateDTO createDTO) {
|
||||
return success(departmentManager.createDepartment(createDTO));
|
||||
}
|
||||
|
||||
@PostMapping("updateDepartment")
|
||||
public CommonResult<Boolean> updateDepartment(@RequestBody DepartmentUpdateDTO updateDTO) {
|
||||
departmentManager.updateDepartment(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("deleteDepartment")
|
||||
public CommonResult<Boolean> deleteDepartment(@RequestParam("departmentId")Integer departmentId) {
|
||||
departmentManager.deleteDepartment(departmentId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getDepartment")
|
||||
public CommonResult<DepartmentVO> getDepartment(@RequestParam("departmentId") Integer departmentId) {
|
||||
return success(departmentManager.getDepartment(departmentId));
|
||||
}
|
||||
|
||||
@GetMapping("listDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments(@RequestParam("departmentIds")Collection<Integer> departmentIds) {
|
||||
return success(departmentManager.listDepartments(departmentIds));
|
||||
}
|
||||
|
||||
@GetMapping("listAllDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments() {
|
||||
return success(departmentManager.listDepartments());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@@ -8,61 +8,67 @@ import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Service(version = "${dubbo.provider.ErrorCodeRpc.version}")
|
||||
public class ErrorCodeRpcImpl implements ErrorCodeRpc {
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/errorcode")
|
||||
public class ErrorCodeController {
|
||||
@Autowired
|
||||
private ErrorCodeManager errorCodeManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(String group, Date minUpdateTime) {
|
||||
@GetMapping("listErrorCodes")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("group") String group, @RequestParam("minUpdateTime") Date minUpdateTime) {
|
||||
return success(errorCodeManager.listErrorCodes(group, minUpdateTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs) {
|
||||
@PostMapping("autoGenerateErrorCodes")
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(@RequestBody List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs) {
|
||||
errorCodeManager.autoGenerateErrorCodes(autoGenerateDTOs);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createErrorCode(ErrorCodeCreateDTO createDTO) {
|
||||
@PostMapping("createErrorCode")
|
||||
public CommonResult<Integer> createErrorCode(@RequestBody ErrorCodeCreateDTO createDTO) {
|
||||
return success(errorCodeManager.createErrorCode(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateErrorCode(ErrorCodeUpdateDTO updateDTO) {
|
||||
@PostMapping("updateErrorCode")
|
||||
public CommonResult<Boolean> updateErrorCode(@RequestBody ErrorCodeUpdateDTO updateDTO) {
|
||||
errorCodeManager.updateErrorCode(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteErrorCode(Integer errorCodeId) {
|
||||
@GetMapping("deleteErrorCode")
|
||||
public CommonResult<Boolean> deleteErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) {
|
||||
errorCodeManager.deleteErrorCode(errorCodeId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(Integer errorCodeId) {
|
||||
@GetMapping("getErrorCode")
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) {
|
||||
return success(errorCodeManager.getErrorCode(errorCodeId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(List<Integer> errorCodeIds) {
|
||||
@GetMapping("listErrorCodesByIds")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("errorCodeIds")List<Integer> errorCodeIds) {
|
||||
return success(errorCodeManager.listErrorCodes(errorCodeIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(ErrorCodePageDTO pageDTO) {
|
||||
@PostMapping("pageErrorCode")
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(@RequestBody ErrorCodePageDTO pageDTO) {
|
||||
return success(errorCodeManager.pageErrorCode(pageDTO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
@@ -6,36 +6,43 @@ import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
import cn.iocoder.mall.systemservice.service.oauth.OAuth2Service;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@DubboService
|
||||
public class OAuth2RpcImpl implements OAuth2Rpc {
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/oauth")
|
||||
public class OAuthController {
|
||||
|
||||
@Autowired
|
||||
private OAuth2Service oAuth2Service;
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2CreateAccessTokenReqDTO createAccessTokenDTO) {
|
||||
@PostMapping("createAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@RequestBody OAuth2CreateAccessTokenReqDTO createAccessTokenDTO) {
|
||||
return success(oAuth2Service.createAccessToken(createAccessTokenDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(String accessToken) {
|
||||
@PostMapping("checkAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(@RequestParam("accessToken") String accessToken) {
|
||||
return success(oAuth2Service.checkAccessToken(accessToken));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO) {
|
||||
@PostMapping("refreshAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestBody OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO) {
|
||||
return success(oAuth2Service.refreshAccessToken(refreshAccessTokenDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> removeToken(OAuth2RemoveTokenByUserReqDTO removeTokenDTO) {
|
||||
@PostMapping("removeToken")
|
||||
public CommonResult<Boolean> removeToken(@RequestBody OAuth2RemoveTokenByUserReqDTO removeTokenDTO) {
|
||||
oAuth2Service.removeToken(removeTokenDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.permission.PermissionManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
@@ -15,45 +15,48 @@ import java.util.Set;
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 权限 Rpc 实现类
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.PermissionRpc.version}")
|
||||
public class PermissionRpcImpl implements PermissionRpc {
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/system/permission")
|
||||
public class PermissionController {
|
||||
@Autowired
|
||||
private PermissionManager permissionManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(Integer roleId) {
|
||||
@GetMapping("listRoleResourceIds")
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(@RequestParam("roleId")Integer roleId) {
|
||||
return success(permissionManager.listRoleResourceIds(roleId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> assignRoleResource(PermissionAssignRoleResourceDTO assignRoleResourceDTO) {
|
||||
@PostMapping("assignRoleResource")
|
||||
public CommonResult<Boolean> assignRoleResource(@RequestBody PermissionAssignRoleResourceDTO assignRoleResourceDTO) {
|
||||
permissionManager.assignRoleResource(assignRoleResourceDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId) {
|
||||
@GetMapping("listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId")Integer adminId) {
|
||||
return success(permissionManager.listAdminRoleIds(adminId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(Collection<Integer> adminIds) {
|
||||
@GetMapping("mapAdminRoleIds")
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(@RequestParam("adminIds") Collection<Integer> adminIds) {
|
||||
return success(permissionManager.mapAdminRoleIds(adminIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> assignAdminRole(PermissionAssignAdminRoleDTO assignAdminRoleDTO) {
|
||||
@PostMapping("assignAdminRole")
|
||||
public CommonResult<Boolean> assignAdminRole(@RequestBody PermissionAssignAdminRoleDTO assignAdminRoleDTO) {
|
||||
permissionManager.assignAdminRole(assignAdminRoleDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> checkPermission(PermissionCheckDTO checkDTO) {
|
||||
@PostMapping("checkPermission")
|
||||
public CommonResult<Boolean> checkPermission(@RequestBody PermissionCheckDTO checkDTO) {
|
||||
permissionManager.checkPermission(checkDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.permission.ResourceManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -14,48 +14,53 @@ import java.util.List;
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 资源 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.ResourceRpc.version}")
|
||||
public class ResourceRpcImpl implements ResourceRpc {
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/resource")
|
||||
public class ResourceController {
|
||||
|
||||
@Autowired
|
||||
private ResourceManager resourceManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createResource(ResourceCreateDTO createDTO) {
|
||||
@PostMapping("createResource")
|
||||
public CommonResult<Integer> createResource(@RequestBody ResourceCreateDTO createDTO) {
|
||||
return success(resourceManager.createResource(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateResource(ResourceUpdateDTO updateDTO) {
|
||||
@PostMapping("updateResource")
|
||||
public CommonResult<Boolean> updateResource(@RequestBody ResourceUpdateDTO updateDTO) {
|
||||
resourceManager.updateResource(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteResource(Integer resourceId) {
|
||||
@GetMapping("deleteResource")
|
||||
public CommonResult<Boolean> deleteResource(@RequestParam("resourceId")Integer resourceId) {
|
||||
resourceManager.deleteResource(resourceId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<ResourceVO> getResource(Integer resourceId) {
|
||||
@GetMapping("getResource")
|
||||
public CommonResult<ResourceVO> getResource(@RequestParam("resourceId")Integer resourceId) {
|
||||
return success(resourceManager.getResource(resourceId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("listAllResource")
|
||||
public CommonResult<List<ResourceVO>> listResource() {
|
||||
return success(resourceManager.listResources());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ResourceVO>> listResource(List<Integer> resourceIds) {
|
||||
@GetMapping("listResource")
|
||||
public CommonResult<List<ResourceVO>> listResource(@RequestParam("resourceIds")List<Integer> resourceIds) {
|
||||
return success(resourceManager.listResources(resourceIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(Collection<Integer> roleIds, Integer type) {
|
||||
@GetMapping("listRoleResource")
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(@RequestParam("roleIds") Collection<Integer> roleIds, @RequestParam("type")Integer type) {
|
||||
return success(resourceManager.listRoleResources(roleIds, type));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@@ -7,8 +7,8 @@ import cn.iocoder.mall.systemservice.rpc.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -17,53 +17,58 @@ import java.util.Set;
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 角色 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.RoleRpc.version}")
|
||||
public class RoleRpcImpl implements RoleRpc {
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class RoleController {
|
||||
|
||||
@Autowired
|
||||
private RoleManager roleManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createRole(RoleCreateDTO createDTO) {
|
||||
@PostMapping("createRole")
|
||||
public CommonResult<Integer> createRole(@RequestBody RoleCreateDTO createDTO) {
|
||||
return success(roleManager.createRole(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateRole(RoleUpdateDTO updateDTO) {
|
||||
@PostMapping("updateRole")
|
||||
public CommonResult<Boolean> updateRole(@RequestBody RoleUpdateDTO updateDTO) {
|
||||
roleManager.updateRole(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteRole(Integer roleId) {
|
||||
@GetMapping("deleteRole")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("roleId")Integer roleId) {
|
||||
roleManager.deleteRole(roleId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<RoleVO> getRole(Integer roleId) {
|
||||
@GetMapping("getRole")
|
||||
public CommonResult<RoleVO> getRole(@RequestParam("roleId")Integer roleId) {
|
||||
return success(roleManager.getRole(roleId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("listAllRoles")
|
||||
public CommonResult<List<RoleVO>> listAllRoles() {
|
||||
return success(roleManager.listAllRoles());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<RoleVO>> listRoles(Collection<Integer> roleIds) {
|
||||
@GetMapping("listRoles")
|
||||
public CommonResult<List<RoleVO>> listRoles(@RequestParam("roleIds")Collection<Integer> roleIds) {
|
||||
return success(roleManager.listRoles(roleIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(RolePageDTO pageDTO) {
|
||||
@PostMapping("pageRole")
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(@RequestBody RolePageDTO pageDTO) {
|
||||
return success(roleManager.pageRole(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId) {
|
||||
@GetMapping("listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId") Integer adminId) {
|
||||
return success(roleManager.listAdminRoleIds(adminId));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@@ -6,28 +6,35 @@ import cn.iocoder.mall.systemservice.manager.systemlog.SystemAccessLogManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 系统访问日志 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.SystemAccessLogRpc.version}")
|
||||
public class SystemAccessLogRpcImpl implements SystemAccessLogRpc {
|
||||
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/accesslog")
|
||||
public class SystemAccessLogController {
|
||||
@Autowired
|
||||
private SystemAccessLogManager systemAccessLogManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> createSystemAccessLog(SystemAccessLogCreateDTO createDTO) {
|
||||
@PostMapping("createSystemAccessLog")
|
||||
public CommonResult<Boolean> createSystemAccessLog(@RequestBody SystemAccessLogCreateDTO createDTO) {
|
||||
systemAccessLogManager.createSystemAccessLog(createDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(SystemAccessLogPageDTO pageDTO) {
|
||||
@PostMapping("pageSystemAccessLog")
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(@RequestBody SystemAccessLogPageDTO pageDTO) {
|
||||
return success(systemAccessLogManager.pageSystemAccessLog(pageDTO));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@@ -7,37 +7,43 @@ import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateD
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Service(version = "${dubbo.provider.SystemExceptionLogRpc.version}")
|
||||
public class SystemExceptionLogRpcImpl implements SystemExceptionLogRpc {
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/exceptionlog")
|
||||
public class SystemExceptionLogController {
|
||||
@Autowired
|
||||
private SystemExceptionLogManager systemExceptionLogManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> createSystemExceptionLog(SystemExceptionLogCreateDTO createDTO) {
|
||||
@PostMapping("createSystemExceptionLog")
|
||||
public CommonResult<Boolean> createSystemExceptionLog(@RequestBody SystemExceptionLogCreateDTO createDTO) {
|
||||
systemExceptionLogManager.createSystemExceptionLog(createDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(Integer systemExceptionLogId) {
|
||||
@GetMapping("getSystemExceptionLog")
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(@RequestParam("systemExceptionLogId") Integer systemExceptionLogId) {
|
||||
return success(systemExceptionLogManager.getSystemExceptionLog(systemExceptionLogId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(SystemExceptionLogPageDTO pageDTO) {
|
||||
@PostMapping("pageSystemExceptionLog")
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(@RequestBody SystemExceptionLogPageDTO pageDTO) {
|
||||
return success(systemExceptionLogManager.pageSystemExceptionLog(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> processSystemExceptionLog(SystemExceptionLogProcessDTO processDTO) {
|
||||
@PostMapping("processSystemExceptionLog")
|
||||
public CommonResult<Boolean> processSystemExceptionLog(@RequestBody SystemExceptionLogProcessDTO processDTO) {
|
||||
systemExceptionLogManager.processSystemExceptionLog(processDTO);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.admin.DepartmentManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.DepartmentRpc.version}")
|
||||
public class DepartmentRpcImpl implements DepartmentRpc {
|
||||
|
||||
@Autowired
|
||||
private DepartmentManager departmentManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createDepartment(DepartmentCreateDTO createDTO) {
|
||||
return success(departmentManager.createDepartment(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateDepartment(DepartmentUpdateDTO updateDTO) {
|
||||
departmentManager.updateDepartment(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteDepartment(Integer departmentId) {
|
||||
departmentManager.deleteDepartment(departmentId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DepartmentVO> getDepartment(Integer departmentId) {
|
||||
return success(departmentManager.getDepartment(departmentId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DepartmentVO>> listDepartments(Collection<Integer> departmentIds) {
|
||||
return success(departmentManager.listDepartments(departmentIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DepartmentVO>> listDepartments() {
|
||||
return success(departmentManager.listDepartments());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user