mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:权限模块新增分配详情功能
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.courseclassinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.MyQueryParam;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -93,8 +93,8 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*
|
||||
* @return 字典数据列表,返回形式为 List<Map<String, Object>>,map中包含两条记录,分别是id和name。
|
||||
*/
|
||||
@PostMapping("/areaCode/listDictAreaCode")
|
||||
ResponseResult<List<Map<String, Object>>> listDictAreaCode();
|
||||
@PostMapping("/areaCode/listDict")
|
||||
ResponseResult<List<Map<String, Object>>> listDict();
|
||||
|
||||
/**
|
||||
* 以id、name的形式返回所有字典数据的列表。
|
||||
@@ -102,50 +102,21 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
* @param parentId 主键的ParentId,用于对主键数据进行过滤。
|
||||
* @return 字典数据列表,返回形式为 List<Map<String, Object>>,map中包含两条记录,分别是id和name。
|
||||
*/
|
||||
@PostMapping("/areaCode/listDictAreaCodeByParentId")
|
||||
ResponseResult<List<Map<String, Object>>> listDictAreaCodeByParentId(@RequestParam("parentId") Long parentId);
|
||||
@GetMapping("/areaCode/listDictByParentId")
|
||||
ResponseResult<List<Map<String, Object>>> listDictByParentId(@RequestParam("parentId") Long parentId);
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
class AreaCodeClientFallbackFactory implements FallbackFactory<AreaCodeClient>, AreaCodeClient {
|
||||
class AreaCodeClientFallbackFactory
|
||||
extends BaseFallbackFactory<AreaCodeDto, Long, AreaCodeClient> implements AreaCodeClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<AreaCodeDto>> listByIds(Set<Long> areaCodeIds, Boolean withDict) {
|
||||
public ResponseResult<List<Map<String, Object>>> listDict() {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<AreaCodeDto> getById(Long areaId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> areaIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long areaId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<AreaCodeDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<AreaCodeDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listDictAreaCode() {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listDictAreaCodeByParentId(Long parentId) {
|
||||
public ResponseResult<List<Map<String, Object>>> listDictByParentId(Long parentId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.courseclassinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.CourseDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
@PostMapping("/course/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("courseId") Long courseId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param courseId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("courseId") Long courseId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody CourseDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
|
||||
@Component("CourseClassCourseClientFallbackFactory")
|
||||
@Slf4j
|
||||
class CourseClientFallbackFactory implements FallbackFactory<CourseClient>, CourseClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<CourseDto>> listByIds(
|
||||
Set<Long> courseIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<CourseDto> getById(
|
||||
Long courseId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> courseIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long courseId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<CourseDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<CourseDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class CourseClientFallbackFactory
|
||||
extends BaseFallbackFactory<CourseDto, Long, CourseClient> implements CourseClient {
|
||||
|
||||
@Override
|
||||
public CourseClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.courseclassinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
@PostMapping("/grade/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("gradeId") Integer gradeId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param gradeId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("gradeId") Integer gradeId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody GradeDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -93,39 +112,8 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
|
||||
@Component("CourseClassGradeClientFallbackFactory")
|
||||
@Slf4j
|
||||
class GradeClientFallbackFactory implements FallbackFactory<GradeClient>, GradeClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<GradeDto>> listByIds(
|
||||
Set<Integer> gradeIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<GradeDto> getById(
|
||||
Integer gradeId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Integer> gradeIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Integer gradeId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<GradeDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<GradeDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class GradeClientFallbackFactory
|
||||
extends BaseFallbackFactory<GradeDto, Integer, GradeClient> implements GradeClient {
|
||||
|
||||
@Override
|
||||
public GradeClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.courseclassinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.SchoolInfoDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
@PostMapping("/schoolInfo/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("schoolId") Long schoolId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param schoolId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("schoolId") Long schoolId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody SchoolInfoDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
|
||||
@Component("CourseClassSchoolInfoClientFallbackFactory")
|
||||
@Slf4j
|
||||
class SchoolInfoClientFallbackFactory implements FallbackFactory<SchoolInfoClient>, SchoolInfoClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<SchoolInfoDto>> listByIds(
|
||||
Set<Long> schoolIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<SchoolInfoDto> getById(
|
||||
Long schoolId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> schoolIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long schoolId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<SchoolInfoDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<SchoolInfoDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class SchoolInfoClientFallbackFactory
|
||||
extends BaseFallbackFactory<SchoolInfoDto, Long, SchoolInfoClient> implements SchoolInfoClient {
|
||||
|
||||
@Override
|
||||
public SchoolInfoClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.courseclassinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentClassDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
@PostMapping("/studentClass/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("classId") Long classId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param classId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("classId") Long classId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody StudentClassDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
|
||||
@Component("CourseClassStudentClassClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentClassClientFallbackFactory implements FallbackFactory<StudentClassClient>, StudentClassClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentClassDto>> listByIds(
|
||||
Set<Long> classIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentClassDto> getById(
|
||||
Long classId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> classIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long classId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentClassDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentClassDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class StudentClassClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentClassDto, Long, StudentClassClient> implements StudentClassClient {
|
||||
|
||||
@Override
|
||||
public StudentClassClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.courseclassinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
@PostMapping("/student/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("studentId") Long studentId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param studentId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("studentId") Long studentId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody StudentDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
|
||||
@Component("CourseClassStudentClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentClientFallbackFactory implements FallbackFactory<StudentClient>, StudentClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentDto>> listByIds(
|
||||
Set<Long> studentIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentDto> getById(
|
||||
Long studentId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> studentIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long studentId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class StudentClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentDto, Long, StudentClient> implements StudentClient {
|
||||
|
||||
@Override
|
||||
public StudentClient create(Throwable throwable) {
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:28.2-android" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-compat-qual:2.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
@@ -63,6 +64,7 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.19" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.22" level="project" />
|
||||
@@ -128,18 +130,6 @@
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.0.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-core:5.0.13" level="project" />
|
||||
<orderEntry type="module" module-name="common-minio" />
|
||||
<orderEntry type="library" name="Maven: io.minio:minio:7.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.simpleframework:simple-xml:2.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xpp3:xpp3:1.1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.spotbugs:spotbugs-annotations:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="module" module-name="common-sequence" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.2.1" level="project" />
|
||||
@@ -187,6 +177,7 @@
|
||||
<orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-cluster-client-default:1.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-sentinel-datasource:2.2.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.woodstox:woodstox-core:5.0.3" level="project" />
|
||||
|
||||
@@ -25,11 +25,6 @@
|
||||
<artifactId>common-redis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<artifactId>common-minio</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<artifactId>common-sequence</artifactId>
|
||||
|
||||
@@ -40,8 +40,8 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
*
|
||||
* @return 字典形式的行政区划列表。
|
||||
*/
|
||||
@GetMapping("/listDictAreaCode")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictAreaCode() {
|
||||
@GetMapping("/listDict")
|
||||
public ResponseResult<List<Map<String, Object>>> listDict() {
|
||||
List<AreaCode> resultList = areaCodeService.getAllList();
|
||||
return ResponseResult.success(BeanQuery.select(
|
||||
"parentId as parentId", "areaId as id", "areaName as name").executeFrom(resultList));
|
||||
@@ -53,8 +53,8 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @param parentId 上级行政区划Id。
|
||||
* @return 按照字典的形式返回下级行政区划列表。
|
||||
*/
|
||||
@GetMapping("/listDictAreaCodeByParentId")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictAreaCodeByParentId(@RequestParam(required = false) Long parentId) {
|
||||
@GetMapping("/listDictByParentId")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictByParentId(@RequestParam(required = false) Long parentId) {
|
||||
Collection<AreaCode> resultList = areaCodeService.getListByParentId(parentId);
|
||||
if (CollectionUtils.isEmpty(resultList)) {
|
||||
return ResponseResult.success(new LinkedList<>());
|
||||
|
||||
@@ -76,14 +76,14 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
public ResponseResult<Long> add(@MyRequestBody("course") CourseDto courseDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(courseDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Course course = Course.INSTANCE.toModel(courseDto);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = courseService.verifyRelatedData(course, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
course = courseService.saveNew(course);
|
||||
return ResponseResult.success(course.getCourseId());
|
||||
@@ -106,7 +106,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
public ResponseResult<Void> update(@MyRequestBody("course") CourseDto courseDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(courseDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Course course = Course.INSTANCE.toModel(courseDto);
|
||||
Course originalCourse = courseService.getById(course.getCourseId());
|
||||
@@ -119,7 +119,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
CallResult callResult = courseService.verifyRelatedData(course, originalCourse);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
if (!courseService.update(course, originalCourse)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
@@ -142,7 +142,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
// 验证关联Id的数据合法性
|
||||
Course originalCourse = courseService.getById(courseId);
|
||||
if (originalCourse == null) {
|
||||
//NOTE: 修改下面方括号中的话述
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
@@ -303,8 +303,8 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含字典形式的数据集合。
|
||||
*/
|
||||
@GetMapping("/listDictCourse")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictCourse(Course filter) {
|
||||
@GetMapping("/listDict")
|
||||
public ResponseResult<List<Map<String, Object>>> listDict(Course filter) {
|
||||
List<Course> resultList = courseService.getListByFilter(filter, null);
|
||||
return ResponseResult.success(
|
||||
BeanQuery.select("courseId as id", "courseName as name").executeFrom(resultList));
|
||||
@@ -362,6 +362,18 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
return super.baseExistId(courseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody CourseDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, Course.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -55,7 +54,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
public ResponseResult<Integer> add(@MyRequestBody("grade") GradeDto gradeDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Grade grade = MyModelUtil.copyTo(gradeDto, Grade.class);
|
||||
grade = gradeService.saveNew(grade);
|
||||
@@ -72,7 +71,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
public ResponseResult<Void> update(@MyRequestBody("grade") GradeDto gradeDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Grade grade = MyModelUtil.copyTo(gradeDto, Grade.class);
|
||||
Grade originalGrade = gradeService.getById(grade.getGradeId());
|
||||
@@ -127,8 +126,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
*
|
||||
* @return 应答结果对象,包含字典形式的数据集合。
|
||||
*/
|
||||
@GetMapping("/listDictGrade")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictGrade() {
|
||||
@GetMapping("/listDict")
|
||||
public ResponseResult<List<Map<String, Object>>> listDict() {
|
||||
List<Grade> resultList = gradeService.getAllList();
|
||||
return ResponseResult.success(BeanQuery.select(
|
||||
"gradeId as id", "gradeName as name").executeFrom(resultList));
|
||||
@@ -186,6 +185,18 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
return super.baseExistId(gradeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody GradeDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -54,14 +54,14 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
public ResponseResult<Long> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SchoolInfo schoolInfo = SchoolInfo.INSTANCE.toModel(schoolInfoDto);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
schoolInfo = schoolInfoService.saveNew(schoolInfo);
|
||||
return ResponseResult.success(schoolInfo.getSchoolId());
|
||||
@@ -77,7 +77,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
public ResponseResult<Void> update(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SchoolInfo schoolInfo = SchoolInfo.INSTANCE.toModel(schoolInfoDto);
|
||||
SchoolInfo originalSchoolInfo = schoolInfoService.getById(schoolInfo.getSchoolId());
|
||||
@@ -90,7 +90,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, originalSchoolInfo);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
if (!schoolInfoService.update(schoolInfo, originalSchoolInfo)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
@@ -113,7 +113,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
// 验证关联Id的数据合法性
|
||||
SchoolInfo originalSchoolInfo = schoolInfoService.getById(schoolId);
|
||||
if (originalSchoolInfo == null) {
|
||||
//NOTE: 修改下面方括号中的话述
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
@@ -181,8 +181,8 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含字典形式的数据集合。
|
||||
*/
|
||||
@GetMapping("/listDictSchoolInfo")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictSchoolInfo(SchoolInfo filter) {
|
||||
@GetMapping("/listDict")
|
||||
public ResponseResult<List<Map<String, Object>>> listDict(SchoolInfo filter) {
|
||||
List<SchoolInfo> resultList = schoolInfoService.getListByFilter(filter, null);
|
||||
return ResponseResult.success(
|
||||
BeanQuery.select("schoolId as id", "schoolName as name").executeFrom(resultList));
|
||||
@@ -240,6 +240,18 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
return super.baseExistId(schoolId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody SchoolInfoDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -58,14 +58,14 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
public ResponseResult<Long> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentClass studentClass = StudentClass.INSTANCE.toModel(studentClassDto);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = studentClassService.verifyRelatedData(studentClass, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
studentClass = studentClassService.saveNew(studentClass);
|
||||
return ResponseResult.success(studentClass.getClassId());
|
||||
@@ -81,7 +81,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
public ResponseResult<Void> update(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentClass studentClass = StudentClass.INSTANCE.toModel(studentClassDto);
|
||||
StudentClass originalStudentClass = studentClassService.getById(studentClass.getClassId());
|
||||
@@ -94,7 +94,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
CallResult callResult = studentClassService.verifyRelatedData(studentClass, originalStudentClass);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
if (!studentClassService.update(studentClass, originalStudentClass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
@@ -117,7 +117,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
// 验证关联Id的数据合法性
|
||||
StudentClass originalStudentClass = studentClassService.getById(classId);
|
||||
if (originalStudentClass == null) {
|
||||
//NOTE: 修改下面方括号中的话述
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
for (ClassCourseDto classCourse : classCourseDtoList) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(classCourse);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
}
|
||||
Set<Long> courseIdSet =
|
||||
@@ -284,7 +284,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
@MyRequestBody("classCourse") ClassCourseDto classCourseDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(classCourseDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
ClassCourse classCourse = MyModelUtil.copyTo(classCourseDto, ClassCourse.class);
|
||||
if (!studentClassService.updateClassCourse(classCourse)) {
|
||||
@@ -413,7 +413,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
for (ClassStudentDto classStudent : classStudentDtoList) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(classStudent);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
}
|
||||
Set<Long> studentIdSet =
|
||||
@@ -499,6 +499,18 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
return super.baseExistId(classId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentClassDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -60,14 +60,14 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
public ResponseResult<Long> add(@MyRequestBody("student") StudentDto studentDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Student student = Student.INSTANCE.toModel(studentDto);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = studentService.verifyRelatedData(student, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
student = studentService.saveNew(student);
|
||||
return ResponseResult.success(student.getStudentId());
|
||||
@@ -89,7 +89,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
public ResponseResult<Void> update(@MyRequestBody("student") StudentDto studentDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Student student = Student.INSTANCE.toModel(studentDto);
|
||||
Student originalStudent = studentService.getById(student.getStudentId());
|
||||
@@ -102,7 +102,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
CallResult callResult = studentService.verifyRelatedData(student, originalStudent);
|
||||
if (!callResult.isSuccess()) {
|
||||
errorMessage = callResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
if (!studentService.update(student, originalStudent)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
@@ -125,7 +125,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
// 验证关联Id的数据合法性
|
||||
Student originalStudent = studentService.getById(studentId);
|
||||
if (originalStudent == null) {
|
||||
//NOTE: 修改下面方括号中的话述
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
@@ -193,8 +193,8 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含字典形式的数据集合。
|
||||
*/
|
||||
@GetMapping("/listDictStudent")
|
||||
public ResponseResult<List<Map<String, Object>>> listDictStudent(Student filter) {
|
||||
@GetMapping("/listDict")
|
||||
public ResponseResult<List<Map<String, Object>>> listDict(Student filter) {
|
||||
List<Student> resultList = studentService.getListByFilter(filter, null);
|
||||
return ResponseResult.success(
|
||||
BeanQuery.select("studentId as id", "studentName as name").executeFrom(resultList));
|
||||
@@ -252,6 +252,18 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
return super.baseExistId(studentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, Student.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -87,7 +87,7 @@ public class Course {
|
||||
/**
|
||||
* 多张课程图片地址。
|
||||
*/
|
||||
@UploadFlagColumn(storeType = UploadStoreTypeEnum.MINIO_SYSTEM)
|
||||
@UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
|
||||
@NotBlank(message = "数据验证失败,课程图片不能为空!")
|
||||
@Column(name = "picture_url")
|
||||
private String pictureUrl;
|
||||
|
||||
@@ -92,7 +92,7 @@ public class CourseService extends BaseService<Course, CourseDto, Long> {
|
||||
return false;
|
||||
}
|
||||
// 这里可继续删除关联数据。
|
||||
// 开始删除多对多父表的关联
|
||||
// 开始删除与本地多对多父表的关联
|
||||
ClassCourse classCourse = new ClassCourse();
|
||||
classCourse.setCourseId(courseId);
|
||||
classCourseMapper.delete(classCourse);
|
||||
|
||||
@@ -102,7 +102,7 @@ public class StudentClassService extends BaseService<StudentClass, StudentClassD
|
||||
if (studentClassMapper.updateByExampleSelective(deletedObject, studentClassExample) == 0) {
|
||||
return false;
|
||||
}
|
||||
// 开始删除多对多子表的关联
|
||||
// 开始删除多对多中间表的关联
|
||||
ClassCourse classCourse = new ClassCourse();
|
||||
classCourse.setClassId(classId);
|
||||
classCourseMapper.delete(classCourse);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class StudentService extends BaseService<Student, StudentDto, Long> {
|
||||
return false;
|
||||
}
|
||||
// 这里可继续删除关联数据。
|
||||
// 开始删除多对多父表的关联
|
||||
// 开始删除与本地多对多父表的关联
|
||||
ClassStudent classStudent = new ClassStudent();
|
||||
classStudent.setStudentId(studentId);
|
||||
classStudentMapper.delete(classStudent);
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>application</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.statsinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.statsinterface.dto.CourseTransStatsDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
@PostMapping("/courseTransStats/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("statsId") Long statsId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param statsId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("statsId") Long statsId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
|
||||
@Component("StatsCourseTransStatsClientFallbackFactory")
|
||||
@Slf4j
|
||||
class CourseTransStatsClientFallbackFactory implements FallbackFactory<CourseTransStatsClient>, CourseTransStatsClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<CourseTransStatsDto>> listByIds(
|
||||
Set<Long> statsIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<CourseTransStatsDto> getById(
|
||||
Long statsId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> statsIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long statsId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<CourseTransStatsDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<CourseTransStatsDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class CourseTransStatsClientFallbackFactory
|
||||
extends BaseFallbackFactory<CourseTransStatsDto, Long, CourseTransStatsClient> implements CourseTransStatsClient {
|
||||
|
||||
@Override
|
||||
public CourseTransStatsClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.statsinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.statsinterface.dto.StudentActionStatsDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
@PostMapping("/studentActionStats/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("statsId") Long statsId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param statsId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("statsId") Long statsId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
|
||||
@Component("StatsStudentActionStatsClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentActionStatsClientFallbackFactory implements FallbackFactory<StudentActionStatsClient>, StudentActionStatsClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentActionStatsDto>> listByIds(
|
||||
Set<Long> statsIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentActionStatsDto> getById(
|
||||
Long statsId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> statsIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long statsId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentActionStatsDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentActionStatsDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class StudentActionStatsClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentActionStatsDto, Long, StudentActionStatsClient> implements StudentActionStatsClient {
|
||||
|
||||
@Override
|
||||
public StudentActionStatsClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.statsinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.statsinterface.dto.StudentActionTransDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
@PostMapping("/studentActionTrans/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("transId") Long transId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param transId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("transId") Long transId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
|
||||
@Component("StatsStudentActionTransClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentActionTransClientFallbackFactory implements FallbackFactory<StudentActionTransClient>, StudentActionTransClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentActionTransDto>> listByIds(
|
||||
Set<Long> transIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentActionTransDto> getById(
|
||||
Long transId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> transIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long transId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<StudentActionTransDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<StudentActionTransDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class StudentActionTransClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentActionTransDto, Long, StudentActionTransClient> implements StudentActionTransClient {
|
||||
|
||||
@Override
|
||||
public StudentActionTransClient create(Throwable throwable) {
|
||||
|
||||
@@ -81,7 +81,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<MyPageData<CourseTransStatsDto>> listWithGroup(
|
||||
@MyRequestBody("courseTransStatsFilter") CourseTransStatsDto courseTransStatsDtoFilter,
|
||||
@MyRequestBody MyGroupParam groupParam,
|
||||
@MyRequestBody(required = true) MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, CourseTransStats.class);
|
||||
@@ -173,6 +173,18 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
return super.baseExistId(statsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, CourseTransStats.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -81,7 +81,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<MyPageData<StudentActionStatsDto>> listWithGroup(
|
||||
@MyRequestBody("studentActionStatsFilter") StudentActionStatsDto studentActionStatsDtoFilter,
|
||||
@MyRequestBody MyGroupParam groupParam,
|
||||
@MyRequestBody(required = true) MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionStats.class);
|
||||
@@ -173,6 +173,18 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
return super.baseExistId(statsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, StudentActionStats.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -56,14 +56,14 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
public ResponseResult<Long> add(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentActionTrans studentActionTrans = StudentActionTrans.INSTANCE.toModel(studentActionTransDto);
|
||||
// 验证远程服务关联Id的数据合法性
|
||||
CallResult remoteCallResult = studentActionTransService.verifyRemoteRelatedData(studentActionTrans, null);
|
||||
if (!remoteCallResult.isSuccess()) {
|
||||
errorMessage = remoteCallResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
studentActionTrans = studentActionTransService.saveNew(studentActionTrans);
|
||||
return ResponseResult.success(studentActionTrans.getTransId());
|
||||
@@ -82,7 +82,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
public ResponseResult<Void> update(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentActionTrans studentActionTrans = StudentActionTrans.INSTANCE.toModel(studentActionTransDto);
|
||||
StudentActionTrans originalStudentActionTrans = studentActionTransService.getById(studentActionTrans.getTransId());
|
||||
@@ -95,7 +95,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
CallResult remoteCallResult = studentActionTransService.verifyRemoteRelatedData(studentActionTrans, originalStudentActionTrans);
|
||||
if (!remoteCallResult.isSuccess()) {
|
||||
errorMessage = remoteCallResult.getErrorMessage();
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
if (!studentActionTransService.update(studentActionTrans, originalStudentActionTrans)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
@@ -118,7 +118,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
// 验证关联Id的数据合法性
|
||||
StudentActionTrans originalStudentActionTrans = studentActionTransService.getById(transId);
|
||||
if (originalStudentActionTrans == null) {
|
||||
//NOTE: 修改下面方括号中的话述
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
@@ -231,6 +231,18 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
return super.baseExistId(transId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, StudentActionTrans.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.orange.demo.upmsinterface.client;
|
||||
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.upmsinterface.dto.SysUserDto;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -71,6 +70,26 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
@PostMapping("/sysUser/existId")
|
||||
ResponseResult<Boolean> existId(@RequestParam("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 删除主键Id关联的对象。
|
||||
*
|
||||
* @param userId 主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/delete")
|
||||
ResponseResult<Void> delete(@RequestParam("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 应答结果对象,包含删除数量。
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/deleteBy")
|
||||
ResponseResult<Integer> deleteBy(@RequestBody SysUserDto filter);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
*
|
||||
@@ -124,54 +143,8 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
|
||||
@Component("UpmsSysUserClientFallbackFactory")
|
||||
@Slf4j
|
||||
class SysUserClientFallbackFactory implements FallbackFactory<SysUserClient>, SysUserClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<SysUserDto>> listByIds(
|
||||
Set<Long> userIds, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<SysUserDto> getById(
|
||||
Long userId, Boolean withDict) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existIds(Set<Long> userIds) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Boolean> existId(Long userId) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<SysUserDto>> listBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<SysUserDto> getBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
|
||||
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
|
||||
}
|
||||
class SysUserClientFallbackFactory
|
||||
extends BaseFallbackFactory<SysUserDto, Long, SysUserClient> implements SysUserClient {
|
||||
|
||||
@Override
|
||||
public SysUserClient create(Throwable throwable) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
@@ -69,16 +70,16 @@ public class LoginController {
|
||||
@ApiImplicitParam(name = "loginName", defaultValue = "admin"),
|
||||
@ApiImplicitParam(name = "password", defaultValue = "IP3ccke3GhH45iGHB5qP9p7iZw6xUyj28Ju10rnBiPKOI35sc%2BjI7%2FdsjOkHWMfUwGYGfz8ik31HC2Ruk%2Fhkd9f6RPULTHj7VpFdNdde2P9M4mQQnFBAiPM7VT9iW3RyCtPlJexQ3nAiA09OqG%2F0sIf1kcyveSrulxembARDbDo%3D")
|
||||
})
|
||||
@GetMapping("/doLogin")
|
||||
@PostMapping("/doLogin")
|
||||
public ResponseResult<JSONObject> doLogin(
|
||||
@RequestParam String loginName, @RequestParam String password) throws Exception {
|
||||
@MyRequestBody String loginName, @MyRequestBody String password) throws Exception {
|
||||
if (MyCommonUtil.existBlankArgument(loginName, password)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
SysUser user = sysUserService.getSysUserByLoginName(loginName);
|
||||
password = URLDecoder.decode(password, StandardCharsets.UTF_8.name());
|
||||
//NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
||||
//执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
||||
// NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
||||
// 执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
||||
password = RsaUtil.decrypt(password, ApplicationConstant.PRIVATE_KEY);
|
||||
if (user == null || !passwordEncoder.matches(password, user.getPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.INVALID_USERNAME_PASSWORD);
|
||||
@@ -112,15 +113,15 @@ public class LoginController {
|
||||
*/
|
||||
@PostMapping("/changePassword")
|
||||
public ResponseResult<Void> changePassword(
|
||||
@RequestParam String oldPass, @RequestParam String newPass) throws Exception {
|
||||
@MyRequestBody String oldPass, @MyRequestBody String newPass) throws Exception {
|
||||
if (MyCommonUtil.existBlankArgument(oldPass, oldPass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
TokenData tokenData = TokenData.takeFromRequest();
|
||||
SysUser user = sysUserService.getById(tokenData.getUserId());
|
||||
oldPass = URLDecoder.decode(oldPass, StandardCharsets.UTF_8.name());
|
||||
//NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
||||
//执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
||||
// NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
||||
// 执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
||||
oldPass = RsaUtil.decrypt(oldPass, ApplicationConstant.PRIVATE_KEY);
|
||||
if (user == null || !passwordEncoder.matches(oldPass, user.getPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.INVALID_USERNAME_PASSWORD);
|
||||
|
||||
@@ -50,12 +50,12 @@ public class SysMenuController {
|
||||
@MyRequestBody("sysMenu") SysMenuDto sysMenuDto, @MyRequestBody String permCodeIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysMenuDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysMenu sysMenu = MyModelUtil.copyTo(sysMenuDto, SysMenu.class);
|
||||
CallResult result = sysMenuService.verifyRelatedData(sysMenu, null, permCodeIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> permCodeIdSet = null;
|
||||
if (result.getData() != null) {
|
||||
@@ -78,7 +78,7 @@ public class SysMenuController {
|
||||
@MyRequestBody("sysMenu") SysMenuDto sysMenuDto, @MyRequestBody String permCodeIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysMenuDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysMenu originalSysMenu = sysMenuService.getById(sysMenuDto.getMenuId());
|
||||
if (originalSysMenu == null) {
|
||||
@@ -88,7 +88,7 @@ public class SysMenuController {
|
||||
SysMenu sysMenu = MyModelUtil.copyTo(sysMenuDto, SysMenu.class);
|
||||
CallResult result = sysMenuService.verifyRelatedData(sysMenu, originalSysMenu, permCodeIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> permCodeIdSet = null;
|
||||
if (result.getData() != null) {
|
||||
@@ -155,13 +155,32 @@ public class SysMenuController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出与指定菜单关联的权限字和权限资源,便于管理员排查配置中的错误。
|
||||
* 查询菜单的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @return 与菜单关联的权限字和权限资源列表。
|
||||
* @param url 权限资源地址过滤条件。
|
||||
* @return 应答对象,包含从菜单到权限资源的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@GetMapping("/listMenuPerm")
|
||||
public ResponseResult<List<Map<String, Object>>> listMenuPerm(@RequestParam Long menuId) {
|
||||
return ResponseResult.success(sysPermCodeService.getPermCodeListByMenuId(menuId));
|
||||
@GetMapping("/listSysPermWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysPermWithDetail(Long menuId, String url) {
|
||||
if (MyCommonUtil.isBlankOrNull(menuId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysMenuService.getSysPermListWithDetail(menuId, url));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜单的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 应答对象,包含从菜单到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@GetMapping("/listSysUserWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysUserWithDetail(Long menuId, String loginName) {
|
||||
if (MyCommonUtil.isBlankOrNull(menuId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysMenuService.getSysUserListWithDetail(menuId, loginName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orange.demo.upmsservice.controller;
|
||||
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -8,7 +7,6 @@ import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.util.MyPageUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermCodeDto;
|
||||
@@ -50,12 +48,12 @@ public class SysPermCodeController {
|
||||
@MyRequestBody("sysPermCode") SysPermCodeDto sysPermCodeDto, @MyRequestBody String permIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermCodeDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED);
|
||||
}
|
||||
SysPermCode sysPermCode = MyModelUtil.copyTo(sysPermCodeDto, SysPermCode.class);
|
||||
CallResult result = sysPermCodeService.verifyRelatedData(sysPermCode, null, permIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> permIdSet = null;
|
||||
if (result.getData() != null) {
|
||||
@@ -78,7 +76,7 @@ public class SysPermCodeController {
|
||||
@MyRequestBody("sysPermCode") SysPermCodeDto sysPermCodeDto, @MyRequestBody String permIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermCodeDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysPermCode originalSysPermCode = sysPermCodeService.getById(sysPermCodeDto.getPermCodeId());
|
||||
if (originalSysPermCode == null) {
|
||||
@@ -88,7 +86,7 @@ public class SysPermCodeController {
|
||||
SysPermCode sysPermCode = MyModelUtil.copyTo(sysPermCodeDto, SysPermCode.class);
|
||||
CallResult result = sysPermCodeService.verifyRelatedData(sysPermCode, originalSysPermCode, permIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> permIdSet = null;
|
||||
if (result.getData() != null) {
|
||||
@@ -162,28 +160,32 @@ public class SysPermCodeController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看用户关联的权限字列表。
|
||||
* 查询权限字的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param loginName 精确匹配用户登录名。
|
||||
* @param permCode 模糊匹配的权限字名,LIKE %permCode%。
|
||||
* @param pageParam 分页对象。
|
||||
* @return 应答结果对象,包含该用户的全部权限资源列表。
|
||||
* @param permCodeId 权限字Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 应答对象。包含从权限字到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@PostMapping("/listAllPermCodesByUserFilter")
|
||||
public ResponseResult<MyPageData<SysPermCodeDto>> listAllPermCodesByUserFilter(
|
||||
@MyRequestBody String loginName,
|
||||
@MyRequestBody String permCode,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (MyCommonUtil.existBlankArgument(loginName)) {
|
||||
@GetMapping("/listSysUserWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysUserWithDetail(Long permCodeId, String loginName) {
|
||||
if (MyCommonUtil.isBlankOrNull(permCodeId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
return ResponseResult.success(sysPermCodeService.getSysUserListWithDetail(permCodeId, loginName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限字的角色列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permCodeId 权限字Id。
|
||||
* @param roleName 角色名。
|
||||
* @return 应答对象。包含从权限字到角色的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@GetMapping("/listSysRoleWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysRoleWithDetail(Long permCodeId, String roleName) {
|
||||
if (MyCommonUtil.isBlankOrNull(permCodeId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
List<SysPermCode> permCodeList =
|
||||
sysPermCodeService.getUserPermCodeListByFilter(loginName, permCode);
|
||||
MyPageData<SysPermCodeDto> pageData = MyPageUtil.makeResponseData(
|
||||
MyModelUtil.copyCollectionTo(permCodeList, SysPermCodeDto.class));
|
||||
return ResponseResult.success(pageData);
|
||||
return ResponseResult.success(sysPermCodeService.getSysRoleListWithDetail(permCodeId, roleName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ public class SysPermController {
|
||||
public ResponseResult<Long> add(@MyRequestBody("sysPerm") SysPermDto sysPermDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysPerm sysPerm = MyModelUtil.copyTo(sysPermDto, SysPerm.class);
|
||||
CallResult result = sysPermService.verifyRelatedData(sysPerm, null);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
sysPerm = sysPermService.saveNew(sysPerm);
|
||||
return ResponseResult.success(sysPerm.getPermId());
|
||||
@@ -71,7 +71,7 @@ public class SysPermController {
|
||||
public ResponseResult<Void> update(@MyRequestBody("sysPerm") SysPermDto sysPermDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysPerm originalPerm = sysPermService.getById(sysPermDto.getPermId());
|
||||
if (originalPerm == null) {
|
||||
@@ -81,7 +81,7 @@ public class SysPermController {
|
||||
SysPerm sysPerm = MyModelUtil.copyTo(sysPermDto, SysPerm.class);
|
||||
CallResult result = sysPermService.verifyRelatedData(sysPerm, originalPerm);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
if (result.getData() != null) {
|
||||
SysPermModule permModule = (SysPermModule) result.getData().get("permModule");
|
||||
@@ -152,58 +152,47 @@ public class SysPermController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看用户关联的权限资源列表。
|
||||
* 查询权限资源地址的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param loginName 精确匹配用户登录名。
|
||||
* @param moduleId 精确匹配权限模块Id。
|
||||
* @param url 模糊匹配的url过滤条件。
|
||||
* @param pageParam 分页对象。
|
||||
* @return 应答结果对象,包含该用户的全部权限资源列表。
|
||||
* @param permId 权限资源Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 应答对象。包含从权限资源到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@PostMapping("/listAllPermsByUserFilter")
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listAllPermsByUserFilter(
|
||||
@MyRequestBody String loginName,
|
||||
@MyRequestBody Long moduleId,
|
||||
@MyRequestBody String url,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (MyCommonUtil.existBlankArgument(loginName)) {
|
||||
@GetMapping("/listSysUserWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysUserWithDetail(Long permId, String loginName) {
|
||||
if (MyCommonUtil.isBlankOrNull(permId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
List<Map<String, Object>> userPermMapList =
|
||||
sysPermService.getUserPermListByFilter(loginName, moduleId, url);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(userPermMapList));
|
||||
return ResponseResult.success(sysPermService.getSysUserListWithDetail(permId, loginName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看拥有指定权限资源的所有用户数据列表。
|
||||
* 查询权限资源地址的角色列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 指定权限资源主键Id。
|
||||
* @return 应答结果对象,包含用户数据列表。
|
||||
* @param permId 权限资源Id。
|
||||
* @param roleName 角色名。
|
||||
* @return 应答对象。包含从权限资源到角色的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@PostMapping("/listAllUsers")
|
||||
public ResponseResult<List<Map<String, Object>>> listAllUsers(@MyRequestBody Long permId) {
|
||||
if (MyCommonUtil.existBlankArgument(permId)) {
|
||||
@GetMapping("/listSysRoleWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysRoleWithDetail(Long permId, String roleName) {
|
||||
if (MyCommonUtil.isBlankOrNull(permId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
List<Map<String, Object>> permUserMapList = sysPermService.getPermUserListById(permId);
|
||||
return ResponseResult.success(permUserMapList);
|
||||
return ResponseResult.success(sysPermService.getSysRoleListWithDetail(permId, roleName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看拥有指定权限资源的所有角色数据列表。
|
||||
* 查询权限资源地址的菜单列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 指定权限资源主键Id。
|
||||
* @return 应答结果对象,包含角色数据列表。
|
||||
* @param permId 权限资源Id。
|
||||
* @param menuName 菜单名。
|
||||
* @return 应答对象。包含从权限资源到菜单的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@PostMapping("/listAllRoles")
|
||||
public ResponseResult<List<Map<String, Object>>> listAllRoles(@MyRequestBody Long permId) {
|
||||
if (MyCommonUtil.existBlankArgument(permId)) {
|
||||
@GetMapping("/listSysMenuWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysMenuWithDetail(Long permId, String menuName) {
|
||||
if (MyCommonUtil.isBlankOrNull(permId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
List<Map<String, Object>> permRoleMapList = sysPermService.getPermRoleListById(permId);
|
||||
return ResponseResult.success(permRoleMapList);
|
||||
}
|
||||
return ResponseResult.success(sysPermService.getSysMenuListWithDetail(permId, menuName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class SysPermModuleController {
|
||||
public ResponseResult<Long> add(@MyRequestBody("sysPermModule") SysPermModuleDto sysPermModuleDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModuleDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysPermModule sysPermModule = MyModelUtil.copyTo(sysPermModuleDto, SysPermModule.class);
|
||||
if (sysPermModule.getParentId() != null
|
||||
@@ -71,7 +71,7 @@ public class SysPermModuleController {
|
||||
public ResponseResult<Void> update(@MyRequestBody("sysPermModule") SysPermModuleDto sysPermModuleDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModuleDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysPermModule sysPermModule = MyModelUtil.copyTo(sysPermModuleDto, SysPermModule.class);
|
||||
SysPermModule originalPermModule = sysPermModuleService.getById(sysPermModule.getModuleId());
|
||||
|
||||
@@ -58,12 +58,12 @@ public class SysRoleController {
|
||||
@MyRequestBody("sysRole") SysRoleDto sysRoleDto, @MyRequestBody String menuIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysRoleDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysRole sysRole = MyModelUtil.copyTo(sysRoleDto, SysRole.class);
|
||||
CallResult result = sysRoleService.verifyRelatedData(sysRole, null, menuIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> menuIdSet = null;
|
||||
if (result.getData() != null) {
|
||||
@@ -87,7 +87,7 @@ public class SysRoleController {
|
||||
@MyRequestBody("sysRole") SysRoleDto sysRoleDto, @MyRequestBody String menuIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysRoleDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysRole originalSysRole = sysRoleService.getById(sysRoleDto.getRoleId());
|
||||
if (originalSysRole == null) {
|
||||
@@ -97,7 +97,7 @@ public class SysRoleController {
|
||||
SysRole sysRole = MyModelUtil.copyTo(sysRoleDto, SysRole.class);
|
||||
CallResult result = sysRoleService.verifyRelatedData(sysRole, originalSysRole, menuIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> menuIdSet = null;
|
||||
if (result.getData() != null) {
|
||||
@@ -291,56 +291,34 @@ public class SysRoleController {
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过权限字Id获取拥有改权限的所有角色。
|
||||
* 开发人员调试用接口。
|
||||
* 查询角色的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permCodeId 查询的权限字Id。
|
||||
* @param pageParam 分页对象。
|
||||
* @return 符合条件的角色列表。
|
||||
* @param roleId 角色Id。
|
||||
* @param url url过滤条件。
|
||||
* @return 应答对象,包含从角色到权限资源的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@PostMapping("/listAllRolesByPermCode")
|
||||
public ResponseResult<MyPageData<SysRoleDto>> listAllRolesByPermCode(
|
||||
@MyRequestBody Long permCodeId, @MyRequestBody MyPageParam pageParam) {
|
||||
if (MyCommonUtil.existBlankArgument(permCodeId)) {
|
||||
@GetMapping("/listSysPermWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysPermWithDetail(Long roleId, String url) {
|
||||
if (MyCommonUtil.isBlankOrNull(roleId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
List<SysRole> roleList = sysRoleService.getSysRoleListByPermCodeId(permCodeId);
|
||||
List<SysRoleDto> roleDtoList = MyModelUtil.copyCollectionTo(roleList, SysRoleDto.class);
|
||||
long totalCount = 0L;
|
||||
if (roleList instanceof Page) {
|
||||
totalCount = ((Page<SysRole>) roleList).getTotal();
|
||||
}
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(roleDtoList, totalCount));
|
||||
return ResponseResult.success(sysRoleService.getSysPermListWithDetail(roleId, url));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过权限资源url,模糊搜索拥有改权限的所有角色。
|
||||
* 开发人员调试用接口。
|
||||
* 查询角色的权限字列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param url 用于模糊搜索的url。
|
||||
* @param pageParam 分页对象。
|
||||
* @return 符合条件的角色列表。
|
||||
* @param roleId 角色Id。
|
||||
* @param permCode 权限字名称过滤条件。
|
||||
* @return 应答对象,包含从角色到权限字的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@PostMapping("/listAllRolesByPerm")
|
||||
public ResponseResult<MyPageData<SysRoleDto>> listAllRolesByPerm(
|
||||
@MyRequestBody String url, @MyRequestBody MyPageParam pageParam) {
|
||||
if (MyCommonUtil.existBlankArgument(url)) {
|
||||
@GetMapping("/listSysPermCodeWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysPermCodeWithDetail(Long roleId, String permCode) {
|
||||
if (MyCommonUtil.isBlankOrNull(roleId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
List<SysRole> roleList = sysRoleService.getSysRoleListByPerm(url);
|
||||
List<SysRoleDto> roleDtoList = MyModelUtil.copyCollectionTo(roleList, SysRoleDto.class);
|
||||
long totalCount = 0L;
|
||||
if (roleList instanceof Page) {
|
||||
totalCount = ((Page<SysRole>) roleList).getTotal();
|
||||
}
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(roleDtoList, totalCount));
|
||||
return ResponseResult.success(sysRoleService.getSysPermCodeListWithDetail(roleId, permCode));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,12 +63,12 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
@MyRequestBody("sysUser") SysUserDto sysUserDto, @MyRequestBody String roleIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, Default.class, AddGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysUser sysUser = SysUser.INSTANCE.toModel(sysUserDto);
|
||||
CallResult result = sysUserService.verifyRelatedData(sysUser, null, roleIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> roleIdSet = (Set<Long>) result.getData().get("roleIdSet");
|
||||
sysUserService.saveNew(sysUser, roleIdSet);
|
||||
@@ -91,7 +91,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
@MyRequestBody("sysUser") SysUserDto sysUserDto, @MyRequestBody String roleIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysUser originalUser = sysUserService.getById(sysUserDto.getUserId());
|
||||
if (originalUser == null) {
|
||||
@@ -100,7 +100,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
SysUser sysUser = SysUser.INSTANCE.toModel(sysUserDto);
|
||||
CallResult result = sysUserService.verifyRelatedData(sysUser, originalUser, roleIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
Set<Long> roleIdSet = (Set<Long>) result.getData().get("roleIdSet");
|
||||
if (!sysUserService.update(sysUser, originalUser, roleIdSet)) {
|
||||
@@ -141,7 +141,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
// 验证关联Id的数据合法性
|
||||
SysUser originalSysUser = sysUserService.getById(userId);
|
||||
if (originalSysUser == null) {
|
||||
//NOTE: 修改下面方括号中的话述
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
@@ -203,6 +203,51 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
return ResponseResult.success(sysUserDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param url url过滤条件。
|
||||
* @return 应答对象,包含从用户到权限资源的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@GetMapping("/listSysPermWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysPermWithDetail(Long userId, String url) {
|
||||
if (MyCommonUtil.isBlankOrNull(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysUserService.getSysPermListWithDetail(userId, url));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的权限字列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param permCode 权限字名称过滤条件。
|
||||
* @return 应答对象,包含从用户到权限字的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@GetMapping("/listSysPermCodeWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysPermCodeWithDetail(Long userId, String permCode) {
|
||||
if (MyCommonUtil.isBlankOrNull(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysUserService.getSysPermCodeListWithDetail(userId, permCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的菜单列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param menuName 菜单名称过滤条件。
|
||||
* @return 应答对象,包含从用户到菜单的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
@GetMapping("/listSysMenuWithDetail")
|
||||
public ResponseResult<List<Map<String, Object>>> listSysMenuWithDetail(Long userId, String menuName) {
|
||||
if (MyCommonUtil.isBlankOrNull(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysUserService.getSysMenuListWithDetail(userId, menuName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键Id集合,获取数据对象集合。仅限于微服务间远程接口调用。
|
||||
*
|
||||
@@ -255,6 +300,18 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
return super.baseExistId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除符合过滤条件的数据。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody SysUserDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, SysUser.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
|
||||
@@ -2,8 +2,9 @@ package com.orange.demo.upmsservice.dao;
|
||||
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.upmsservice.model.SysMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 菜单数据访问操作接口。
|
||||
@@ -19,5 +20,25 @@ public interface SysMenuMapper extends BaseDaoMapper<SysMenu> {
|
||||
* @param userId 登录用户。
|
||||
* @return 菜单列表。
|
||||
*/
|
||||
List<SysMenu> getMenuListByUserId(Long userId);
|
||||
List<SysMenu> getMenuListByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 查询菜单的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @param url 权限资源地址过滤条件。
|
||||
* @return 包含从菜单到权限资源的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getSysPermListWithDetail(
|
||||
@Param("menuId") Long menuId, @Param("url") String url);
|
||||
|
||||
/**
|
||||
* 查询菜单的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 包含从菜单到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getSysUserListWithDetail(
|
||||
@Param("menuId") Long menuId, @Param("loginName") String loginName);
|
||||
}
|
||||
|
||||
@@ -21,23 +21,25 @@ public interface SysPermCodeMapper extends BaseDaoMapper<SysPermCode> {
|
||||
* @param userId 用户Id。
|
||||
* @return 该用户的权限字列表。
|
||||
*/
|
||||
List<String> getPermCodeListByUserId(Long userId);
|
||||
List<String> getPermCodeListByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 获取该菜单的权限字和关联的权限资源列表。
|
||||
* 查询权限字的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @return 权限字和关联的权限资源列表。
|
||||
* @param permCodeId 权限字Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 包含从权限字到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getPermCodeListByMenuId(Long menuId);
|
||||
List<Map<String, Object>> getSysUserListWithDetail(
|
||||
@Param("permCodeId") Long permCodeId, @Param("loginName") String loginName);
|
||||
|
||||
/**
|
||||
* 获取指定用户的权限字列表。
|
||||
* 查询权限字的角色列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param loginName 精确匹配用户登录名。
|
||||
* @param permCode 模糊匹配的权限字名,LIKE %permCode%。
|
||||
* @return 权限字列表。
|
||||
* @param permCodeId 权限字Id。
|
||||
* @param roleName 角色名。
|
||||
* @return 包含从权限字到角色的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<SysPermCode> getUserPermCodeListByFilter(
|
||||
@Param("loginName") String loginName, @Param("permCode") String permCode);
|
||||
List<Map<String, Object>> getSysRoleListWithDetail(
|
||||
@Param("permCodeId") Long permCodeId, @Param("roleName") String roleName);
|
||||
}
|
||||
|
||||
@@ -23,17 +23,6 @@ public interface SysPermMapper extends BaseDaoMapper<SysPerm> {
|
||||
*/
|
||||
List<SysPerm> getPermListByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 获取指定用户Id的权限列表。
|
||||
*
|
||||
* @param loginName 精确匹配用户登录名。
|
||||
* @param moduleId 精确匹配权限模块Id。
|
||||
* @param url 权限的url过滤条件,LIKE %url%。
|
||||
* @return 权限列表。
|
||||
*/
|
||||
List<Map<String, Object>> getUserPermListByFilter(
|
||||
@Param("loginName") String loginName, @Param("moduleId") Long moduleId, @Param("url") String url);
|
||||
|
||||
/**
|
||||
* 根据关联权限字主键Id,获取权限资源数据列表。
|
||||
*
|
||||
@@ -44,18 +33,32 @@ public interface SysPermMapper extends BaseDaoMapper<SysPerm> {
|
||||
List<SysPerm> getPermListByPermCodeId(@Param("permCodeId") Long permCodeId, @Param("orderBy") String orderBy);
|
||||
|
||||
/**
|
||||
* 获取指定权限的用户列表。
|
||||
* 查询权限资源地址的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 指定权限。
|
||||
* @return 用户列表。
|
||||
* @param permId 权限资源Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 包含从权限资源到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getPermUserListById(@Param("permId") Long permId);
|
||||
List<Map<String, Object>> getSysUserListWithDetail(
|
||||
@Param("permId") Long permId, @Param("loginName") String loginName);
|
||||
|
||||
/**
|
||||
* 获取指定权限的角色列表。
|
||||
* 查询权限资源地址的角色列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 指定权限。
|
||||
* @return 角色列表。
|
||||
* @param permId 权限资源Id。
|
||||
* @param roleName 角色名。
|
||||
* @return 包含从权限资源到角色的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getPermRoleListById(@Param("permId") Long permId);
|
||||
List<Map<String, Object>> getSysRoleListWithDetail(
|
||||
@Param("permId") Long permId, @Param("roleName") String roleName);
|
||||
|
||||
/**
|
||||
* 查询权限资源地址的菜单列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 权限资源Id。
|
||||
* @param menuName 菜单名。
|
||||
* @return 包含从权限资源到菜单的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getSysMenuListWithDetail(
|
||||
@Param("permId") Long permId, @Param("menuName") String menuName);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.upmsservice.model.SysRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 角色数据访问操作接口。
|
||||
@@ -24,18 +24,22 @@ public interface SysRoleMapper extends BaseDaoMapper<SysRole> {
|
||||
List<SysRole> getSysRoleList(@Param("sysRoleFilter") SysRole sysRoleFilter, @Param("orderBy") String orderBy);
|
||||
|
||||
/**
|
||||
* 根据权限字Id获取关联的角色列表。
|
||||
* 查询角色的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permCodeId 权限字Id。
|
||||
* @return 关联的角色列表。
|
||||
* @param roleId 角色Id。
|
||||
* @param url url过滤条件。
|
||||
* @return 包含从角色到权限资源的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<SysRole> getSysRoleListByPermCodeId(@Param("permCodeId") Long permCodeId);
|
||||
List<Map<String, Object>> getSysPermListWithDetail(
|
||||
@Param("roleId") Long roleId, @Param("url") String url);
|
||||
|
||||
/**
|
||||
* 根据url模糊查询关联的角色列表。
|
||||
* 查询角色的权限字列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param url url片段。
|
||||
* @return 关联的角色列表。
|
||||
* @param roleId 角色Id。
|
||||
* @param permCode 权限字名称过滤条件。
|
||||
* @return 包含从角色到权限字的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<SysRole> getSysRoleListByPerm(@Param("url") String url);
|
||||
List<Map<String, Object>> getSysPermCodeListWithDetail(
|
||||
@Param("roleId") Long roleId, @Param("permCode") String permCode);
|
||||
}
|
||||
|
||||
@@ -67,4 +67,34 @@ public interface SysUserMapper extends BaseDaoMapper<SysUser> {
|
||||
@Param("roleId") Long roleId,
|
||||
@Param("sysUserFilter") SysUser sysUserFilter,
|
||||
@Param("orderBy") String orderBy);
|
||||
|
||||
/**
|
||||
* 查询用户的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param url url过滤条件。
|
||||
* @return 包含从用户到权限资源的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getSysPermListWithDetail(
|
||||
@Param("userId") Long userId, @Param("url") String url);
|
||||
|
||||
/**
|
||||
* 查询用户的权限字列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param permCode 权限字名称过滤条件。
|
||||
* @return 包含从用户到权限字的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getSysPermCodeListWithDetail(
|
||||
@Param("userId") Long userId, @Param("permCode") String permCode);
|
||||
|
||||
/**
|
||||
* 查询用户的菜单列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param menuName 菜单名称过滤条件。
|
||||
* @return 包含从用户到菜单的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
List<Map<String, Object>> getSysMenuListWithDetail(
|
||||
@Param("userId") Long userId, @Param("menuName") String menuName);
|
||||
}
|
||||
|
||||
@@ -32,4 +32,57 @@
|
||||
</where>
|
||||
ORDER BY m.show_order
|
||||
</select>
|
||||
|
||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||
<select id="getSysPermListWithDetail" resultType="map">
|
||||
SELECT
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.show_name showName,
|
||||
pc.perm_code_type permCodeType,
|
||||
pc.perm_code permCode,
|
||||
p.perm_id permId,
|
||||
p.perm_name permName,
|
||||
p.url
|
||||
FROM
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_perm p
|
||||
<where>
|
||||
AND mpc.menu_id = #{menuId}
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
AND mpc.perm_code_id = pcp.perm_code_id
|
||||
AND pcp.perm_id = p.perm_id
|
||||
<if test="url != null and url != ''">
|
||||
AND p.url = #{url}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
pc.perm_code_id, p.url
|
||||
</select>
|
||||
|
||||
<select id="getSysUserListWithDetail" resultType="map">
|
||||
SELECT
|
||||
u.user_id userId,
|
||||
u.login_name loginName,
|
||||
u.show_name showName,
|
||||
r.role_id roleId,
|
||||
r.role_name roleName
|
||||
FROM
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_role r,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_user u
|
||||
<where>
|
||||
AND rm.menu_id = #{menuId}
|
||||
AND rm.role_id = r.role_id
|
||||
AND rm.role_id = ur.role_id
|
||||
AND ur.user_id = u.user_id
|
||||
<if test="loginName != null and loginName != ''">
|
||||
AND u.login_name = #{loginName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
u.user_id, r.role_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -32,53 +32,61 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getUserPermCodeListByFilter" resultMap="BaseResultMap">
|
||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||
<select id="getSysUserListWithDetail" resultType="map">
|
||||
SELECT
|
||||
DISTINCT pc.*
|
||||
u.user_id userId,
|
||||
u.login_name loginName,
|
||||
u.show_name showName,
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType
|
||||
FROM
|
||||
zz_sys_user u,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code pc
|
||||
zz_sys_menu m,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_role r,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_user u
|
||||
<where>
|
||||
AND u.login_name = #{loginName}
|
||||
AND u.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND u.user_id = ur.user_id
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
AND pc.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
<if test="permCode != null and permCode != ''">
|
||||
<bind name= "safePermCode" value= "'%' + permCode + '%'" />
|
||||
AND pc.perm_code LIKE #{safePermCode}
|
||||
AND mpc.perm_code_id = #{permCodeId}
|
||||
AND mpc.menu_id = m.menu_id
|
||||
AND mpc.menu_id = rm.menu_id
|
||||
AND rm.role_id = r.role_id
|
||||
AND rm.role_id = ur.role_id
|
||||
AND ur.user_id = u.user_id
|
||||
<if test="loginName != null and loginName != ''">
|
||||
AND u.login_name = #{loginName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY pc.create_time
|
||||
ORDER BY
|
||||
u.user_id, r.role_id, m.menu_id
|
||||
</select>
|
||||
|
||||
<select id="getPermCodeListByMenuId" resultType="map">
|
||||
<select id="getSysRoleListWithDetail" resultType="map">
|
||||
SELECT
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.show_name showName,
|
||||
pc.perm_code_type permCodeType,
|
||||
pc.perm_code permCode,
|
||||
p.perm_id permId,
|
||||
p.perm_name permName,
|
||||
p.url
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType
|
||||
FROM
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_perm p
|
||||
zz_sys_menu m,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_role r
|
||||
<where>
|
||||
AND mpc.menu_id = #{menuId}
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
AND mpc.perm_code_id = pcp.perm_code_id
|
||||
AND pcp.perm_id = p.perm_id
|
||||
AND pc.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND mpc.perm_code_id = #{permCodeId}
|
||||
AND mpc.menu_id = m.menu_id
|
||||
AND mpc.menu_id = rm.menu_id
|
||||
AND rm.role_id = r.role_id
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name = #{roleName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY pc.perm_code_id, p.show_order
|
||||
ORDER BY
|
||||
r.role_id, m.menu_id
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -33,44 +33,6 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getUserPermListByFilter" resultType="map">
|
||||
SELECT
|
||||
pm.module_id moduleId,
|
||||
pm.module_name moduleName,
|
||||
p.perm_id permId,
|
||||
p.perm_name permName,
|
||||
p.create_time createTime,
|
||||
p.url
|
||||
FROM
|
||||
zz_sys_user u,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm p,
|
||||
zz_sys_perm_module pm
|
||||
<where>
|
||||
AND u.login_name = #{loginName}
|
||||
AND u.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND u.user_id = ur.user_id
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pcp.perm_code_id
|
||||
AND pcp.perm_id = p.perm_id
|
||||
AND p.module_id = pm.module_id
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND pm.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
<if test="url != null and url != ''">
|
||||
<bind name= "safeUrl" value= "'%' + url + '%'" />
|
||||
AND p.url LIKE #{safeUrl}
|
||||
</if>
|
||||
<if test="moduleId != null">
|
||||
AND p.module_id = #{moduleId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY pm.module_id, p.create_time
|
||||
</select>
|
||||
|
||||
<select id="getPermListByPermCodeId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
p.*
|
||||
@@ -87,48 +49,101 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPermUserListById" resultType="map">
|
||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||
<select id="getSysUserListWithDetail" resultType="map">
|
||||
SELECT
|
||||
u.user_id,
|
||||
u.login_name
|
||||
u.show_name
|
||||
u.user_id userId,
|
||||
u.login_name loginName,
|
||||
u.show_name showName,
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType
|
||||
FROM
|
||||
zz_sys_perm p,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_menu m,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_role r,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_user u
|
||||
<where>
|
||||
AND p.perm_id = #{permId}
|
||||
AND p.perm_id = pcp.perm_id
|
||||
AND pcp.perm_id = #{permId}
|
||||
AND pcp.perm_code_id = pc.perm_code_id
|
||||
AND pcp.perm_code_id = mpc.perm_code_id
|
||||
AND mpc.menu_id = m.menu_id
|
||||
AND mpc.menu_id = rm.menu_id
|
||||
AND rm.role_id = r.role_id
|
||||
AND rm.role_id = ur.role_id
|
||||
AND ur.user_id = u.user_id
|
||||
AND u.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
<if test="loginName != null and loginName != ''">
|
||||
AND u.login_name = #{loginName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
u.user_id, r.role_id, m.menu_id, pc.perm_code_id
|
||||
</select>
|
||||
|
||||
<select id="getPermRoleListById" resultType="map">
|
||||
<select id="getSysRoleListWithDetail" resultType="map">
|
||||
SELECT
|
||||
r.role_id,
|
||||
r.role_name
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType
|
||||
FROM
|
||||
zz_sys_perm p,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_menu m,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_role r
|
||||
<where>
|
||||
AND p.perm_id = #{permId}
|
||||
AND p.perm_id = pcp.perm_id
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND r.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND pcp.perm_id = #{permId}
|
||||
AND pcp.perm_code_id = pc.perm_code_id
|
||||
AND pcp.perm_code_id = mpc.perm_code_id
|
||||
AND mpc.menu_id = m.menu_id
|
||||
AND mpc.menu_id = rm.menu_id
|
||||
AND rm.role_id = r.role_id
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name = #{roleName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
r.role_id, m.menu_id, pc.perm_code_id
|
||||
</select>
|
||||
|
||||
<select id="getSysMenuListWithDetail" resultType="map">
|
||||
SELECT
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType
|
||||
FROM
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_menu m
|
||||
<where>
|
||||
AND pcp.perm_id = #{permId}
|
||||
AND pcp.perm_code_id = pc.perm_code_id
|
||||
AND pcp.perm_code_id = mpc.perm_code_id
|
||||
AND mpc.menu_id = m.menu_id
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND m.menu_name = #{menuName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
m.menu_id, pc.perm_code_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -26,42 +26,62 @@
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getSysRoleListByPermCodeId" resultMap="BaseResultMap">
|
||||
|
||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||
<select id="getSysPermListWithDetail" resultType="map">
|
||||
SELECT
|
||||
DISTINCT r.*
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType,
|
||||
p.url
|
||||
FROM
|
||||
my_sys_role r,
|
||||
my_sys_role_menu rm,
|
||||
my_sys_menu_perm_code mpc
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu m,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm p
|
||||
<where>
|
||||
mpc.perm_code_id = #{permCodeId}
|
||||
AND mpc.menu_id = rm.menu_id
|
||||
AND rm.role_id = r.role_id
|
||||
AND r.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND rm.role_id = #{roleId}
|
||||
AND rm.menu_id = m.menu_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
AND mpc.perm_code_id = pcp.perm_code_id
|
||||
AND pcp.perm_id = p.perm_id
|
||||
<if test="url != null and url != ''">
|
||||
AND p.url = #{url}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY r.create_time
|
||||
ORDER BY
|
||||
m.menu_id, pc.perm_code_id, p.url
|
||||
</select>
|
||||
|
||||
<select id="getSysRoleListByPerm" resultMap="BaseResultMap">
|
||||
<select id="getSysPermCodeListWithDetail" resultType="map">
|
||||
SELECT
|
||||
DISTINCT r.*
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType
|
||||
FROM
|
||||
my_sys_role r,
|
||||
my_sys_role_menu rm,
|
||||
my_sys_menu_perm_code mpc,
|
||||
my_sys_perm_code_perm pcp,
|
||||
my_sys_perm p
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu m,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code pc
|
||||
<where>
|
||||
<bind name= "safeUrl" value= "'%' + url + '%'"/>
|
||||
p.url LIKE #{safeUrl}
|
||||
AND p.perm_id = pcp.perm_id
|
||||
AND pcp.perm_code_id = mpc.perm_code_id
|
||||
AND mpc.menu_id = rm.menu_id
|
||||
AND rm.role_id = r.role_id
|
||||
AND r.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND rm.role_id = #{roleId}
|
||||
AND rm.menu_id = m.menu_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
<if test="permCode != null and permCode != ''">
|
||||
AND pc.perm_code = #{permCode}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY r.create_time
|
||||
ORDER BY
|
||||
m.menu_id, pc.perm_code_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -95,4 +95,99 @@
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||
<select id="getSysPermListWithDetail" resultType="map">
|
||||
SELECT
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType,
|
||||
p.url
|
||||
FROM
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role r,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu m,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code pc,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm p
|
||||
<where>
|
||||
AND ur.user_id = #{userId}
|
||||
AND ur.role_id = r.role_id
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = m.menu_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
AND mpc.perm_code_id = pcp.perm_code_id
|
||||
AND pcp.perm_id = p.perm_id
|
||||
<if test="url != null and url != ''">
|
||||
AND p.url = #{url}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
r.role_id, m.menu_id, pc.perm_code_id, p.url
|
||||
</select>
|
||||
|
||||
<select id="getSysPermCodeListWithDetail" resultType="map">
|
||||
SELECT
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType,
|
||||
pc.perm_code_id permCodeId,
|
||||
pc.perm_code permCode,
|
||||
pc.perm_code_type permCodeType
|
||||
FROM
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role r,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu m,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code pc
|
||||
<where>
|
||||
AND ur.user_id = #{userId}
|
||||
AND ur.role_id = r.role_id
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = m.menu_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
<if test="permCode != null and permCode != ''">
|
||||
AND pc.perm_code = #{permCode}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
r.role_id, m.menu_id, pc.perm_code_id
|
||||
</select>
|
||||
|
||||
<select id="getSysMenuListWithDetail" resultType="map">
|
||||
SELECT
|
||||
r.role_id roleId,
|
||||
r.role_name roleName,
|
||||
m.menu_id menuId,
|
||||
m.menu_name menuName,
|
||||
m.menu_type menuType
|
||||
FROM
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role r,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu m
|
||||
<where>
|
||||
AND ur.user_id = #{userId}
|
||||
AND ur.role_id = r.role_id
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = m.menu_id
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND m.menu_name = #{menuName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
r.role_id, m.menu_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -205,6 +205,28 @@ public class SysMenuService extends BaseService<SysMenu, SysMenuDto, Long> {
|
||||
return CallResult.ok(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜单的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @param url 权限资源地址过滤条件。
|
||||
* @return 包含从菜单到权限资源的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysPermListWithDetail(Long menuId, String url) {
|
||||
return sysMenuMapper.getSysPermListWithDetail(menuId, url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜单的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 包含从菜单到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysUserListWithDetail(Long menuId, String loginName) {
|
||||
return sysMenuMapper.getSysUserListWithDetail(menuId, loginName);
|
||||
}
|
||||
|
||||
private String checkErrorOfNonDirectoryMenu(SysMenu sysMenu) {
|
||||
// 判断父节点是否存在
|
||||
SysMenu parentSysMenu = getById(sysMenu.getParentId());
|
||||
|
||||
@@ -61,16 +61,6 @@ public class SysPermCodeService extends BaseService<SysPermCode, SysPermCodeDto,
|
||||
return sysPermCodeMapper.getPermCodeListByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取该菜单的权限字,及其权限字关联的权限资源列表。
|
||||
*
|
||||
* @param menuId 菜单Id。
|
||||
* @return 关联了权限资源的权限字列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getPermCodeListByMenuId(Long menuId) {
|
||||
return sysPermCodeMapper.getPermCodeListByMenuId(menuId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新增的权限字对象。
|
||||
*
|
||||
@@ -152,17 +142,6 @@ public class SysPermCodeService extends BaseService<SysPermCode, SysPermCodeDto,
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定用户的权限字列表。
|
||||
*
|
||||
* @param loginName 精确匹配用户登录名。
|
||||
* @param permCode 模糊匹配的权限字名,LIKE %permCode%。
|
||||
* @return 权限字列表。
|
||||
*/
|
||||
public List<SysPermCode> getUserPermCodeListByFilter(String loginName, String permCode) {
|
||||
return sysPermCodeMapper.getUserPermCodeListByFilter(loginName, permCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前权限字是否存在下级权限字对象。
|
||||
*
|
||||
@@ -202,4 +181,26 @@ public class SysPermCodeService extends BaseService<SysPermCode, SysPermCodeDto,
|
||||
}
|
||||
return CallResult.ok(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限字的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permCodeId 权限字Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 包含从权限字到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysUserListWithDetail(Long permCodeId, String loginName) {
|
||||
return sysPermCodeMapper.getSysUserListWithDetail(permCodeId, loginName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限字的角色列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permCodeId 权限字Id。
|
||||
* @param roleName 角色名。
|
||||
* @return 包含从权限字到角色的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysRoleListWithDetail(Long permCodeId, String roleName) {
|
||||
return sysPermCodeMapper.getSysRoleListWithDetail(permCodeId, roleName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,9 +94,9 @@ public class SysPermService extends BaseService<SysPerm, SysPermDto, Long> {
|
||||
if (sysPermMapper.updateByPrimaryKeySelective(perm) != 1) {
|
||||
return false;
|
||||
}
|
||||
Example e = new Example(SysPermCodePerm.class);
|
||||
e.createCriteria().andEqualTo("permId", permId);
|
||||
sysPermCodePermMapper.deleteByExample(e);
|
||||
SysPermCodePerm permCodePerm = new SysPermCodePerm();
|
||||
permCodePerm.setPermId(permId);
|
||||
sysPermCodePermMapper.delete(permCodePerm);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -144,38 +144,6 @@ public class SysPermService extends BaseService<SysPerm, SysPermDto, Long> {
|
||||
return sysPermMapper.getPermListByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定用户的用户权限关联列表。
|
||||
*
|
||||
* @param loginName 精确匹配用户登录名。
|
||||
* @param moduleId 精确匹配权限模块Id。
|
||||
* @param url 模糊匹配的url过滤条件。
|
||||
* @return 用户权限关联列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getUserPermListByFilter(String loginName, Long moduleId, String url) {
|
||||
return sysPermMapper.getUserPermListByFilter(loginName, moduleId, url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定权限资源的权限用户关联数据列表。
|
||||
*
|
||||
* @param permId 权限资源主键Id。
|
||||
* @return 用户和权限资源关联列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getPermUserListById(Long permId) {
|
||||
return sysPermMapper.getPermUserListById(permId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定权限资源的权限角色关联数据列表。
|
||||
*
|
||||
* @param permId 权限资源主键Id。
|
||||
* @return 角色和权限资源关联列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getPermRoleListById(Long permId) {
|
||||
return sysPermMapper.getPermRoleListById(permId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证权限资源对象关联的数据是否都合法。
|
||||
*
|
||||
@@ -195,4 +163,37 @@ public class SysPermService extends BaseService<SysPerm, SysPermDto, Long> {
|
||||
}
|
||||
return CallResult.ok(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限资源地址的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 权限资源Id。
|
||||
* @param loginName 登录名。
|
||||
* @return 包含从权限资源到用户的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysUserListWithDetail(Long permId, String loginName) {
|
||||
return sysPermMapper.getSysUserListWithDetail(permId, loginName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限资源地址的角色列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 权限资源Id。
|
||||
* @param roleName 角色名。
|
||||
* @return 包含从权限资源到角色的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysRoleListWithDetail(Long permId, String roleName) {
|
||||
return sysPermMapper.getSysRoleListWithDetail(permId, roleName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限资源地址的菜单列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param permId 权限资源Id。
|
||||
* @param menuName 菜单名。
|
||||
* @return 包含从权限资源到菜单的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysMenuListWithDetail(Long permId, String menuName) {
|
||||
return sysPermMapper.getSysMenuListWithDetail(permId, menuName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,28 +151,6 @@ public class SysRoleService extends BaseService<SysRole, SysRoleDto, Long> {
|
||||
return sysRoleMapper.getSysRoleList(filter, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过权限字Id获取拥有改权限的所有角色。
|
||||
* 开发人员调试用接口。
|
||||
*
|
||||
* @param permCodeId 查询的权限字Id。
|
||||
* @return 符合条件的角色列表。
|
||||
*/
|
||||
public List<SysRole> getSysRoleListByPermCodeId(Long permCodeId) {
|
||||
return sysRoleMapper.getSysRoleListByPermCodeId(permCodeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过权限资源url,模糊搜索拥有改权限的所有角色。
|
||||
* 开发人员调试用接口。
|
||||
*
|
||||
* @param url 用于模糊搜索的url。
|
||||
* @return 符合条件的角色列表。
|
||||
*/
|
||||
public List<SysRole> getSysRoleListByPerm(String url) {
|
||||
return sysRoleMapper.getSysRoleListByPerm(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增用户角色关联。
|
||||
*
|
||||
@@ -219,4 +197,26 @@ public class SysRoleService extends BaseService<SysRole, SysRoleDto, Long> {
|
||||
}
|
||||
return CallResult.ok(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param roleId 角色Id。
|
||||
* @param url url过滤条件。
|
||||
* @return 包含从角色到权限资源的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysPermListWithDetail(Long roleId, String url) {
|
||||
return sysRoleMapper.getSysPermListWithDetail(roleId, url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色的权限字列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param roleId 角色Id。
|
||||
* @param permCode 权限字名称过滤条件。
|
||||
* @return 包含从角色到权限字的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysPermCodeListWithDetail(Long roleId, String permCode) {
|
||||
return sysRoleMapper.getSysPermCodeListWithDetail(roleId, permCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,6 +275,39 @@ public class SysUserService extends BaseService<SysUser, SysUserDto, Long> {
|
||||
return sysUserMapper.getNotInSysUserListByRoleId(roleId, filter, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的权限资源地址列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param url url过滤条件。
|
||||
* @return 包含从用户到权限资源的完整权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysPermListWithDetail(Long userId, String url) {
|
||||
return sysUserMapper.getSysPermListWithDetail(userId, url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的权限字列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param permCode 权限字名称过滤条件。
|
||||
* @return 包含从用户到权限字的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysPermCodeListWithDetail(Long userId, String permCode) {
|
||||
return sysUserMapper.getSysPermCodeListWithDetail(userId, permCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的菜单列表。同时返回详细的分配路径。
|
||||
*
|
||||
* @param userId 用户Id。
|
||||
* @param menuName 菜单名称过滤条件。
|
||||
* @return 包含从用户到菜单的权限分配路径信息的查询结果列表。
|
||||
*/
|
||||
public List<Map<String, Object>> getSysMenuListWithDetail(Long userId, String menuName) {
|
||||
return sysUserMapper.getSysMenuListWithDetail(userId, menuName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户对象关联的数据是否都合法。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user