mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:集成knife4j
This commit is contained in:
@@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* 应用服务启动类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class MyApplication {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orange.demo.app.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.orange.demo.app.model.AreaCode;
|
||||
import com.orange.demo.app.service.AreaCodeService;
|
||||
@@ -17,8 +18,9 @@ import java.util.*;
|
||||
* 行政区划数据访问接口类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "行政区划数据访问接口")
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/areaCode")
|
||||
public class AreaCodeController {
|
||||
|
||||
@@ -16,8 +16,9 @@ import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.cache.SessionCacheHelper;
|
||||
import com.orange.demo.config.ApplicationConfig;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -30,8 +31,9 @@ import javax.validation.groups.Default;
|
||||
* 课程数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "课程数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/course")
|
||||
@@ -52,8 +54,16 @@ public class CourseController {
|
||||
* @param course 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"course.courseId",
|
||||
"course.priceStart",
|
||||
"course.priceEnd",
|
||||
"course.classHourStart",
|
||||
"course.classHourEnd",
|
||||
"course.createTimeStart",
|
||||
"course.createTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody Course course) {
|
||||
public ResponseResult<Long> add(@MyRequestBody Course course) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(course);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -65,9 +75,7 @@ public class CourseController {
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,6 +84,13 @@ public class CourseController {
|
||||
* @param course 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"course.priceStart",
|
||||
"course.priceEnd",
|
||||
"course.classHourStart",
|
||||
"course.classHourEnd",
|
||||
"course.createTimeStart",
|
||||
"course.createTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody Course course) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(course, Default.class, UpdateGroup.class);
|
||||
@@ -136,7 +151,7 @@ public class CourseController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<Course>> list(
|
||||
@MyRequestBody Course courseFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -18,8 +18,9 @@ import java.util.*;
|
||||
* 课程统计操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "课程统计管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/courseTransStats")
|
||||
@@ -37,7 +38,7 @@ public class CourseTransStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<CourseTransStats>> list(
|
||||
@MyRequestBody CourseTransStats courseTransStatsFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -59,7 +60,7 @@ public class CourseTransStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<JSONObject> listWithGroup(
|
||||
public ResponseResult<MyPageData<CourseTransStats>> listWithGroup(
|
||||
@MyRequestBody CourseTransStats courseTransStatsFilter,
|
||||
@MyRequestBody MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
|
||||
@@ -8,7 +8,8 @@ import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -21,8 +22,9 @@ import java.util.*;
|
||||
* 年级操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "年级管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/grade")
|
||||
@@ -37,16 +39,15 @@ public class GradeController {
|
||||
* @param grade 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"grade.gradeId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody Grade grade) {
|
||||
public ResponseResult<Integer> add(@MyRequestBody Grade grade) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(grade);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
grade = gradeService.saveNew(grade);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("gradeId", grade.getGradeId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(grade.getGradeId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,8 +9,9 @@ import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,8 +22,9 @@ import javax.validation.groups.Default;
|
||||
* 校区数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "校区数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/schoolInfo")
|
||||
@@ -37,8 +39,9 @@ public class SchoolInfoController {
|
||||
* @param schoolInfo 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"schoolInfo.userId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SchoolInfo schoolInfo) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SchoolInfo schoolInfo) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfo);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -50,9 +53,7 @@ public class SchoolInfoController {
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,7 +122,7 @@ public class SchoolInfoController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<SchoolInfo>> list(
|
||||
@MyRequestBody SchoolInfo schoolInfoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -18,8 +18,9 @@ import java.util.*;
|
||||
* 学生行为统计操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "学生行为统计管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/studentActionStats")
|
||||
@@ -37,7 +38,7 @@ public class StudentActionStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<StudentActionStats>> list(
|
||||
@MyRequestBody StudentActionStats studentActionStatsFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -59,7 +60,7 @@ public class StudentActionStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<JSONObject> listWithGroup(
|
||||
public ResponseResult<MyPageData<StudentActionStats>> listWithGroup(
|
||||
@MyRequestBody StudentActionStats studentActionStatsFilter,
|
||||
@MyRequestBody MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
|
||||
@@ -8,8 +8,9 @@ import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -20,8 +21,9 @@ import javax.validation.groups.Default;
|
||||
* 学生行为流水操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "学生行为流水管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/studentActionTrans")
|
||||
@@ -36,8 +38,12 @@ public class StudentActionTransController {
|
||||
* @param studentActionTrans 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"studentActionTrans.transId",
|
||||
"studentActionTrans.createTimeStart",
|
||||
"studentActionTrans.createTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody StudentActionTrans studentActionTrans) {
|
||||
public ResponseResult<Long> add(@MyRequestBody StudentActionTrans studentActionTrans) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTrans);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -49,9 +55,7 @@ public class StudentActionTransController {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
}
|
||||
studentActionTrans = studentActionTransService.saveNew(studentActionTrans);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("transId", studentActionTrans.getTransId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(studentActionTrans.getTransId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +64,9 @@ public class StudentActionTransController {
|
||||
* @param studentActionTrans 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"studentActionTrans.createTimeStart",
|
||||
"studentActionTrans.createTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody StudentActionTrans studentActionTrans) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTrans, Default.class, UpdateGroup.class);
|
||||
@@ -120,7 +127,7 @@ public class StudentActionTransController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<StudentActionTrans>> list(
|
||||
@MyRequestBody StudentActionTrans studentActionTransFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
|
||||
@@ -8,8 +8,9 @@ import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,8 +22,9 @@ import java.util.stream.Collectors;
|
||||
* 班级数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "班级数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/studentClass")
|
||||
@@ -41,8 +43,9 @@ public class StudentClassController {
|
||||
* @param studentClass 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"studentClass.userId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody StudentClass studentClass) {
|
||||
public ResponseResult<Long> add(@MyRequestBody StudentClass studentClass) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClass);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -54,9 +57,7 @@ public class StudentClassController {
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +126,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<StudentClass>> list(
|
||||
@MyRequestBody StudentClass studentClassFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -165,7 +166,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassCourse")
|
||||
public ResponseResult<JSONObject> listNotInClassCourse(
|
||||
public ResponseResult<MyPageData<Course>> listNotInClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Course courseFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -180,8 +181,7 @@ public class StudentClassController {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> resultList =
|
||||
courseService.getNotInCourseListByClassId(classId, courseFilter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(resultList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +194,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassCourse")
|
||||
public ResponseResult<JSONObject> listClassCourse(
|
||||
public ResponseResult<MyPageData<Course>> listClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Course courseFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -209,8 +209,7 @@ public class StudentClassController {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> resultList =
|
||||
courseService.getCourseListByClassId(classId, courseFilter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(resultList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
private ResponseResult<Void> doClassCourseVerify(Long classId) {
|
||||
@@ -320,7 +319,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassStudent")
|
||||
public ResponseResult<JSONObject> listNotInClassStudent(
|
||||
public ResponseResult<MyPageData<Student>> listNotInClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Student studentFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -335,8 +334,7 @@ public class StudentClassController {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> resultList =
|
||||
studentService.getNotInStudentListByClassId(classId, studentFilter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(resultList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,7 +347,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassStudent")
|
||||
public ResponseResult<JSONObject> listClassStudent(
|
||||
public ResponseResult<MyPageData<Student>> listClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Student studentFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -364,8 +362,7 @@ public class StudentClassController {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> resultList =
|
||||
studentService.getStudentListByClassId(classId, studentFilter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(resultList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
private ResponseResult<Void> doClassStudentVerify(Long classId) {
|
||||
|
||||
@@ -9,8 +9,9 @@ import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,8 +22,9 @@ import javax.validation.groups.Default;
|
||||
* 学生数据操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "学生数据管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/app/student")
|
||||
@@ -37,8 +39,15 @@ public class StudentController {
|
||||
* @param student 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"student.studentId",
|
||||
"student.searchString",
|
||||
"student.birthdayStart",
|
||||
"student.birthdayEnd",
|
||||
"student.registerTimeStart",
|
||||
"student.registerTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody Student student) {
|
||||
public ResponseResult<Long> add(@MyRequestBody Student student) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(student);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -50,9 +59,7 @@ public class StudentController {
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +68,12 @@ public class StudentController {
|
||||
* @param student 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"student.searchString",
|
||||
"student.birthdayStart",
|
||||
"student.birthdayEnd",
|
||||
"student.registerTimeStart",
|
||||
"student.registerTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody Student student) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(student, Default.class, UpdateGroup.class);
|
||||
@@ -121,7 +134,7 @@ public class StudentController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<Student>> list(
|
||||
@MyRequestBody Student studentFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.app.model.AreaCode;
|
||||
* 行政区划数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface AreaCodeMapper extends BaseDaoMapper<AreaCode> {
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.app.model.ClassCourse;
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface ClassCourseMapper extends BaseDaoMapper<ClassCourse> {
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.app.model.ClassStudent;
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface ClassStudentMapper extends BaseDaoMapper<ClassStudent> {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 课程数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface CourseMapper extends BaseDaoMapper<Course> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 课程统计数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface CourseTransStatsMapper extends BaseDaoMapper<CourseTransStats> {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.app.model.Grade;
|
||||
* 年级数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface GradeMapper extends BaseDaoMapper<Grade> {
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.app.model.MaterialEdition;
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface MaterialEditionMapper extends BaseDaoMapper<MaterialEdition> {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 校区数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SchoolInfoMapper extends BaseDaoMapper<SchoolInfo> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 学生行为统计数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface StudentActionStatsMapper extends BaseDaoMapper<StudentActionStats> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 学生行为流水数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface StudentActionTransMapper extends BaseDaoMapper<StudentActionTrans> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 班级数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface StudentClassMapper extends BaseDaoMapper<StudentClass> {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 学生数据数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface StudentMapper extends BaseDaoMapper<Student> {
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -79,7 +79,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>
|
||||
@@ -94,7 +94,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>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
GROUP BY ${groupBy}) zz_course_trans_stats
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -53,7 +53,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
GROUP BY ${groupBy}) zz_student_action_stats
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -79,7 +79,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -79,7 +79,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>
|
||||
@@ -94,7 +94,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>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.orange.demo.app.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -8,8 +10,9 @@ import javax.persistence.*;
|
||||
* 行政区划实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("行政区划实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_area_code")
|
||||
public class AreaCode {
|
||||
@@ -17,6 +20,7 @@ public class AreaCode {
|
||||
/**
|
||||
* 行政区划主键Id
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划主键Id", required = true)
|
||||
@Id
|
||||
@Column(name = "area_id")
|
||||
private Long areaId;
|
||||
@@ -24,18 +28,21 @@ public class AreaCode {
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划名称")
|
||||
@Column(name = "area_name")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划级别")
|
||||
@Column(name = "area_level")
|
||||
private Integer areaLevel;
|
||||
|
||||
/**
|
||||
* 父级行政区划Id
|
||||
*/
|
||||
@ApiModelProperty(value = "父级行政区划Id")
|
||||
@Column(name = "parent_id")
|
||||
private Long parentId;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -9,8 +11,9 @@ import javax.validation.constraints.*;
|
||||
* ClassCourse实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("ClassCourse实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_class_course")
|
||||
public class ClassCourse {
|
||||
@@ -18,6 +21,7 @@ public class ClassCourse {
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "class_id")
|
||||
@@ -26,6 +30,7 @@ public class ClassCourse {
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程Id", required = true)
|
||||
@NotNull(message = "数据验证失败,课程Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "course_id")
|
||||
@@ -34,6 +39,7 @@ public class ClassCourse {
|
||||
/**
|
||||
* 课程顺序(数值越小越靠前)。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程顺序(数值越小越靠前)", required = true)
|
||||
@NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "course_order")
|
||||
private Integer courseOrder;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -9,8 +11,9 @@ import javax.validation.constraints.*;
|
||||
* ClassStudent实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("ClassStudent实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_class_student")
|
||||
public class ClassStudent {
|
||||
@@ -18,6 +21,7 @@ public class ClassStudent {
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "class_id")
|
||||
@@ -26,6 +30,7 @@ public class ClassStudent {
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "student_id")
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -20,8 +22,9 @@ import java.util.Map;
|
||||
* Course实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("Course实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_course")
|
||||
public class Course {
|
||||
@@ -29,6 +32,7 @@ public class Course {
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "course_id")
|
||||
@@ -37,6 +41,7 @@ public class Course {
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,课程名称不能为空!")
|
||||
@Column(name = "course_name")
|
||||
private String courseName;
|
||||
@@ -44,17 +49,20 @@ public class Course {
|
||||
/**
|
||||
* 课程价格。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程价格", required = true)
|
||||
@NotNull(message = "数据验证失败,课程价格不能为空!")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 课程描述。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)", required = true)
|
||||
@NotNull(message = "数据验证失败,课程难度不能为空!")
|
||||
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
|
||||
private Integer difficulty;
|
||||
@@ -62,6 +70,7 @@ public class Course {
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||
@Column(name = "grade_id")
|
||||
private Integer gradeId;
|
||||
@@ -69,6 +78,7 @@ public class Course {
|
||||
/**
|
||||
* 学科Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学科Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属学科不能为空!")
|
||||
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
|
||||
@Column(name = "subject_id")
|
||||
@@ -77,6 +87,7 @@ public class Course {
|
||||
/**
|
||||
* 课时数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "课时数量", required = true)
|
||||
@NotNull(message = "数据验证失败,课时数量不能为空!")
|
||||
@Column(name = "class_hour")
|
||||
private Integer classHour;
|
||||
@@ -84,6 +95,7 @@ public class Course {
|
||||
/**
|
||||
* 多张课程图片地址。
|
||||
*/
|
||||
@ApiModelProperty(value = "多张课程图片地址", required = true)
|
||||
@UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
|
||||
@NotBlank(message = "数据验证失败,课程图片不能为空!")
|
||||
@Column(name = "picture_url")
|
||||
@@ -92,63 +104,74 @@ public class Course {
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户Id")
|
||||
@Column(name = "create_user_id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最后修改时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "最后修改时间")
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* price 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "price 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private BigDecimal priceStart;
|
||||
|
||||
/**
|
||||
* price 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "price 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private BigDecimal priceEnd;
|
||||
|
||||
/**
|
||||
* classHour 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "classHour 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private Integer classHourStart;
|
||||
|
||||
/**
|
||||
* classHour 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "classHour 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private Integer classHourEnd;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String createTimeStart;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String createTimeEnd;
|
||||
|
||||
/**
|
||||
* courseId 的多对多关联表数据对象。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Transient
|
||||
private ClassCourse classCourse;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveServiceName = "gradeService",
|
||||
@@ -158,12 +181,14 @@ public class Course {
|
||||
@Transient
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "difficulty",
|
||||
constantDictClass = CourseDifficult.class)
|
||||
@Transient
|
||||
private Map<String, Object> difficultyDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "subjectId",
|
||||
constantDictClass = Subject.class)
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -16,8 +18,9 @@ import java.util.Map;
|
||||
* CourseTransStats实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("CourseTransStats实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_course_trans_stats")
|
||||
public class CourseTransStats {
|
||||
@@ -25,6 +28,7 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -34,6 +38,7 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
@ApiModelProperty(value = "统计日期", required = true)
|
||||
@NotNull(message = "数据验证失败,统计日期不能为空!")
|
||||
@Column(name = "stats_date")
|
||||
private Date statsDate;
|
||||
@@ -41,6 +46,7 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 科目Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "科目Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属科目不能为空!")
|
||||
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!")
|
||||
@Column(name = "subject_id")
|
||||
@@ -49,6 +55,7 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||
@Column(name = "grade_id")
|
||||
private Integer gradeId;
|
||||
@@ -56,12 +63,14 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级名称")
|
||||
@Column(name = "grade_name")
|
||||
private String gradeName;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程Id", required = true)
|
||||
@NotNull(message = "数据验证失败,课程Id不能为空!")
|
||||
@Column(name = "course_id")
|
||||
private Long courseId;
|
||||
@@ -69,12 +78,14 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程名称")
|
||||
@Column(name = "course_name")
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 学生上课次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生上课次数", required = true)
|
||||
@NotNull(message = "数据验证失败,上课次数不能为空!")
|
||||
@Column(name = "student_attend_count")
|
||||
private Integer studentAttendCount;
|
||||
@@ -82,6 +93,7 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 学生献花数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生献花数量", required = true)
|
||||
@NotNull(message = "数据验证失败,献花数量不能为空!")
|
||||
@Column(name = "student_flower_amount")
|
||||
private Integer studentFlowerAmount;
|
||||
@@ -89,6 +101,7 @@ public class CourseTransStats {
|
||||
/**
|
||||
* 学生献花次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生献花次数", required = true)
|
||||
@NotNull(message = "数据验证失败,献花次数不能为空!")
|
||||
@Column(name = "student_flower_count")
|
||||
private Integer studentFlowerCount;
|
||||
@@ -96,15 +109,18 @@ public class CourseTransStats {
|
||||
/**
|
||||
* statsDate 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String statsDateStart;
|
||||
|
||||
/**
|
||||
* statsDate 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String statsDateEnd;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveServiceName = "gradeService",
|
||||
@@ -114,6 +130,7 @@ public class CourseTransStats {
|
||||
@Transient
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "subjectId",
|
||||
constantDictClass = Subject.class)
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.orange.demo.app.model;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -11,8 +13,9 @@ import javax.validation.constraints.*;
|
||||
* Grade实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("Grade实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_grade")
|
||||
public class Grade {
|
||||
@@ -20,6 +23,7 @@ public class Grade {
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -29,6 +33,7 @@ public class Grade {
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,年级名称不能为空!")
|
||||
@Column(name = "grade_name")
|
||||
private String gradeName;
|
||||
@@ -36,6 +41,7 @@ public class Grade {
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
private Integer status;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -9,8 +11,9 @@ import javax.validation.constraints.*;
|
||||
* MaterialEdition实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("MaterialEdition实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_material_edition")
|
||||
public class MaterialEdition {
|
||||
@@ -18,6 +21,7 @@ public class MaterialEdition {
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -27,6 +31,7 @@ public class MaterialEdition {
|
||||
/**
|
||||
* 教材版本名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "教材版本名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,教材版本名称不能为空!")
|
||||
@Column(name = "edition_name")
|
||||
private String editionName;
|
||||
@@ -34,6 +39,7 @@ public class MaterialEdition {
|
||||
/**
|
||||
* 是否正在使用(0:不是,1:是)。
|
||||
*/
|
||||
@ApiModelProperty(value = "是否正在使用(0:不是,1:是)", required = true)
|
||||
@NotNull(message = "数据验证失败,是否正在使用(0:不是,1:是)不能为空!")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -12,8 +14,9 @@ import java.util.Map;
|
||||
* SchoolInfo实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("SchoolInfo实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_school_info")
|
||||
public class SchoolInfo {
|
||||
@@ -21,6 +24,7 @@ public class SchoolInfo {
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学校Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "school_id")
|
||||
@@ -29,6 +33,7 @@ public class SchoolInfo {
|
||||
/**
|
||||
* 学校名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,学校名称不能为空!")
|
||||
@Column(name = "school_name")
|
||||
private String schoolName;
|
||||
@@ -36,6 +41,7 @@ public class SchoolInfo {
|
||||
/**
|
||||
* 所在省Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在省Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||
@Column(name = "province_id")
|
||||
private Long provinceId;
|
||||
@@ -43,10 +49,12 @@ public class SchoolInfo {
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
||||
@Column(name = "city_id")
|
||||
private Long cityId;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "provinceId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
@@ -56,6 +64,7 @@ public class SchoolInfo {
|
||||
@Transient
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "cityId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -18,8 +20,9 @@ import java.util.Map;
|
||||
* Student实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("Student实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_student")
|
||||
public class Student {
|
||||
@@ -27,6 +30,7 @@ public class Student {
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "student_id")
|
||||
@@ -35,6 +39,7 @@ public class Student {
|
||||
/**
|
||||
* 登录手机。
|
||||
*/
|
||||
@ApiModelProperty(value = "登录手机", required = true)
|
||||
@NotBlank(message = "数据验证失败,手机号码不能为空!")
|
||||
@Column(name = "login_mobile")
|
||||
private String loginMobile;
|
||||
@@ -42,6 +47,7 @@ public class Student {
|
||||
/**
|
||||
* 学生姓名。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生姓名", required = true)
|
||||
@NotBlank(message = "数据验证失败,学生姓名不能为空!")
|
||||
@Column(name = "student_name")
|
||||
private String studentName;
|
||||
@@ -49,6 +55,7 @@ public class Student {
|
||||
/**
|
||||
* 所在省份Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在省份Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||
@Column(name = "province_id")
|
||||
private Long provinceId;
|
||||
@@ -56,6 +63,7 @@ public class Student {
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
||||
@Column(name = "city_id")
|
||||
private Long cityId;
|
||||
@@ -63,6 +71,7 @@ public class Student {
|
||||
/**
|
||||
* 区县Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "区县Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在区县不能为空!")
|
||||
@Column(name = "district_id")
|
||||
private Long districtId;
|
||||
@@ -70,6 +79,7 @@ public class Student {
|
||||
/**
|
||||
* 学生性别 (0: 女生 1: 男生)。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)", required = true)
|
||||
@NotNull(message = "数据验证失败,学生性别不能为空!")
|
||||
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,学生性别为无效值!")
|
||||
private Integer gender;
|
||||
@@ -77,12 +87,14 @@ public class Student {
|
||||
/**
|
||||
* 生日。
|
||||
*/
|
||||
@ApiModelProperty(value = "生日", required = true)
|
||||
@NotNull(message = "数据验证失败,出生日期不能为空!")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||
*/
|
||||
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)", required = true)
|
||||
@NotNull(message = "数据验证失败,经验等级不能为空!")
|
||||
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
|
||||
@Column(name = "experience_level")
|
||||
@@ -91,6 +103,7 @@ public class Student {
|
||||
/**
|
||||
* 总共充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "总共充值学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "total_coin")
|
||||
private Integer totalCoin;
|
||||
@@ -98,6 +111,7 @@ public class Student {
|
||||
/**
|
||||
* 可用学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "可用学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,剩余学币不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "left_coin")
|
||||
private Integer leftCoin;
|
||||
@@ -105,6 +119,7 @@ public class Student {
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,年级不能为空!")
|
||||
@Column(name = "grade_id")
|
||||
private Integer gradeId;
|
||||
@@ -112,6 +127,7 @@ public class Student {
|
||||
/**
|
||||
* 校区Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "校区Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
||||
@Column(name = "school_id")
|
||||
private Long schoolId;
|
||||
@@ -119,12 +135,14 @@ public class Student {
|
||||
/**
|
||||
* 注册时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
@Column(name = "register_time")
|
||||
private Date registerTime;
|
||||
|
||||
/**
|
||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)", required = true)
|
||||
@NotNull(message = "数据验证失败,学生状态不能为空!", groups = {UpdateGroup.class})
|
||||
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,学生状态为无效值!")
|
||||
private Integer status;
|
||||
@@ -132,33 +150,39 @@ public class Student {
|
||||
/**
|
||||
* birthday 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "birthday 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String birthdayStart;
|
||||
|
||||
/**
|
||||
* birthday 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "birthday 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String birthdayEnd;
|
||||
|
||||
/**
|
||||
* registerTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "registerTime 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String registerTimeStart;
|
||||
|
||||
/**
|
||||
* registerTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "registerTime 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String registerTimeEnd;
|
||||
|
||||
/**
|
||||
* login_mobile / student_name LIKE搜索字符串。
|
||||
*/
|
||||
@ApiModelProperty(value = "LIKE模糊搜索字符串")
|
||||
@Transient
|
||||
private String searchString;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "provinceId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
@@ -168,6 +192,7 @@ public class Student {
|
||||
@Transient
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "cityId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
@@ -177,6 +202,7 @@ public class Student {
|
||||
@Transient
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "districtId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
@@ -186,6 +212,7 @@ public class Student {
|
||||
@Transient
|
||||
private Map<String, Object> districtIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveServiceName = "gradeService",
|
||||
@@ -195,6 +222,7 @@ public class Student {
|
||||
@Transient
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "schoolId",
|
||||
slaveServiceName = "schoolInfoService",
|
||||
@@ -204,18 +232,21 @@ public class Student {
|
||||
@Transient
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "gender",
|
||||
constantDictClass = Gender.class)
|
||||
@Transient
|
||||
private Map<String, Object> genderDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "experienceLevel",
|
||||
constantDictClass = ExpLevel.class)
|
||||
@Transient
|
||||
private Map<String, Object> experienceLevelDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "status",
|
||||
constantDictClass = StudentStatus.class)
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -13,8 +15,9 @@ import java.util.Map;
|
||||
* StudentActionStats实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("StudentActionStats实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_student_action_stats")
|
||||
public class StudentActionStats {
|
||||
@@ -22,6 +25,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "stats_id")
|
||||
@@ -30,6 +34,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
@ApiModelProperty(value = "统计日期", required = true)
|
||||
@NotNull(message = "数据验证失败,统计日期不能为空!")
|
||||
@Column(name = "stats_date")
|
||||
private Date statsDate;
|
||||
@@ -37,12 +42,14 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 统计小时。
|
||||
*/
|
||||
@ApiModelProperty(value = "统计小时")
|
||||
@Column(name = "stats_month")
|
||||
private Date statsMonth;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||
@Column(name = "grade_id")
|
||||
private Integer gradeId;
|
||||
@@ -50,6 +57,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 学生所在省Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生所在省Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||
@Column(name = "province_id")
|
||||
private Long provinceId;
|
||||
@@ -57,6 +65,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 学生所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生所在城市Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在城市不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "city_id")
|
||||
private Long cityId;
|
||||
@@ -64,6 +73,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购课学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购课学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,购课学币数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_course_amount")
|
||||
private Integer buyCourseAmount;
|
||||
@@ -71,6 +81,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买课程次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买课程次数", required = true)
|
||||
@NotNull(message = "数据验证失败,购买课程次数不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_course_count")
|
||||
private Integer buyCourseCount;
|
||||
@@ -78,6 +89,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买视频学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买视频学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,购买视频学币数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_video_amount")
|
||||
private Integer buyVideoAmount;
|
||||
@@ -85,6 +97,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买视频次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买视频次数", required = true)
|
||||
@NotNull(message = "数据验证失败,购买视频次数不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_video_count")
|
||||
private Integer buyVideoCount;
|
||||
@@ -92,6 +105,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买作业学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买作业学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,购买作业学币数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_paper_amount")
|
||||
private Integer buyPaperAmount;
|
||||
@@ -99,6 +113,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买作业次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买作业次数", required = true)
|
||||
@NotNull(message = "数据验证失败,购买作业次数不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_paper_count")
|
||||
private Integer buyPaperCount;
|
||||
@@ -106,6 +121,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花数量", required = true)
|
||||
@NotNull(message = "数据验证失败,购买献花数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_flower_amount")
|
||||
private Integer buyFlowerAmount;
|
||||
@@ -113,6 +129,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买献花次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花次数", required = true)
|
||||
@NotNull(message = "数据验证失败,购买献花次数不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "buy_flower_count")
|
||||
private Integer buyFlowerCount;
|
||||
@@ -120,6 +137,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "充值学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,充值学币数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "recharge_coin_amount")
|
||||
private Integer rechargeCoinAmount;
|
||||
@@ -127,6 +145,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 充值学币次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "充值学币次数", required = true)
|
||||
@NotNull(message = "数据验证失败,充值学币次数不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "recharge_coin_count")
|
||||
private Integer rechargeCoinCount;
|
||||
@@ -134,6 +153,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 线下课程上课次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "线下课程上课次数", required = true)
|
||||
@NotNull(message = "数据验证失败,线下课程上课次数不能为空!")
|
||||
@Column(name = "do_course_count")
|
||||
private Integer doCourseCount;
|
||||
@@ -141,6 +161,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 观看视频次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "观看视频次数", required = true)
|
||||
@NotNull(message = "数据验证失败,观看视频次数不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "watch_video_count")
|
||||
private Integer watchVideoCount;
|
||||
@@ -148,6 +169,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 购买献花消费学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花消费学币数量", required = true)
|
||||
@NotNull(message = "数据验证失败,购买献花消费学币数量不能为空!")
|
||||
@Column(name = "watch_video_total_second")
|
||||
private Integer watchVideoTotalSecond;
|
||||
@@ -155,6 +177,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 做题数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "做题数量", required = true)
|
||||
@NotNull(message = "数据验证失败,做题数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "do_exercise_count")
|
||||
private Integer doExerciseCount;
|
||||
@@ -162,6 +185,7 @@ public class StudentActionStats {
|
||||
/**
|
||||
* 做题正确的数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "做题正确的数量", required = true)
|
||||
@NotNull(message = "数据验证失败,做题正确的数量不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "do_exercise_correct_count")
|
||||
private Integer doExerciseCorrectCount;
|
||||
@@ -169,15 +193,18 @@ public class StudentActionStats {
|
||||
/**
|
||||
* statsDate 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String statsDateStart;
|
||||
|
||||
/**
|
||||
* statsDate 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String statsDateEnd;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveServiceName = "gradeService",
|
||||
@@ -187,6 +214,7 @@ public class StudentActionStats {
|
||||
@Transient
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "provinceId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
@@ -196,6 +224,7 @@ public class StudentActionStats {
|
||||
@Transient
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "cityId",
|
||||
slaveServiceName = "areaCodeService",
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -17,8 +19,9 @@ import java.util.Map;
|
||||
* StudentActionTrans实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("StudentActionTrans实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_student_action_trans")
|
||||
public class StudentActionTrans {
|
||||
@@ -26,6 +29,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id", required = true)
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "trans_id")
|
||||
@@ -34,6 +38,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学生Id不能为空!")
|
||||
@Column(name = "student_id")
|
||||
private Long studentId;
|
||||
@@ -41,6 +46,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 学生名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,学生名称不能为空!")
|
||||
@Column(name = "student_name")
|
||||
private String studentName;
|
||||
@@ -48,6 +54,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 学生校区。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生校区", required = true)
|
||||
@NotNull(message = "数据验证失败,学生校区不能为空!")
|
||||
@Column(name = "school_id")
|
||||
private Long schoolId;
|
||||
@@ -55,6 +62,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学生年级不能为空!")
|
||||
@Column(name = "grade_id")
|
||||
private Integer gradeId;
|
||||
@@ -62,6 +70,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||
*/
|
||||
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)", required = true)
|
||||
@NotNull(message = "数据验证失败,行为类型不能为空!")
|
||||
@ConstDictRef(constDictClass = StudentActionType.class, message = "数据验证失败,行为类型为无效值!")
|
||||
@Column(name = "action_type")
|
||||
@@ -70,6 +79,7 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||
*/
|
||||
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)", required = true)
|
||||
@NotNull(message = "数据验证失败,设备类型不能为空!")
|
||||
@ConstDictRef(constDictClass = DeviceType.class, message = "数据验证失败,设备类型为无效值!")
|
||||
@Column(name = "device_type")
|
||||
@@ -78,48 +88,56 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* 看视频秒数。
|
||||
*/
|
||||
@ApiModelProperty(value = "看视频秒数")
|
||||
@Column(name = "watch_video_seconds")
|
||||
private Integer watchVideoSeconds;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花数量")
|
||||
@Column(name = "flower_count")
|
||||
private Integer flowerCount;
|
||||
|
||||
/**
|
||||
* 购买作业数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买作业数量")
|
||||
@Column(name = "paper_count")
|
||||
private Integer paperCount;
|
||||
|
||||
/**
|
||||
* 购买视频数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买视频数量")
|
||||
@Column(name = "video_count")
|
||||
private Integer videoCount;
|
||||
|
||||
/**
|
||||
* 购买课程数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买课程数量")
|
||||
@Column(name = "course_count")
|
||||
private Integer courseCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "充值学币数量")
|
||||
@Column(name = "coin_count")
|
||||
private Integer coinCount;
|
||||
|
||||
/**
|
||||
* 做题是否正确标记。
|
||||
*/
|
||||
@ApiModelProperty(value = "做题是否正确标记")
|
||||
@Column(name = "exercise_correct_flag")
|
||||
private Integer exerciseCorrectFlag;
|
||||
|
||||
/**
|
||||
* 发生时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "发生时间", required = true)
|
||||
@NotNull(message = "数据验证失败,发生时间不能为空!")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
@@ -127,15 +145,18 @@ public class StudentActionTrans {
|
||||
/**
|
||||
* createTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String createTimeStart;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String createTimeEnd;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "schoolId",
|
||||
slaveServiceName = "schoolInfoService",
|
||||
@@ -145,6 +166,7 @@ public class StudentActionTrans {
|
||||
@Transient
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveServiceName = "gradeService",
|
||||
@@ -154,12 +176,14 @@ public class StudentActionTrans {
|
||||
@Transient
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "actionType",
|
||||
constantDictClass = StudentActionType.class)
|
||||
@Transient
|
||||
private Map<String, Object> actionTypeDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "deviceType",
|
||||
constantDictClass = DeviceType.class)
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -18,8 +20,9 @@ import java.util.Map;
|
||||
* StudentClass实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("StudentClass实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_class")
|
||||
public class StudentClass {
|
||||
@@ -27,6 +30,7 @@ public class StudentClass {
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级Id", required = true)
|
||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "class_id")
|
||||
@@ -35,6 +39,7 @@ public class StudentClass {
|
||||
/**
|
||||
* 班级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,班级名称不能为空!")
|
||||
@Column(name = "class_name")
|
||||
private String className;
|
||||
@@ -42,6 +47,7 @@ public class StudentClass {
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
||||
@Column(name = "school_id")
|
||||
private Long schoolId;
|
||||
@@ -49,6 +55,7 @@ public class StudentClass {
|
||||
/**
|
||||
* 学生班长Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生班长Id", required = true)
|
||||
@NotNull(message = "数据验证失败,学生班长不能为空!")
|
||||
@Column(name = "leader_id")
|
||||
private Long leaderId;
|
||||
@@ -56,6 +63,7 @@ public class StudentClass {
|
||||
/**
|
||||
* 已完成课时数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "已完成课时数量", required = true)
|
||||
@NotNull(message = "数据验证失败,已完成课时不能为空!", groups = {UpdateGroup.class})
|
||||
@Column(name = "finish_class_hour")
|
||||
private Integer finishClassHour;
|
||||
@@ -63,6 +71,7 @@ public class StudentClass {
|
||||
/**
|
||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)", required = true)
|
||||
@NotNull(message = "数据验证失败,班级级别不能为空!")
|
||||
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
|
||||
@Column(name = "class_level")
|
||||
@@ -71,22 +80,26 @@ public class StudentClass {
|
||||
/**
|
||||
* 创建用户。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户")
|
||||
@Column(name = "create_user_id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 班级创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "schoolId",
|
||||
slaveServiceName = "schoolInfoService",
|
||||
@@ -96,6 +109,7 @@ public class StudentClass {
|
||||
@Transient
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "leaderId",
|
||||
slaveServiceName = "studentService",
|
||||
@@ -105,6 +119,7 @@ public class StudentClass {
|
||||
@Transient
|
||||
private Map<String, Object> leaderIdDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "classLevel",
|
||||
constantDictClass = ClassLevel.class)
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 班级级别常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class ClassLevel {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 班级状态常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class ClassStatus {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 课程难度常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class CourseDifficult {
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
* 行政区划的Service类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class AreaCodeService extends BaseDictService<AreaCode, Long> {
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.*;
|
||||
* 课程数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class CourseService extends BaseService<Course, Long> {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.*;
|
||||
* 课程统计数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class CourseTransStatsService extends BaseService<CourseTransStats, Long> {
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
* 年级数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class GradeService extends BaseDictService<Grade, Integer> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.*;
|
||||
* 校区数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
|
||||
@@ -75,7 +75,6 @@ public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean remove(Long schoolId) {
|
||||
return schoolInfoMapper.deleteByPrimaryKey(schoolId) != 0;
|
||||
// 这里可继续删除关联数据。
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.*;
|
||||
* 学生行为统计数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class StudentActionStatsService extends BaseService<StudentActionStats, Long> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.*;
|
||||
* 学生行为流水数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class StudentActionTransService extends BaseService<StudentActionTrans, Long> {
|
||||
@@ -77,7 +77,6 @@ public class StudentActionTransService extends BaseService<StudentActionTrans, L
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean remove(Long transId) {
|
||||
return studentActionTransMapper.deleteByPrimaryKey(transId) != 0;
|
||||
// 这里可继续删除关联数据。
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.*;
|
||||
* 班级数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class StudentClassService extends BaseService<StudentClass, Long> {
|
||||
@@ -65,9 +65,6 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
|
||||
if (studentClass.getFinishClassHour() == null) {
|
||||
studentClass.setFinishClassHour(0);
|
||||
}
|
||||
if (studentClass.getStatus() == null) {
|
||||
studentClass.setStatus(0);
|
||||
}
|
||||
studentClassMapper.insert(studentClass);
|
||||
return studentClass;
|
||||
}
|
||||
@@ -106,7 +103,6 @@ public class StudentClassService extends BaseService<StudentClass, Long> {
|
||||
if (studentClassMapper.updateByExampleSelective(deletedObject, studentClassExample) == 0) {
|
||||
return false;
|
||||
}
|
||||
// 这里可继续删除关联数据。
|
||||
// 开始删除多对多子表的关联
|
||||
ClassCourse classCourse = new ClassCourse();
|
||||
classCourse.setClassId(classId);
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.*;
|
||||
* 学生数据数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class StudentService extends BaseService<Student, Long> {
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* 应用程序自定义的程序属性配置文件。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@@ -24,7 +24,7 @@ public class ApplicationConfig {
|
||||
*/
|
||||
private String refreshedTokenHeaderKey;
|
||||
/**
|
||||
* token 加密用的密钥
|
||||
* token 加密用的密钥,该值的长度最少10个字符(过短会报错)。
|
||||
*/
|
||||
private String tokenSigningKey;
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ import javax.sql.DataSource;
|
||||
* 数据源配置Bean对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.nio.charset.StandardCharsets;
|
||||
* 这里主要配置Web的各种过滤器和监听器等Servlet容器组件。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Configuration
|
||||
public class FilterConfig {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
* 所有的项目拦截器都在这里集中配置
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Configuration
|
||||
public class InterceptorConfig implements WebMvcConfigurer {
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
|
||||
* 登录用户Token验证、生成和权限验证的拦截器。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthenticationInterceptor implements HandlerInterceptor {
|
||||
@@ -45,13 +45,13 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
|
||||
private SysPermService sysPermService =
|
||||
ApplicationContextHolder.getBean("sysPermService");
|
||||
|
||||
private static SysPermWhitelistService sysPermWhilelistService =
|
||||
private static SysPermWhitelistService sysPermWhitelistService =
|
||||
ApplicationContextHolder.getBean("sysPermWhitelistService");
|
||||
|
||||
private static Set<String> whitelistPermSet;
|
||||
|
||||
static {
|
||||
List<SysPermWhitelist> sysPermWhitelistList = sysPermWhilelistService.getAllList();
|
||||
List<SysPermWhitelist> sysPermWhitelistList = sysPermWhitelistService.getAllList();
|
||||
whitelistPermSet = sysPermWhitelistList.stream()
|
||||
.map(SysPermWhitelist::getPermUrl).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.config.ApplicationConfig;
|
||||
import com.orange.demo.upms.service.*;
|
||||
@@ -8,7 +12,6 @@ import com.orange.demo.upms.model.SysMenu;
|
||||
import com.orange.demo.upms.model.SysUser;
|
||||
import com.orange.demo.upms.model.constant.SysUserStatus;
|
||||
import com.orange.demo.upms.model.constant.SysUserType;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.annotation.NoAuthInterface;
|
||||
import com.orange.demo.common.core.constant.ApplicationConstant;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
@@ -28,8 +31,10 @@ import java.util.*;
|
||||
* 登录接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiSupport(order = 1)
|
||||
@Api(tags = "用户登录接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/login")
|
||||
@@ -57,6 +62,12 @@ public class LoginController {
|
||||
* @param password 密码。
|
||||
* @return 应答结果对象,其中包括JWT的Token数据,以及菜单列表。
|
||||
*/
|
||||
@ApiImplicitParams({
|
||||
// 这里包含密码密文,仅用于方便开发期间的接口测试,集成测试和发布阶段,需要将当前注解去掉。
|
||||
// 如果您重新生成了公钥和私钥,请替换password的缺省值。
|
||||
@ApiImplicitParam(name = "loginName", defaultValue = "admin"),
|
||||
@ApiImplicitParam(name = "password", defaultValue = "IP3ccke3GhH45iGHB5qP9p7iZw6xUyj28Ju10rnBiPKOI35sc%2BjI7%2FdsjOkHWMfUwGYGfz8ik31HC2Ruk%2Fhkd9f6RPULTHj7VpFdNdde2P9M4mQQnFBAiPM7VT9iW3RyCtPlJexQ3nAiA09OqG%2F0sIf1kcyveSrulxembARDbDo%3D")
|
||||
})
|
||||
@NoAuthInterface
|
||||
@GetMapping("/doLogin")
|
||||
public ResponseResult<JSONObject> doLogin(
|
||||
@@ -128,7 +139,7 @@ public class LoginController {
|
||||
*/
|
||||
@PostMapping("/changePassword")
|
||||
public ResponseResult<Void> changePassword(
|
||||
@MyRequestBody String oldPass, @MyRequestBody String newPass) throws Exception {
|
||||
@RequestParam String oldPass, @RequestParam String newPass) throws Exception {
|
||||
if (MyCommonUtil.existBlankArgument(oldPass, oldPass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.upms.model.SysMenu;
|
||||
import com.orange.demo.upms.service.SysMenuService;
|
||||
import com.orange.demo.upms.service.SysPermCodeService;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
@@ -22,8 +21,9 @@ import java.util.*;
|
||||
* 菜单管理接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "菜单管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/sysMenu")
|
||||
@@ -42,8 +42,9 @@ public class SysMenuController {
|
||||
* @return 应答结果对象,包含新增菜单的主键Id。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@ApiOperationSupport(ignoreParameters = {"sysMenu.menuId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SysMenu sysMenu, @MyRequestBody String permCodeIdListString) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SysMenu sysMenu, @MyRequestBody String permCodeIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysMenu);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -57,9 +58,7 @@ public class SysMenuController {
|
||||
permCodeIdSet = (Set<Long>) result.getData().get("permCodeIdSet");
|
||||
}
|
||||
sysMenuService.saveNew(sysMenu, permCodeIdSet);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("sysMenuId", sysMenu.getMenuId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(sysMenu.getMenuId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.upms.model.SysPermCode;
|
||||
import com.orange.demo.upms.service.SysPermCodeService;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.common.core.object.MyPageParam;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.util.MyPageUtil;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
@@ -25,8 +23,9 @@ import java.util.*;
|
||||
* 权限字管理接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "权限字管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/sysPermCode")
|
||||
@@ -43,8 +42,9 @@ public class SysPermCodeController {
|
||||
* @return 应答结果对象,包含新增权限字的主键Id。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@ApiOperationSupport(ignoreParameters = {"sysPermCode.permCodeId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SysPermCode sysPermCode, @MyRequestBody String permIdListString) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SysPermCode sysPermCode, @MyRequestBody String permIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermCode);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED);
|
||||
@@ -58,9 +58,7 @@ public class SysPermCodeController {
|
||||
permIdSet = (Set<Long>) result.getData().get("permIdSet");
|
||||
}
|
||||
sysPermCode = sysPermCodeService.saveNew(sysPermCode, permIdSet);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("sysPermCodeId", sysPermCode.getPermCodeId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(sysPermCode.getPermCodeId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +160,7 @@ public class SysPermCodeController {
|
||||
* @return 应答结果对象,包含该用户的全部权限资源列表。
|
||||
*/
|
||||
@PostMapping("/listAllPermCodesByUserFilter")
|
||||
public ResponseResult<JSONObject> listAllPermCodesByUserFilter(
|
||||
public ResponseResult<MyPageData<SysPermCode>> listAllPermCodesByUserFilter(
|
||||
@MyRequestBody String loginName,
|
||||
@MyRequestBody String permCode,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -172,9 +170,7 @@ public class SysPermCodeController {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
List<SysPermCode> permCodeList =
|
||||
sysPermCodeService.getUserPermCodeListByFilter(loginName, permCode);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(permCodeList);
|
||||
return ResponseResult.success(responseData);
|
||||
List<SysPermCode> permCodeList = sysPermCodeService.getUserPermCodeListByFilter(loginName, permCode);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(permCodeList));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.upms.model.SysPerm;
|
||||
import com.orange.demo.upms.model.SysPermModule;
|
||||
import com.orange.demo.upms.service.SysPermService;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.common.core.object.MyPageParam;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.util.MyPageUtil;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
@@ -25,8 +24,9 @@ import java.util.Map;
|
||||
* 权限资源管理接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "权限资源管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/sysPerm")
|
||||
@@ -41,8 +41,9 @@ public class SysPermController {
|
||||
* @param sysPerm 新增权限资源对象。
|
||||
* @return 应答结果对象,包含新增权限资源的主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"sysPerm.permId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SysPerm sysPerm) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SysPerm sysPerm) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPerm);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -52,9 +53,7 @@ public class SysPermController {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
sysPerm = sysPermService.saveNew(sysPerm);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("permId", sysPerm.getPermId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(sysPerm.getPermId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +129,7 @@ public class SysPermController {
|
||||
* @return 应答结果对象,包含权限资源列表。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(@MyRequestBody SysPerm sysPermFilter, @MyRequestBody MyPageParam pageParam) {
|
||||
public ResponseResult<MyPageData<SysPerm>> list(@MyRequestBody SysPerm sysPermFilter, @MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
@@ -148,7 +147,7 @@ public class SysPermController {
|
||||
* @return 应答结果对象,包含该用户的全部权限资源列表。
|
||||
*/
|
||||
@PostMapping("/listAllPermsByUserFilter")
|
||||
public ResponseResult<JSONObject> listAllPermsByUserFilter(
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listAllPermsByUserFilter(
|
||||
@MyRequestBody String loginName,
|
||||
@MyRequestBody Long moduleId,
|
||||
@MyRequestBody String url,
|
||||
@@ -161,8 +160,7 @@ public class SysPermController {
|
||||
}
|
||||
List<Map<String, Object>> userPermMapList =
|
||||
sysPermService.getUserPermListByFilter(loginName, moduleId, url);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(userPermMapList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(userPermMapList));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.upms.model.SysPerm;
|
||||
import com.orange.demo.upms.model.SysPermModule;
|
||||
import com.orange.demo.upms.service.SysPermModuleService;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
@@ -24,8 +25,9 @@ import java.util.Map;
|
||||
* 权限资源模块管理接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "权限资源模块管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/sysPermModule")
|
||||
@@ -40,8 +42,9 @@ public class SysPermModuleController {
|
||||
* @param sysPermModule 新增权限资源模块对象。
|
||||
* @return 应答结果对象,包含新增权限资源模块的主键Id。
|
||||
*/
|
||||
@ApiOperationSupport(ignoreParameters = {"sysPermModule.moduleId"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SysPermModule sysPermModule) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SysPermModule sysPermModule) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModule);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -52,9 +55,7 @@ public class SysPermModuleController {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_PARENT_ID_NOT_EXIST, errorMessage);
|
||||
}
|
||||
sysPermModuleService.saveNew(sysPermModule);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("permModuleId", sysPermModule.getModuleId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(sysPermModule.getModuleId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.upms.model.SysRole;
|
||||
@@ -11,11 +13,7 @@ import com.orange.demo.upms.service.SysUserService;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.MyOrderParam;
|
||||
import com.orange.demo.common.core.object.MyPageParam;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyPageUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -29,8 +27,9 @@ import java.util.stream.Collectors;
|
||||
* 角色管理接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "角色管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/sysRole")
|
||||
@@ -49,8 +48,9 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含新增角色的主键Id。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@ApiOperationSupport(ignoreParameters = {"sysRole.roleId", "sysRole.createTimeStart", "sysRole.createTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SysRole sysRole, @MyRequestBody String menuIdListString) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SysRole sysRole, @MyRequestBody String menuIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysRole);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -64,9 +64,7 @@ public class SysRoleController {
|
||||
menuIdSet = (Set<Long>) result.getData().get("menuIdSet");
|
||||
}
|
||||
sysRoleService.saveNew(sysRole, menuIdSet);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("roleId", sysRole.getRoleId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(sysRole.getRoleId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,6 +75,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@ApiOperationSupport(ignoreParameters = {"sysRole.createTimeStart", "sysRole.createTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody SysRole sysRole, @MyRequestBody String menuIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysRole, Default.class, UpdateGroup.class);
|
||||
@@ -130,7 +129,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含角色列表。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<SysRole>> list(
|
||||
@MyRequestBody SysRole sysRoleFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -171,7 +170,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含用户列表数据。
|
||||
*/
|
||||
@PostMapping("/listNotInUserRole")
|
||||
public ResponseResult<JSONObject> listNotInUserRole(
|
||||
public ResponseResult<MyPageData<SysUser>> listNotInUserRole(
|
||||
@MyRequestBody Long roleId,
|
||||
@MyRequestBody SysUser sysUserFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -186,8 +185,7 @@ public class SysRoleController {
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||
List<SysUser> resultList =
|
||||
sysUserService.getNotInSysUserListByRoleId(roleId, sysUserFilter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(resultList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,7 +198,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含用户列表数据。
|
||||
*/
|
||||
@PostMapping("/listUserRole")
|
||||
public ResponseResult<JSONObject> listUserRole(
|
||||
public ResponseResult<MyPageData<SysUser>> listUserRole(
|
||||
@MyRequestBody Long roleId,
|
||||
@MyRequestBody SysUser sysUserFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -214,8 +212,7 @@ public class SysRoleController {
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||
List<SysUser> resultList = sysUserService.getSysUserListByRoleId(roleId, sysUserFilter, orderBy);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(resultList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
private ResponseResult<Void> doRoleUserVerify(Long roleId) {
|
||||
@@ -286,7 +283,7 @@ public class SysRoleController {
|
||||
* @return 符合条件的角色列表。
|
||||
*/
|
||||
@PostMapping("/listAllRolesByPermCode")
|
||||
public ResponseResult<JSONObject> listAllRolesByPermCode(
|
||||
public ResponseResult<MyPageData<SysRole>> listAllRolesByPermCode(
|
||||
@MyRequestBody Long permCodeId, @MyRequestBody MyPageParam pageParam) {
|
||||
if (MyCommonUtil.existBlankArgument(permCodeId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
@@ -295,8 +292,7 @@ public class SysRoleController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
List<SysRole> roleList = sysRoleService.getSysRoleListByPermCodeId(permCodeId);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(roleList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(roleList));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +304,7 @@ public class SysRoleController {
|
||||
* @return 符合条件的角色列表。
|
||||
*/
|
||||
@PostMapping("/listAllRolesByPerm")
|
||||
public ResponseResult<JSONObject> listAllRolesByPerm(
|
||||
public ResponseResult<MyPageData<SysRole>> listAllRolesByPerm(
|
||||
@MyRequestBody String url, @MyRequestBody MyPageParam pageParam) {
|
||||
if (MyCommonUtil.existBlankArgument(url)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
@@ -317,7 +313,6 @@ public class SysRoleController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
List<SysRole> roleList = sysRoleService.getSysRoleListByPerm(url);
|
||||
JSONObject responseData = MyPageUtil.makeResponseData(roleList);
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(roleList));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,9 @@ import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.AddGroup;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.config.ApplicationConfig;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -23,8 +24,9 @@ import javax.validation.groups.Default;
|
||||
* 用户管理操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Api(tags = "用户管理管理接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/sysUser")
|
||||
@@ -45,8 +47,12 @@ public class SysUserController {
|
||||
* @return 应答结果对象,包含新增用户的主键Id。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"sysUser.userId",
|
||||
"sysUser.createTimeStart",
|
||||
"sysUser.createTimeEnd"})
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<JSONObject> add(@MyRequestBody SysUser sysUser, @MyRequestBody String roleIdListString) {
|
||||
public ResponseResult<Long> add(@MyRequestBody SysUser sysUser, @MyRequestBody String roleIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUser, Default.class, AddGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
|
||||
@@ -57,9 +63,7 @@ public class SysUserController {
|
||||
}
|
||||
Set<Long> roleIdSet = (Set<Long>) result.getData().get("roleIdSet");
|
||||
sysUserService.saveNew(sysUser, roleIdSet);
|
||||
JSONObject responseData = new JSONObject();
|
||||
responseData.put("userId", sysUser.getUserId());
|
||||
return ResponseResult.success(responseData);
|
||||
return ResponseResult.success(sysUser.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +74,9 @@ public class SysUserController {
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"sysUser.createTimeStart",
|
||||
"sysUser.createTimeEnd"})
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody SysUser sysUser, @MyRequestBody String roleIdListString) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUser, Default.class, UpdateGroup.class);
|
||||
@@ -143,7 +150,7 @@ public class SysUserController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<JSONObject> list(
|
||||
public ResponseResult<MyPageData<SysUser>> list(
|
||||
@MyRequestBody SysUser sysUserFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
* 菜单数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysMenuMapper extends BaseDaoMapper<SysMenu> {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.upms.model.SysMenuPermCode;
|
||||
* 菜单与权限字关系数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysMenuPermCodeMapper extends BaseDaoMapper<SysMenuPermCode> {
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||
* 权限字数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysPermCodeMapper extends BaseDaoMapper<SysPermCode> {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.upms.model.SysPermCodePerm;
|
||||
* 权限字与权限资源关系数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysPermCodePermMapper extends BaseDaoMapper<SysPermCodePerm> {
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||
* 权限资源数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysPermMapper extends BaseDaoMapper<SysPerm> {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
* 权限资源模块数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysPermModuleMapper extends BaseDaoMapper<SysPermModule> {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.upms.model.SysPermWhitelist;
|
||||
* 权限资源白名单数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysPermWhitelistMapper extends BaseDaoMapper<SysPermWhitelist> {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
* 角色数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysRoleMapper extends BaseDaoMapper<SysRole> {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.upms.model.SysRoleMenu;
|
||||
* 角色与菜单操作关联关系数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysRoleMenuMapper extends BaseDaoMapper<SysRoleMenu> {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.*;
|
||||
* 用户管理数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysUserMapper extends BaseDaoMapper<SysUser> {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
* 用户与角色关联关系数据访问操作接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysUserRoleMapper extends BaseDaoMapper<SysUserRole> {
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
AND pcp.perm_id = p.perm_id
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</if>
|
||||
AND deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -60,7 +60,7 @@
|
||||
AND zz_sys_user_role.user_id = zz_sys_user.user_id
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
@@ -72,7 +72,7 @@
|
||||
WHERE zz_sys_user_role.role_id = #{roleId} AND zz_sys_user_role.user_id = zz_sys_user.user_id)
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null">
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upms.model.constant.SysMenuType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -17,15 +19,17 @@ import java.util.List;
|
||||
* 菜单实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("菜单实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_menu")
|
||||
public class SysMenu {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
* 菜单Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单Id", required = true)
|
||||
@NotNull(message = "菜单Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "menu_id")
|
||||
@@ -34,12 +38,14 @@ public class SysMenu {
|
||||
/**
|
||||
* 父菜单Id,目录菜单的父菜单为null。
|
||||
*/
|
||||
@ApiModelProperty(value = "父菜单Id")
|
||||
@Column(name = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单显示名称", required = true)
|
||||
@NotBlank(message = "菜单显示名称不能为空!")
|
||||
@Column(name = "menu_name")
|
||||
private String menuName;
|
||||
@@ -47,6 +53,7 @@ public class SysMenu {
|
||||
/**
|
||||
* 菜单类型(0: 目录 1: 菜单 2: 按钮 3: UI片段)。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单类型", required = true)
|
||||
@NotNull(message = "菜单类型不能为空!")
|
||||
@ConstDictRef(constDictClass = SysMenuType.class, message = "数据验证失败,菜单类型为无效值!")
|
||||
@Column(name = "menu_type")
|
||||
@@ -55,12 +62,14 @@ public class SysMenu {
|
||||
/**
|
||||
* 前端表单路由名称,仅用于menu_type为1的菜单类型。
|
||||
*/
|
||||
@ApiModelProperty(value = "前端表单路由名称")
|
||||
@Column(name = "form_router_name")
|
||||
private String formRouterName;
|
||||
|
||||
/**
|
||||
* 菜单显示顺序 (值越小,排序越靠前)。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单显示顺序", required = true)
|
||||
@NotNull(message = "菜单显示顺序不能为空!")
|
||||
@Column(name = "show_order")
|
||||
private Integer showOrder;
|
||||
@@ -68,22 +77,26 @@ public class SysMenu {
|
||||
/**
|
||||
* 菜单图标。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
@Column(name = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationManyToMany(
|
||||
relationMapperName = "sysMenuPermCodeMapper",
|
||||
relationMasterIdField = "menuId",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.orange.demo.upms.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -8,8 +10,9 @@ import javax.persistence.*;
|
||||
* 菜单与权限字关联实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("菜单与权限字关联实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_menu_perm_code")
|
||||
public class SysMenuPermCode {
|
||||
@@ -17,6 +20,7 @@ public class SysMenuPermCode {
|
||||
/**
|
||||
* 关联菜单Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "关联菜单Id", required = true)
|
||||
@Id
|
||||
@Column(name = "menu_id")
|
||||
private Long menuId;
|
||||
@@ -24,6 +28,7 @@ public class SysMenuPermCode {
|
||||
/**
|
||||
* 关联权限字Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "关联权限字Id", required = true)
|
||||
@Id
|
||||
@Column(name = "perm_code_id")
|
||||
private Long permCodeId;
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -15,15 +17,17 @@ import java.util.Map;
|
||||
* 权限资源实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("权限资源实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_perm")
|
||||
public class SysPerm {
|
||||
|
||||
/**
|
||||
* 权限Id。
|
||||
* 权限资源Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限资源Id", required = true)
|
||||
@NotNull(message = "权限Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "perm_id")
|
||||
@@ -32,6 +36,7 @@ public class SysPerm {
|
||||
/**
|
||||
* 权限所在的权限模块Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限所在的权限模块Id", required = true)
|
||||
@NotNull(message = "权限模块Id不能为空!")
|
||||
@Column(name = "module_id")
|
||||
private Long moduleId;
|
||||
@@ -39,6 +44,7 @@ public class SysPerm {
|
||||
/**
|
||||
* 权限名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限名称", required = true)
|
||||
@NotBlank(message = "权限名称不能为空!")
|
||||
@Column(name = "perm_name")
|
||||
private String permName;
|
||||
@@ -46,12 +52,14 @@ public class SysPerm {
|
||||
/**
|
||||
* 关联的URL。
|
||||
*/
|
||||
@ApiModelProperty(value = "关联的URL", required = true)
|
||||
@NotBlank(message = "权限关联的url不能为空!")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 权限在当前模块下的顺序,由小到大。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限在当前模块下的顺序", required = true)
|
||||
@NotNull(message = "权限显示顺序不能为空!")
|
||||
@Column(name = "show_order")
|
||||
private Integer showOrder;
|
||||
@@ -59,17 +67,20 @@ public class SysPerm {
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
@Column(name = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationDict(
|
||||
masterIdField = "moduleId",
|
||||
slaveServiceName = "SysPermModuleService",
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upms.model.constant.SysPermCodeType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -17,15 +19,17 @@ import java.util.List;
|
||||
* 权限字实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("权限字实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_perm_code")
|
||||
public class SysPermCode {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
* 权限字Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字Id", required = true)
|
||||
@NotNull(message = "权限字Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "perm_code_id")
|
||||
@@ -34,12 +38,14 @@ public class SysPermCode {
|
||||
/**
|
||||
* 上级权限字Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "上级权限字Id")
|
||||
@Column(name = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 权限字标识(一般为有含义的英文字符串)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字标识", required = true)
|
||||
@NotBlank(message = "权限字编码不能为空!")
|
||||
@Column(name = "perm_code")
|
||||
private String permCode;
|
||||
@@ -47,6 +53,7 @@ public class SysPermCode {
|
||||
/**
|
||||
* 权限类型(0: 表单 1: UI片段 2: 操作)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限类型", required = true)
|
||||
@NotNull(message = "权限字类型不能为空!")
|
||||
@ConstDictRef(constDictClass = SysPermCodeType.class, message = "数据验证失败,权限类型为无效值!")
|
||||
@Column(name = "perm_code_type")
|
||||
@@ -55,6 +62,7 @@ public class SysPermCode {
|
||||
/**
|
||||
* 显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示名称", required = true)
|
||||
@NotBlank(message = "权限字显示名称不能为空!")
|
||||
@Column(name = "show_name")
|
||||
private String showName;
|
||||
@@ -62,6 +70,7 @@ public class SysPermCode {
|
||||
/**
|
||||
* 显示顺序(数值越小,越靠前)。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序", required = true)
|
||||
@NotNull(message = "权限字显示顺序不能为空!")
|
||||
@Column(name = "show_order")
|
||||
private Integer showOrder;
|
||||
@@ -69,17 +78,20 @@ public class SysPermCode {
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
@Column(name = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationManyToMany(
|
||||
relationMapperName = "sysPermCodePermMapper",
|
||||
relationMasterIdField = "permCodeId",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.orange.demo.upms.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -8,8 +10,9 @@ import javax.persistence.*;
|
||||
* 权限字与权限资源关联实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("权限字与权限资源关联实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_perm_code_perm")
|
||||
public class SysPermCodePerm {
|
||||
@@ -17,6 +20,7 @@ public class SysPermCodePerm {
|
||||
/**
|
||||
* 权限字Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字Id", required = true)
|
||||
@Id
|
||||
@Column(name = "perm_code_id")
|
||||
private Long permCodeId;
|
||||
@@ -24,6 +28,7 @@ public class SysPermCodePerm {
|
||||
/**
|
||||
* 权限Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限Id", required = true)
|
||||
@Id
|
||||
@Column(name = "perm_id")
|
||||
private Long permId;
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upms.model.constant.SysPermModuleType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -16,8 +18,9 @@ import java.util.List;
|
||||
* 权限模块实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("权限模块实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_perm_module")
|
||||
public class SysPermModule {
|
||||
@@ -25,6 +28,7 @@ public class SysPermModule {
|
||||
/**
|
||||
* 权限模块Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限模块Id", required = true)
|
||||
@NotNull(message = "权限模块Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "module_id")
|
||||
@@ -33,12 +37,14 @@ public class SysPermModule {
|
||||
/**
|
||||
* 上级权限模块Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "上级权限模块Id")
|
||||
@Column(name = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 权限模块名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限模块名称", required = true)
|
||||
@NotBlank(message = "权限模块名称不能为空!")
|
||||
@Column(name = "module_name")
|
||||
private String moduleName;
|
||||
@@ -46,6 +52,7 @@ public class SysPermModule {
|
||||
/**
|
||||
* 权限模块类型(0: 普通模块 1: Controller模块)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限模块类型", required = true)
|
||||
@NotNull(message = "模块类型不能为空!")
|
||||
@ConstDictRef(constDictClass = SysPermModuleType.class, message = "数据验证失败,权限模块类型为无效值!")
|
||||
@Column(name = "module_type")
|
||||
@@ -54,6 +61,7 @@ public class SysPermModule {
|
||||
/**
|
||||
* 权限模块在当前层级下的顺序,由小到大。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序", required = true)
|
||||
@NotNull(message = "权限模块显示顺序不能为空!")
|
||||
@Column(name = "show_order")
|
||||
private Integer showOrder;
|
||||
@@ -61,17 +69,20 @@ public class SysPermModule {
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
@Column(name = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Transient
|
||||
private List<SysPerm> sysPermList;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import javax.persistence.*;
|
||||
* 白名单实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_sys_perm_whitelist")
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -15,15 +17,17 @@ import java.util.List;
|
||||
* 角色实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("角色实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_role")
|
||||
public class SysRole {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
* 角色Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色Id", required = true)
|
||||
@NotNull(message = "角色Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "role_id")
|
||||
@@ -32,42 +36,49 @@ public class SysRole {
|
||||
/**
|
||||
* 角色名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色名称", required = true)
|
||||
@NotBlank(message = "角色名称不能为空!")
|
||||
@Column(name = "role_name")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 创建者。
|
||||
* 创建者Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者Id")
|
||||
@Column(name = "create_user_id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建者显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者显示名称")
|
||||
@Column(name = "create_username")
|
||||
private String createUsername;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
@Column(name = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationManyToMany(
|
||||
relationMapperName = "sysRoleMenuMapper",
|
||||
relationMasterIdField = "roleId",
|
||||
@@ -75,9 +86,11 @@ public class SysRole {
|
||||
@Transient
|
||||
private List<SysRoleMenu> sysRoleMenuList;
|
||||
|
||||
@ApiModelProperty(value = "创建时间开始查询时间")
|
||||
@Transient
|
||||
private String createTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "创建时间结束查询时间")
|
||||
@Transient
|
||||
private String createTimeEnd;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.orange.demo.upms.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -8,8 +10,9 @@ import javax.persistence.*;
|
||||
* 角色菜单实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("角色菜单实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_role_menu")
|
||||
public class SysRoleMenu {
|
||||
@@ -17,6 +20,7 @@ public class SysRoleMenu {
|
||||
/**
|
||||
* 角色Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色Id", required = true)
|
||||
@Id
|
||||
@Column(name = "role_id")
|
||||
private Long roleId;
|
||||
@@ -24,6 +28,7 @@ public class SysRoleMenu {
|
||||
/**
|
||||
* 菜单Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单Id", required = true)
|
||||
@Id
|
||||
@Column(name = "menu_id")
|
||||
private Long menuId;
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.AddGroup;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -21,8 +23,9 @@ import java.util.List;
|
||||
* SysUser实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("SysUser实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_user")
|
||||
public class SysUser {
|
||||
@@ -30,6 +33,7 @@ public class SysUser {
|
||||
/**
|
||||
* 用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户Id", required = true)
|
||||
@NotNull(message = "数据验证失败,用户Id不能为空!", groups = {UpdateGroup.class})
|
||||
@Id
|
||||
@Column(name = "user_id")
|
||||
@@ -38,6 +42,7 @@ public class SysUser {
|
||||
/**
|
||||
* 登录用户名。
|
||||
*/
|
||||
@ApiModelProperty(value = "登录用户名", required = true)
|
||||
@NotBlank(message = "数据验证失败,登录用户名不能为空!")
|
||||
@Column(name = "login_name")
|
||||
private String loginName;
|
||||
@@ -45,12 +50,14 @@ public class SysUser {
|
||||
/**
|
||||
* 用户密码。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户密码", required = true)
|
||||
@NotBlank(message = "数据验证失败,用户密码不能为空!", groups = {AddGroup.class})
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户显示名称", required = true)
|
||||
@NotBlank(message = "数据验证失败,用户显示名称不能为空!")
|
||||
@Column(name = "show_name")
|
||||
private String showName;
|
||||
@@ -58,6 +65,7 @@ public class SysUser {
|
||||
/**
|
||||
* 用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)", required = true)
|
||||
@NotNull(message = "数据验证失败,用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)不能为空!")
|
||||
@ConstDictRef(constDictClass = SysUserType.class, message = "数据验证失败,用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)为无效值!")
|
||||
@Column(name = "user_type")
|
||||
@@ -66,12 +74,14 @@ public class SysUser {
|
||||
/**
|
||||
* 用户头像的Url。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户头像的Url")
|
||||
@Column(name = "head_image_url")
|
||||
private String headImageUrl;
|
||||
|
||||
/**
|
||||
* 用户状态(0: 正常 1: 锁定)。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户状态(0: 正常 1: 锁定)", required = true)
|
||||
@NotNull(message = "数据验证失败,用户状态(0: 正常 1: 锁定)不能为空!")
|
||||
@ConstDictRef(constDictClass = SysUserStatus.class, message = "数据验证失败,用户状态(0: 正常 1: 锁定)为无效值!")
|
||||
@Column(name = "user_status")
|
||||
@@ -80,6 +90,7 @@ public class SysUser {
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JSONField(serialize = false)
|
||||
@DeletedFlagColumn
|
||||
@Column(name = "deleted_flag")
|
||||
@@ -88,42 +99,49 @@ public class SysUser {
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户Id")
|
||||
@Column(name = "create_user_id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建用户名。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户名")
|
||||
@Column(name = "create_username")
|
||||
private String createUsername;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
|
||||
@Transient
|
||||
private String createTimeStart;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
||||
@Transient
|
||||
private String createTimeEnd;
|
||||
|
||||
/**
|
||||
* 多对多用户角色数据集合。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationManyToMany(
|
||||
relationMapperName = "sysUserRoleMapper",
|
||||
relationMasterIdField = "userId",
|
||||
@@ -131,12 +149,14 @@ public class SysUser {
|
||||
@Transient
|
||||
private List<SysUserRole> sysUserRoleList;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "userType",
|
||||
constantDictClass = SysUserType.class)
|
||||
@Transient
|
||||
private Map<String, Object> userTypeDictMap;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@RelationConstDict(
|
||||
masterIdField = "userStatus",
|
||||
constantDictClass = SysUserStatus.class)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.orange.demo.upms.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -8,8 +10,9 @@ import javax.persistence.*;
|
||||
* 用户角色实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@ApiModel("用户角色实体对象")
|
||||
@Data
|
||||
@Table(name = "zz_sys_user_role")
|
||||
public class SysUserRole {
|
||||
@@ -17,6 +20,7 @@ public class SysUserRole {
|
||||
/**
|
||||
* 用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户Id", required = true)
|
||||
@Id
|
||||
@Column(name = "user_id")
|
||||
private Long userId;
|
||||
@@ -24,6 +28,7 @@ public class SysUserRole {
|
||||
/**
|
||||
* 角色Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色Id", required = true)
|
||||
@Id
|
||||
@Column(name = "role_id")
|
||||
private Long roleId;
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 菜单类型常量对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class SysMenuType {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 权限字类型常量对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class SysPermCodeType {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 权限资源模块类型常量对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class SysPermModuleType {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 用户状态常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class SysUserStatus {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
* 用户类型常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public final class SysUserType {
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
|
||||
* 菜单数据服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuService extends BaseService<SysMenu, Long> {
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
|
||||
* 权限字数据服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysPermCodeService extends BaseService<SysPermCode, Long> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
* 权限资源模块数据服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysPermModuleService extends BaseService<SysPermModule, Long> {
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
|
||||
* 权限资源数据服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysPermService extends BaseService<SysPerm, Long> {
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
|
||||
* 白名单中的权限资源,可以不受权限控制,任何用户皆可访问,一般用于常用的字典数据列表接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-10-19
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysPermWhitelistService extends BaseService<SysPermWhitelist, String> {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user