mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:VO支持以及bug修复
This commit is contained in:
@@ -91,24 +91,6 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
|
||||
<orderEntry type="module" module-name="common-swagger" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<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" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.2.1" level="project" />
|
||||
@@ -265,7 +247,7 @@
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.8" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||
|
||||
@@ -26,11 +26,5 @@
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!-- knife4j 接口文档框架 -->
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -3,9 +3,9 @@ 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.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.AreaCodeVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -20,7 +20,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@FeignClient(name = "system-service", fallbackFactory = AreaCodeClient.AreaCodeClientFallbackFactory.class)
|
||||
public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
public interface AreaCodeClient extends BaseClient<AreaCodeDto, AreaCodeVo, Long> {
|
||||
|
||||
/**
|
||||
* 根据主键Id集合,返回给定的数据集合。
|
||||
@@ -31,7 +31,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/areaCode/listByIds")
|
||||
ResponseResult<List<AreaCodeDto>> listByIds(
|
||||
ResponseResult<List<AreaCodeVo>> listByIds(
|
||||
@RequestParam("areaCodeIds") Set<Long> areaCodeIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/areaCode/getById")
|
||||
ResponseResult<AreaCodeDto> getById(
|
||||
ResponseResult<AreaCodeVo> getById(
|
||||
@RequestParam("areaId") Long areaId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -76,7 +76,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/areaCode/listBy")
|
||||
ResponseResult<List<AreaCodeDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<AreaCodeVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -86,7 +86,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/areaCode/getBy")
|
||||
ResponseResult<AreaCodeDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<AreaCodeVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 以id、name的形式返回所有字典数据的列表。
|
||||
@@ -108,7 +108,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
@Component
|
||||
@Slf4j
|
||||
class AreaCodeClientFallbackFactory
|
||||
extends BaseFallbackFactory<AreaCodeDto, Long, AreaCodeClient> implements AreaCodeClient {
|
||||
extends BaseFallbackFactory<AreaCodeDto, AreaCodeVo, Long, AreaCodeClient> implements AreaCodeClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listDict() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.CourseDto;
|
||||
import com.orange.demo.courseclassinterface.vo.CourseVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = CourseClient.CourseClientFallbackFactory.class)
|
||||
public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
public interface CourseClient extends BaseClient<CourseDto, CourseVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/listByIds")
|
||||
ResponseResult<List<CourseDto>> listByIds(
|
||||
ResponseResult<List<CourseVo>> listByIds(
|
||||
@RequestParam("courseIds") Set<Long> courseIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/getById")
|
||||
ResponseResult<CourseDto> getById(
|
||||
ResponseResult<CourseVo> getById(
|
||||
@RequestParam("courseId") Long courseId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/listBy")
|
||||
ResponseResult<List<CourseDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<CourseVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/getBy")
|
||||
ResponseResult<CourseDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<CourseVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
@Component("CourseClassCourseClientFallbackFactory")
|
||||
@Slf4j
|
||||
class CourseClientFallbackFactory
|
||||
extends BaseFallbackFactory<CourseDto, Long, CourseClient> implements CourseClient {
|
||||
extends BaseFallbackFactory<CourseDto, CourseVo, Long, CourseClient> implements CourseClient {
|
||||
|
||||
@Override
|
||||
public CourseClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = GradeClient.GradeClientFallbackFactory.class)
|
||||
public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
public interface GradeClient extends BaseClient<GradeDto, GradeVo, Integer> {
|
||||
|
||||
/**
|
||||
* 基于主键的(in list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/listByIds")
|
||||
ResponseResult<List<GradeDto>> listByIds(
|
||||
ResponseResult<List<GradeVo>> listByIds(
|
||||
@RequestParam("gradeIds") Set<Integer> gradeIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/getById")
|
||||
ResponseResult<GradeDto> getById(
|
||||
ResponseResult<GradeVo> getById(
|
||||
@RequestParam("gradeId") Integer gradeId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/listBy")
|
||||
ResponseResult<List<GradeDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<GradeVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,12 +109,12 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/getBy")
|
||||
ResponseResult<GradeDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<GradeVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
@Component("CourseClassGradeClientFallbackFactory")
|
||||
@Slf4j
|
||||
class GradeClientFallbackFactory
|
||||
extends BaseFallbackFactory<GradeDto, Integer, GradeClient> implements GradeClient {
|
||||
extends BaseFallbackFactory<GradeDto, GradeVo, Integer, GradeClient> implements GradeClient {
|
||||
|
||||
@Override
|
||||
public GradeClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.SchoolInfoDto;
|
||||
import com.orange.demo.courseclassinterface.vo.SchoolInfoVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = SchoolInfoClient.SchoolInfoClientFallbackFactory.class)
|
||||
public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, SchoolInfoVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/listByIds")
|
||||
ResponseResult<List<SchoolInfoDto>> listByIds(
|
||||
ResponseResult<List<SchoolInfoVo>> listByIds(
|
||||
@RequestParam("schoolIds") Set<Long> schoolIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/getById")
|
||||
ResponseResult<SchoolInfoDto> getById(
|
||||
ResponseResult<SchoolInfoVo> getById(
|
||||
@RequestParam("schoolId") Long schoolId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/listBy")
|
||||
ResponseResult<List<SchoolInfoDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<SchoolInfoVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/getBy")
|
||||
ResponseResult<SchoolInfoDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<SchoolInfoVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
@Component("CourseClassSchoolInfoClientFallbackFactory")
|
||||
@Slf4j
|
||||
class SchoolInfoClientFallbackFactory
|
||||
extends BaseFallbackFactory<SchoolInfoDto, Long, SchoolInfoClient> implements SchoolInfoClient {
|
||||
extends BaseFallbackFactory<SchoolInfoDto, SchoolInfoVo, Long, SchoolInfoClient> implements SchoolInfoClient {
|
||||
|
||||
@Override
|
||||
public SchoolInfoClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentClassDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentClassVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = StudentClassClient.StudentClassClientFallbackFactory.class)
|
||||
public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
public interface StudentClassClient extends BaseClient<StudentClassDto, StudentClassVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/listByIds")
|
||||
ResponseResult<List<StudentClassDto>> listByIds(
|
||||
ResponseResult<List<StudentClassVo>> listByIds(
|
||||
@RequestParam("classIds") Set<Long> classIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/getById")
|
||||
ResponseResult<StudentClassDto> getById(
|
||||
ResponseResult<StudentClassVo> getById(
|
||||
@RequestParam("classId") Long classId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/listBy")
|
||||
ResponseResult<List<StudentClassDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<StudentClassVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/getBy")
|
||||
ResponseResult<StudentClassDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<StudentClassVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
@Component("CourseClassStudentClassClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentClassClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentClassDto, Long, StudentClassClient> implements StudentClassClient {
|
||||
extends BaseFallbackFactory<StudentClassDto, StudentClassVo, Long, StudentClassClient> implements StudentClassClient {
|
||||
|
||||
@Override
|
||||
public StudentClassClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = StudentClient.StudentClientFallbackFactory.class)
|
||||
public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
public interface StudentClient extends BaseClient<StudentDto, StudentVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/listByIds")
|
||||
ResponseResult<List<StudentDto>> listByIds(
|
||||
ResponseResult<List<StudentVo>> listByIds(
|
||||
@RequestParam("studentIds") Set<Long> studentIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/getById")
|
||||
ResponseResult<StudentDto> getById(
|
||||
ResponseResult<StudentVo> getById(
|
||||
@RequestParam("studentId") Long studentId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/listBy")
|
||||
ResponseResult<List<StudentDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<StudentVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/getBy")
|
||||
ResponseResult<StudentDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<StudentVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
@Component("CourseClassStudentClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentDto, Long, StudentClient> implements StudentClient {
|
||||
extends BaseFallbackFactory<StudentDto, StudentVo, Long, StudentClient> implements StudentClient {
|
||||
|
||||
@Override
|
||||
public StudentClient create(Throwable throwable) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.orange.demo.courseclassinterface.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -10,31 +8,26 @@ import lombok.Data;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("行政区划实体对象")
|
||||
@Data
|
||||
public class AreaCodeDto {
|
||||
|
||||
/**
|
||||
* 行政区划主键Id
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划主键Id", required = true)
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划名称")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划级别")
|
||||
private Integer areaLevel;
|
||||
|
||||
/**
|
||||
* 父级行政区划Id
|
||||
*/
|
||||
@ApiModelProperty(value = "父级行政区划Id")
|
||||
private Long parentId;
|
||||
}
|
||||
@@ -5,15 +5,12 @@ import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.constant.CourseDifficult;
|
||||
import com.orange.demo.application.common.constant.Subject;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseDto对象。
|
||||
@@ -21,41 +18,35 @@ import java.util.Map;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("CourseDto实体对象")
|
||||
@Data
|
||||
public class CourseDto {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,课程名称不能为空!")
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 课程价格。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程价格", required = true)
|
||||
@NotNull(message = "数据验证失败,课程价格不能为空!")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 课程描述。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)", required = true)
|
||||
@NotNull(message = "数据验证失败,课程难度不能为空!")
|
||||
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
|
||||
private Integer difficulty;
|
||||
@@ -63,14 +54,12 @@ public class CourseDto {
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学科Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学科Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属学科不能为空!")
|
||||
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
|
||||
private Integer subjectId;
|
||||
@@ -78,92 +67,57 @@ public class CourseDto {
|
||||
/**
|
||||
* 课时数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "课时数量", required = true)
|
||||
@NotNull(message = "数据验证失败,课时数量不能为空!")
|
||||
private Integer classHour;
|
||||
|
||||
/**
|
||||
* 多张课程图片地址。
|
||||
*/
|
||||
@ApiModelProperty(value = "多张课程图片地址", required = true)
|
||||
@NotBlank(message = "数据验证失败,课程图片不能为空!")
|
||||
private String pictureUrl;
|
||||
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户Id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最后修改时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "最后修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* price 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "price 范围过滤起始值(>=)")
|
||||
private BigDecimal priceStart;
|
||||
|
||||
/**
|
||||
* price 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "price 范围过滤结束值(<=)")
|
||||
private BigDecimal priceEnd;
|
||||
|
||||
/**
|
||||
* classHour 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "classHour 范围过滤起始值(>=)")
|
||||
private Integer classHourStart;
|
||||
|
||||
/**
|
||||
* classHour 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "classHour 范围过滤结束值(<=)")
|
||||
private Integer classHourEnd;
|
||||
|
||||
/**
|
||||
* updateTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "updateTime 范围过滤起始值(>=)")
|
||||
private String updateTimeStart;
|
||||
|
||||
/**
|
||||
* updateTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "updateTime 范围过滤结束值(<=)")
|
||||
private String updateTimeEnd;
|
||||
|
||||
/**
|
||||
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseDto。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> classCourse;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* difficulty 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> difficultyDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.orange.demo.courseclassinterface.dto;
|
||||
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
@@ -14,21 +12,18 @@ import javax.validation.constraints.*;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("GradeDto实体对象")
|
||||
@Data
|
||||
public class GradeDto {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,年级名称不能为空!")
|
||||
private String gradeName;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,10 @@ package com.orange.demo.courseclassinterface.dto;
|
||||
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SchoolInfoDto对象。
|
||||
@@ -16,47 +13,30 @@ import java.util.Map;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("SchoolInfoDto实体对象")
|
||||
@Data
|
||||
public class SchoolInfoDto {
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学校Id不能为空!", groups = {UpdateGroup.class})
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学校名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,学校名称不能为空!")
|
||||
private String schoolName;
|
||||
|
||||
/**
|
||||
* 所在省Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在省Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
|
||||
@@ -4,14 +4,11 @@ import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.constant.ClassLevel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentClassDto对象。
|
||||
@@ -19,49 +16,42 @@ import java.util.Map;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentClassDto实体对象")
|
||||
@Data
|
||||
public class StudentClassDto {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,班级名称不能为空!")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学生班长Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生班长Id", required = true)
|
||||
@NotNull(message = "数据验证失败,班长不能为空!")
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 已完成课时数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "已完成课时数量", required = true)
|
||||
@NotNull(message = "数据验证失败,已完成课时不能为空!")
|
||||
private Integer finishClassHour;
|
||||
|
||||
/**
|
||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)", required = true)
|
||||
@NotNull(message = "数据验证失败,班级级别不能为空!")
|
||||
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
|
||||
private Integer classLevel;
|
||||
@@ -69,30 +59,10 @@ public class StudentClassDto {
|
||||
/**
|
||||
* 创建用户。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 班级创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* leaderId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> leaderIdDictMap;
|
||||
|
||||
/**
|
||||
* classLevel 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,11 @@ import com.orange.demo.application.common.constant.Gender;
|
||||
import com.orange.demo.application.common.constant.ExpLevel;
|
||||
import com.orange.demo.application.common.constant.StudentStatus;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentDto对象。
|
||||
@@ -21,56 +18,48 @@ import java.util.Map;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentDto实体对象")
|
||||
@Data
|
||||
public class StudentDto {
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 登录手机。
|
||||
*/
|
||||
@ApiModelProperty(value = "登录手机", required = true)
|
||||
@NotBlank(message = "数据验证失败,手机号码不能为空!")
|
||||
private String loginMobile;
|
||||
|
||||
/**
|
||||
* 学生姓名。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生姓名", required = true)
|
||||
@NotBlank(message = "数据验证失败,姓名不能为空!")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 所在省份Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在省份Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 区县Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "区县Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在区县不能为空!")
|
||||
private Long districtId;
|
||||
|
||||
/**
|
||||
* 学生性别 (0: 女生 1: 男生)。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)", required = true)
|
||||
@NotNull(message = "数据验证失败,性别不能为空!")
|
||||
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,性别为无效值!")
|
||||
private Integer gender;
|
||||
@@ -78,14 +67,12 @@ public class StudentDto {
|
||||
/**
|
||||
* 生日。
|
||||
*/
|
||||
@ApiModelProperty(value = "生日", required = true)
|
||||
@NotNull(message = "数据验证失败,生日不能为空!")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||
*/
|
||||
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)", required = true)
|
||||
@NotNull(message = "数据验证失败,经验等级不能为空!")
|
||||
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
|
||||
private Integer experienceLevel;
|
||||
@@ -93,41 +80,35 @@ public class StudentDto {
|
||||
/**
|
||||
* 总共充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "总共充值学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class})
|
||||
private Integer totalCoin;
|
||||
|
||||
/**
|
||||
* 可用学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "可用学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,剩余学币不能为空!", groups = {UpdateGroup.class})
|
||||
private Integer leftCoin;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,年级不能为空!")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 校区Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "校区Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 注册时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date registerTime;
|
||||
|
||||
/**
|
||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)", required = true)
|
||||
@NotNull(message = "数据验证失败,状态 不能为空!", groups = {UpdateGroup.class})
|
||||
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,状态 为无效值!")
|
||||
private Integer status;
|
||||
@@ -135,78 +116,25 @@ public class StudentDto {
|
||||
/**
|
||||
* birthday 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "birthday 范围过滤起始值(>=)")
|
||||
private String birthdayStart;
|
||||
|
||||
/**
|
||||
* birthday 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "birthday 范围过滤结束值(<=)")
|
||||
private String birthdayEnd;
|
||||
|
||||
/**
|
||||
* registerTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "registerTime 范围过滤起始值(>=)")
|
||||
private String registerTimeStart;
|
||||
|
||||
/**
|
||||
* registerTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "registerTime 范围过滤结束值(<=)")
|
||||
private String registerTimeEnd;
|
||||
|
||||
/**
|
||||
* true LIKE搜索字符串。
|
||||
*/
|
||||
@ApiModelProperty(value = "LIKE模糊搜索字符串")
|
||||
private String searchString;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
/**
|
||||
* districtId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> districtIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gender 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> genderDictMap;
|
||||
|
||||
/**
|
||||
* experienceLevel 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> experienceLevelDictMap;
|
||||
|
||||
/**
|
||||
* status 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> statusDictMap;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 行政区划VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class AreaCodeVo {
|
||||
|
||||
/**
|
||||
* 行政区划主键Id
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||
*/
|
||||
private Integer areaLevel;
|
||||
|
||||
/**
|
||||
* 父级行政区划Id
|
||||
*/
|
||||
private Long parentId;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassCourseVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class ClassCourseVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程顺序(数值越小越靠前)。
|
||||
*/
|
||||
private Integer courseOrder;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassStudentVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class ClassStudentVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
private Long studentId;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class CourseVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 课程价格。
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 课程描述。
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||
*/
|
||||
private Integer difficulty;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学科Id。
|
||||
*/
|
||||
private Integer subjectId;
|
||||
|
||||
/**
|
||||
* 课时数量。
|
||||
*/
|
||||
private Integer classHour;
|
||||
|
||||
/**
|
||||
* 多张课程图片地址。
|
||||
*/
|
||||
private String pictureUrl;
|
||||
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最后修改时间。
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseVo。
|
||||
*/
|
||||
private Map<String, Object> classCourse;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* difficulty 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> difficultyDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* GradeVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class GradeVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
private String gradeName;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SchoolInfoVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class SchoolInfoVo {
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学校名称。
|
||||
*/
|
||||
private String schoolName;
|
||||
|
||||
/**
|
||||
* 所在省Id。
|
||||
*/
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentClassVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class StudentClassVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称。
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学生班长Id。
|
||||
*/
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 已完成课时数量。
|
||||
*/
|
||||
private Integer finishClassHour;
|
||||
|
||||
/**
|
||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||
*/
|
||||
private Integer classLevel;
|
||||
|
||||
/**
|
||||
* 创建用户。
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 班级创建时间。
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* leaderId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> leaderIdDictMap;
|
||||
|
||||
/**
|
||||
* classLevel 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class StudentVo {
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 登录手机。
|
||||
*/
|
||||
private String loginMobile;
|
||||
|
||||
/**
|
||||
* 学生姓名。
|
||||
*/
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 所在省份Id。
|
||||
*/
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 区县Id。
|
||||
*/
|
||||
private Long districtId;
|
||||
|
||||
/**
|
||||
* 学生性别 (0: 女生 1: 男生)。
|
||||
*/
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
* 生日。
|
||||
*/
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||
*/
|
||||
private Integer experienceLevel;
|
||||
|
||||
/**
|
||||
* 总共充值学币数量。
|
||||
*/
|
||||
private Integer totalCoin;
|
||||
|
||||
/**
|
||||
* 可用学币数量。
|
||||
*/
|
||||
private Integer leftCoin;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 校区Id。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 注册时间。
|
||||
*/
|
||||
private Date registerTime;
|
||||
|
||||
/**
|
||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
/**
|
||||
* districtId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> districtIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gender 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> genderDictMap;
|
||||
|
||||
/**
|
||||
* experienceLevel 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> experienceLevelDictMap;
|
||||
|
||||
/**
|
||||
* status 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> statusDictMap;
|
||||
}
|
||||
@@ -89,23 +89,6 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
|
||||
<orderEntry type="module" module-name="common-swagger" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="module" module-name="common-redis" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.7.0" level="project" />
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orange.demo.common.core.object.MyQueryParam;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.vo.AreaCodeVo;
|
||||
import com.orange.demo.courseclassservice.model.AreaCode;
|
||||
import com.orange.demo.courseclassservice.service.AreaCodeService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -22,16 +20,15 @@ import java.util.*;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "行政区划数据访问接口")
|
||||
@RestController
|
||||
@RequestMapping("/areaCode")
|
||||
public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Long> {
|
||||
public class AreaCodeController extends BaseController<AreaCode, AreaCodeVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private AreaCodeService areaCodeService;
|
||||
|
||||
@Override
|
||||
protected BaseService<AreaCode, AreaCodeDto, Long> service() {
|
||||
protected BaseService<AreaCode, Long> service() {
|
||||
return areaCodeService;
|
||||
}
|
||||
|
||||
@@ -70,9 +67,9 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果的Data对象中,将包含行政区划对象。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<AreaCodeDto> view(@RequestParam Long areaId) {
|
||||
public ResponseResult<AreaCodeVo> view(@RequestParam Long areaId) {
|
||||
AreaCode areaCode = areaCodeService.getById(areaId);
|
||||
return ResponseResult.success(MyModelUtil.copyTo(areaCode, AreaCodeDto.class));
|
||||
return ResponseResult.success(MyModelUtil.copyTo(areaCode, AreaCodeVo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +80,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 符合主键(in list)的数据集合。
|
||||
*/
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<AreaCodeDto>> listByIds(
|
||||
public ResponseResult<List<AreaCodeVo>> listByIds(
|
||||
@RequestParam Set<Long> areaCodeIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(areaCodeIds, withDict, null);
|
||||
}
|
||||
@@ -96,7 +93,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@GetMapping("/getById")
|
||||
public ResponseResult<AreaCodeDto> getById(@RequestParam Long areaId, @RequestParam Boolean withDict) {
|
||||
public ResponseResult<AreaCodeVo> getById(@RequestParam Long areaId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(areaId, withDict, null);
|
||||
}
|
||||
|
||||
@@ -129,7 +126,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<AreaCodeDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<AreaCodeVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, null);
|
||||
}
|
||||
|
||||
@@ -140,7 +137,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<AreaCodeDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<AreaCodeVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ import com.orange.demo.common.core.upload.BaseUpDownloader;
|
||||
import com.orange.demo.common.core.upload.UpDownloaderFactory;
|
||||
import com.orange.demo.common.core.upload.UploadResponseInfo;
|
||||
import com.orange.demo.common.core.upload.UploadStoreInfo;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -20,9 +20,6 @@ import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.redis.cache.SessionCacheHelper;
|
||||
import com.orange.demo.courseclassservice.config.ApplicationConfig;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -38,11 +35,10 @@ import java.util.*;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "课程数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/course")
|
||||
public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
public class CourseController extends BaseController<Course, CourseVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
@@ -54,7 +50,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
private UpDownloaderFactory upDownloaderFactory;
|
||||
|
||||
@Override
|
||||
protected BaseService<Course, CourseDto, Long> service() {
|
||||
protected BaseService<Course, Long> service() {
|
||||
return courseService;
|
||||
}
|
||||
|
||||
@@ -64,21 +60,13 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param courseDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"course.courseId",
|
||||
"course.priceStart",
|
||||
"course.priceEnd",
|
||||
"course.classHourStart",
|
||||
"course.classHourEnd",
|
||||
"course.updateTimeStart",
|
||||
"course.updateTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody("course") CourseDto courseDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(courseDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Course course = Course.INSTANCE.toModel(courseDto);
|
||||
Course course = MyModelUtil.copyTo(courseDto, Course.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = courseService.verifyRelatedData(course, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -95,20 +83,13 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param courseDto 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"course.priceStart",
|
||||
"course.priceEnd",
|
||||
"course.classHourStart",
|
||||
"course.classHourEnd",
|
||||
"course.updateTimeStart",
|
||||
"course.updateTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
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_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Course course = Course.INSTANCE.toModel(courseDto);
|
||||
Course course = MyModelUtil.copyTo(courseDto, Course.class);
|
||||
Course originalCourse = courseService.getById(course.getCourseId());
|
||||
if (originalCourse == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -162,25 +143,18 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<CourseDto>> list(
|
||||
public ResponseResult<MyPageData<CourseVo>> list(
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Course courseFilter = Course.INSTANCE.toModel(courseDtoFilter);
|
||||
Course courseFilter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getCourseListWithRelation(courseFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (courseList instanceof Page) {
|
||||
totalCount = ((Page<Course>) courseList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<CourseDto>, Long> responseData =
|
||||
new Tuple2<>(Course.INSTANCE.fromModelList(courseList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +164,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<CourseDto> view(@RequestParam Long courseId) {
|
||||
public ResponseResult<CourseVo> view(@RequestParam Long courseId) {
|
||||
if (MyCommonUtil.existBlankArgument(courseId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -199,8 +173,8 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
if (course == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
CourseDto courseDto = Course.INSTANCE.fromModel(course);
|
||||
return ResponseResult.success(courseDto);
|
||||
CourseVo courseVo = Course.INSTANCE.fromModel(course);
|
||||
return ResponseResult.success(courseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -317,9 +291,8 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<CourseDto>> listByIds(
|
||||
public ResponseResult<List<CourseVo>> listByIds(
|
||||
@RequestParam Set<Long> courseIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(courseIds, withDict, Course.INSTANCE);
|
||||
}
|
||||
@@ -331,9 +304,8 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<CourseDto> getById(
|
||||
public ResponseResult<CourseVo> getById(
|
||||
@RequestParam Long courseId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(courseId, withDict, Course.INSTANCE);
|
||||
}
|
||||
@@ -344,7 +316,6 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param courseIds 主键Id集合。
|
||||
* @return 应答结果对象,包含true全部存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existIds")
|
||||
@PostMapping("/existIds")
|
||||
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> courseIds) {
|
||||
return super.baseExistIds(courseIds);
|
||||
@@ -356,7 +327,6 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param courseId 主键Id。
|
||||
* @return 应答结果对象,包含true表示存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existId")
|
||||
@PostMapping("/existId")
|
||||
public ResponseResult<Boolean> existId(@RequestParam Long courseId) {
|
||||
return super.baseExistId(courseId);
|
||||
@@ -368,33 +338,30 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @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);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Course.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<CourseDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<CourseVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, Course.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, Course.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -404,9 +371,8 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<CourseDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<CourseVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, Course.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -416,7 +382,6 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含结果数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "countBy")
|
||||
@PostMapping("/countBy")
|
||||
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseCountBy(queryParam);
|
||||
@@ -428,7 +393,6 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param aggregationParam 聚合参数。
|
||||
* @return 应该结果对象,包含聚合计算后的分组Map列表。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "aggregateBy")
|
||||
@PostMapping("/aggregateBy")
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
|
||||
return super.baseAggregateBy(aggregationParam);
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseDictService;
|
||||
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.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.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import com.orange.demo.courseclassservice.model.Grade;
|
||||
import com.orange.demo.courseclassservice.service.GradeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -29,17 +26,16 @@ import java.util.*;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "年级管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/grade")
|
||||
public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
public class GradeController extends BaseController<Grade, GradeVo, Integer> {
|
||||
|
||||
@Autowired
|
||||
private GradeService gradeService;
|
||||
|
||||
@Override
|
||||
protected BaseDictService<Grade, GradeDto, Integer> service() {
|
||||
protected BaseDictService<Grade, Integer> service() {
|
||||
return gradeService;
|
||||
}
|
||||
|
||||
@@ -49,7 +45,6 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param gradeDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"grade.gradeId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Integer> add(@MyRequestBody("grade") GradeDto gradeDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);
|
||||
@@ -108,7 +103,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<GradeDto> view(@RequestParam Integer gradeId) {
|
||||
public ResponseResult<GradeVo> view(@RequestParam Integer gradeId) {
|
||||
if (MyCommonUtil.existBlankArgument(gradeId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -116,8 +111,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
if (grade == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
GradeDto gradeDto = MyModelUtil.copyTo(grade, GradeDto.class);
|
||||
return ResponseResult.success(gradeDto);
|
||||
GradeVo gradeVo = MyModelUtil.copyTo(grade, GradeVo.class);
|
||||
return ResponseResult.success(gradeVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,9 +135,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<GradeDto>> listByIds(
|
||||
public ResponseResult<List<GradeVo>> listByIds(
|
||||
@RequestParam Set<Integer> gradeIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(gradeIds, withDict, null);
|
||||
}
|
||||
@@ -154,9 +148,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<GradeDto> getById(
|
||||
public ResponseResult<GradeVo> getById(
|
||||
@RequestParam Integer gradeId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(gradeId, withDict, null);
|
||||
}
|
||||
@@ -167,7 +160,6 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param gradeIds 主键Id集合。
|
||||
* @return 应答结果对象,包含true全部存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existIds")
|
||||
@PostMapping("/existIds")
|
||||
public ResponseResult<Boolean> existIds(@RequestParam Set<Integer> gradeIds) {
|
||||
return super.baseExistIds(gradeIds);
|
||||
@@ -179,7 +171,6 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param gradeId 主键Id。
|
||||
* @return 应答结果对象,包含true全部存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existId")
|
||||
@PostMapping("/existId")
|
||||
public ResponseResult<Boolean> existId(@RequestParam Integer gradeId) {
|
||||
return super.baseExistId(gradeId);
|
||||
@@ -191,10 +182,9 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param filter 过滤对象。
|
||||
* @return 删除数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody GradeDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, null);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Grade.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,9 +193,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<GradeDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<GradeVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, null);
|
||||
}
|
||||
|
||||
@@ -215,9 +204,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<GradeDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<GradeVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -13,9 +13,6 @@ import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,17 +26,16 @@ import java.util.*;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "校区数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/schoolInfo")
|
||||
public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoDto, Long> {
|
||||
public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private SchoolInfoService schoolInfoService;
|
||||
|
||||
@Override
|
||||
protected BaseService<SchoolInfo, SchoolInfoDto, Long> service() {
|
||||
protected BaseService<SchoolInfo, Long> service() {
|
||||
return schoolInfoService;
|
||||
}
|
||||
|
||||
@@ -49,14 +45,13 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param schoolInfoDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"schoolInfo.userId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SchoolInfo schoolInfo = SchoolInfo.INSTANCE.toModel(schoolInfoDto);
|
||||
SchoolInfo schoolInfo = MyModelUtil.copyTo(schoolInfoDto, SchoolInfo.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -79,7 +74,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SchoolInfo schoolInfo = SchoolInfo.INSTANCE.toModel(schoolInfoDto);
|
||||
SchoolInfo schoolInfo = MyModelUtil.copyTo(schoolInfoDto, SchoolInfo.class);
|
||||
SchoolInfo originalSchoolInfo = schoolInfoService.getById(schoolInfo.getSchoolId());
|
||||
if (originalSchoolInfo == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -133,25 +128,18 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SchoolInfoDto>> list(
|
||||
public ResponseResult<MyPageData<SchoolInfoVo>> list(
|
||||
@MyRequestBody("schoolInfoFilter") SchoolInfoDto schoolInfoDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
SchoolInfo schoolInfoFilter = SchoolInfo.INSTANCE.toModel(schoolInfoDtoFilter);
|
||||
SchoolInfo schoolInfoFilter = MyModelUtil.copyTo(schoolInfoDtoFilter, SchoolInfo.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SchoolInfo.class);
|
||||
List<SchoolInfo> schoolInfoList =
|
||||
schoolInfoService.getSchoolInfoListWithRelation(schoolInfoFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (schoolInfoList instanceof Page) {
|
||||
totalCount = ((Page<SchoolInfo>) schoolInfoList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<SchoolInfoDto>, Long> responseData =
|
||||
new Tuple2<>(SchoolInfo.INSTANCE.fromModelList(schoolInfoList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(schoolInfoList, SchoolInfo.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,7 +149,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SchoolInfoDto> view(@RequestParam Long schoolId) {
|
||||
public ResponseResult<SchoolInfoVo> view(@RequestParam Long schoolId) {
|
||||
if (MyCommonUtil.existBlankArgument(schoolId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -170,8 +158,8 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
if (schoolInfo == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SchoolInfoDto schoolInfoDto = SchoolInfo.INSTANCE.fromModel(schoolInfo);
|
||||
return ResponseResult.success(schoolInfoDto);
|
||||
SchoolInfoVo schoolInfoVo = SchoolInfo.INSTANCE.fromModel(schoolInfo);
|
||||
return ResponseResult.success(schoolInfoVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,9 +183,8 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<SchoolInfoDto>> listByIds(
|
||||
public ResponseResult<List<SchoolInfoVo>> listByIds(
|
||||
@RequestParam Set<Long> schoolIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(schoolIds, withDict, SchoolInfo.INSTANCE);
|
||||
}
|
||||
@@ -209,9 +196,8 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<SchoolInfoDto> getById(
|
||||
public ResponseResult<SchoolInfoVo> getById(
|
||||
@RequestParam Long schoolId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(schoolId, withDict, SchoolInfo.INSTANCE);
|
||||
}
|
||||
@@ -222,7 +208,6 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param schoolIds 主键Id集合。
|
||||
* @return 应答结果对象,包含true全部存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existIds")
|
||||
@PostMapping("/existIds")
|
||||
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> schoolIds) {
|
||||
return super.baseExistIds(schoolIds);
|
||||
@@ -234,7 +219,6 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param schoolId 主键Id。
|
||||
* @return 应答结果对象,包含true表示存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existId")
|
||||
@PostMapping("/existId")
|
||||
public ResponseResult<Boolean> existId(@RequestParam Long schoolId) {
|
||||
return super.baseExistId(schoolId);
|
||||
@@ -246,33 +230,30 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @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);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, SchoolInfo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<SchoolInfoDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<SchoolInfoVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -282,9 +263,8 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<SchoolInfoDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<SchoolInfoVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -294,7 +274,6 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含结果数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "countBy")
|
||||
@PostMapping("/countBy")
|
||||
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseCountBy(queryParam);
|
||||
@@ -306,7 +285,6 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param aggregationParam 聚合参数。
|
||||
* @return 应该结果对象,包含聚合计算后的分组Map列表。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "aggregateBy")
|
||||
@PostMapping("/aggregateBy")
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
|
||||
return super.baseAggregateBy(aggregationParam);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -12,9 +12,6 @@ import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,11 +26,10 @@ import java.util.stream.Collectors;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "班级数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/studentClass")
|
||||
public class StudentClassController extends BaseController<StudentClass, StudentClassDto, Long> {
|
||||
public class StudentClassController extends BaseController<StudentClass, StudentClassVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentClassService studentClassService;
|
||||
@@ -43,7 +39,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
private StudentService studentService;
|
||||
|
||||
@Override
|
||||
protected BaseService<StudentClass, StudentClassDto, Long> service() {
|
||||
protected BaseService<StudentClass, Long> service() {
|
||||
return studentClassService;
|
||||
}
|
||||
|
||||
@@ -53,14 +49,13 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param studentClassDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"studentClass.userId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentClass studentClass = StudentClass.INSTANCE.toModel(studentClassDto);
|
||||
StudentClass studentClass = MyModelUtil.copyTo(studentClassDto, StudentClass.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = studentClassService.verifyRelatedData(studentClass, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -83,7 +78,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentClass studentClass = StudentClass.INSTANCE.toModel(studentClassDto);
|
||||
StudentClass studentClass = MyModelUtil.copyTo(studentClassDto, StudentClass.class);
|
||||
StudentClass originalStudentClass = studentClassService.getById(studentClass.getClassId());
|
||||
if (originalStudentClass == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -137,25 +132,18 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentClassDto>> list(
|
||||
public ResponseResult<MyPageData<StudentClassVo>> list(
|
||||
@MyRequestBody("studentClassFilter") StudentClassDto studentClassDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
StudentClass studentClassFilter = StudentClass.INSTANCE.toModel(studentClassDtoFilter);
|
||||
StudentClass studentClassFilter = MyModelUtil.copyTo(studentClassDtoFilter, StudentClass.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentClass.class);
|
||||
List<StudentClass> studentClassList =
|
||||
studentClassService.getStudentClassListWithRelation(studentClassFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (studentClassList instanceof Page) {
|
||||
totalCount = ((Page<StudentClass>) studentClassList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<StudentClassDto>, Long> responseData =
|
||||
new Tuple2<>(StudentClass.INSTANCE.fromModelList(studentClassList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentClassList, StudentClass.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,7 +153,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentClassDto> view(@RequestParam Long classId) {
|
||||
public ResponseResult<StudentClassVo> view(@RequestParam Long classId) {
|
||||
if (MyCommonUtil.existBlankArgument(classId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -174,8 +162,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (studentClass == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
StudentClassDto studentClassDto = StudentClass.INSTANCE.fromModel(studentClass);
|
||||
return ResponseResult.success(studentClassDto);
|
||||
StudentClassVo studentClassVo = StudentClass.INSTANCE.fromModel(studentClass);
|
||||
return ResponseResult.success(studentClassVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +177,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassCourse")
|
||||
public ResponseResult<MyPageData<CourseDto>> listNotInClassCourse(
|
||||
public ResponseResult<MyPageData<CourseVo>> listNotInClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -203,7 +191,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Course filter = Course.INSTANCE.toModel(courseDtoFilter);
|
||||
Course filter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getNotInCourseListByClassId(classId, filter, orderBy);
|
||||
@@ -220,7 +208,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassCourse")
|
||||
public ResponseResult<MyPageData<CourseDto>> listClassCourse(
|
||||
public ResponseResult<MyPageData<CourseVo>> listClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -234,7 +222,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Course filter = Course.INSTANCE.toModel(courseDtoFilter);
|
||||
Course filter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getCourseListByClassId(classId, filter, orderBy);
|
||||
@@ -301,7 +289,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包括中间表详情。
|
||||
*/
|
||||
@GetMapping("/viewClassCourse")
|
||||
public ResponseResult<ClassCourseDto> viewClassCourse(
|
||||
public ResponseResult<ClassCourseVo> viewClassCourse(
|
||||
@RequestParam Long classId, @RequestParam Long courseId) {
|
||||
if (MyCommonUtil.existBlankArgument(classId, courseId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
@@ -310,8 +298,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (classCourse == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
ClassCourseDto classCourseDto = MyModelUtil.copyTo(classCourse, ClassCourseDto.class);
|
||||
return ResponseResult.success(classCourseDto);
|
||||
ClassCourseVo classCourseVo = MyModelUtil.copyTo(classCourse, ClassCourseVo.class);
|
||||
return ResponseResult.success(classCourseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +332,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassStudent")
|
||||
public ResponseResult<MyPageData<StudentDto>> listNotInClassStudent(
|
||||
public ResponseResult<MyPageData<StudentVo>> listNotInClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -358,7 +346,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Student filter = Student.INSTANCE.toModel(studentDtoFilter);
|
||||
Student filter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getNotInStudentListByClassId(classId, filter, orderBy);
|
||||
@@ -375,7 +363,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassStudent")
|
||||
public ResponseResult<MyPageData<StudentDto>> listClassStudent(
|
||||
public ResponseResult<MyPageData<StudentVo>> listClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -389,7 +377,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Student filter = Student.INSTANCE.toModel(studentDtoFilter);
|
||||
Student filter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getStudentListByClassId(classId, filter, orderBy);
|
||||
@@ -454,9 +442,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentClassDto>> listByIds(
|
||||
public ResponseResult<List<StudentClassVo>> listByIds(
|
||||
@RequestParam Set<Long> classIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(classIds, withDict, StudentClass.INSTANCE);
|
||||
}
|
||||
@@ -468,9 +455,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentClassDto> getById(
|
||||
public ResponseResult<StudentClassVo> getById(
|
||||
@RequestParam Long classId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(classId, withDict, StudentClass.INSTANCE);
|
||||
}
|
||||
@@ -481,7 +467,6 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param classIds 主键Id集合。
|
||||
* @return 应答结果对象,包含true全部存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existIds")
|
||||
@PostMapping("/existIds")
|
||||
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> classIds) {
|
||||
return super.baseExistIds(classIds);
|
||||
@@ -493,7 +478,6 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param classId 主键Id。
|
||||
* @return 应答结果对象,包含true表示存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existId")
|
||||
@PostMapping("/existId")
|
||||
public ResponseResult<Boolean> existId(@RequestParam Long classId) {
|
||||
return super.baseExistId(classId);
|
||||
@@ -505,33 +489,30 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @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);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentClass.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentClassDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<StudentClassVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -541,9 +522,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentClassDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<StudentClassVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -553,7 +533,6 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含结果数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "countBy")
|
||||
@PostMapping("/countBy")
|
||||
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseCountBy(queryParam);
|
||||
@@ -565,7 +544,6 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param aggregationParam 聚合参数。
|
||||
* @return 应该结果对象,包含聚合计算后的分组Map列表。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "aggregateBy")
|
||||
@PostMapping("/aggregateBy")
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
|
||||
return super.baseAggregateBy(aggregationParam);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -13,9 +13,6 @@ import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,17 +26,16 @@ import java.util.*;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "学生数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/student")
|
||||
public class StudentController extends BaseController<Student, StudentDto, Long> {
|
||||
public class StudentController extends BaseController<Student, StudentVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentService studentService;
|
||||
|
||||
@Override
|
||||
protected BaseService<Student, StudentDto, Long> service() {
|
||||
protected BaseService<Student, Long> service() {
|
||||
return studentService;
|
||||
}
|
||||
|
||||
@@ -49,20 +45,13 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param studentDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"student.studentId",
|
||||
"student.searchString",
|
||||
"student.birthdayStart",
|
||||
"student.birthdayEnd",
|
||||
"student.registerTimeStart",
|
||||
"student.registerTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody("student") StudentDto studentDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Student student = Student.INSTANCE.toModel(studentDto);
|
||||
Student student = MyModelUtil.copyTo(studentDto, Student.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = studentService.verifyRelatedData(student, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -79,19 +68,13 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param studentDto 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"student.searchString",
|
||||
"student.birthdayStart",
|
||||
"student.birthdayEnd",
|
||||
"student.registerTimeStart",
|
||||
"student.registerTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
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_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Student student = Student.INSTANCE.toModel(studentDto);
|
||||
Student student = MyModelUtil.copyTo(studentDto, Student.class);
|
||||
Student originalStudent = studentService.getById(student.getStudentId());
|
||||
if (originalStudent == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -145,25 +128,18 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentDto>> list(
|
||||
public ResponseResult<MyPageData<StudentVo>> list(
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Student studentFilter = Student.INSTANCE.toModel(studentDtoFilter);
|
||||
Student studentFilter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getStudentListWithRelation(studentFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (studentList instanceof Page) {
|
||||
totalCount = ((Page<Student>) studentList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<StudentDto>, Long> responseData =
|
||||
new Tuple2<>(Student.INSTANCE.fromModelList(studentList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +149,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentDto> view(@RequestParam Long studentId) {
|
||||
public ResponseResult<StudentVo> view(@RequestParam Long studentId) {
|
||||
if (MyCommonUtil.existBlankArgument(studentId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -182,8 +158,8 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
if (student == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
StudentDto studentDto = Student.INSTANCE.fromModel(student);
|
||||
return ResponseResult.success(studentDto);
|
||||
StudentVo studentVo = Student.INSTANCE.fromModel(student);
|
||||
return ResponseResult.success(studentVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,9 +183,8 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentDto>> listByIds(
|
||||
public ResponseResult<List<StudentVo>> listByIds(
|
||||
@RequestParam Set<Long> studentIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(studentIds, withDict, Student.INSTANCE);
|
||||
}
|
||||
@@ -221,9 +196,8 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentDto> getById(
|
||||
public ResponseResult<StudentVo> getById(
|
||||
@RequestParam Long studentId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(studentId, withDict, Student.INSTANCE);
|
||||
}
|
||||
@@ -234,7 +208,6 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param studentIds 主键Id集合。
|
||||
* @return 应答结果对象,包含true全部存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existIds")
|
||||
@PostMapping("/existIds")
|
||||
public ResponseResult<Boolean> existIds(@RequestParam Set<Long> studentIds) {
|
||||
return super.baseExistIds(studentIds);
|
||||
@@ -246,7 +219,6 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param studentId 主键Id。
|
||||
* @return 应答结果对象,包含true表示存在,否则false。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "existId")
|
||||
@PostMapping("/existId")
|
||||
public ResponseResult<Boolean> existId(@RequestParam Long studentId) {
|
||||
return super.baseExistId(studentId);
|
||||
@@ -258,33 +230,30 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @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);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Student.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<StudentVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, Student.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, Student.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -294,9 +263,8 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<StudentVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, Student.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -306,7 +274,6 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含结果数量。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "countBy")
|
||||
@PostMapping("/countBy")
|
||||
public ResponseResult<Integer> countBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseCountBy(queryParam);
|
||||
@@ -318,7 +285,6 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param aggregationParam 聚合参数。
|
||||
* @return 应该结果对象,包含聚合计算后的分组Map列表。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "aggregateBy")
|
||||
@PostMapping("/aggregateBy")
|
||||
public ResponseResult<List<Map<String, Object>>> aggregateBy(@RequestBody MyAggregationParam aggregationParam) {
|
||||
return super.baseAggregateBy(aggregationParam);
|
||||
|
||||
@@ -20,8 +20,13 @@
|
||||
<association property="classCourse" column="course_id" foreignColumn="course_id"
|
||||
notNullColumn="course_id" resultMap="com.orange.demo.courseclassservice.dao.ClassCourseMapper.BaseResultMap" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.CourseMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="courseFilter != null">
|
||||
<if test="courseFilter.courseName != null and courseFilter.courseName != ''">
|
||||
<bind name = "safeCourseName" value = "'%' + courseFilter.courseName + '%'" />
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
<result column="province_id" jdbcType="BIGINT" property="provinceId"/>
|
||||
<result column="city_id" jdbcType="BIGINT" property="cityId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.SchoolInfoMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="schoolInfoFilter != null">
|
||||
<if test="schoolInfoFilter.schoolName != null and schoolInfoFilter.schoolName != ''">
|
||||
<bind name = "safeSchoolName" value = "'%' + schoolInfoFilter.schoolName + '%'" />
|
||||
|
||||
@@ -12,8 +12,14 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.StudentClassMapper.inputFilterRef"/>
|
||||
AND zz_class.status = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentClassFilter != null">
|
||||
<if test="studentClassFilter.className != null and studentClassFilter.className != ''">
|
||||
AND zz_class.class_name = #{studentClassFilter.className}
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
<result column="register_time" jdbcType="TIMESTAMP" property="registerTime"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.StudentMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentFilter != null">
|
||||
<if test="studentFilter.provinceId != null">
|
||||
AND zz_student.province_id = #{studentFilter.provinceId}
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.dto.CourseDto;
|
||||
import com.orange.demo.courseclassinterface.vo.CourseVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -174,25 +174,25 @@ public class Course {
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface CourseModelMapper extends BaseModelMapper<CourseDto, Course> {
|
||||
public interface CourseModelMapper extends BaseModelMapper<CourseVo, Course> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param courseDto 域对象。
|
||||
* @param courseVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "classCourse", expression = "java(mapToBean(courseDto.getClassCourse(), com.orange.demo.courseclassservice.model.ClassCourse.class))")
|
||||
@Mapping(target = "classCourse", expression = "java(mapToBean(courseVo.getClassCourse(), com.orange.demo.courseclassservice.model.ClassCourse.class))")
|
||||
@Override
|
||||
Course toModel(CourseDto courseDto);
|
||||
Course toModel(CourseVo courseVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param course 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "classCourse", expression = "java(beanToMap(course.getClassCourse(), false))")
|
||||
@Override
|
||||
CourseDto fromModel(Course course);
|
||||
CourseVo fromModel(Course course);
|
||||
}
|
||||
public static final CourseModelMapper INSTANCE = Mappers.getMapper(CourseModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.orange.demo.courseclassservice.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.courseclassinterface.dto.SchoolInfoDto;
|
||||
import com.orange.demo.courseclassinterface.vo.SchoolInfoVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -69,23 +69,23 @@ public class SchoolInfo {
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface SchoolInfoModelMapper extends BaseModelMapper<SchoolInfoDto, SchoolInfo> {
|
||||
public interface SchoolInfoModelMapper extends BaseModelMapper<SchoolInfoVo, SchoolInfo> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param schoolInfoDto 域对象。
|
||||
* @param schoolInfoVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
SchoolInfo toModel(SchoolInfoDto schoolInfoDto);
|
||||
SchoolInfo toModel(SchoolInfoVo schoolInfoVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param schoolInfo 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
SchoolInfoDto fromModel(SchoolInfo schoolInfo);
|
||||
SchoolInfoVo fromModel(SchoolInfo schoolInfo);
|
||||
}
|
||||
public static final SchoolInfoModelMapper INSTANCE = Mappers.getMapper(SchoolInfoModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -226,23 +226,23 @@ public class Student {
|
||||
private Map<String, Object> statusDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentModelMapper extends BaseModelMapper<StudentDto, Student> {
|
||||
public interface StudentModelMapper extends BaseModelMapper<StudentVo, Student> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentDto 域对象。
|
||||
* @param studentVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
Student toModel(StudentDto studentDto);
|
||||
Student toModel(StudentVo studentVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param student 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentDto fromModel(Student student);
|
||||
StudentVo fromModel(Student student);
|
||||
}
|
||||
public static final StudentModelMapper INSTANCE = Mappers.getMapper(StudentModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentClassDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentClassVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -115,23 +115,23 @@ public class StudentClass {
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentClassModelMapper extends BaseModelMapper<StudentClassDto, StudentClass> {
|
||||
public interface StudentClassModelMapper extends BaseModelMapper<StudentClassVo, StudentClass> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentClassDto 域对象。
|
||||
* @param studentClassVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentClass toModel(StudentClassDto studentClassDto);
|
||||
StudentClass toModel(StudentClassVo studentClassVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentClass 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentClassDto fromModel(StudentClass studentClass);
|
||||
StudentClassVo fromModel(StudentClass studentClass);
|
||||
}
|
||||
public static final StudentClassModelMapper INSTANCE = Mappers.getMapper(StudentClassModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.courseclassservice.dao.AreaCodeMapper;
|
||||
import com.orange.demo.courseclassservice.model.AreaCode;
|
||||
import com.orange.demo.common.core.cache.MapTreeDictionaryCache;
|
||||
@@ -20,7 +19,7 @@ import java.util.List;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class AreaCodeService extends BaseDictService<AreaCode, AreaCodeDto, Long> {
|
||||
public class AreaCodeService extends BaseDictService<AreaCode, Long> {
|
||||
|
||||
@Autowired
|
||||
private AreaCodeMapper areaCodeMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -24,7 +23,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class CourseService extends BaseService<Course, CourseDto, Long> {
|
||||
public class CourseService extends BaseService<Course, Long> {
|
||||
|
||||
@Autowired
|
||||
private CourseMapper courseMapper;
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.courseclassservice.dao.GradeMapper;
|
||||
import com.orange.demo.courseclassservice.model.Grade;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -21,7 +20,7 @@ import javax.annotation.PostConstruct;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class GradeService extends BaseDictService<Grade, GradeDto, Integer> {
|
||||
public class GradeService extends BaseDictService<Grade, Integer> {
|
||||
|
||||
@Autowired
|
||||
private GradeMapper gradeMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -23,7 +22,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SchoolInfoService extends BaseService<SchoolInfo, SchoolInfoDto, Long> {
|
||||
public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
|
||||
|
||||
@Autowired
|
||||
private SchoolInfoMapper schoolInfoMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -26,7 +25,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentClassService extends BaseService<StudentClass, StudentClassDto, Long> {
|
||||
public class StudentClassService extends BaseService<StudentClass, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentClassMapper studentClassMapper;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
import com.orange.demo.application.common.constant.StudentStatus;
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -24,7 +23,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentService extends BaseService<Student, StudentDto, Long> {
|
||||
public class StudentService extends BaseService<Student, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentMapper studentMapper;
|
||||
|
||||
@@ -59,9 +59,6 @@
|
||||
<Root level="${OUTPUT_LOG_LEVEL}">
|
||||
<AppenderRef ref="console"/>
|
||||
</Root>
|
||||
<Logger name="springfox.documentation" additivity="false" level="error">
|
||||
<AppenderRef ref="console"/>
|
||||
</Logger>
|
||||
<!-- AsyncLogger 是基于Disruptor的全量异步队列,性能极高,队列默认大小4096。-->
|
||||
<!-- 队列默认值可通过JVM参数设置,参考博客:https://www.jianshu.com/p/82469047acbf -->
|
||||
<AsyncLogger name="com.orange.demo" additivity="false" level="info">
|
||||
|
||||
Reference in New Issue
Block a user