commit:VO支持以及bug修复

This commit is contained in:
Jerry
2020-12-18 22:52:35 +08:00
parent ecec5ae30a
commit d86ae86f1c
558 changed files with 8019 additions and 10785 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,6 @@ import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/**
* CourseDto对象。
@@ -142,28 +141,4 @@ public class CourseDto {
*/
@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;
}

View File

@@ -8,7 +8,6 @@ import lombok.Data;
import javax.validation.constraints.*;
import java.util.Map;
/**
* SchoolInfoDto对象。
@@ -47,16 +46,4 @@ public class SchoolInfoDto {
@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;
}

View File

@@ -11,7 +11,6 @@ import lombok.Data;
import javax.validation.constraints.*;
import java.util.Date;
import java.util.Map;
/**
* StudentClassDto对象。
@@ -77,22 +76,4 @@ public class StudentClassDto {
*/
@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;
}

View File

@@ -13,7 +13,6 @@ import lombok.Data;
import javax.validation.constraints.*;
import java.util.Date;
import java.util.Map;
/**
* StudentDto对象。
@@ -161,52 +160,4 @@ public class StudentDto {
*/
@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;
}

View File

@@ -0,0 +1,40 @@
package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 行政区划VO。
*
* @author Jerry
* @date 2020-08-08
*/
@ApiModel("行政区划实体对象VO")
@Data
public class AreaCodeVo {
/**
* 行政区划主键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;
}

View File

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

View File

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

View File

@@ -0,0 +1,116 @@
package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/**
* CourseVO对象。
*
* @author Jerry
* @date 2020-08-08
*/
@ApiModel("CourseVO实体对象")
@Data
public class CourseVo {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id")
private Long courseId;
/**
* 课程名称。
*/
@ApiModelProperty(value = "课程名称")
private String courseName;
/**
* 课程价格。
*/
@ApiModelProperty(value = "课程价格")
private BigDecimal price;
/**
* 课程描述。
*/
@ApiModelProperty(value = "课程描述")
private String description;
/**
* 课程难度(0: 容易 1: 普通 2: 很难)。
*/
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)")
private Integer difficulty;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id")
private Integer gradeId;
/**
* 学科Id。
*/
@ApiModelProperty(value = "学科Id")
private Integer subjectId;
/**
* 课时数量。
*/
@ApiModelProperty(value = "课时数量")
private Integer classHour;
/**
* 多张课程图片地址。
*/
@ApiModelProperty(value = "多张课程图片地址")
private String pictureUrl;
/**
* 创建用户Id。
*/
@ApiModelProperty(value = "创建用户Id")
private Long createUserId;
/**
* 创建时间。
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 最后修改时间。
*/
@ApiModelProperty(value = "最后修改时间")
private Date updateTime;
/**
* courseId 的多对多关联表数据对象数据对应类型为ClassCourseVo。
*/
@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;
}

View File

@@ -0,0 +1,28 @@
package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* GradeVO对象。
*
* @author Jerry
* @date 2020-08-08
*/
@ApiModel("GradeVO实体对象")
@Data
public class GradeVo {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id")
private Integer gradeId;
/**
* 年级名称。
*/
@ApiModelProperty(value = "年级名称")
private String gradeName;
}

View File

@@ -0,0 +1,54 @@
package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Map;
/**
* SchoolInfoVO对象。
*
* @author Jerry
* @date 2020-08-08
*/
@ApiModel("SchoolInfoVO实体对象")
@Data
public class SchoolInfoVo {
/**
* 学校Id。
*/
@ApiModelProperty(value = "学校Id")
private Long schoolId;
/**
* 学校名称。
*/
@ApiModelProperty(value = "学校名称")
private String schoolName;
/**
* 所在省Id。
*/
@ApiModelProperty(value = "所在省Id")
private Long provinceId;
/**
* 所在城市Id。
*/
@ApiModelProperty(value = "所在城市Id")
private Long cityId;
/**
* provinceId 字典关联数据。
*/
@ApiModelProperty(hidden = true)
private Map<String, Object> provinceIdDictMap;
/**
* cityId 字典关联数据。
*/
@ApiModelProperty(hidden = true)
private Map<String, Object> cityIdDictMap;
}

View File

@@ -0,0 +1,85 @@
package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.Map;
/**
* StudentClassVO对象。
*
* @author Jerry
* @date 2020-08-08
*/
@ApiModel("StudentClassVO实体对象")
@Data
public class StudentClassVo {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id")
private Long classId;
/**
* 班级名称。
*/
@ApiModelProperty(value = "班级名称")
private String className;
/**
* 学校Id。
*/
@ApiModelProperty(value = "学校Id")
private Long schoolId;
/**
* 学生班长Id。
*/
@ApiModelProperty(value = "学生班长Id")
private Long leaderId;
/**
* 已完成课时数量。
*/
@ApiModelProperty(value = "已完成课时数量")
private Integer finishClassHour;
/**
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
*/
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)")
private Integer classLevel;
/**
* 创建用户。
*/
@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;
}

