mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-18 19:16:37 +08:00
commit:集成knife4j
This commit is contained in:
@@ -9,7 +9,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* course-class服务启动类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@EnableFeignClients(basePackages = "com.orange.demo")
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* defaultSomething: defaultValue
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@RefreshScope
|
||||
|
||||
@@ -14,7 +14,7 @@ import javax.sql.DataSource;
|
||||
* 数据源配置Bean对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -19,8 +20,9 @@ import java.util.*;
|
||||
* 行政区划数据访问接口类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "行政区划数据访问接口")
|
||||
@RestController
|
||||
@RequestMapping("/areaCode")
|
||||
public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Long> {
|
||||
|
||||
@@ -6,7 +6,6 @@ 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.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
@@ -21,6 +20,9 @@ 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.*;
|
||||
@@ -34,8 +36,9 @@ import java.util.*;
|
||||
* 课程数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "课程数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/course")
|
||||
@@ -61,8 +64,16 @@ 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<JSONObject> add(@MyRequestBody("course") CourseDto courseDto) {
|
||||
public ResponseResult<Long> add(@MyRequestBody("course") CourseDto courseDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(courseDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -75,9 +86,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
course = courseService.saveNew(course);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("courseId", course.getCourseId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(course.getCourseId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,6 +95,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);
|
||||
@@ -146,7 +162,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<CourseDto>> list(
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -301,6 +317,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<CourseDto>> listByIds(
|
||||
@RequestParam Set<Long> courseIds, @RequestParam Boolean withDict) {
|
||||
@@ -314,6 +331,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<CourseDto> getById(
|
||||
@RequestParam Long courseId, @RequestParam Boolean withDict) {
|
||||
@@ -326,6 +344,7 @@ 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);
|
||||
@@ -337,6 +356,7 @@ 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);
|
||||
@@ -348,6 +368,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<CourseDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, Course.INSTANCE);
|
||||
@@ -359,6 +380,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, Course.INSTANCE);
|
||||
@@ -370,6 +392,7 @@ 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) {
|
||||
return super.baseGetBy(queryParam, Course.INSTANCE);
|
||||
@@ -381,6 +404,7 @@ 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);
|
||||
@@ -392,6 +416,7 @@ 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);
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseDictService;
|
||||
@@ -25,8 +28,9 @@ import java.util.*;
|
||||
* 年级操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "年级管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/grade")
|
||||
@@ -46,17 +50,16 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param gradeDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"grade.gradeId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody("grade") GradeDto gradeDto) {
|
||||
public ResponseResult<Integer> add(@MyRequestBody("grade") GradeDto gradeDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
Grade grade = MyModelUtil.copyTo(gradeDto, Grade.class);
|
||||
grade = gradeService.saveNew(grade);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("gradeId", grade.getGradeId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(grade.getGradeId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,7 +120,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
GradeDto gradeDto = MyModelUtil.copyTo(grade, GradeDto.class);
|
||||
return ResponseResult.success(gradeDto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 以字典形式返回全部年级数据集合。
|
||||
* 白名单接口,登录用户均可访问。
|
||||
@@ -138,6 +141,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<GradeDto>> listByIds(
|
||||
@RequestParam Set<Integer> gradeIds, @RequestParam Boolean withDict) {
|
||||
@@ -151,6 +155,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<GradeDto> getById(
|
||||
@RequestParam Integer gradeId, @RequestParam Boolean withDict) {
|
||||
@@ -163,6 +168,7 @@ 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);
|
||||
@@ -174,6 +180,7 @@ 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);
|
||||
@@ -185,6 +192,7 @@ 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) {
|
||||
return super.baseListBy(queryParam, null);
|
||||
@@ -196,6 +204,7 @@ 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) {
|
||||
return super.baseGetBy(queryParam, null);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
@@ -14,6 +13,9 @@ 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.*;
|
||||
@@ -25,8 +27,9 @@ import java.util.*;
|
||||
* 校区数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "校区数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/schoolInfo")
|
||||
@@ -46,8 +49,9 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param schoolInfoDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"schoolInfo.userId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
|
||||
public ResponseResult<Long> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -60,9 +64,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
schoolInfo = schoolInfoService.saveNew(schoolInfo);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("schoolId", schoolInfo.getSchoolId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(schoolInfo.getSchoolId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +133,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<SchoolInfoDto>> list(
|
||||
@MyRequestBody("schoolInfoFilter") SchoolInfoDto schoolInfoDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -193,6 +195,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<SchoolInfoDto>> listByIds(
|
||||
@RequestParam Set<Long> schoolIds, @RequestParam Boolean withDict) {
|
||||
@@ -206,6 +209,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<SchoolInfoDto> getById(
|
||||
@RequestParam Long schoolId, @RequestParam Boolean withDict) {
|
||||
@@ -218,6 +222,7 @@ 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);
|
||||
@@ -229,6 +234,7 @@ 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);
|
||||
@@ -240,6 +246,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<SchoolInfoDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, SchoolInfo.INSTANCE);
|
||||
@@ -251,6 +258,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, SchoolInfo.INSTANCE);
|
||||
@@ -262,6 +270,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<SchoolInfoDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, SchoolInfo.INSTANCE);
|
||||
@@ -273,6 +282,7 @@ 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);
|
||||
@@ -284,6 +294,7 @@ 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,6 +1,5 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
@@ -13,6 +12,9 @@ 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.*;
|
||||
@@ -25,8 +27,9 @@ import java.util.stream.Collectors;
|
||||
* 班级数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "班级数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/studentClass")
|
||||
@@ -50,8 +53,9 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param studentClassDto 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"studentClass.userId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
|
||||
public ResponseResult<Long> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -64,9 +68,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
studentClass = studentClassService.saveNew(studentClass);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("classId", studentClass.getClassId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(studentClass.getClassId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,7 +137,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<StudentClassDto>> list(
|
||||
@MyRequestBody("studentClassFilter") StudentClassDto studentClassDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -187,7 +189,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassCourse")
|
||||
public ResponseResult<JSONObject> listNotInClassCourse(
|
||||
public ResponseResult<MyPageData<CourseDto>> listNotInClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -205,8 +207,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getNotInCourseListByClassId(classId, filter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(courseList, Course.INSTANCE);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +220,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassCourse")
|
||||
public ResponseResult<JSONObject> listClassCourse(
|
||||
public ResponseResult<MyPageData<CourseDto>> listClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -237,8 +238,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getCourseListByClassId(classId, filter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(courseList, Course.INSTANCE);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +344,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassStudent")
|
||||
public ResponseResult<JSONObject> listNotInClassStudent(
|
||||
public ResponseResult<MyPageData<StudentDto>> listNotInClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -362,8 +362,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getNotInStudentListByClassId(classId, filter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(studentList, Student.INSTANCE);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,7 +375,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassStudent")
|
||||
public ResponseResult<JSONObject> listClassStudent(
|
||||
public ResponseResult<MyPageData<StudentDto>> listClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -394,8 +393,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getStudentListByClassId(classId, filter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(studentList, Student.INSTANCE);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,6 +454,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentClassDto>> listByIds(
|
||||
@RequestParam Set<Long> classIds, @RequestParam Boolean withDict) {
|
||||
@@ -469,6 +468,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentClassDto> getById(
|
||||
@RequestParam Long classId, @RequestParam Boolean withDict) {
|
||||
@@ -481,6 +481,7 @@ 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);
|
||||
@@ -492,6 +493,7 @@ 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);
|
||||
@@ -503,6 +505,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentClassDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, StudentClass.INSTANCE);
|
||||
@@ -514,6 +517,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, StudentClass.INSTANCE);
|
||||
@@ -525,6 +529,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentClassDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, StudentClass.INSTANCE);
|
||||
@@ -536,6 +541,7 @@ 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);
|
||||
@@ -547,6 +553,7 @@ 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,7 +1,6 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
@@ -14,6 +13,9 @@ 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.*;
|
||||
@@ -25,8 +27,9 @@ import java.util.*;
|
||||
* 学生数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Api(tags = "学生数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/student")
|
||||
@@ -46,8 +49,15 @@ 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<JSONObject> add(@MyRequestBody("student") StudentDto studentDto) {
|
||||
public ResponseResult<Long> add(@MyRequestBody("student") StudentDto studentDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentDto);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -60,9 +70,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
student = studentService.saveNew(student);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("studentId", student.getStudentId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(student.getStudentId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,6 +79,12 @@ 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);
|
||||
@@ -131,7 +145,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<StudentDto>> list(
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -193,6 +207,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象集合。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentDto>> listByIds(
|
||||
@RequestParam Set<Long> studentIds, @RequestParam Boolean withDict) {
|
||||
@@ -206,6 +221,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param withDict 是否包含字典关联。
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentDto> getById(
|
||||
@RequestParam Long studentId, @RequestParam Boolean withDict) {
|
||||
@@ -218,6 +234,7 @@ 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);
|
||||
@@ -229,6 +246,7 @@ 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);
|
||||
@@ -240,6 +258,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, Student.INSTANCE);
|
||||
@@ -251,6 +270,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, Student.INSTANCE);
|
||||
@@ -262,6 +282,7 @@ 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) {
|
||||
return super.baseGetBy(queryParam, Student.INSTANCE);
|
||||
@@ -273,6 +294,7 @@ 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);
|
||||
@@ -284,6 +306,7 @@ 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);
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.courseclassservice.model.AreaCode;
|
||||
* 行政区划数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface AreaCodeMapper extends BaseDaoMapper<AreaCode> {
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.courseclassservice.model.ClassCourse;
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface ClassCourseMapper extends BaseDaoMapper<ClassCourse> {
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.courseclassservice.model.ClassStudent;
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface ClassStudentMapper extends BaseDaoMapper<ClassStudent> {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 课程数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface CourseMapper extends BaseDaoMapper<Course> {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.courseclassservice.model.Grade;
|
||||
* 年级数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface GradeMapper extends BaseDaoMapper<Grade> {
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.courseclassservice.model.MaterialEdition;
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface MaterialEditionMapper extends BaseDaoMapper<MaterialEdition> {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 校区数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SchoolInfoMapper extends BaseDaoMapper<SchoolInfo> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 班级数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface StudentClassMapper extends BaseDaoMapper<StudentClass> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 学生数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface StudentMapper extends BaseDaoMapper<Student> {
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</if>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -98,7 +98,7 @@
|
||||
AND zz_class_course.course_id = zz_course.course_id
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -113,7 +113,7 @@
|
||||
WHERE zz_class_course.class_id = #{classId} AND zz_class_course.course_id = zz_course.course_id)
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</if>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</if>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</if>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -98,7 +98,7 @@
|
||||
AND zz_class_student.student_id = zz_student.student_id
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -113,7 +113,7 @@
|
||||
WHERE zz_class_student.class_id = #{classId} AND zz_class_student.student_id = zz_student.student_id)
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.persistence.*;
|
||||
* 行政区划实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_area_code")
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.validation.constraints.*;
|
||||
* ClassCourse实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_class_course")
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.validation.constraints.*;
|
||||
* ClassStudent实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_class_student")
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Map;
|
||||
* Course实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_course")
|
||||
|
||||
@@ -10,7 +10,7 @@ import javax.validation.constraints.*;
|
||||
* Grade实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_grade")
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.validation.constraints.*;
|
||||
* MaterialEdition实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_material_edition")
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Map;
|
||||
* SchoolInfo实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_school_info")
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* Student实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_student")
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* StudentClass实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_class")
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
* 行政区划的Service类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class AreaCodeService extends BaseDictService<AreaCode, AreaCodeDto, Long> {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.*;
|
||||
* 课程数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class CourseService extends BaseService<Course, CourseDto, Long> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import javax.annotation.PostConstruct;
|
||||
* 年级数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class GradeService extends BaseDictService<Grade, GradeDto, Integer> {
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.*;
|
||||
* 校区数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SchoolInfoService extends BaseService<SchoolInfo, SchoolInfoDto, Long> {
|
||||
@@ -77,7 +77,6 @@ public class SchoolInfoService extends BaseService<SchoolInfo, SchoolInfoDto, Lo
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean remove(Long schoolId) {
|
||||
return schoolInfoMapper.deleteByPrimaryKey(schoolId) != 0;
|
||||
// 这里可继续删除关联数据。
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.*;
|
||||
* 班级数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentClassService extends BaseService<StudentClass, StudentClassDto, Long> {
|
||||
@@ -102,7 +102,6 @@ public class StudentClassService extends BaseService<StudentClass, StudentClassD
|
||||
if (studentClassMapper.updateByExampleSelective(deletedObject, studentClassExample) == 0) {
|
||||
return false;
|
||||
}
|
||||
// 这里可继续删除关联数据。
|
||||
// 开始删除多对多子表的关联
|
||||
ClassCourse classCourse = new ClassCourse();
|
||||
classCourse.setClassId(classId);
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.*;
|
||||
* 学生数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentService extends BaseService<Student, StudentDto, Long> {
|
||||
|
||||
@@ -59,6 +59,9 @@
|
||||
<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