system改造

This commit is contained in:
zhuyang
2021-10-13 17:07:09 +08:00
parent 341404eafa
commit db27985036
57 changed files with 855 additions and 934 deletions

View File

@@ -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) {

View File

@@ -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));
}

View File

@@ -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));
}

View File

@@ -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());
}
}

View File

@@ -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));
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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));
}

View File

@@ -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));
}

View File

@@ -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));
}

View File

@@ -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);
}
}

View File

@@ -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());
}
}