将 onemall 老代码,统一到归档目录,后续不断迁移移除
This commit is contained in:
46
归档/system-service-project/pom.xml
Normal file
46
归档/system-service-project/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>onemall</artifactId>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>system-service-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>system-service-api</module>
|
||||
<module>system-service-app</module>
|
||||
<module>system-service-integration-test</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- onemall 基础 bom 文件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>mall-dependencies</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 自身项目 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>system-service-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 错误码自动生成 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodeAutoGenerateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 错误码编码
|
||||
*/
|
||||
@NotNull(message = "错误码编码不能为空")
|
||||
private Integer code;
|
||||
/**
|
||||
* 错误码错误提示
|
||||
*/
|
||||
@NotEmpty(message = "错误码错误提示不能为空")
|
||||
private String message;
|
||||
/**
|
||||
* 错误码分组
|
||||
*/
|
||||
@NotNull(message = "错误码分组不能为空")
|
||||
private String group;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.systemservice.enums.errorcode.ErrorCodeTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 错误码创建 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodeCreateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 错误码编码
|
||||
*/
|
||||
@NotNull(message = "错误码编码不能为空")
|
||||
private Integer code;
|
||||
/**
|
||||
* 错误码错误提示
|
||||
*/
|
||||
@NotEmpty(message = "错误码错误提示不能为空")
|
||||
private String message;
|
||||
/**
|
||||
* 错误码类型
|
||||
*/
|
||||
@NotNull(message = "错误码类型不能为空")
|
||||
@InEnum(value = ErrorCodeTypeEnum.class, message = "错误码类型必须是 {value}")
|
||||
private Integer type;
|
||||
/**
|
||||
* 错误码分组
|
||||
*/
|
||||
@NotNull(message = "错误码分组不能为空")
|
||||
private String group;
|
||||
/**
|
||||
* 错误码备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode.dto;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 错误码分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodePageDTO extends PageParam {
|
||||
|
||||
/**
|
||||
* 错误码编码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 错误码错误提示
|
||||
*
|
||||
* 模糊匹配
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 错误码分组
|
||||
*
|
||||
* 模糊匹配
|
||||
*/
|
||||
private String group;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.systemservice.enums.errorcode.ErrorCodeTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 错误码更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodeUpdateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 错误码编号
|
||||
*/
|
||||
@NotNull(message = "错误码编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 错误码编码
|
||||
*/
|
||||
@NotNull(message = "错误码编码不能为空")
|
||||
private Integer code;
|
||||
/**
|
||||
* 错误码错误提示
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 错误码类型
|
||||
*/
|
||||
@InEnum(value = ErrorCodeTypeEnum.class, message = "错误码类型必须是 {value}")
|
||||
private Integer type;
|
||||
/**
|
||||
* 错误码分组
|
||||
*/
|
||||
private String group;
|
||||
/**
|
||||
* 错误码备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 错误码 VO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ErrorCodeVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 错误码编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 错误码编码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 错误码错误提示
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 错误码类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 错误码分组
|
||||
*/
|
||||
private String group;
|
||||
/**
|
||||
* 错误码备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.manager.admin.AdminManager;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/admin")
|
||||
public class AdminController {
|
||||
@Autowired
|
||||
private AdminManager adminManager;
|
||||
|
||||
|
||||
@PostMapping("verifyPassword")
|
||||
public CommonResult<AdminVO> verifyPassword(@RequestBody AdminVerifyPasswordDTO verifyPasswordDTO) {
|
||||
return success(adminManager.verifyPassword(verifyPasswordDTO));
|
||||
}
|
||||
|
||||
@PostMapping("createAdmin")
|
||||
public CommonResult<Integer> createAdmin(@RequestBody AdminCreateDTO createDTO) {
|
||||
AdminVO adminVO = adminManager.createAdmin(createDTO);
|
||||
return success(adminVO.getId());
|
||||
}
|
||||
|
||||
@PostMapping("updateAdmin")
|
||||
public CommonResult<Boolean> updateAdmin(@RequestBody AdminUpdateDTO updateDTO) {
|
||||
adminManager.updateAdmin(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("pageAdmin")
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(@RequestBody AdminPageDTO pageDTO) {
|
||||
return success(adminManager.pageAdmin(pageDTO));
|
||||
}
|
||||
|
||||
@GetMapping("getAdmin")
|
||||
public CommonResult<AdminVO> getAdmin(@RequestParam("adminId") Integer adminId) {
|
||||
return success(adminManager.getAdmin(adminId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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/datadict")
|
||||
public class DataDictController {
|
||||
@Autowired
|
||||
private DataDictManager dataDictManager;
|
||||
|
||||
@PostMapping("createDataDict")
|
||||
public CommonResult<Integer> createDataDict(@RequestBody DataDictCreateDTO createDTO) {
|
||||
return success(dataDictManager.createDataDict(createDTO));
|
||||
}
|
||||
|
||||
@PostMapping("updateDataDict")
|
||||
public CommonResult<Boolean> updateDataDict(@RequestBody DataDictUpdateDTO updateDTO) {
|
||||
dataDictManager.updateDataDict(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("deleteDataDict")
|
||||
public CommonResult<Boolean> deleteDataDict(@RequestParam("dataDictId") Integer dataDictId) {
|
||||
dataDictManager.deleteDataDict(dataDictId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getDataDict")
|
||||
public CommonResult<DataDictVO> getDataDict(@RequestParam("dataDictId") Integer dataDictId) {
|
||||
return success(dataDictManager.getDataDict(dataDictId));
|
||||
}
|
||||
|
||||
@GetMapping("listAllDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts() {
|
||||
return success(dataDictManager.listDataDicts());
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.manager.errorcode.ErrorCodeManager;
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/errorcode")
|
||||
public class ErrorCodeController {
|
||||
@Autowired
|
||||
private ErrorCodeManager errorCodeManager;
|
||||
|
||||
@GetMapping("listErrorCodes")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("group") String group, @RequestParam("minUpdateTime") Date minUpdateTime) {
|
||||
return success(errorCodeManager.listErrorCodes(group, minUpdateTime));
|
||||
}
|
||||
|
||||
@PostMapping("autoGenerateErrorCodes")
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(@RequestBody List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs) {
|
||||
errorCodeManager.autoGenerateErrorCodes(autoGenerateDTOs);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("createErrorCode")
|
||||
public CommonResult<Integer> createErrorCode(@RequestBody ErrorCodeCreateDTO createDTO) {
|
||||
return success(errorCodeManager.createErrorCode(createDTO));
|
||||
}
|
||||
|
||||
@PostMapping("updateErrorCode")
|
||||
public CommonResult<Boolean> updateErrorCode(@RequestBody ErrorCodeUpdateDTO updateDTO) {
|
||||
errorCodeManager.updateErrorCode(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("deleteErrorCode")
|
||||
public CommonResult<Boolean> deleteErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) {
|
||||
errorCodeManager.deleteErrorCode(errorCodeId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getErrorCode")
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) {
|
||||
return success(errorCodeManager.getErrorCode(errorCodeId));
|
||||
}
|
||||
|
||||
@GetMapping("listErrorCodesByIds")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("errorCodeIds")List<Integer> errorCodeIds) {
|
||||
return success(errorCodeManager.listErrorCodes(errorCodeIds));
|
||||
}
|
||||
|
||||
@PostMapping("pageErrorCode")
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(@RequestBody ErrorCodePageDTO pageDTO) {
|
||||
return success(errorCodeManager.pageErrorCode(pageDTO));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
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 cn.iocoder.mall.systemservice.service.oauth.OAuth2Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/oauth")
|
||||
public class OAuthController {
|
||||
|
||||
@Autowired
|
||||
private OAuth2Service oAuth2Service;
|
||||
|
||||
@PostMapping("createAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@RequestBody OAuth2CreateAccessTokenReqDTO createAccessTokenDTO) {
|
||||
return success(oAuth2Service.createAccessToken(createAccessTokenDTO));
|
||||
}
|
||||
|
||||
@GetMapping("checkAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(@RequestParam("accessToken") String accessToken) {
|
||||
return success(oAuth2Service.checkAccessToken(accessToken));
|
||||
}
|
||||
|
||||
@PostMapping("refreshAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestBody OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO) {
|
||||
return success(oAuth2Service.refreshAccessToken(refreshAccessTokenDTO));
|
||||
}
|
||||
|
||||
@PostMapping("removeToken")
|
||||
public CommonResult<Boolean> removeToken(@RequestBody OAuth2RemoveTokenByUserReqDTO removeTokenDTO) {
|
||||
oAuth2Service.removeToken(removeTokenDTO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/permission")
|
||||
public class PermissionController {
|
||||
@Autowired
|
||||
private PermissionManager permissionManager;
|
||||
|
||||
@GetMapping("listRoleResourceIds")
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(@RequestParam("roleId")Integer roleId) {
|
||||
return success(permissionManager.listRoleResourceIds(roleId));
|
||||
}
|
||||
|
||||
@PostMapping("assignRoleResource")
|
||||
public CommonResult<Boolean> assignRoleResource(@RequestBody PermissionAssignRoleResourceDTO assignRoleResourceDTO) {
|
||||
permissionManager.assignRoleResource(assignRoleResourceDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId")Integer adminId) {
|
||||
return success(permissionManager.listAdminRoleIds(adminId));
|
||||
}
|
||||
|
||||
@GetMapping("mapAdminRoleIds")
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(@RequestParam("adminIds") Collection<Integer> adminIds) {
|
||||
return success(permissionManager.mapAdminRoleIds(adminIds));
|
||||
}
|
||||
|
||||
@PostMapping("assignAdminRole")
|
||||
public CommonResult<Boolean> assignAdminRole(@RequestBody PermissionAssignAdminRoleDTO assignAdminRoleDTO) {
|
||||
permissionManager.assignAdminRole(assignAdminRoleDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("checkPermission")
|
||||
public CommonResult<Boolean> checkPermission(@RequestBody PermissionCheckDTO checkDTO) {
|
||||
permissionManager.checkPermission(checkDTO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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.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/resource")
|
||||
public class ResourceController {
|
||||
|
||||
@Autowired
|
||||
private ResourceManager resourceManager;
|
||||
|
||||
@PostMapping("createResource")
|
||||
public CommonResult<Integer> createResource(@RequestBody ResourceCreateDTO createDTO) {
|
||||
return success(resourceManager.createResource(createDTO));
|
||||
}
|
||||
|
||||
@PostMapping("updateResource")
|
||||
public CommonResult<Boolean> updateResource(@RequestBody ResourceUpdateDTO updateDTO) {
|
||||
resourceManager.updateResource(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("deleteResource")
|
||||
public CommonResult<Boolean> deleteResource(@RequestParam("resourceId")Integer resourceId) {
|
||||
resourceManager.deleteResource(resourceId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getResource")
|
||||
public CommonResult<ResourceVO> getResource(@RequestParam("resourceId")Integer resourceId) {
|
||||
return success(resourceManager.getResource(resourceId));
|
||||
}
|
||||
|
||||
@GetMapping("listAllResource")
|
||||
public CommonResult<List<ResourceVO>> listResource() {
|
||||
return success(resourceManager.listResources());
|
||||
}
|
||||
|
||||
@GetMapping("listResource")
|
||||
public CommonResult<List<ResourceVO>> listResource(@RequestParam("resourceIds")List<Integer> resourceIds) {
|
||||
return success(resourceManager.listResources(resourceIds));
|
||||
}
|
||||
|
||||
@GetMapping("listRoleResource")
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(@RequestParam("roleIds") Collection<Integer> roleIds, @RequestParam("type")Integer type) {
|
||||
return success(resourceManager.listRoleResources(roleIds, type));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.manager.permission.RoleManager;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class RoleController {
|
||||
|
||||
@Autowired
|
||||
private RoleManager roleManager;
|
||||
|
||||
@PostMapping("createRole")
|
||||
public CommonResult<Integer> createRole(@RequestBody RoleCreateDTO createDTO) {
|
||||
return success(roleManager.createRole(createDTO));
|
||||
}
|
||||
|
||||
@PostMapping("updateRole")
|
||||
public CommonResult<Boolean> updateRole(@RequestBody RoleUpdateDTO updateDTO) {
|
||||
roleManager.updateRole(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("deleteRole")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("roleId")Integer roleId) {
|
||||
roleManager.deleteRole(roleId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getRole")
|
||||
public CommonResult<RoleVO> getRole(@RequestParam("roleId")Integer roleId) {
|
||||
return success(roleManager.getRole(roleId));
|
||||
}
|
||||
|
||||
@GetMapping("listAllRoles")
|
||||
public CommonResult<List<RoleVO>> listAllRoles() {
|
||||
return success(roleManager.listAllRoles());
|
||||
}
|
||||
|
||||
@GetMapping("listRoles")
|
||||
public CommonResult<List<RoleVO>> listRoles(@RequestParam("roleIds")Collection<Integer> roleIds) {
|
||||
return success(roleManager.listRoles(roleIds));
|
||||
}
|
||||
|
||||
@PostMapping("pageRole")
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(@RequestBody RolePageDTO pageDTO) {
|
||||
return success(roleManager.pageRole(pageDTO));
|
||||
}
|
||||
|
||||
@GetMapping("listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId") Integer adminId) {
|
||||
return success(roleManager.listAdminRoleIds(adminId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/accesslog")
|
||||
public class SystemAccessLogController {
|
||||
@Autowired
|
||||
private SystemAccessLogManager systemAccessLogManager;
|
||||
|
||||
@PostMapping("createSystemAccessLog")
|
||||
public CommonResult<Boolean> createSystemAccessLog(@RequestBody SystemAccessLogCreateDTO createDTO) {
|
||||
systemAccessLogManager.createSystemAccessLog(createDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("pageSystemAccessLog")
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(@RequestBody SystemAccessLogPageDTO pageDTO) {
|
||||
return success(systemAccessLogManager.pageSystemAccessLog(pageDTO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.manager.systemlog.SystemExceptionLogManager;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/exceptionlog")
|
||||
public class SystemExceptionLogController {
|
||||
@Autowired
|
||||
private SystemExceptionLogManager systemExceptionLogManager;
|
||||
|
||||
@PostMapping("createSystemExceptionLog")
|
||||
public CommonResult<Boolean> createSystemExceptionLog(@RequestBody SystemExceptionLogCreateDTO createDTO) {
|
||||
systemExceptionLogManager.createSystemExceptionLog(createDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getSystemExceptionLog")
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(@RequestParam("systemExceptionLogId") Integer systemExceptionLogId) {
|
||||
return success(systemExceptionLogManager.getSystemExceptionLog(systemExceptionLogId));
|
||||
}
|
||||
|
||||
@PostMapping("pageSystemExceptionLog")
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(@RequestBody SystemExceptionLogPageDTO pageDTO) {
|
||||
return success(systemExceptionLogManager.pageSystemExceptionLog(pageDTO));
|
||||
}
|
||||
|
||||
@PostMapping("processSystemExceptionLog")
|
||||
public CommonResult<Boolean> processSystemExceptionLog(@RequestBody SystemExceptionLogProcessDTO processDTO) {
|
||||
systemExceptionLogManager.processSystemExceptionLog(processDTO);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user