View File

@@ -0,0 +1,157 @@
package com.orange.demo.courseclassinterface.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.Map;
/**
* StudentVO对象。
*
* @author Jerry
* @date 2020-08-08
*/
@ApiModel("StudentVO实体对象")
@Data
public class StudentVo {
/**
* 学生Id。
*/
@ApiModelProperty(value = "学生Id")
private Long studentId;
/**
* 登录手机。
*/
@ApiModelProperty(value = "登录手机")
private String loginMobile;
/**
* 学生姓名。
*/
@ApiModelProperty(value = "学生姓名")
private String studentName;
/**
* 所在省份Id。
*/
@ApiModelProperty(value = "所在省份Id")
private Long provinceId;
/**
* 所在城市Id。
*/
@ApiModelProperty(value = "所在城市Id")
private Long cityId;
/**
* 区县Id。
*/
@ApiModelProperty(value = "区县Id")
private Long districtId;
/**
* 学生性别 (0: 女生 1: 男生)。
*/
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)")
private Integer gender;
/**
* 生日。
*/
@ApiModelProperty(value = "生日")
private Date birthday;
/**
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
*/
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)")
private Integer experienceLevel;
/**
* 总共充值学币数量。
*/
@ApiModelProperty(value = "总共充值学币数量")
private Integer totalCoin;
/**
* 可用学币数量。
*/
@ApiModelProperty(value = "可用学币数量")
private Integer leftCoin;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id")
private Integer gradeId;
/**
* 校区Id。
*/
@ApiModelProperty(value = "校区Id")
private Long schoolId;
/**
* 注册时间。
*/
@ApiModelProperty(value = "注册时间")
private Date registerTime;
/**
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
*/
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)")
private Integer status;
/**
* 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;
}

View File

@@ -5,9 +5,8 @@ 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;
@@ -25,13 +24,13 @@ import java.util.*;
@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 +69,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 +82,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 +95,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 +128,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 +139,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);
}
}

View File

@@ -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.*;
@@ -42,7 +42,7 @@ import java.util.*;
@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 +54,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;
}
@@ -78,7 +78,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
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()) {
@@ -108,7 +108,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
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 +162,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 +183,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 +192,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);
}
/**
@@ -319,7 +312,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
*/
@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);
}
@@ -333,7 +326,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
*/
@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);
}
@@ -371,30 +364,30 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
@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);
}
@@ -406,7 +399,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
*/
@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);
}

View File

@@ -8,13 +8,13 @@ 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;
@@ -33,13 +33,13 @@ import java.util.*;
@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;
}
@@ -108,7 +108,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 +116,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);
}
/**
@@ -142,7 +142,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
*/
@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);
}
@@ -156,7 +156,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
*/
@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);
}
@@ -194,7 +194,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
@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));
}
/**
@@ -205,7 +205,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
*/
@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);
}
@@ -217,7 +217,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
*/
@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);
}

View File

@@ -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.*;
@@ -33,13 +33,13 @@ import java.util.*;
@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;
}
@@ -56,7 +56,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);
// 验证关联Id的数据合法性
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, null);
if (!callResult.isSuccess()) {
@@ -79,7 +79,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 +133,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 +154,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 +163,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);
}
/**
@@ -197,7 +190,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
*/
@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);
}
@@ -211,7 +204,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
*/
@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);
}
@@ -249,30 +242,30 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
@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);
}
@@ -284,7 +277,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
*/
@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);
}

View File

@@ -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.*;
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
@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 +43,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;
}
@@ -60,7 +60,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);
// 验证关联Id的数据合法性
CallResult callResult = studentClassService.verifyRelatedData(studentClass, null);
if (!callResult.isSuccess()) {
@@ -83,7 +83,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 +137,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 +158,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 +167,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 +182,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 +196,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 +213,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 +227,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 +294,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 +303,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 +337,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 +351,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 +368,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 +382,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);
@@ -456,7 +449,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
*/
@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);
}
@@ -470,7 +463,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
*/
@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);
}
@@ -508,30 +501,30 @@ public class StudentClassController extends BaseController<StudentClass, Student
@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);
}
@@ -543,7 +536,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
*/
@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);
}

View File

@@ -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.*;
@@ -33,13 +33,13 @@ import java.util.*;
@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;
}
@@ -62,7 +62,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
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()) {
@@ -91,7 +91,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
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 +145,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 +166,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 +175,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);
}
/**
@@ -209,7 +202,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
*/
@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);
}
@@ -223,7 +216,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
*/
@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);
}
@@ -261,30 +254,30 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
@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);
}
@@ -296,7 +289,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
*/
@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);
}

View File

@@ -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 + '%'" />

View File

@@ -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 + '%'" />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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