commit:同步1.4版本

This commit is contained in:
Jerry
2021-02-03 21:40:27 +08:00
parent 461b7a303b
commit 3a062ad619
290 changed files with 6973 additions and 4845 deletions

Binary file not shown.

View File

@@ -1,10 +1,15 @@
### 服务接口文档
---
- Knife4j
- 服务启动后Knife4j的文档入口地址 [http://localhost:8082/doc.html#/plus](http://localhost:8082/doc.html#/plus)
- Postman
- 无需启动服务即可将当前工程的接口导出成Postman格式。在工程的common/common-tools/模块下找到ExportApiApp文件并执行main函数。
### 服务启动环境依赖
---
执行docker-compose up -d 命令启动下面依赖的服务。
执行docker-compose down 命令停止下面服务。
- Redis
- 版本4
- 端口: 6379
- 推荐客户端工具 [AnotherRedisDesktopManager](https://github.com/qishibo/AnotherRedisDesktopManager)

View File

@@ -20,6 +20,11 @@
<artifactId>common-core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-redis</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-sequence</artifactId>
@@ -30,11 +35,6 @@
<artifactId>application-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-swagger</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -1,6 +1,5 @@
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;
@@ -20,7 +19,6 @@ import java.util.*;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "行政区划数据访问接口")
@RestController
@RequestMapping("/admin/app/areaCode")
public class AreaCodeController {

View File

@@ -16,10 +16,8 @@ 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.orange.demo.common.core.cache.SessionCacheHelper;
import com.orange.demo.common.redis.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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -35,7 +33,6 @@ import javax.validation.groups.Default;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "课程数据管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/course")
@@ -56,14 +53,6 @@ public class CourseController {
* @param courseDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。
*/
@ApiOperationSupport(ignoreParameters = {
"course.courseId",
"course.priceStart",
"course.priceEnd",
"course.classHourStart",
"course.classHourEnd",
"course.createTimeStart",
"course.createTimeEnd"})
@PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("course") CourseDto courseDto) {
String errorMessage = MyCommonUtil.getModelValidationError(courseDto);
@@ -87,13 +76,6 @@ public class CourseController {
* @param courseDto 更新对象。
* @return 应答结果对象。
*/
@ApiOperationSupport(ignoreParameters = {
"course.priceStart",
"course.priceEnd",
"course.classHourStart",
"course.classHourEnd",
"course.createTimeStart",
"course.createTimeEnd"})
@PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("course") CourseDto courseDto) {
String errorMessage = MyCommonUtil.getModelValidationError(courseDto, Default.class, UpdateGroup.class);

View File

@@ -9,7 +9,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +21,6 @@ import java.util.*;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "课程统计管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/courseTransStats")

View File

@@ -12,8 +12,6 @@ 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.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.*;
@@ -27,7 +25,6 @@ import java.util.*;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "年级管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/grade")
@@ -42,7 +39,6 @@ public class GradeController {
* @param gradeDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。
*/
@ApiOperationSupport(ignoreParameters = {"grade.gradeId"})
@PostMapping("/add")
public ResponseResult<Integer> add(@MyRequestBody("grade") GradeDto gradeDto) {
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);

View File

@@ -11,8 +11,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -26,7 +24,6 @@ import javax.validation.groups.Default;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "校区数据管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/schoolInfo")
@@ -41,7 +38,6 @@ public class SchoolInfoController {
* @param schoolInfoDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。
*/
@ApiOperationSupport(ignoreParameters = {"schoolInfo.schoolId"})
@PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("schoolInfo") SchoolInfoDto schoolInfoDto) {
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto);

View File

@@ -9,7 +9,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +21,6 @@ import java.util.*;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "学生行为统计管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/studentActionStats")

View File

@@ -10,8 +10,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -25,7 +23,6 @@ import javax.validation.groups.Default;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "学生行为流水管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/studentActionTrans")
@@ -40,10 +37,6 @@ public class StudentActionTransController {
* @param studentActionTransDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。
*/
@ApiOperationSupport(ignoreParameters = {
"studentActionTrans.transId",
"studentActionTrans.createTimeStart",
"studentActionTrans.createTimeEnd"})
@PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto);
@@ -67,9 +60,6 @@ public class StudentActionTransController {
* @param studentActionTransDto 更新对象。
* @return 应答结果对象。
*/
@ApiOperationSupport(ignoreParameters = {
"studentActionTrans.createTimeStart",
"studentActionTrans.createTimeEnd"})
@PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class);

View File

@@ -10,8 +10,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -26,7 +24,6 @@ import java.util.stream.Collectors;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "班级数据管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/studentClass")
@@ -45,7 +42,6 @@ public class StudentClassController {
* @param studentClassDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。
*/
@ApiOperationSupport(ignoreParameters = {"studentClass.classId"})
@PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("studentClass") StudentClassDto studentClassDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto);

View File

@@ -11,8 +11,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -26,7 +24,6 @@ import javax.validation.groups.Default;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "学生数据管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/app/student")
@@ -41,13 +38,6 @@ public class StudentController {
* @param studentDto 新增对象。
* @return 应答结果对象包含新增对象主键Id。
*/
@ApiOperationSupport(ignoreParameters = {
"student.studentId",
"student.searchString",
"student.birthdayStart",
"student.birthdayEnd",
"student.registerTimeStart",
"student.registerTimeEnd"})
@PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("student") StudentDto studentDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentDto);
@@ -71,12 +61,6 @@ public class StudentController {
* @param studentDto 更新对象。
* @return 应答结果对象。
*/
@ApiOperationSupport(ignoreParameters = {
"student.searchString",
"student.birthdayStart",
"student.birthdayEnd",
"student.registerTimeStart",
"student.registerTimeEnd"})
@PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("student") StudentDto studentDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentDto, Default.class, UpdateGroup.class);

View File

@@ -2,8 +2,6 @@ package com.orange.demo.app.dto;
import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -14,28 +12,24 @@ import javax.validation.constraints.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("ClassCourseDto对象")
@Data
public class ClassCourseDto {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id", required = true)
@NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class})
private Long classId;
/**
* 课程Id。
*/
@ApiModelProperty(value = "课程Id", required = true)
@NotNull(message = "数据验证失败课程Id不能为空", groups = {UpdateGroup.class})
private Long courseId;
/**
* 课程顺序(数值越小越靠前)。
*/
@ApiModelProperty(value = "课程顺序(数值越小越靠前)", required = true)
@NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!", groups = {UpdateGroup.class})
private Integer courseOrder;
}

View File

@@ -2,8 +2,6 @@ package com.orange.demo.app.dto;
import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -14,21 +12,18 @@ import javax.validation.constraints.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("ClassStudentDto对象")
@Data
public class ClassStudentDto {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id", required = true)
@NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class})
private Long classId;
/**
* 学生Id。
*/
@ApiModelProperty(value = "学生Id", required = true)
@NotNull(message = "数据验证失败学生Id不能为空", groups = {UpdateGroup.class})
private Long studentId;
}

View File

@@ -5,8 +5,6 @@ import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.app.model.constant.CourseDifficult;
import com.orange.demo.application.common.constant.Subject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -19,41 +17,35 @@ import java.math.BigDecimal;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("CourseDto对象")
@Data
public class CourseDto {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long courseId;
/**
* 课程名称。
*/
@ApiModelProperty(value = "课程名称", required = true)
@NotBlank(message = "数据验证失败,课程名称不能为空!")
private String courseName;
/**
* 课程价格。
*/
@ApiModelProperty(value = "课程价格", required = true)
@NotNull(message = "数据验证失败,课程价格不能为空!")
private BigDecimal price;
/**
* 课程描述。
*/
@ApiModelProperty(value = "课程描述")
private String description;
/**
* 课程难度(0: 容易 1: 普通 2: 很难)。
*/
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)", required = true)
@NotNull(message = "数据验证失败,课程难度不能为空!")
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
private Integer difficulty;
@@ -61,14 +53,12 @@ public class CourseDto {
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId;
/**
* 学科Id。
*/
@ApiModelProperty(value = "学科Id", required = true)
@NotNull(message = "数据验证失败,所属学科不能为空!")
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
private Integer subjectId;
@@ -76,50 +66,42 @@ public class CourseDto {
/**
* 课时数量。
*/
@ApiModelProperty(value = "课时数量", required = true)
@NotNull(message = "数据验证失败,课时数量不能为空!")
private Integer classHour;
/**
* 多张课程图片地址。
*/
@ApiModelProperty(value = "多张课程图片地址", required = true)
@NotBlank(message = "数据验证失败,课程图片不能为空!")
private String pictureUrl;
/**
* price 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "price 范围过滤起始值(>=)")
private BigDecimal priceStart;
/**
* price 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "price 范围过滤结束值(<=)")
private BigDecimal priceEnd;
/**
* classHour 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "classHour 范围过滤起始值(>=)")
private Integer classHourStart;
/**
* classHour 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "classHour 范围过滤结束值(<=)")
private Integer classHourEnd;
/**
* createTime 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
private String createTimeStart;
/**
* createTime 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
private String createTimeEnd;
}

View File

@@ -4,8 +4,6 @@ import com.orange.demo.common.core.validator.UpdateGroup;
import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.application.common.constant.Subject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -18,28 +16,24 @@ import java.util.Date;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("CourseTransStatsDto对象")
@Data
public class CourseTransStatsDto {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long statsId;
/**
* 统计日期。
*/
@ApiModelProperty(value = "统计日期", required = true)
@NotNull(message = "数据验证失败,统计日期不能为空!")
private Date statsDate;
/**
* 科目Id。
*/
@ApiModelProperty(value = "科目Id", required = true)
@NotNull(message = "数据验证失败,所属科目不能为空!")
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!")
private Integer subjectId;
@@ -47,59 +41,50 @@ public class CourseTransStatsDto {
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId;
/**
* 年级名称。
*/
@ApiModelProperty(value = "年级名称")
private String gradeName;
/**
* 课程Id。
*/
@ApiModelProperty(value = "课程Id", required = true)
@NotNull(message = "数据验证失败课程Id不能为空")
private Long courseId;
/**
* 课程名称。
*/
@ApiModelProperty(value = "课程名称")
private String courseName;
/**
* 学生上课次数。
*/
@ApiModelProperty(value = "学生上课次数", required = true)
@NotNull(message = "数据验证失败,上课次数不能为空!")
private Integer studentAttendCount;
/**
* 学生献花数量。
*/
@ApiModelProperty(value = "学生献花数量", required = true)
@NotNull(message = "数据验证失败,献花数量不能为空!")
private Integer studentFlowerAmount;
/**
* 学生献花次数。
*/
@ApiModelProperty(value = "学生献花次数", required = true)
@NotNull(message = "数据验证失败,献花次数不能为空!")
private Integer studentFlowerCount;
/**
* statsDate 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
private String statsDateStart;
/**
* statsDate 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
private String statsDateEnd;
}

View File

@@ -2,8 +2,6 @@ package com.orange.demo.app.dto;
import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -14,21 +12,18 @@ import javax.validation.constraints.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("GradeDto对象")
@Data
public class GradeDto {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Integer gradeId;
/**
* 年级名称。
*/
@ApiModelProperty(value = "年级名称", required = true)
@NotBlank(message = "数据验证失败,年级名称不能为空!")
private String gradeName;
}

View File

@@ -2,8 +2,6 @@ package com.orange.demo.app.dto;
import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -14,35 +12,30 @@ import javax.validation.constraints.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("SchoolInfoDto对象")
@Data
public class SchoolInfoDto {
/**
* 学校Id。
*/
@ApiModelProperty(value = "学校Id", required = true)
@NotNull(message = "数据验证失败学校Id不能为空", groups = {UpdateGroup.class})
private Long schoolId;
/**
* 学校名称。
*/
@ApiModelProperty(value = "学校名称", required = true)
@NotBlank(message = "数据验证失败,学校名称不能为空!")
private String schoolName;
/**
* 所在省Id。
*/
@ApiModelProperty(value = "所在省Id", required = true)
@NotNull(message = "数据验证失败,所在省份不能为空!")
private Long provinceId;
/**
* 所在城市Id。
*/
@ApiModelProperty(value = "所在城市Id", required = true)
@NotNull(message = "数据验证失败,所在城市不能为空!")
private Long cityId;
}

View File

@@ -2,8 +2,6 @@ package com.orange.demo.app.dto;
import com.orange.demo.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -16,165 +14,141 @@ import java.util.Date;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentActionStatsDto对象")
@Data
public class StudentActionStatsDto {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long statsId;
/**
* 统计日期。
*/
@ApiModelProperty(value = "统计日期", required = true)
@NotNull(message = "数据验证失败,统计日期不能为空!")
private Date statsDate;
/**
* 统计小时。
*/
@ApiModelProperty(value = "统计小时")
private Date statsMonth;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,所属年级不能为空!")
private Integer gradeId;
/**
* 学生所在省Id。
*/
@ApiModelProperty(value = "学生所在省Id", required = true)
@NotNull(message = "数据验证失败,所在省份不能为空!")
private Long provinceId;
/**
* 学生所在城市Id。
*/
@ApiModelProperty(value = "学生所在城市Id", required = true)
@NotNull(message = "数据验证失败,所在城市不能为空!", groups = {UpdateGroup.class})
private Long cityId;
/**
* 购课学币数量。
*/
@ApiModelProperty(value = "购课学币数量", required = true)
@NotNull(message = "数据验证失败,购课学币数量不能为空!", groups = {UpdateGroup.class})
private Integer buyCourseAmount;
/**
* 购买课程次数。
*/
@ApiModelProperty(value = "购买课程次数", required = true)
@NotNull(message = "数据验证失败,购买课程次数不能为空!", groups = {UpdateGroup.class})
private Integer buyCourseCount;
/**
* 购买视频学币数量。
*/
@ApiModelProperty(value = "购买视频学币数量", required = true)
@NotNull(message = "数据验证失败,购买视频学币数量不能为空!", groups = {UpdateGroup.class})
private Integer buyVideoAmount;
/**
* 购买视频次数。
*/
@ApiModelProperty(value = "购买视频次数", required = true)
@NotNull(message = "数据验证失败,购买视频次数不能为空!", groups = {UpdateGroup.class})
private Integer buyVideoCount;
/**
* 购买作业学币数量。
*/
@ApiModelProperty(value = "购买作业学币数量", required = true)
@NotNull(message = "数据验证失败,购买作业学币数量不能为空!", groups = {UpdateGroup.class})
private Integer buyPaperAmount;
/**
* 购买作业次数。
*/
@ApiModelProperty(value = "购买作业次数", required = true)
@NotNull(message = "数据验证失败,购买作业次数不能为空!", groups = {UpdateGroup.class})
private Integer buyPaperCount;
/**
* 购买献花数量。
*/
@ApiModelProperty(value = "购买献花数量", required = true)
@NotNull(message = "数据验证失败,购买献花数量不能为空!", groups = {UpdateGroup.class})
private Integer buyFlowerAmount;
/**
* 购买献花次数。
*/
@ApiModelProperty(value = "购买献花次数", required = true)
@NotNull(message = "数据验证失败,购买献花次数不能为空!", groups = {UpdateGroup.class})
private Integer buyFlowerCount;
/**
* 充值学币数量。
*/
@ApiModelProperty(value = "充值学币数量", required = true)
@NotNull(message = "数据验证失败,充值学币数量不能为空!", groups = {UpdateGroup.class})
private Integer rechargeCoinAmount;
/**
* 充值学币次数。
*/
@ApiModelProperty(value = "充值学币次数", required = true)
@NotNull(message = "数据验证失败,充值学币次数不能为空!", groups = {UpdateGroup.class})
private Integer rechargeCoinCount;
/**
* 线下课程上课次数。
*/
@ApiModelProperty(value = "线下课程上课次数", required = true)
@NotNull(message = "数据验证失败,线下课程上课次数不能为空!")
private Integer doCourseCount;
/**
* 观看视频次数。
*/
@ApiModelProperty(value = "观看视频次数", required = true)
@NotNull(message = "数据验证失败,观看视频次数不能为空!", groups = {UpdateGroup.class})
private Integer watchVideoCount;
/**
* 购买献花消费学币数量。
*/
@ApiModelProperty(value = "购买献花消费学币数量", required = true)
@NotNull(message = "数据验证失败,购买献花消费学币数量不能为空!")
private Integer watchVideoTotalSecond;
/**
* 做题数量。
*/
@ApiModelProperty(value = "做题数量", required = true)
@NotNull(message = "数据验证失败,做题数量不能为空!", groups = {UpdateGroup.class})
private Integer doExerciseCount;
/**
* 做题正确的数量。
*/
@ApiModelProperty(value = "做题正确的数量", required = true)
@NotNull(message = "数据验证失败,做题正确的数量不能为空!", groups = {UpdateGroup.class})
private Integer doExerciseCorrectCount;
/**
* statsDate 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
private String statsDateStart;
/**
* statsDate 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
private String statsDateEnd;
}

View File

@@ -5,8 +5,6 @@ import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.application.common.constant.StudentActionType;
import com.orange.demo.application.common.constant.DeviceType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -19,49 +17,42 @@ import java.util.Date;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentActionTransDto对象")
@Data
public class StudentActionTransDto {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id", required = true)
@NotNull(message = "数据验证失败主键Id不能为空", groups = {UpdateGroup.class})
private Long transId;
/**
* 学生Id。
*/
@ApiModelProperty(value = "学生Id", required = true)
@NotNull(message = "数据验证失败学生Id不能为空")
private Long studentId;
/**
* 学生名称。
*/
@ApiModelProperty(value = "学生名称", required = true)
@NotBlank(message = "数据验证失败,学生名称不能为空!")
private String studentName;
/**
* 学生校区。
*/
@ApiModelProperty(value = "学生校区", required = true)
@NotNull(message = "数据验证失败,学生校区不能为空!")
private Long schoolId;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,学生年级不能为空!")
private Integer gradeId;
/**
* 行为类型(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 = "数据验证失败,行为类型为无效值!")
private Integer actionType;
@@ -69,7 +60,6 @@ public class StudentActionTransDto {
/**
* 设备类型(0: iOS 1: Android 2: PC)。
*/
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)", required = true)
@NotNull(message = "数据验证失败,设备类型不能为空!")
@ConstDictRef(constDictClass = DeviceType.class, message = "数据验证失败,设备类型为无效值!")
private Integer deviceType;
@@ -77,61 +67,51 @@ public class StudentActionTransDto {
/**
* 看视频秒数。
*/
@ApiModelProperty(value = "看视频秒数")
private Integer watchVideoSeconds;
/**
* 购买献花数量。
*/
@ApiModelProperty(value = "购买献花数量")
private Integer flowerCount;
/**
* 购买作业数量。
*/
@ApiModelProperty(value = "购买作业数量")
private Integer paperCount;
/**
* 购买视频数量。
*/
@ApiModelProperty(value = "购买视频数量")
private Integer videoCount;
/**
* 购买课程数量。
*/
@ApiModelProperty(value = "购买课程数量")
private Integer courseCount;
/**
* 充值学币数量。
*/
@ApiModelProperty(value = "充值学币数量")
private Integer coinCount;
/**
* 做题是否正确标记。
*/
@ApiModelProperty(value = "做题是否正确标记")
private Integer exerciseCorrectFlag;
/**
* 发生时间。
*/
@ApiModelProperty(value = "发生时间", required = true)
@NotNull(message = "数据验证失败,发生时间不能为空!")
private Date createTime;
/**
* createTime 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
private String createTimeStart;
/**
* createTime 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
private String createTimeEnd;
}

View File

@@ -4,8 +4,6 @@ import com.orange.demo.common.core.validator.UpdateGroup;
import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.app.model.constant.ClassLevel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -16,49 +14,42 @@ import javax.validation.constraints.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentClassDto对象")
@Data
public class StudentClassDto {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id", required = true)
@NotNull(message = "数据验证失败班级Id不能为空", groups = {UpdateGroup.class})
private Long classId;
/**
* 班级名称。
*/
@ApiModelProperty(value = "班级名称", required = true)
@NotBlank(message = "数据验证失败,班级名称不能为空!")
private String className;
/**
* 学校Id。
*/
@ApiModelProperty(value = "学校Id", required = true)
@NotNull(message = "数据验证失败,所属校区不能为空!")
private Long schoolId;
/**
* 学生班长Id。
*/
@ApiModelProperty(value = "学生班长Id", required = true)
@NotNull(message = "数据验证失败,学生班长不能为空!")
private Long leaderId;
/**
* 已完成课时数量。
*/
@ApiModelProperty(value = "已完成课时数量", required = true)
@NotNull(message = "数据验证失败,已完成课时不能为空!", groups = {UpdateGroup.class})
private Integer finishClassHour;
/**
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
*/
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)", required = true)
@NotNull(message = "数据验证失败,班级级别不能为空!")
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
private Integer classLevel;

View File

@@ -6,8 +6,6 @@ import com.orange.demo.application.common.constant.Gender;
import com.orange.demo.application.common.constant.ExpLevel;
import com.orange.demo.application.common.constant.StudentStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -20,56 +18,48 @@ import java.util.Date;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentDto对象")
@Data
public class StudentDto {
/**
* 学生Id。
*/
@ApiModelProperty(value = "学生Id", required = true)
@NotNull(message = "数据验证失败学生Id不能为空", groups = {UpdateGroup.class})
private Long studentId;
/**
* 登录手机。
*/
@ApiModelProperty(value = "登录手机", required = true)
@NotBlank(message = "数据验证失败,手机号码不能为空!")
private String loginMobile;
/**
* 学生姓名。
*/
@ApiModelProperty(value = "学生姓名", required = true)
@NotBlank(message = "数据验证失败,学生姓名不能为空!")
private String studentName;
/**
* 所在省份Id。
*/
@ApiModelProperty(value = "所在省份Id", required = true)
@NotNull(message = "数据验证失败,所在省份不能为空!")
private Long provinceId;
/**
* 所在城市Id。
*/
@ApiModelProperty(value = "所在城市Id", required = true)
@NotNull(message = "数据验证失败,所在城市不能为空!")
private Long cityId;
/**
* 区县Id。
*/
@ApiModelProperty(value = "区县Id", required = true)
@NotNull(message = "数据验证失败,所在区县不能为空!")
private Long districtId;
/**
* 学生性别 (0: 女生 1: 男生)。
*/
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)", required = true)
@NotNull(message = "数据验证失败,学生性别不能为空!")
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,学生性别为无效值!")
private Integer gender;
@@ -77,14 +67,12 @@ public class StudentDto {
/**
* 生日。
*/
@ApiModelProperty(value = "生日", required = true)
@NotNull(message = "数据验证失败,出生日期不能为空!")
private Date birthday;
/**
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
*/
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)", required = true)
@NotNull(message = "数据验证失败,经验等级不能为空!")
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
private Integer experienceLevel;
@@ -92,35 +80,30 @@ public class StudentDto {
/**
* 总共充值学币数量。
*/
@ApiModelProperty(value = "总共充值学币数量", required = true)
@NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class})
private Integer totalCoin;
/**
* 可用学币数量。
*/
@ApiModelProperty(value = "可用学币数量", required = true)
@NotNull(message = "数据验证失败,剩余学币不能为空!", groups = {UpdateGroup.class})
private Integer leftCoin;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id", required = true)
@NotNull(message = "数据验证失败,年级不能为空!")
private Integer gradeId;
/**
* 校区Id。
*/
@ApiModelProperty(value = "校区Id", required = true)
@NotNull(message = "数据验证失败,所属校区不能为空!")
private Long schoolId;
/**
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
*/
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)", required = true)
@NotNull(message = "数据验证失败,学生状态不能为空!", groups = {UpdateGroup.class})
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,学生状态为无效值!")
private Integer status;
@@ -128,30 +111,25 @@ public class StudentDto {
/**
* birthday 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "birthday 范围过滤起始值(>=)")
private String birthdayStart;
/**
* birthday 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "birthday 范围过滤结束值(<=)")
private String birthdayEnd;
/**
* registerTime 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "registerTime 范围过滤起始值(>=)")
private String registerTimeStart;
/**
* registerTime 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "registerTime 范围过滤结束值(<=)")
private String registerTimeEnd;
/**
* login_mobile / student_name LIKE搜索字符串。
*/
@ApiModelProperty(value = "LIKE模糊搜索字符串")
private String searchString;
}

View File

@@ -1,6 +1,5 @@
package com.orange.demo.app.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
import lombok.Data;
import javax.persistence.*;
@@ -32,7 +31,6 @@ public class Grade {
/**
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
*/
@JSONField(serialize = false)
@DeletedFlagColumn
private Integer status;
}

View File

@@ -1,6 +1,5 @@
package com.orange.demo.app.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.orange.demo.app.model.constant.ClassLevel;
import com.orange.demo.common.core.annotation.RelationDict;
import com.orange.demo.common.core.annotation.RelationConstDict;
@@ -77,7 +76,6 @@ public class StudentClass {
/**
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
*/
@JSONField(serialize = false)
@DeletedFlagColumn
private Integer status;

View File

@@ -2,12 +2,14 @@ package com.orange.demo.app.service.impl;
import com.orange.demo.common.core.base.service.BaseDictService;
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
import com.orange.demo.common.core.cache.MapDictionaryCache;
import com.orange.demo.common.redis.cache.RedisDictionaryCache;
import com.orange.demo.app.service.GradeService;
import com.orange.demo.app.dao.GradeMapper;
import com.orange.demo.app.model.Grade;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* 年级字典数据操作服务类。
@@ -20,10 +22,17 @@ public class GradeServiceImpl extends BaseDictService<Grade, Integer> implements
@Autowired
private GradeMapper gradeMapper;
@Autowired
private RedissonClient redissonClient;
public GradeServiceImpl() {
super();
this.dictionaryCache = MapDictionaryCache.create(Grade::getGradeId);
}
@PostConstruct
public void init() {
this.dictionaryCache = RedisDictionaryCache.create(
redissonClient, "Grade", Grade.class, Grade::getGradeId);
}
/**

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@@ -10,31 +8,26 @@ import lombok.Data;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("行政区划实体对象")
@Data
public class AreaCodeVo {
/**
* 行政区划主键Id
*/
@ApiModelProperty(value = "行政区划主键Id", required = true)
private Long areaId;
/**
* 行政区划名称
*/
@ApiModelProperty(value = "行政区划名称")
private String areaName;
/**
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
*/
@ApiModelProperty(value = "行政区划级别")
private Integer areaLevel;
/**
* 父级行政区划Id
*/
@ApiModelProperty(value = "父级行政区划Id")
private Long parentId;
}

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@@ -10,25 +8,21 @@ import lombok.Data;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("ClassCourseVO实体对象")
@Data
public class ClassCourseVo {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id")
private Long classId;
/**
* 课程Id。
*/
@ApiModelProperty(value = "课程Id")
private Long courseId;
/**
* 课程顺序(数值越小越靠前)。
*/
@ApiModelProperty(value = "课程顺序(数值越小越靠前)")
private Integer courseOrder;
}

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@@ -10,19 +8,16 @@ import lombok.Data;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("ClassStudentVO实体对象")
@Data
public class ClassStudentVo {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id")
private Long classId;
/**
* 学生Id。
*/
@ApiModelProperty(value = "学生Id")
private Long studentId;
}

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@@ -13,79 +11,66 @@ import java.util.Map;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("CourseTransStatsVO实体对象")
@Data
public class CourseTransStatsVo {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id")
private Long statsId;
/**
* 统计日期。
*/
@ApiModelProperty(value = "统计日期")
private Date statsDate;
/**
* 科目Id。
*/
@ApiModelProperty(value = "科目Id")
private Integer subjectId;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id")
private Integer gradeId;
/**
* 年级名称。
*/
@ApiModelProperty(value = "年级名称")
private String gradeName;
/**
* 课程Id。
*/
@ApiModelProperty(value = "课程Id")
private Long courseId;
/**
* 课程名称。
*/
@ApiModelProperty(value = "课程名称")
private String courseName;
/**
* 学生上课次数。
*/
@ApiModelProperty(value = "学生上课次数")
private Integer studentAttendCount;
/**
* 学生献花数量。
*/
@ApiModelProperty(value = "学生献花数量")
private Integer studentFlowerAmount;
/**
* 学生献花次数。
*/
@ApiModelProperty(value = "学生献花次数")
private Integer studentFlowerCount;
/**
* gradeId 字典关联数据。
*/
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap;
/**
* subjectId 常量字典关联数据。
*/
@ApiModelProperty(value = "subjectId 常量字典关联数据")
private Map<String, Object> subjectIdDictMap;
}

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@@ -13,151 +11,126 @@ import java.util.Map;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentActionStatsVO实体对象")
@Data
public class StudentActionStatsVo {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id")
private Long statsId;
/**
* 统计日期。
*/
@ApiModelProperty(value = "统计日期")
private Date statsDate;
/**
* 统计小时。
*/
@ApiModelProperty(value = "统计小时")
private Date statsMonth;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id")
private Integer gradeId;
/**
* 学生所在省Id。
*/
@ApiModelProperty(value = "学生所在省Id")
private Long provinceId;
/**
* 学生所在城市Id。
*/
@ApiModelProperty(value = "学生所在城市Id")
private Long cityId;
/**
* 购课学币数量。
*/
@ApiModelProperty(value = "购课学币数量")
private Integer buyCourseAmount;
/**
* 购买课程次数。
*/
@ApiModelProperty(value = "购买课程次数")
private Integer buyCourseCount;
/**
* 购买视频学币数量。
*/
@ApiModelProperty(value = "购买视频学币数量")
private Integer buyVideoAmount;
/**
* 购买视频次数。
*/
@ApiModelProperty(value = "购买视频次数")
private Integer buyVideoCount;
/**
* 购买作业学币数量。
*/
@ApiModelProperty(value = "购买作业学币数量")
private Integer buyPaperAmount;
/**
* 购买作业次数。
*/
@ApiModelProperty(value = "购买作业次数")
private Integer buyPaperCount;
/**
* 购买献花数量。
*/
@ApiModelProperty(value = "购买献花数量")
private Integer buyFlowerAmount;
/**
* 购买献花次数。
*/
@ApiModelProperty(value = "购买献花次数")
private Integer buyFlowerCount;
/**
* 充值学币数量。
*/
@ApiModelProperty(value = "充值学币数量")
private Integer rechargeCoinAmount;
/**
* 充值学币次数。
*/
@ApiModelProperty(value = "充值学币次数")
private Integer rechargeCoinCount;
/**
* 线下课程上课次数。
*/
@ApiModelProperty(value = "线下课程上课次数")
private Integer doCourseCount;
/**
* 观看视频次数。
*/
@ApiModelProperty(value = "观看视频次数")
private Integer watchVideoCount;
/**
* 购买献花消费学币数量。
*/
@ApiModelProperty(value = "购买献花消费学币数量")
private Integer watchVideoTotalSecond;
/**
* 做题数量。
*/
@ApiModelProperty(value = "做题数量")
private Integer doExerciseCount;
/**
* 做题正确的数量。
*/
@ApiModelProperty(value = "做题正确的数量")
private Integer doExerciseCorrectCount;
/**
* gradeId 字典关联数据。
*/
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap;
/**
* provinceId 字典关联数据。
*/
@ApiModelProperty(value = "provinceId 字典关联数据")
private Map<String, Object> provinceIdDictMap;
/**
* cityId 字典关联数据。
*/
@ApiModelProperty(value = "cityId 字典关联数据")
private Map<String, Object> cityIdDictMap;
}

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@@ -13,121 +11,101 @@ import java.util.Map;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentActionTransVO实体对象")
@Data
public class StudentActionTransVo {
/**
* 主键Id。
*/
@ApiModelProperty(value = "主键Id")
private Long transId;
/**
* 学生Id。
*/
@ApiModelProperty(value = "学生Id")
private Long studentId;
/**
* 学生名称。
*/
@ApiModelProperty(value = "学生名称")
private String studentName;
/**
* 学生校区。
*/
@ApiModelProperty(value = "学生校区")
private Long schoolId;
/**
* 年级Id。
*/
@ApiModelProperty(value = "年级Id")
private Integer gradeId;
/**
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
*/
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)")
private Integer actionType;
/**
* 设备类型(0: iOS 1: Android 2: PC)。
*/
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)")
private Integer deviceType;
/**
* 看视频秒数。
*/
@ApiModelProperty(value = "看视频秒数")
private Integer watchVideoSeconds;
/**
* 购买献花数量。
*/
@ApiModelProperty(value = "购买献花数量")
private Integer flowerCount;
/**
* 购买作业数量。
*/
@ApiModelProperty(value = "购买作业数量")
private Integer paperCount;
/**
* 购买视频数量。
*/
@ApiModelProperty(value = "购买视频数量")
private Integer videoCount;
/**
* 购买课程数量。
*/
@ApiModelProperty(value = "购买课程数量")
private Integer courseCount;
/**
* 充值学币数量。
*/
@ApiModelProperty(value = "充值学币数量")
private Integer coinCount;
/**
* 做题是否正确标记。
*/
@ApiModelProperty(value = "做题是否正确标记")
private Integer exerciseCorrectFlag;
/**
* 发生时间。
*/
@ApiModelProperty(value = "发生时间")
private Date createTime;
/**
* schoolId 字典关联数据。
*/
@ApiModelProperty(value = "schoolId 字典关联数据")
private Map<String, Object> schoolIdDictMap;
/**
* gradeId 字典关联数据。
*/
@ApiModelProperty(value = "gradeId 字典关联数据")
private Map<String, Object> gradeIdDictMap;
/**
* actionType 常量字典关联数据。
*/
@ApiModelProperty(value = "actionType 常量字典关联数据")
private Map<String, Object> actionTypeDictMap;
/**
* deviceType 常量字典关联数据。
*/
@ApiModelProperty(value = "deviceType 常量字典关联数据")
private Map<String, Object> deviceTypeDictMap;
}

View File

@@ -1,7 +1,5 @@
package com.orange.demo.app.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@@ -13,73 +11,61 @@ import java.util.Map;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("StudentClassVO实体对象")
@Data
public class StudentClassVo {
/**
* 班级Id。
*/
@ApiModelProperty(value = "班级Id")
private Long classId;
/**
* 班级名称。
*/
@ApiModelProperty(value = "班级名称")
private String className;
/**
* 学校Id。
*/
@ApiModelProperty(value = "学校Id")
private Long schoolId;
/**
* 学生班长Id。
*/
@ApiModelProperty(value = "学生班长Id")
private Long leaderId;
/**
* 已完成课时数量。
*/
@ApiModelProperty(value = "已完成课时数量")
private Integer finishClassHour;
/**
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
*/
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)")
private Integer classLevel;
/**
* 创建用户。
*/
@ApiModelProperty(value = "创建用户")
private Long createUserId;
/**
* 班级创建时间。
*/
@ApiModelProperty(value = "班级创建时间")
private Date createTime;
/**
* schoolId 字典关联数据。
*/
@ApiModelProperty(value = "schoolId 字典关联数据")
private Map<String, Object> schoolIdDictMap;
/**
* leaderId 字典关联数据。
*/
@ApiModelProperty(value = "leaderId 字典关联数据")
private Map<String, Object> leaderIdDictMap;
/**
* classLevel 常量字典关联数据。
*/
@ApiModelProperty(value = "classLevel 常量字典关联数据")
private Map<String, Object> classLevelDictMap;
}

View File

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

View File

@@ -8,7 +8,7 @@ import com.orange.demo.common.core.object.ResponseResult;
import com.orange.demo.common.core.object.TokenData;
import com.orange.demo.common.core.util.ApplicationContextHolder;
import com.orange.demo.common.core.util.JwtUtil;
import com.orange.demo.common.core.cache.SessionCacheHelper;
import com.orange.demo.common.redis.cache.SessionCacheHelper;
import io.jsonwebtoken.Claims;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -30,10 +30,10 @@ import java.io.PrintWriter;
@Slf4j
public class AuthenticationInterceptor implements HandlerInterceptor {
private ApplicationConfig appConfig =
private final ApplicationConfig appConfig =
ApplicationContextHolder.getBean("applicationConfig");
private SessionCacheHelper cacheHelper =
private final SessionCacheHelper cacheHelper =
ApplicationContextHolder.getBean("sessionCacheHelper");
@Override

View File

@@ -1,10 +1,6 @@
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.*;
@@ -18,7 +14,7 @@ import com.orange.demo.common.core.constant.ErrorCodeEnum;
import com.orange.demo.common.core.object.ResponseResult;
import com.orange.demo.common.core.object.TokenData;
import com.orange.demo.common.core.util.*;
import com.orange.demo.common.core.cache.SessionCacheHelper;
import com.orange.demo.common.redis.cache.SessionCacheHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.*;
@@ -33,8 +29,6 @@ import java.util.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiSupport(order = 1)
@Api(tags = "用户登录接口")
@Slf4j
@RestController
@RequestMapping("/admin/upms/login")
@@ -56,12 +50,6 @@ 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
@PostMapping("/doLogin")
public ResponseResult<JSONObject> doLogin(

View File

@@ -12,8 +12,6 @@ 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 org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +26,6 @@ import javax.validation.groups.Default;
* @author Jerry
* @date 2020-09-24
*/
@Api(tags = "用户管理管理接口")
@Slf4j
@RestController
@RequestMapping("/admin/upms/sysUser")
@@ -47,10 +44,6 @@ public class SysUserController {
* @param sysUserDto 新增用户对象。
* @return 应答结果对象包含新增用户的主键Id。
*/
@ApiOperationSupport(ignoreParameters = {
"sysUser.userId",
"sysUser.createTimeStart",
"sysUser.createTimeEnd"})
@PostMapping("/add")
public ResponseResult<Long> add(@MyRequestBody("sysUser") SysUserDto sysUserDto) {
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, Default.class, AddGroup.class);
@@ -72,9 +65,6 @@ public class SysUserController {
* @param sysUserDto 更新用户对象。
* @return 应答结果对象。
*/
@ApiOperationSupport(ignoreParameters = {
"sysUser.createTimeStart",
"sysUser.createTimeEnd"})
@PostMapping("/update")
public ResponseResult<Void> update(@MyRequestBody("sysUser") SysUserDto sysUserDto) {
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, Default.class, UpdateGroup.class);

View File

@@ -6,8 +6,6 @@ import com.orange.demo.common.core.validator.ConstDictRef;
import com.orange.demo.upms.model.constant.SysUserType;
import com.orange.demo.upms.model.constant.SysUserStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
@@ -18,42 +16,36 @@ import javax.validation.constraints.*;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("SysUserDto对象")
@Data
public class SysUserDto {
/**
* 用户Id。
*/
@ApiModelProperty(value = "用户Id", required = true)
@NotNull(message = "数据验证失败用户Id不能为空", groups = {UpdateGroup.class})
private Long userId;
/**
* 登录用户名。
*/
@ApiModelProperty(value = "登录用户名", required = true)
@NotBlank(message = "数据验证失败,登录用户名不能为空!")
private String loginName;
/**
* 用户密码。
*/
@ApiModelProperty(value = "用户密码", required = true)
@NotBlank(message = "数据验证失败,用户密码不能为空!", groups = {AddGroup.class})
private String password;
/**
* 用户显示名称。
*/
@ApiModelProperty(value = "用户显示名称", required = true)
@NotBlank(message = "数据验证失败,用户显示名称不能为空!")
private String showName;
/**
* 用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)。
*/
@ApiModelProperty(value = "用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)", required = true)
@NotNull(message = "数据验证失败,用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)不能为空!")
@ConstDictRef(constDictClass = SysUserType.class, message = "数据验证失败,用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)为无效值!")
private Integer userType;
@@ -61,13 +53,11 @@ public class SysUserDto {
/**
* 用户头像的Url。
*/
@ApiModelProperty(value = "用户头像的Url")
private String headImageUrl;
/**
* 用户状态(0: 正常 1: 锁定)。
*/
@ApiModelProperty(value = "用户状态(0: 正常 1: 锁定)", required = true)
@NotNull(message = "数据验证失败,用户状态(0: 正常 1: 锁定)不能为空!")
@ConstDictRef(constDictClass = SysUserStatus.class, message = "数据验证失败,用户状态(0: 正常 1: 锁定)为无效值!")
private Integer userStatus;
@@ -75,12 +65,10 @@ public class SysUserDto {
/**
* createTime 范围过滤起始值(>=)。
*/
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
private String createTimeStart;
/**
* createTime 范围过滤结束值(<=)。
*/
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
private String createTimeEnd;
}

View File

@@ -1,6 +1,5 @@
package com.orange.demo.upms.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.orange.demo.upms.model.constant.SysUserType;
import com.orange.demo.upms.model.constant.SysUserStatus;
import com.orange.demo.common.core.annotation.RelationConstDict;
@@ -70,7 +69,6 @@ public class SysUser {
/**
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
*/
@JSONField(serialize = false)
@DeletedFlagColumn
@Column(name = "deleted_flag")
private Integer deletedFlag;

View File

@@ -54,11 +54,10 @@ public class SysUserServiceImpl extends BaseService<SysUser, Long> implements Sy
*/
@Override
public SysUser getSysUserByLoginName(String loginName) {
Example e = new Example(SysUser.class);
Example.Criteria c = e.createCriteria();
c.andEqualTo("loginName", loginName);
c.andEqualTo("deletedFlag", GlobalDeletedFlag.NORMAL);
return sysUserMapper.selectOneByExample(e);
SysUser filter = new SysUser();
filter.setLoginName(loginName);
filter.setDeletedFlag(GlobalDeletedFlag.NORMAL);
return sysUserMapper.selectOne(filter);
}
/**

View File

@@ -1,7 +1,5 @@
package com.orange.demo.upms.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@@ -13,85 +11,66 @@ import java.util.Map;
* @author Jerry
* @date 2020-09-24
*/
@ApiModel("SysUserVO实体对象")
@Data
public class SysUserVo {
/**
* 用户Id。
*/
@ApiModelProperty(value = "用户Id")
private Long userId;
/**
* 登录用户名。
*/
@ApiModelProperty(value = "登录用户名")
private String loginName;
/**
* 用户密码。
*/
@ApiModelProperty(value = "用户密码")
private String password;
/**
* 用户显示名称。
*/
@ApiModelProperty(value = "用户显示名称")
private String showName;
/**
* 用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)。
*/
@ApiModelProperty(value = "用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)")
private Integer userType;
/**
* 用户头像的Url。
*/
@ApiModelProperty(value = "用户头像的Url")
private String headImageUrl;
/**
* 用户状态(0: 正常 1: 锁定)。
*/
@ApiModelProperty(value = "用户状态(0: 正常 1: 锁定)")
private Integer userStatus;
/**
* 创建用户Id。
*/
@ApiModelProperty(value = "创建用户Id")
private Long createUserId;
/**
* 更新者Id。
*/
@ApiModelProperty(value = "更新者Id")
private Long updateUserId;
/**
* 创建时间。
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新时间。
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* userType 常量字典关联数据。
*/
@ApiModelProperty(value = "userType 常量字典关联数据")
private Map<String, Object> userTypeDictMap;
/**
* userStatus 常量字典关联数据。
*/
@ApiModelProperty(value = "userStatus 常量字典关联数据")
private Map<String, Object> userStatusDictMap;
}

View File

@@ -56,14 +56,35 @@ pagehelper:
supportMethodsArguments: false
params: count=countSql
swagger:
# 当enabled为false的时候则可禁用swagger
enabled: true
# 工程的基础包名。
basePackage: com.orange.demo
title: 橙单单体服务工程
description: 橙单单体服务工程详情
version: 1.0
# 存储session数据的Redis所有服务均需要因此放到公共配置中。
# 根据实际情况该Redis也可以用于存储其他数据
redis:
jedis:
enabled: true
host: localhost
port: 6379
timeout: 60000
pool:
maxTotal: 20
maxIdle: 8
minIdle: 0
maxWait: 2000
# redisson的配置。每个服务可以自己的配置文件中覆盖此选项。
redisson:
# 如果该值为false系统将不会创建RedissionClient的bean。
enabled: true
# redis地址多个地址之间逗号分隔。如果是从主机制第一个为master其余为slave。
address: localhost:6379
# 链接超时,单位毫秒。
timeout: 6000
# 单位毫秒。分布式锁的超时检测时长。
# 如果一次锁内操作超该毫秒数或在释放锁之前异常退出Redis会在该时长之后主动删除该锁使用的key。
lockWatchdogTimeout: 60000
pool:
# 连接池数量。
poolSize: 20
# 连接池中最小空闲数量。
minIdle: 5
# 暴露监控端点
management:

View File

@@ -53,9 +53,6 @@
<root level="${OUTPUT_LOG_LEVEL}">
<AppenderRef ref="console"/>
</root>
<Logger name="springfox.documentation" additivity="false" level="error">
<AppenderRef ref="console"/>
</Logger>
<Logger name="com.orange.demo" additivity="false" level="info">
<AppenderRef ref="console"/>
<AppenderRef ref="file_log"/>

View File

@@ -0,0 +1,16 @@
package com.orange.demo.common.core.annotation;
import java.lang.annotation.*;
/**
* 主要用于标记数据权限中基于DeptId进行过滤的字段。
*
* @author Jerry
* @date 2020-09-24
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DeptFilterColumn {
}

View File

@@ -0,0 +1,17 @@
package com.orange.demo.common.core.annotation;
import java.lang.annotation.*;
/**
* 作为DisableDataFilterAspect的切点。
* 该注解仅能标记在方法上方法内所有的查询语句均不会被Mybatis拦截器过滤数据。
*
* @author Jerry
* @date 2020-09-24
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DisableDataFilter {
}

View File

@@ -0,0 +1,28 @@
package com.orange.demo.common.core.annotation;
import java.lang.annotation.*;
/**
* 仅用于微服务的多租户项目。
* 用于注解DAO层Mapper对象的租户过滤规则。被包含的方法将不会进行租户Id的过滤。
* 对于tk mapper和mybatis plus中的内置方法可以直接指定方法名即可selectOne。
* 需要说明的是在大多数场景下只要在实体对象中指定了租户Id字段基于该主表的绝大部分增删改操作
* 都需要经过租户Id过滤仅当查询非常复杂或者主表不在SQL语句之中的时候可以通过该注解禁用该SQL
* 并根据需求通过手动的方式实现租户过滤。
*
* @author Jerry
* @date 2020-09-24
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DisableTenantFilter {
/**
* 包含的方法名称数组。该值不能为空,因为如想取消所有方法的租户过滤,
* 可以通过在实体对象中不指定租户Id字段注解的方式实现。
*
* @return 被包括的方法名称数组。
*/
String[] includeMethodName();
}

View File

@@ -0,0 +1,27 @@
package com.orange.demo.common.core.annotation;
import java.lang.annotation.*;
/**
* 用于注解DAO层Mapper对象的数据权限规则。
* 由于框架使用了tk.mapper所以并非所有的Mapper接口均在当前Mapper对象中定义有一部分被tk.mapper封装如selectAll等。
* 如果需要排除tk.mapper中的方法可以直接使用tk.mapper基类所声明的方法名称即可。
* 另外比较特殊的场景是因为tk.mapper是通用框架所以同样的selectAll方法可以获取不同的数据集合因此在service中如果
* 出现两个不同的方法调用Mapper的selectAll方法但是一个需要参与过滤另外一个不需要参与那么就需要修改当前类的Mapper方法
* 将其中一个方法重新定义一个具体的接口方法,并重新设定其是否参与数据过滤。
*
* @author Jerry
* @date 2020-09-24
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface EnableDataPerm {
/**
* 排除的方法名称数组。如果为空所有的方法均会被Mybaits拦截注入权限过滤条件。
*
* @return 被排序的方法名称数据。
*/
String[] excluseMethodName() default {};
}

View File

@@ -0,0 +1,16 @@
package com.orange.demo.common.core.annotation;
import java.lang.annotation.*;
/**
* 主要用于标记通过租户Id进行过滤的字段。
*
* @author Jerry
* @date 2020-09-24
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface TenantFilterColumn {
}

View File

@@ -0,0 +1,16 @@
package com.orange.demo.common.core.annotation;
import java.lang.annotation.*;
/**
* 主要用于标记数据权限中基于UserId进行过滤的字段。
*
* @author Jerry
* @date 2020-09-24
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface UserFilterColumn {
}

View File

@@ -1,90 +0,0 @@
package com.orange.demo.common.core.cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.caffeine.CaffeineCache;
import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
/**
* 使用Caffeine作为本地缓存库
*
* @author Jerry
* @date 2020-09-24
*/
@Configuration
@EnableCaching
public class CacheConfig {
private static final int DEFAULT_MAXSIZE = 10000;
private static final int DEFAULT_TTL = 3600;
/**
* 定义cache名称、超时时长秒、最大个数
* 每个cache缺省3600秒过期最大个数1000
*/
public enum CacheEnum {
/**
* 专门存储用户权限的缓存。
*/
USER_PERMISSION_CACHE(1800, 10000),
/**
* session下上传文件名的缓存(时间是24小时)。
*/
UPLOAD_FILENAME_CACHE(86400, 20000),
/**
* 缺省全局缓存(时间是24小时)。
*/
GLOBAL_CACHE(86400, 20000);
CacheEnum() {
}
CacheEnum(int ttl, int maxSize) {
this.ttl = ttl;
this.maxSize = maxSize;
}
/**
* 缓存的最大数量。
*/
private int maxSize = DEFAULT_MAXSIZE;
/**
* 缓存的时长(单位:秒)
*/
private int ttl = DEFAULT_TTL;
public int getMaxSize() {
return maxSize;
}
public int getTtl() {
return ttl;
}
}
/**
* 初始化缓存配置。
*/
@Bean
public CacheManager cacheManager() {
SimpleCacheManager manager = new SimpleCacheManager();
// 把各个cache注册到cacheManager中CaffeineCache实现了org.springframework.cache.Cache接口
ArrayList<CaffeineCache> caches = new ArrayList<>();
for (CacheEnum c : CacheEnum.values()) {
caches.add(new CaffeineCache(c.name(),
Caffeine.newBuilder().recordStats()
.expireAfterAccess(c.getTtl(), TimeUnit.SECONDS)
.maximumSize(c.getMaxSize())
.build())
);
}
manager.setCaches(caches);
return manager;
}
}

View File

@@ -206,7 +206,7 @@ public class MyRequestArgumentResolver implements HandlerMethodArgumentResolver
}
}
} else if (parameterType == Boolean.class) {
return value.toString();
return value;
} else if (parameterType == Character.class) {
return value.toString().charAt(0);
}

View File

@@ -0,0 +1,52 @@
package com.orange.demo.common.core.object;
import cn.hutool.core.util.BooleanUtil;
/**
* 线程本地化数据管理的工具类。可根据需求自行添加更多的线程本地化变量及其操作方法。
*
* @author Jerry
* @date 2020-09-24
*/
public class GlobalThreadLocal {
/**
* 存储数据权限过滤是否启用的线程本地化对象。
* 目前的过滤条件,包括数据权限和租户过滤。
*/
private static final ThreadLocal<Boolean> DATA_FILTER_ENABLE = ThreadLocal.withInitial(() -> Boolean.TRUE);
/**
* 设置数据过滤是否打开。如果打开当前Servlet线程所执行的SQL操作均会进行数据过滤。
*
* @param enable 打开为true否则false。
* @return 返回之前的状态,便于恢复。
*/
public static boolean setDataFilter(boolean enable) {
boolean oldValue = DATA_FILTER_ENABLE.get();
DATA_FILTER_ENABLE.set(enable);
return oldValue;
}
/**
* 判断当前Servlet线程所执行的SQL操作是否进行数据过滤。
*
* @return true 进行数据权限过滤否则false。
*/
public static boolean enabledDataFilter() {
return BooleanUtil.isTrue(DATA_FILTER_ENABLE.get());
}
/**
* 清空该存储数据,主动释放线程本地化存储资源。
*/
public static void clearDataFilter() {
DATA_FILTER_ENABLE.remove();
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private GlobalThreadLocal() {
}
}

View File

@@ -24,6 +24,16 @@ public class TokenData {
* 用户Id。
*/
private Long userId;
/**
* 用户所在部门Id。
* 仅当系统支持uaa时可用否则可以直接忽略该字段。保留该字段是为了保持单体和微服务通用代码部分的兼容性。
*/
private Long deptId;
/**
* 租户Id。
* 仅当系统支持uaa时可用否则可以直接忽略该字段。保留该字段是为了保持单体和微服务通用代码部分的兼容性。
*/
private Long tenantId;
/**
* 是否为超级管理员。
*/
@@ -36,6 +46,11 @@ public class TokenData {
* 标识不同登录的会话Id。
*/
private String sessionId;
/**
* 访问uaa的授权token。
* 仅当系统支持uaa时可用否则可以直接忽略该字段。保留该字段是为了保持单体和微服务通用代码部分的兼容性。
*/
private String uaaAccessToken;
/**
* 将令牌对象添加到Http请求对象。

View File

@@ -0,0 +1,36 @@
package com.orange.demo.common.core.util;
/**
* Redis 键生成工具类。
*
* @author Jerry
* @date 2020-09-24
*/
public class RedisKeyUtil {
/**
* 计算SessionId关联的权限数据存储于Redis中的键。
*
* @param sessionId 会话Id。
* @return 会话关联的权限数据存储于Redis中的键值。
*/
public static String makeSessionPermIdKeyForRedis(String sessionId) {
return "PERM__" + sessionId;
}
/**
* 计算SessionId关联的数据权限数据存储于Redis中的键。
*
* @param sessionId 会话Id。
* @return 会话关联的数据权限数据存储于Redis中的键值。
*/
public static String makeSessionDataPermIdKeyForRedis(String sessionId) {
return "DATA_PERM__" + sessionId;
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private RedisKeyUtil() {
}
}

View File

@@ -9,21 +9,26 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-swagger</artifactId>
<artifactId>common-redis</artifactId>
<version>1.0.0</version>
<name>common-swagger</name>
<name>common-redis</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j.version}</version>
</dependency>
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${jedis.version}</version>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>${redisson.version}</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,412 @@
package com.orange.demo.common.redis.cache;
import com.alibaba.fastjson.JSON;
import com.orange.demo.common.core.cache.DictionaryCache;
import com.orange.demo.common.core.constant.ApplicationConstant;
import com.orange.demo.common.core.exception.RedisCacheAccessException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.redisson.api.RMap;
import org.redisson.api.RedissonClient;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 字典数据Redis缓存对象。
*
* @param <K> 字典表主键类型。
* @param <V> 字典表对象类型。
* @author Jerry
* @date 2020-09-24
*/
@Slf4j
public class RedisDictionaryCache<K, V> implements DictionaryCache<K, V> {
/**
* redisson客户端。
*/
protected final RedissonClient redissonClient;
/**
* 数据存储对象。
*/
protected final RMap<K, String> dataMap;
/**
* 字典值对象类型。
*/
protected final Class<V> valueClazz;
/**
* 由于大部分场景是读取操作,所以使用读写锁提高并发的伸缩性。
*/
protected final ReadWriteLock lock;
/**
* 获取字典主键数据的函数对象。
*/
protected final Function<V, K> idGetter;
/**
* 超时时长。单位毫秒。
*/
protected static final long TIMEOUT = 2000L;
/**
* 当前对象的构造器函数。
*
* @param redissonClient Redisson的客户端对象。
* @param dictionaryName 字典表的名称。等同于redis hash对象的key。
* @param valueClazz 值对象的Class对象。
* @param idGetter 获取当前类主键字段值的函数对象。
* @param <K> 字典主键类型。
* @param <V> 字典对象类型
* @return 实例化后的字典内存缓存对象。
*/
public static <K, V> RedisDictionaryCache<K, V> create(
RedissonClient redissonClient,
String dictionaryName,
Class<V> valueClazz,
Function<V, K> idGetter) {
if (idGetter == null) {
throw new IllegalArgumentException("IdGetter can't be NULL.");
}
return new RedisDictionaryCache<>(redissonClient, dictionaryName, valueClazz, idGetter);
}
/**
* 构造函数。
*
* @param redissonClient Redisson的客户端对象。
* @param dictionaryName 字典表的名称。等同于redis hash对象的key。确保全局唯一。
* @param valueClazz 值对象的Class对象。
* @param idGetter 获取当前类主键字段值的函数对象。
*/
public RedisDictionaryCache(
RedissonClient redissonClient,
String dictionaryName,
Class<V> valueClazz,
Function<V, K> idGetter) {
this.redissonClient = redissonClient;
this.dataMap = redissonClient.getMap(dictionaryName + ApplicationConstant.DICT_CACHE_NAME_SUFFIX);
this.lock = new ReentrantReadWriteLock();
this.valueClazz = valueClazz;
this.idGetter = idGetter;
}
/**
* 按照数据插入的顺序返回全部字典对象的列表。
*
* @return 全部字段数据列表。
*/
@Override
public List<V> getAll() {
Collection<String> dataList;
String exceptionMessage;
try {
if (lock.readLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataList = dataMap.readAllValues();
} finally {
// 如果上面的操作时间超过redisson.lockWatchdogTimeout的时长
// redis会将与该锁关联的键删除此后调用unlock的时候就会抛出运行时异常。
lock.readLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::getAll] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
if (CollectionUtils.isEmpty(dataList)) {
return new LinkedList<>();
}
return dataList.stream()
.map(data -> JSON.parseObject(data, valueClazz))
.collect(Collectors.toCollection(LinkedList::new));
}
/**
* 获取缓存中与键列表对应的对象列表。
*
* @param keys 主键集合。
* @return 对象列表。
*/
@Override
public List<V> getInList(Set<K> keys) {
if (CollectionUtils.isEmpty(keys)) {
return new LinkedList<>();
}
Collection<String> dataList;
String exceptionMessage;
try {
if (lock.readLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataList = dataMap.getAll(keys).values();
} finally {
lock.readLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::getInList] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
if (dataList == null) {
return new LinkedList<>();
}
return dataList.stream()
.map(data -> JSON.parseObject(data, valueClazz))
.collect(Collectors.toCollection(LinkedList::new));
}
/**
* 从缓存中获取指定的数据。
*
* @param id 数据的key。
* @return 获取到的数据如果没有返回null。
*/
@Override
public V get(K id) {
if (id == null) {
return null;
}
String data;
String exceptionMessage;
try {
if (lock.readLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
data = dataMap.get(id);
} finally {
lock.readLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::get] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
if (data == null) {
return null;
}
return JSON.parseObject(data, valueClazz);
}
/**
* 获取缓存中数据条目的数量。
*
* @return 返回缓存的数据数量。
*/
@Override
public int getCount() {
return dataMap.size();
}
/**
* 将参数List中的数据保存到缓存中同时保证getAll返回的数据列表与参数列表中数据项的顺序保持一致。
*
* @param dataList 待缓存的数据列表。
*/
@Override
public void putAll(List<V> dataList) {
if (CollectionUtils.isEmpty(dataList)) {
return;
}
Map<K, String> map = dataList.stream()
.collect(Collectors.toMap(idGetter, JSON::toJSONString));
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataMap.putAll(map, 1000);
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::putAll] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 将数据存入缓存。
*
* @param id 通常为字典数据的主键。
* @param data 字典数据对象。
*/
@Override
public void put(K id, V data) {
if (id == null || data == null) {
return;
}
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataMap.fastPut(id, JSON.toJSONString(data));
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::put] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 重新加载先清空原有数据在执行putAll的操作。
*
* @param dataList 待缓存的数据列表。
* @param force true则强制刷新如果false当缓存中存在数据时不刷新。
*/
@Override
public void reload(List<V> dataList, boolean force) {
Map<K, String> map = null;
if (CollectionUtils.isNotEmpty(dataList)) {
map = dataList.stream().collect(Collectors.toMap(idGetter, JSON::toJSONString));
}
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
// 如果不强制刷新,需要先判断缓存中是否存在数据。
if (!force && this.getCount() > 0) {
return;
}
dataMap.clear();
if (map != null) {
dataMap.putAll(map, 1000);
}
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::reload] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 删除缓存中指定的键。
*
* @param id 待删除数据的主键。
* @return 返回被删除的对象如果主键不存在返回null。
*/
@Override
public V invalidate(K id) {
if (id == null) {
return null;
}
String data;
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
data = dataMap.remove(id);
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::invalidate] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
if (data == null) {
return null;
}
return JSON.parseObject(data, valueClazz);
}
/**
* 删除缓存中,参数列表中包含的键。
*
* @param keys 待删除数据的主键集合。
*/
@SuppressWarnings("unchecked")
@Override
public void invalidateSet(Set<K> keys) {
if (CollectionUtils.isEmpty(keys)) {
return;
}
Object[] keyArray = keys.toArray(new Object[]{});
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataMap.fastRemove((K[]) keyArray);
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::invalidateSet] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 清空缓存。
*/
@Override
public void invalidateAll() {
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataMap.clear();
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::invalidateAll] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
}

View File

@@ -0,0 +1,352 @@
package com.orange.demo.common.redis.cache;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import com.orange.demo.common.core.exception.RedisCacheAccessException;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
import org.apache.commons.collections4.CollectionUtils;
import org.redisson.api.RListMultimap;
import org.redisson.api.RedissonClient;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 树形字典数据Redis缓存对象。
*
* @param <K> 字典表主键类型。
* @param <V> 字典表对象类型。
* @author Jerry
* @date 2020-09-24
*/
@Slf4j
public class RedisTreeDictionaryCache<K, V> extends RedisDictionaryCache<K, V> {
/**
* 树形数据存储对象。
*/
private final RListMultimap<K, String> allTreeMap;
/**
* 获取字典父主键数据的函数对象。
*/
protected final Function<V, K> parentIdGetter;
/**
* 当前对象的构造器函数。
*
* @param redissonClient Redisson的客户端对象。
* @param dictionaryName 字典表的名称。等同于redis hash对象的key。
* @param valueClazz 值对象的Class对象。
* @param idGetter 获取当前类主键字段值的函数对象。
* @param parentIdGetter 获取当前类父主键字段值的函数对象。
* @param <K> 字典主键类型。
* @param <V> 字典对象类型
* @return 实例化后的树形字典内存缓存对象。
*/
public static <K, V> RedisTreeDictionaryCache<K, V> create(
RedissonClient redissonClient,
String dictionaryName,
Class<V> valueClazz,
Function<V, K> idGetter,
Function<V, K> parentIdGetter) {
if (idGetter == null) {
throw new IllegalArgumentException("IdGetter can't be NULL.");
}
if (parentIdGetter == null) {
throw new IllegalArgumentException("ParentIdGetter can't be NULL.");
}
return new RedisTreeDictionaryCache<>(
redissonClient, dictionaryName, valueClazz, idGetter, parentIdGetter);
}
/**
* 构造函数。
*
* @param redissonClient Redisson的客户端对象。
* @param dictionaryName 字典表的名称。等同于redis hash对象的key。
* @param valueClazz 值对象的Class对象。
* @param idGetter 获取当前类主键字段值的函数对象。
* @param parentIdGetter 获取当前类父主键字段值的函数对象。
*/
public RedisTreeDictionaryCache(
RedissonClient redissonClient,
String dictionaryName,
Class<V> valueClazz,
Function<V, K> idGetter,
Function<V, K> parentIdGetter) {
super(redissonClient, dictionaryName, valueClazz, idGetter);
this.allTreeMap = redissonClient.getListMultimap(dictionaryName + "-TREE-DICT");
this.parentIdGetter = parentIdGetter;
}
/**
* 获取该父主键的子数据列表。
*
* @param parentId 父主键Id。如果parentId为null则返回所有一级节点数据。
* @return 子数据列表。
*/
public List<V> getListByParentId(K parentId) {
List<String> dataList;
String exceptionMessage;
try {
if (lock.readLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataList = allTreeMap.get(parentId);
} finally {
lock.readLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisTreeDictionaryCache::getListByParentId] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
if (CollectionUtils.isEmpty(dataList)) {
return new LinkedList<>();
}
List<V> resultList = new LinkedList<>();
dataList.forEach(data -> resultList.add(JSON.parseObject(data, valueClazz)));
return resultList;
}
/**
* 将参数List中的数据保存到缓存中同时保证getAll返回的数据列表与参数列表中数据项的顺序保持一致。
*
* @param dataList 待缓存的数据列表。
*/
@Override
public void putAll(List<V> dataList) {
if (CollectionUtils.isEmpty(dataList)) {
return;
}
// 锁外执行数据结构组装,降低锁的粒度,提高并发性。
Map<K, String> map = dataList.stream()
.collect(Collectors.toMap(idGetter, JSON::toJSONString));
Multimap<K, String> treeMap = LinkedListMultimap.create();
for (V data : dataList) {
treeMap.put(parentIdGetter.apply(data), JSON.toJSONString(data));
}
Set<Map.Entry<K, Collection<String>>> entries = treeMap.asMap().entrySet();
String exceptionMessage;
try {
if (this.lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataMap.putAll(map, 1000);
for (Map.Entry<K, Collection<String>> entry : entries) {
allTreeMap.removeAll(entry.getKey());
allTreeMap.putAll(entry.getKey(), entry.getValue());
}
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisTreeDictionaryCache::putAll] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 将数据存入缓存。
*
* @param id 通常为字典数据的主键。
* @param data 字典数据对象。
*/
@Override
public void put(K id, V data) {
if (id == null || data == null) {
return;
}
String stringData = JSON.toJSONString(data);
K parentId = parentIdGetter.apply(data);
String exceptionMessage;
try {
if (this.lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
String oldData = dataMap.put(id, stringData);
if (oldData != null) {
allTreeMap.remove(parentId, oldData);
}
allTreeMap.put(parentId, stringData);
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisTreeDictionaryCache::put] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 行为等同于接口中的描述。这里之所以重写是因为不确定redisson的读写锁
* 是否为可重入锁。
*
* @param dataList 待缓存的数据列表。
* @param force true则强制刷新如果false当缓存中存在数据时不刷新。
*/
@Override
public void reload(List<V> dataList, boolean force) {
// 锁外执行数据结构组装,降低锁的粒度,提高并发性。
Map<K, String> map = null;
Set<Map.Entry<K, Collection<String>>> entries = null;
if (CollectionUtils.isNotEmpty(dataList)) {
map = dataList.stream().collect(Collectors.toMap(idGetter, JSON::toJSONString));
Multimap<K, String> treeMap = LinkedListMultimap.create();
for (V data : dataList) {
treeMap.put(parentIdGetter.apply(data), JSON.toJSONString(data));
}
entries = treeMap.asMap().entrySet();
}
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
// 如果不强制刷新,需要先判断缓存中是否存在数据。
if (!force && this.getCount() > 0) {
return;
}
dataMap.clear();
allTreeMap.clear();
if (map != null) {
dataMap.putAll(map, 1000);
for (Map.Entry<K, Collection<String>> entry : entries) {
allTreeMap.removeAll(entry.getKey());
allTreeMap.putAll(entry.getKey(), entry.getValue());
}
}
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisDictionaryCache::reload] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 删除缓存中指定的键。
*
* @param id 待删除数据的主键。
* @return 返回被删除的对象如果主键不存在返回null。
*/
@Override
public V invalidate(K id) {
if (id == null) {
return null;
}
V data = null;
String exceptionMessage;
try {
if (this.lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
String stringData = dataMap.remove(id);
if (stringData != null) {
data = JSON.parseObject(stringData, valueClazz);
K parentId = parentIdGetter.apply(data);
allTreeMap.remove(parentId, stringData);
}
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisTreeDictionaryCache::invalidate] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
return data;
}
/**
* 删除缓存中,参数列表中包含的键。
*
* @param keys 待删除数据的主键集合。
*/
@Override
public void invalidateSet(Set<K> keys) {
if (CollectionUtils.isEmpty(keys)) {
return;
}
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
keys.forEach(id -> {
if (id != null) {
String stringData = dataMap.remove(id);
if (stringData != null) {
K parentId = parentIdGetter.apply(JSON.parseObject(stringData, valueClazz));
allTreeMap.remove(parentId, stringData);
}
}
});
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisTreeDictionaryCache::invalidateSet] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
/**
* 清空缓存。
*/
@Override
public void invalidateAll() {
String exceptionMessage;
try {
if (lock.writeLock().tryLock(TIMEOUT, TimeUnit.MILLISECONDS)) {
try {
dataMap.clear();
allTreeMap.clear();
} finally {
lock.writeLock().unlock();
}
} else {
throw new TimeoutException();
}
} catch (Exception e) {
exceptionMessage = String.format(
"LOCK Operation of [RedisTreeDictionaryCache::invalidateAll] encountered EXCEPTION [%s] for DICT [%s].",
e.getClass().getSimpleName(), valueClazz.getSimpleName());
log.warn(exceptionMessage);
throw new RedisCacheAccessException(exceptionMessage, e);
}
}
}

View File

@@ -0,0 +1,67 @@
package com.orange.demo.common.redis.cache;
import com.google.common.collect.Maps;
import org.redisson.api.RedissonClient;
import org.redisson.spring.cache.CacheConfig;
import org.redisson.spring.cache.RedissonSpringCacheManager;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
/**
* 使用Redisson作为Redis的分布式缓存库。
*
* @author Jerry
* @date 2020-09-24
*/
@Configuration
@EnableCaching
public class RedissonCacheConfig {
private static final int DEFAULT_TTL = 3600000;
/**
* 定义cache名称、超时时长(毫秒)。
*/
public enum CacheEnum {
/**
* session下上传文件名的缓存(时间是24小时)。
*/
UPLOAD_FILENAME_CACHE(86400000),
/**
* 缺省全局缓存(时间是24小时)。
*/
GLOBAL_CACHE(86400000);
/**
* 缓存的时长(单位:毫秒)
*/
private int ttl = DEFAULT_TTL;
CacheEnum() {
}
CacheEnum(int ttl) {
this.ttl = ttl;
}
public int getTtl() {
return ttl;
}
}
/**
* 初始化缓存配置。
*/
@Bean
CacheManager cacheManager(RedissonClient redissonClient) {
Map<String, CacheConfig> config = Maps.newHashMap();
for (CacheEnum c : CacheEnum.values()) {
config.put(c.name(), new CacheConfig(c.getTtl(), 0));
}
return new RedissonSpringCacheManager(redissonClient, config);
}
}

View File

@@ -1,5 +1,7 @@
package com.orange.demo.common.core.cache;
package com.orange.demo.common.redis.cache;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.orange.demo.common.core.object.TokenData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
@@ -30,7 +32,7 @@ public class SessionCacheHelper {
public void putSessionUploadFile(String filename) {
if (filename != null) {
Set<String> sessionUploadFileSet = null;
Cache cache = cacheManager.getCache(CacheConfig.CacheEnum.UPLOAD_FILENAME_CACHE.name());
Cache cache = cacheManager.getCache(RedissonCacheConfig.CacheEnum.UPLOAD_FILENAME_CACHE.name());
Cache.ValueWrapper valueWrapper = cache.get(TokenData.takeFromRequest().getSessionId());
if (valueWrapper != null) {
sessionUploadFileSet = (Set<String>) valueWrapper.get();
@@ -53,7 +55,7 @@ public class SessionCacheHelper {
if (filename == null) {
return false;
}
Cache cache = cacheManager.getCache(CacheConfig.CacheEnum.UPLOAD_FILENAME_CACHE.name());
Cache cache = cacheManager.getCache(RedissonCacheConfig.CacheEnum.UPLOAD_FILENAME_CACHE.name());
Cache.ValueWrapper valueWrapper = cache.get(TokenData.takeFromRequest().getSessionId());
if (valueWrapper == null) {
return false;
@@ -71,8 +73,8 @@ public class SessionCacheHelper {
if (sessionId == null || tokenData == null) {
return;
}
Cache cache = cacheManager.getCache(CacheConfig.CacheEnum.GLOBAL_CACHE.name());
cache.put(sessionId, tokenData);
Cache cache = cacheManager.getCache(RedissonCacheConfig.CacheEnum.GLOBAL_CACHE.name());
cache.put(sessionId, JSON.toJSONString(tokenData));
}
/**
@@ -82,8 +84,9 @@ public class SessionCacheHelper {
* @return 当前会话的JWT Token对象
*/
public TokenData getTokenData(String sessionId) {
Cache cache = cacheManager.getCache(CacheConfig.CacheEnum.GLOBAL_CACHE.name());
return cache.get(sessionId, TokenData.class);
Cache cache = cacheManager.getCache(RedissonCacheConfig.CacheEnum.GLOBAL_CACHE.name());
String tokenString = cache.get(sessionId, String.class);
return JSONObject.parseObject(tokenString, TokenData.class);
}
/**
@@ -92,7 +95,7 @@ public class SessionCacheHelper {
* @param sessionId 当前会话的SessionId
*/
public void removeAllSessionCache(String sessionId) {
for (CacheConfig.CacheEnum c : CacheConfig.CacheEnum.values()) {
for (RedissonCacheConfig.CacheEnum c : RedissonCacheConfig.CacheEnum.values()) {
cacheManager.getCache(c.name()).evict(sessionId);
}
}

View File

@@ -0,0 +1,52 @@
package com.orange.demo.common.redis.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
/**
* Redis配置类。
*
* @author Jerry
* @date 2020-09-24
*/
@Configuration
@ConditionalOnProperty(name = "redis.jedis.enabled", havingValue = "true")
public class JedisConfig {
@Value("${redis.jedis.port}")
private Integer port;
@Value("${redis.jedis.host}")
private String redisHost;
@Value("${redis.jedis.timeout}")
private int timeout;
@Value("${redis.jedis.pool.maxTotal}")
private Integer maxTotal;
@Value("${redis.jedis.pool.maxIdle}")
private Integer maxIdle;
@Value("${redis.jedis.pool.minIdle}")
private Integer minIdle;
@Value("${redis.jedis.pool.maxWait}")
private Integer maxWait;
@Bean
public JedisPool getJedisPool() {
// Jedis配置信息
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxTotal(maxTotal);
jedisPoolConfig.setMaxIdle(maxIdle);
jedisPoolConfig.setMinIdle(minIdle);
jedisPoolConfig.setMaxWaitMillis(maxWait);
jedisPoolConfig.setEvictorShutdownTimeoutMillis(2000);
return new JedisPool(jedisPoolConfig, redisHost, port);
}
}

View File

@@ -0,0 +1,50 @@
package com.orange.demo.common.redis.config;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Redisson配置类。和Jedis一样都是Redis客户端但是Redisson提供了更多的数据结构抽象。
* 这里我们只是使用了Redisson的分布式锁以及map等数据结构作为字典缓存使用。更多用法请参考其文档。
*
* @author Jerry
* @date 2020-09-24
*/
@Configuration
@ConditionalOnProperty(name = "redis.redisson.enabled", havingValue = "true")
public class RedissonConfig {
@Value("${redis.redisson.lockWatchdogTimeout}")
private Integer lockWatchdogTimeout;
@Value("${redis.redisson.address}")
private String address;
@Value("${redis.redisson.timeout}")
private Integer timeout;
@Value("${redis.redisson.pool.poolSize}")
private Integer poolSize;
@Value("${redis.redisson.pool.minIdle}")
private Integer minIdle;
@Bean
public RedissonClient redissonClient() {
Config config = new Config();
// 这里config还支持其他redis集群模式可根据实际需求更换。
// 比如useClusterServers()/useMasterSlaveServers()等。
config.setLockWatchdogTimeout(lockWatchdogTimeout)
.useSingleServer()
.setAddress("redis://" + address)
.setConnectionPoolSize(poolSize)
.setConnectionMinimumIdleSize(minIdle)
.setConnectTimeout(timeout);
return Redisson.create(config);
}
}

View File

@@ -0,0 +1,3 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.orange.demo.common.redis.config.JedisConfig,\
com.orange.demo.common.redis.config.RedissonConfig

View File

@@ -1,56 +0,0 @@
package com.orange.demo.common.swagger.config;
import com.orange.demo.common.core.annotation.MyRequestBody;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* 自动加载bean的配置对象。
*
* @author Jerry
* @date 2020-09-24
*/
@EnableSwagger2
@EnableKnife4j
@EnableConfigurationProperties(SwaggerProperties.class)
@ConditionalOnProperty(prefix = "swagger", name = "enabled")
public class SwaggerAutoConfiguration {
@Bean
public Docket upmsDocket(SwaggerProperties properties) {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("1. 用户权限分组接口")
.ignoredParameterTypes(MyRequestBody.class)
.apiInfo(apiInfo(properties))
.select()
.apis(RequestHandlerSelectors.basePackage(properties.getBasePackage() + ".upms.controller"))
.paths(PathSelectors.any()).build();
}
@Bean
public Docket bizDocket(SwaggerProperties properties) {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("2. 业务应用分组接口")
.ignoredParameterTypes(MyRequestBody.class)
.apiInfo(apiInfo(properties))
.select()
.apis(RequestHandlerSelectors.basePackage(properties.getBasePackage() + ".app.controller"))
.paths(PathSelectors.any()).build();
}
private ApiInfo apiInfo(SwaggerProperties properties) {
return new ApiInfoBuilder()
.title(properties.getTitle())
.description(properties.getDescription())
.version(properties.getVersion()).build();
}
}

View File

@@ -1,40 +0,0 @@
package com.orange.demo.common.swagger.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 配置参数对象。
*
* @author Jerry
* @date 2020-09-24
*/
@Data
@ConfigurationProperties("swagger")
public class SwaggerProperties {
/**
* 是否开启Swagger。
*/
private Boolean enabled;
/**
* Swagger解析的基础包路径。
**/
private String basePackage = "";
/**
* ApiInfo中的标题。
**/
private String title = "";
/**
* ApiInfo中的描述信息。
**/
private String description = "";
/**
* ApiInfo中的版本信息。
**/
private String version = "";
}

View File

@@ -1,85 +0,0 @@
package com.orange.demo.common.swagger.plugin;
import cn.hutool.core.lang.Assert;
import com.orange.demo.common.core.annotation.MyRequestBody;
import com.github.xiaoymin.knife4j.core.conf.Consts;
import javassist.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import springfox.documentation.service.ResolvedMethodParameter;
import java.util.List;
/**
* 通过字节码方式动态创建接口参数封装对象。
*
* @author Jerry
* @date 2020-09-24
*/
@Slf4j
public class ByteBodyUtils {
private static final ClassPool CLASS_POOL = ClassPool.getDefault();
public static Class<?> createDynamicModelClass(String name, List<ResolvedMethodParameter> parameters) {
String clazzName = Consts.BASE_PACKAGE_PREFIX + name;
try {
CtClass tmp = CLASS_POOL.getCtClass(clazzName);
if (tmp != null) {
tmp.detach();
}
} catch (NotFoundException e) {
// 需要吃掉这个异常。
}
CtClass ctClass = CLASS_POOL.makeClass(clazzName);
try {
int fieldCount = 0;
for (ResolvedMethodParameter dynamicParameter : parameters) {
// 因为在调用这个方法之前这些参数都包含MyRequestBody注解。
MyRequestBody myRequestBody =
dynamicParameter.findAnnotation(MyRequestBody.class).orNull();
Assert.notNull(myRequestBody);
String fieldName = dynamicParameter.defaultName().isPresent()
? dynamicParameter.defaultName().get() : "parameter";
if (StringUtils.isNotBlank(myRequestBody.value())) {
fieldName = myRequestBody.value();
}
ctClass.addField(createField(dynamicParameter, fieldName, ctClass));
fieldCount++;
}
if (fieldCount > 0) {
return ctClass.toClass();
}
} catch (Throwable e) {
log.error(e.getMessage());
}
return null;
}
private static CtField createField(ResolvedMethodParameter parameter, String parameterName, CtClass ctClass)
throws NotFoundException, CannotCompileException {
CtField field = new CtField(getFieldType(parameter.getParameterType().getErasedType()), parameterName, ctClass);
field.setModifiers(Modifier.PUBLIC);
return field;
}
private static CtClass getFieldType(Class<?> propetyType) {
CtClass fieldType = null;
try {
if (!propetyType.isAssignableFrom(Void.class)) {
fieldType = CLASS_POOL.get(propetyType.getName());
} else {
fieldType = CLASS_POOL.get(String.class.getName());
}
} catch (NotFoundException e) {
// 抛异常
ClassClassPath path = new ClassClassPath(propetyType);
CLASS_POOL.insertClassPath(path);
try {
fieldType = CLASS_POOL.get(propetyType.getName());
} catch (NotFoundException e1) {
log.error(e1.getMessage(), e1);
}
}
return fieldType;
}
}

View File

@@ -1,61 +0,0 @@
package com.orange.demo.common.swagger.plugin;
import com.orange.demo.common.core.annotation.MyRequestBody;
import com.fasterxml.classmate.TypeResolver;
import com.google.common.base.CaseFormat;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import springfox.documentation.service.ResolvedMethodParameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.OperationModelsProviderPlugin;
import springfox.documentation.spi.service.contexts.RequestMappingContext;
import java.util.List;
import java.util.stream.Collectors;
/**
* 生成参数包装类的插件。
*
* @author Jerry
* @date 2020-09-24
*/
@Component
@Order(Ordered.HIGHEST_PRECEDENCE + 200)
@ConditionalOnProperty(prefix = "swagger", name = "enabled")
public class DynamicBodyModelPlugin implements OperationModelsProviderPlugin {
private final TypeResolver typeResolver;
public DynamicBodyModelPlugin(TypeResolver typeResolver) {
this.typeResolver = typeResolver;
}
@Override
public void apply(RequestMappingContext context) {
List<ResolvedMethodParameter> parameterTypes = context.getParameters();
if (CollectionUtils.isEmpty(parameterTypes)) {
return;
}
List<ResolvedMethodParameter> bodyParameter = parameterTypes.stream()
.filter(p -> p.hasParameterAnnotation(MyRequestBody.class)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(bodyParameter)) {
return;
}
String groupName = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, context.getGroupName());
String clazzName = groupName + StringUtils.capitalize(context.getName());
Class<?> clazz = ByteBodyUtils.createDynamicModelClass(clazzName, bodyParameter);
if (clazz != null) {
context.operationModelsBuilder().addInputParam(typeResolver.resolve(clazz));
}
}
@Override
public boolean supports(DocumentationType delimiter) {
// 支持2.0版本
return delimiter == DocumentationType.SWAGGER_2;
}
}

View File

@@ -1,64 +0,0 @@
package com.orange.demo.common.swagger.plugin;
import com.orange.demo.common.core.annotation.MyRequestBody;
import com.google.common.base.CaseFormat;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.Parameter;
import springfox.documentation.service.ResolvedMethodParameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.OperationBuilderPlugin;
import springfox.documentation.spi.service.contexts.OperationContext;
import springfox.documentation.spi.service.contexts.ParameterContext;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 构建操作接口参数对象的插件。
*
* @author Jerry
* @date 2020-09-24
*/
@Component
@Order(Ordered.HIGHEST_PRECEDENCE + 102)
@ConditionalOnProperty(prefix = "swagger", name = "enabled")
public class DynamicBodyParameterBuilder implements OperationBuilderPlugin {
@Override
public void apply(OperationContext context) {
List<ResolvedMethodParameter> methodParameters = context.getParameters();
List<Parameter> parameters = new ArrayList<>();
if (CollectionUtils.isNotEmpty(methodParameters)) {
List<ResolvedMethodParameter> bodyParameter = methodParameters.stream()
.filter(p -> p.hasParameterAnnotation(MyRequestBody.class)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(bodyParameter)) {
// 构造model
String groupName = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, context.getGroupName());
String clazzName = groupName + StringUtils.capitalize(context.getName());
ResolvedMethodParameter methodParameter = bodyParameter.get(0);
ParameterContext parameterContext = new ParameterContext(methodParameter,
new ParameterBuilder(),
context.getDocumentationContext(),
context.getGenericsNamingStrategy(),
context);
Parameter parameter = parameterContext.parameterBuilder()
.parameterType("body").modelRef(new ModelRef(clazzName)).name(clazzName).build();
parameters.add(parameter);
}
}
context.operationBuilder().parameters(parameters);
}
@Override
public boolean supports(DocumentationType delimiter) {
return delimiter == DocumentationType.SWAGGER_2;
}
}

View File

@@ -1,2 +0,0 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.orange.demo.common.swagger.config.SwaggerAutoConfiguration

View File

@@ -13,7 +13,7 @@
<modules>
<module>common-core</module>
<module>common-redis</module>
<module>common-sequence</module>
<module>common-swagger</module>
</modules>
</project>

View File

@@ -33,10 +33,9 @@
<mybatis-mapper.version>2.1.5</mybatis-mapper.version>
<mybatis-generator.version>1.3.7</mybatis-generator.version>
<pagehelper.version>1.3.0</pagehelper.version>
<jedis.version>3.2.0</jedis.version>
<redisson.version>3.12.3</redisson.version>
<qdox.version>2.0.0</qdox.version>
<knife4j.version>2.0.5</knife4j.version>
<springfox.version>2.9.2</springfox.version>
<swagger.version>1.5.21</swagger.version>
</properties>
<modules>

View File

@@ -1,29 +1,27 @@
CREATE DATABASE `zzdemo-single` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE `zzdemo-single`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for zz_area_code
-- 行政区划表,在以下数据库中执行该脚本。
-- 主数据源 [localhost:3306/zzdemo-single]
-- ----------------------------
DROP TABLE IF EXISTS `zz_area_code`;
CREATE TABLE `zz_area_code` (
`area_id` bigint(20) unsigned NOT NULL COMMENT '行政区划主键Id',
`area_name` varchar(128) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '行政区划名称',
`area_level` int(11) NOT NULL COMMENT '行政区划级别 (1: 省级别 2: 市级别 3: 区级别)',
`parent_id` bigint(20) DEFAULT NULL COMMENT '父级行政区划Id',
PRIMARY KEY (`area_id`) USING BTREE,
KEY `idx_level` (`area_level`) USING BTREE,
KEY `idx_area_name` (`area_name`) USING BTREE,
KEY `idx_parent_id` (`parent_id`) USING BTREE
`area_id` bigint(20) unsigned NOT NULL COMMENT '行政区划主键Id',
`area_name` varchar(128) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '行政区划名称',
`area_level` int(5) NOT NULL COMMENT '行政区划级别 (1: 省级别 2: 市级别 3: 区级别)',
`parent_id` bigint(20) DEFAULT NULL COMMENT '父级行政区划Id',
PRIMARY KEY (`area_id`) USING BTREE,
KEY `idx_level` (`area_level`) USING BTREE,
KEY `idx_area_name` (`area_name`) USING BTREE,
KEY `idx_parent_id` (`parent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='行政区划表';
-- ----------------------------
-- Records of zz_area_code
-- 行政区划数据
-- ----------------------------
BEGIN;
INSERT INTO `zz_area_code` VALUES (110000000000, '北京市', 1, NULL);
INSERT INTO `zz_area_code` VALUES (110000000000, '北京市', 1, null);
INSERT INTO `zz_area_code` VALUES (110100000000, '市辖区', 2, 110000000000);
INSERT INTO `zz_area_code` VALUES (110101000000, '东城区', 3, 110100000000);
INSERT INTO `zz_area_code` VALUES (110102000000, '西城区', 3, 110100000000);
@@ -41,7 +39,7 @@ INSERT INTO `zz_area_code` VALUES (110116000000, '怀柔区', 3, 110100000000);
INSERT INTO `zz_area_code` VALUES (110117000000, '平谷区', 3, 110100000000);
INSERT INTO `zz_area_code` VALUES (110118000000, '密云区', 3, 110100000000);
INSERT INTO `zz_area_code` VALUES (110119000000, '延庆区', 3, 110100000000);
INSERT INTO `zz_area_code` VALUES (120000000000, '天津市', 1, NULL);
INSERT INTO `zz_area_code` VALUES (120000000000, '天津市', 1, null);
INSERT INTO `zz_area_code` VALUES (120100000000, '市辖区', 2, 120000000000);
INSERT INTO `zz_area_code` VALUES (120101000000, '和平区', 3, 120100000000);
INSERT INTO `zz_area_code` VALUES (120102000000, '河东区', 3, 120100000000);
@@ -59,7 +57,7 @@ INSERT INTO `zz_area_code` VALUES (120116000000, '滨海新区', 3, 120100000000
INSERT INTO `zz_area_code` VALUES (120117000000, '宁河区', 3, 120100000000);
INSERT INTO `zz_area_code` VALUES (120118000000, '静海区', 3, 120100000000);
INSERT INTO `zz_area_code` VALUES (120119000000, '蓟州区', 3, 120100000000);
INSERT INTO `zz_area_code` VALUES (130000000000, '河北省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (130000000000, '河北省', 1, null);
INSERT INTO `zz_area_code` VALUES (130100000000, '石家庄市', 2, 130000000000);
INSERT INTO `zz_area_code` VALUES (130101000000, '市辖区', 3, 130100000000);
INSERT INTO `zz_area_code` VALUES (130102000000, '长安区', 3, 130100000000);
@@ -273,7 +271,7 @@ INSERT INTO `zz_area_code` VALUES (131128000000, '阜城县', 3, 131100000000);
INSERT INTO `zz_area_code` VALUES (131171000000, '河北衡水高新技术产业开发区', 3, 131100000000);
INSERT INTO `zz_area_code` VALUES (131172000000, '衡水滨湖新区', 3, 131100000000);
INSERT INTO `zz_area_code` VALUES (131182000000, '深州市', 3, 131100000000);
INSERT INTO `zz_area_code` VALUES (140000000000, '山西省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (140000000000, '山西省', 1, null);
INSERT INTO `zz_area_code` VALUES (140100000000, '太原市', 2, 140000000000);
INSERT INTO `zz_area_code` VALUES (140101000000, '市辖区', 3, 140100000000);
INSERT INTO `zz_area_code` VALUES (140105000000, '小店区', 3, 140100000000);
@@ -418,7 +416,7 @@ INSERT INTO `zz_area_code` VALUES (141129000000, '中阳县', 3, 141100000000);
INSERT INTO `zz_area_code` VALUES (141130000000, '交口县', 3, 141100000000);
INSERT INTO `zz_area_code` VALUES (141181000000, '孝义市', 3, 141100000000);
INSERT INTO `zz_area_code` VALUES (141182000000, '汾阳市', 3, 141100000000);
INSERT INTO `zz_area_code` VALUES (150000000000, '内蒙古自治区', 1, NULL);
INSERT INTO `zz_area_code` VALUES (150000000000, '内蒙古自治区', 1, null);
INSERT INTO `zz_area_code` VALUES (150100000000, '呼和浩特市', 2, 150000000000);
INSERT INTO `zz_area_code` VALUES (150101000000, '市辖区', 3, 150100000000);
INSERT INTO `zz_area_code` VALUES (150102000000, '新城区', 3, 150100000000);
@@ -549,7 +547,7 @@ INSERT INTO `zz_area_code` VALUES (152921000000, '阿拉善左旗', 3, 152900000
INSERT INTO `zz_area_code` VALUES (152922000000, '阿拉善右旗', 3, 152900000000);
INSERT INTO `zz_area_code` VALUES (152923000000, '额济纳旗', 3, 152900000000);
INSERT INTO `zz_area_code` VALUES (152971000000, '内蒙古阿拉善经济开发区', 3, 152900000000);
INSERT INTO `zz_area_code` VALUES (210000000000, '辽宁省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (210000000000, '辽宁省', 1, null);
INSERT INTO `zz_area_code` VALUES (210100000000, '沈阳市', 2, 210000000000);
INSERT INTO `zz_area_code` VALUES (210101000000, '市辖区', 3, 210100000000);
INSERT INTO `zz_area_code` VALUES (210102000000, '和平区', 3, 210100000000);
@@ -678,7 +676,7 @@ INSERT INTO `zz_area_code` VALUES (211404000000, '南票区', 3, 211400000000);
INSERT INTO `zz_area_code` VALUES (211421000000, '绥中县', 3, 211400000000);
INSERT INTO `zz_area_code` VALUES (211422000000, '建昌县', 3, 211400000000);
INSERT INTO `zz_area_code` VALUES (211481000000, '兴城市', 3, 211400000000);
INSERT INTO `zz_area_code` VALUES (220000000000, '吉林省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (220000000000, '吉林省', 1, null);
INSERT INTO `zz_area_code` VALUES (220100000000, '长春市', 2, 220000000000);
INSERT INTO `zz_area_code` VALUES (220101000000, '市辖区', 3, 220100000000);
INSERT INTO `zz_area_code` VALUES (220102000000, '南关区', 3, 220100000000);
@@ -765,7 +763,7 @@ INSERT INTO `zz_area_code` VALUES (222405000000, '龙井市', 3, 222400000000);
INSERT INTO `zz_area_code` VALUES (222406000000, '和龙市', 3, 222400000000);
INSERT INTO `zz_area_code` VALUES (222424000000, '汪清县', 3, 222400000000);
INSERT INTO `zz_area_code` VALUES (222426000000, '安图县', 3, 222400000000);
INSERT INTO `zz_area_code` VALUES (230000000000, '黑龙江省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (230000000000, '黑龙江省', 1, null);
INSERT INTO `zz_area_code` VALUES (230100000000, '哈尔滨市', 2, 230000000000);
INSERT INTO `zz_area_code` VALUES (230101000000, '市辖区', 3, 230100000000);
INSERT INTO `zz_area_code` VALUES (230102000000, '道里区', 3, 230100000000);
@@ -925,7 +923,7 @@ INSERT INTO `zz_area_code` VALUES (232761000000, '加格达奇区', 3, 232700000
INSERT INTO `zz_area_code` VALUES (232762000000, '松岭区', 3, 232700000000);
INSERT INTO `zz_area_code` VALUES (232763000000, '新林区', 3, 232700000000);
INSERT INTO `zz_area_code` VALUES (232764000000, '呼中区', 3, 232700000000);
INSERT INTO `zz_area_code` VALUES (310000000000, '上海市', 1, NULL);
INSERT INTO `zz_area_code` VALUES (310000000000, '上海市', 1, null);
INSERT INTO `zz_area_code` VALUES (310100000000, '市辖区', 2, 310000000000);
INSERT INTO `zz_area_code` VALUES (310101000000, '黄浦区', 3, 310100000000);
INSERT INTO `zz_area_code` VALUES (310104000000, '徐汇区', 3, 310100000000);
@@ -943,7 +941,7 @@ INSERT INTO `zz_area_code` VALUES (310117000000, '松江区', 3, 310100000000);
INSERT INTO `zz_area_code` VALUES (310118000000, '青浦区', 3, 310100000000);
INSERT INTO `zz_area_code` VALUES (310120000000, '奉贤区', 3, 310100000000);
INSERT INTO `zz_area_code` VALUES (310151000000, '崇明区', 3, 310100000000);
INSERT INTO `zz_area_code` VALUES (320000000000, '江苏省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (320000000000, '江苏省', 1, null);
INSERT INTO `zz_area_code` VALUES (320100000000, '南京市', 2, 320000000000);
INSERT INTO `zz_area_code` VALUES (320101000000, '市辖区', 3, 320100000000);
INSERT INTO `zz_area_code` VALUES (320102000000, '玄武区', 3, 320100000000);
@@ -1077,7 +1075,7 @@ INSERT INTO `zz_area_code` VALUES (321322000000, '沭阳县', 3, 321300000000);
INSERT INTO `zz_area_code` VALUES (321323000000, '泗阳县', 3, 321300000000);
INSERT INTO `zz_area_code` VALUES (321324000000, '泗洪县', 3, 321300000000);
INSERT INTO `zz_area_code` VALUES (321371000000, '宿迁经济技术开发区', 3, 321300000000);
INSERT INTO `zz_area_code` VALUES (330000000000, '浙江省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (330000000000, '浙江省', 1, null);
INSERT INTO `zz_area_code` VALUES (330100000000, '杭州市', 2, 330000000000);
INSERT INTO `zz_area_code` VALUES (330101000000, '市辖区', 3, 330100000000);
INSERT INTO `zz_area_code` VALUES (330102000000, '上城区', 3, 330100000000);
@@ -1190,7 +1188,7 @@ INSERT INTO `zz_area_code` VALUES (331125000000, '云和县', 3, 331100000000);
INSERT INTO `zz_area_code` VALUES (331126000000, '庆元县', 3, 331100000000);
INSERT INTO `zz_area_code` VALUES (331127000000, '景宁畲族自治县', 3, 331100000000);
INSERT INTO `zz_area_code` VALUES (331181000000, '龙泉市', 3, 331100000000);
INSERT INTO `zz_area_code` VALUES (340000000000, '安徽省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (340000000000, '安徽省', 1, null);
INSERT INTO `zz_area_code` VALUES (340100000000, '合肥市', 2, 340000000000);
INSERT INTO `zz_area_code` VALUES (340101000000, '市辖区', 3, 340100000000);
INSERT INTO `zz_area_code` VALUES (340102000000, '瑶海区', 3, 340100000000);
@@ -1343,7 +1341,7 @@ INSERT INTO `zz_area_code` VALUES (341824000000, '绩溪县', 3, 341800000000);
INSERT INTO `zz_area_code` VALUES (341825000000, '旌德县', 3, 341800000000);
INSERT INTO `zz_area_code` VALUES (341871000000, '宣城市经济开发区', 3, 341800000000);
INSERT INTO `zz_area_code` VALUES (341881000000, '宁国市', 3, 341800000000);
INSERT INTO `zz_area_code` VALUES (350000000000, '福建省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (350000000000, '福建省', 1, null);
INSERT INTO `zz_area_code` VALUES (350100000000, '福州市', 2, 350000000000);
INSERT INTO `zz_area_code` VALUES (350101000000, '市辖区', 3, 350100000000);
INSERT INTO `zz_area_code` VALUES (350102000000, '鼓楼区', 3, 350100000000);
@@ -1447,7 +1445,7 @@ INSERT INTO `zz_area_code` VALUES (350925000000, '周宁县', 3, 350900000000);
INSERT INTO `zz_area_code` VALUES (350926000000, '柘荣县', 3, 350900000000);
INSERT INTO `zz_area_code` VALUES (350981000000, '福安市', 3, 350900000000);
INSERT INTO `zz_area_code` VALUES (350982000000, '福鼎市', 3, 350900000000);
INSERT INTO `zz_area_code` VALUES (360000000000, '江西省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (360000000000, '江西省', 1, null);
INSERT INTO `zz_area_code` VALUES (360100000000, '南昌市', 2, 360000000000);
INSERT INTO `zz_area_code` VALUES (360101000000, '市辖区', 3, 360100000000);
INSERT INTO `zz_area_code` VALUES (360102000000, '东湖区', 3, 360100000000);
@@ -1570,7 +1568,7 @@ INSERT INTO `zz_area_code` VALUES (361128000000, '鄱阳县', 3, 361100000000);
INSERT INTO `zz_area_code` VALUES (361129000000, '万年县', 3, 361100000000);
INSERT INTO `zz_area_code` VALUES (361130000000, '婺源县', 3, 361100000000);
INSERT INTO `zz_area_code` VALUES (361181000000, '德兴市', 3, 361100000000);
INSERT INTO `zz_area_code` VALUES (370000000000, '山东省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (370000000000, '山东省', 1, null);
INSERT INTO `zz_area_code` VALUES (370100000000, '济南市', 2, 370000000000);
INSERT INTO `zz_area_code` VALUES (370101000000, '市辖区', 3, 370100000000);
INSERT INTO `zz_area_code` VALUES (370102000000, '历下区', 3, 370100000000);
@@ -1761,7 +1759,7 @@ INSERT INTO `zz_area_code` VALUES (371726000000, '鄄城县', 3, 371700000000);
INSERT INTO `zz_area_code` VALUES (371728000000, '东明县', 3, 371700000000);
INSERT INTO `zz_area_code` VALUES (371771000000, '菏泽经济技术开发区', 3, 371700000000);
INSERT INTO `zz_area_code` VALUES (371772000000, '菏泽高新技术开发区', 3, 371700000000);
INSERT INTO `zz_area_code` VALUES (410000000000, '河南省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (410000000000, '河南省', 1, null);
INSERT INTO `zz_area_code` VALUES (410100000000, '郑州市', 2, 410000000000);
INSERT INTO `zz_area_code` VALUES (410101000000, '市辖区', 3, 410100000000);
INSERT INTO `zz_area_code` VALUES (410102000000, '中原区', 3, 410100000000);
@@ -1979,7 +1977,7 @@ INSERT INTO `zz_area_code` VALUES (411729000000, '新蔡县', 3, 411700000000);
INSERT INTO `zz_area_code` VALUES (411771000000, '河南驻马店经济开发区', 3, 411700000000);
INSERT INTO `zz_area_code` VALUES (419000000000, '省直辖县级行政区划', 2, 410000000000);
INSERT INTO `zz_area_code` VALUES (419001000000, '济源市', 3, 419000000000);
INSERT INTO `zz_area_code` VALUES (420000000000, '湖北省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (420000000000, '湖北省', 1, null);
INSERT INTO `zz_area_code` VALUES (420100000000, '武汉市', 2, 420000000000);
INSERT INTO `zz_area_code` VALUES (420101000000, '市辖区', 3, 420100000000);
INSERT INTO `zz_area_code` VALUES (420102000000, '江岸区', 3, 420100000000);
@@ -2111,7 +2109,7 @@ INSERT INTO `zz_area_code` VALUES (429004000000, '仙桃市', 3, 429000000000);
INSERT INTO `zz_area_code` VALUES (429005000000, '潜江市', 3, 429000000000);
INSERT INTO `zz_area_code` VALUES (429006000000, '天门市', 3, 429000000000);
INSERT INTO `zz_area_code` VALUES (429021000000, '神农架林区', 3, 429000000000);
INSERT INTO `zz_area_code` VALUES (430000000000, '湖南省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (430000000000, '湖南省', 1, null);
INSERT INTO `zz_area_code` VALUES (430100000000, '长沙市', 2, 430000000000);
INSERT INTO `zz_area_code` VALUES (430101000000, '市辖区', 3, 430100000000);
INSERT INTO `zz_area_code` VALUES (430102000000, '芙蓉区', 3, 430100000000);
@@ -2278,7 +2276,7 @@ INSERT INTO `zz_area_code` VALUES (433127000000, '永顺县', 3, 433100000000);
INSERT INTO `zz_area_code` VALUES (433130000000, '龙山县', 3, 433100000000);
INSERT INTO `zz_area_code` VALUES (433172000000, '湖南吉首经济开发区', 3, 433100000000);
INSERT INTO `zz_area_code` VALUES (433173000000, '湖南永顺经济开发区', 3, 433100000000);
INSERT INTO `zz_area_code` VALUES (440000000000, '广东省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (440000000000, '广东省', 1, null);
INSERT INTO `zz_area_code` VALUES (440100000000, '广州市', 2, 440000000000);
INSERT INTO `zz_area_code` VALUES (440101000000, '市辖区', 3, 440100000000);
INSERT INTO `zz_area_code` VALUES (440103000000, '荔湾区', 3, 440100000000);
@@ -2441,7 +2439,7 @@ INSERT INTO `zz_area_code` VALUES (445303000000, '云安区', 3, 445300000000);
INSERT INTO `zz_area_code` VALUES (445321000000, '新兴县', 3, 445300000000);
INSERT INTO `zz_area_code` VALUES (445322000000, '郁南县', 3, 445300000000);
INSERT INTO `zz_area_code` VALUES (445381000000, '罗定市', 3, 445300000000);
INSERT INTO `zz_area_code` VALUES (450000000000, '广西壮族自治区', 1, NULL);
INSERT INTO `zz_area_code` VALUES (450000000000, '广西壮族自治区', 1, null);
INSERT INTO `zz_area_code` VALUES (450100000000, '南宁市', 2, 450000000000);
INSERT INTO `zz_area_code` VALUES (450101000000, '市辖区', 3, 450100000000);
INSERT INTO `zz_area_code` VALUES (450102000000, '兴宁区', 3, 450100000000);
@@ -2581,7 +2579,7 @@ INSERT INTO `zz_area_code` VALUES (451423000000, '龙州县', 3, 451400000000);
INSERT INTO `zz_area_code` VALUES (451424000000, '大新县', 3, 451400000000);
INSERT INTO `zz_area_code` VALUES (451425000000, '天等县', 3, 451400000000);
INSERT INTO `zz_area_code` VALUES (451481000000, '凭祥市', 3, 451400000000);
INSERT INTO `zz_area_code` VALUES (460000000000, '海南省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (460000000000, '海南省', 1, null);
INSERT INTO `zz_area_code` VALUES (460100000000, '海口市', 2, 460000000000);
INSERT INTO `zz_area_code` VALUES (460101000000, '市辖区', 3, 460100000000);
INSERT INTO `zz_area_code` VALUES (460105000000, '秀英区', 3, 460100000000);
@@ -2615,7 +2613,7 @@ INSERT INTO `zz_area_code` VALUES (469027000000, '乐东黎族自治县', 3, 469
INSERT INTO `zz_area_code` VALUES (469028000000, '陵水黎族自治县', 3, 469000000000);
INSERT INTO `zz_area_code` VALUES (469029000000, '保亭黎族苗族自治县', 3, 469000000000);
INSERT INTO `zz_area_code` VALUES (469030000000, '琼中黎族苗族自治县', 3, 469000000000);
INSERT INTO `zz_area_code` VALUES (500000000000, '重庆市', 1, NULL);
INSERT INTO `zz_area_code` VALUES (500000000000, '重庆市', 1, null);
INSERT INTO `zz_area_code` VALUES (500100000000, '市辖区', 2, 500000000000);
INSERT INTO `zz_area_code` VALUES (500101000000, '万州区', 3, 500100000000);
INSERT INTO `zz_area_code` VALUES (500102000000, '涪陵区', 3, 500100000000);
@@ -2656,7 +2654,7 @@ INSERT INTO `zz_area_code` VALUES (500240000000, '石柱土家族自治县', 3,
INSERT INTO `zz_area_code` VALUES (500241000000, '秀山土家族苗族自治县', 3, 500200000000);
INSERT INTO `zz_area_code` VALUES (500242000000, '酉阳土家族苗族自治县', 3, 500200000000);
INSERT INTO `zz_area_code` VALUES (500243000000, '彭水苗族土家族自治县', 3, 500200000000);
INSERT INTO `zz_area_code` VALUES (510000000000, '四川省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (510000000000, '四川省', 1, null);
INSERT INTO `zz_area_code` VALUES (510100000000, '成都市', 2, 510000000000);
INSERT INTO `zz_area_code` VALUES (510101000000, '市辖区', 3, 510100000000);
INSERT INTO `zz_area_code` VALUES (510104000000, '锦江区', 3, 510100000000);
@@ -2882,7 +2880,7 @@ INSERT INTO `zz_area_code` VALUES (513434000000, '越西县', 3, 513400000000);
INSERT INTO `zz_area_code` VALUES (513435000000, '甘洛县', 3, 513400000000);
INSERT INTO `zz_area_code` VALUES (513436000000, '美姑县', 3, 513400000000);
INSERT INTO `zz_area_code` VALUES (513437000000, '雷波县', 3, 513400000000);
INSERT INTO `zz_area_code` VALUES (520000000000, '贵州省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (520000000000, '贵州省', 1, null);
INSERT INTO `zz_area_code` VALUES (520100000000, '贵阳市', 2, 520000000000);
INSERT INTO `zz_area_code` VALUES (520101000000, '市辖区', 3, 520100000000);
INSERT INTO `zz_area_code` VALUES (520102000000, '南明区', 3, 520100000000);
@@ -2985,7 +2983,7 @@ INSERT INTO `zz_area_code` VALUES (522729000000, '长顺县', 3, 522700000000);
INSERT INTO `zz_area_code` VALUES (522730000000, '龙里县', 3, 522700000000);
INSERT INTO `zz_area_code` VALUES (522731000000, '惠水县', 3, 522700000000);
INSERT INTO `zz_area_code` VALUES (522732000000, '三都水族自治县', 3, 522700000000);
INSERT INTO `zz_area_code` VALUES (530000000000, '云南省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (530000000000, '云南省', 1, null);
INSERT INTO `zz_area_code` VALUES (530100000000, '昆明市', 2, 530000000000);
INSERT INTO `zz_area_code` VALUES (530101000000, '市辖区', 3, 530100000000);
INSERT INTO `zz_area_code` VALUES (530102000000, '五华区', 3, 530100000000);
@@ -3139,7 +3137,7 @@ INSERT INTO `zz_area_code` VALUES (533400000000, '迪庆藏族自治州', 2, 530
INSERT INTO `zz_area_code` VALUES (533401000000, '香格里拉市', 3, 533400000000);
INSERT INTO `zz_area_code` VALUES (533422000000, '德钦县', 3, 533400000000);
INSERT INTO `zz_area_code` VALUES (533423000000, '维西傈僳族自治县', 3, 533400000000);
INSERT INTO `zz_area_code` VALUES (540000000000, '西藏自治区', 1, NULL);
INSERT INTO `zz_area_code` VALUES (540000000000, '西藏自治区', 1, null);
INSERT INTO `zz_area_code` VALUES (540100000000, '拉萨市', 2, 540000000000);
INSERT INTO `zz_area_code` VALUES (540101000000, '市辖区', 3, 540100000000);
INSERT INTO `zz_area_code` VALUES (540102000000, '城关区', 3, 540100000000);
@@ -3227,7 +3225,7 @@ INSERT INTO `zz_area_code` VALUES (542524000000, '日土县', 3, 542500000000);
INSERT INTO `zz_area_code` VALUES (542525000000, '革吉县', 3, 542500000000);
INSERT INTO `zz_area_code` VALUES (542526000000, '改则县', 3, 542500000000);
INSERT INTO `zz_area_code` VALUES (542527000000, '措勤县', 3, 542500000000);
INSERT INTO `zz_area_code` VALUES (610000000000, '陕西省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (610000000000, '陕西省', 1, null);
INSERT INTO `zz_area_code` VALUES (610100000000, '西安市', 2, 610000000000);
INSERT INTO `zz_area_code` VALUES (610101000000, '市辖区', 3, 610100000000);
INSERT INTO `zz_area_code` VALUES (610102000000, '新城区', 3, 610100000000);
@@ -3355,7 +3353,7 @@ INSERT INTO `zz_area_code` VALUES (611023000000, '商南县', 3, 611000000000);
INSERT INTO `zz_area_code` VALUES (611024000000, '山阳县', 3, 611000000000);
INSERT INTO `zz_area_code` VALUES (611025000000, '镇安县', 3, 611000000000);
INSERT INTO `zz_area_code` VALUES (611026000000, '柞水县', 3, 611000000000);
INSERT INTO `zz_area_code` VALUES (620000000000, '甘肃省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (620000000000, '甘肃省', 1, null);
INSERT INTO `zz_area_code` VALUES (620100000000, '兰州市', 2, 620000000000);
INSERT INTO `zz_area_code` VALUES (620101000000, '市辖区', 3, 620100000000);
INSERT INTO `zz_area_code` VALUES (620102000000, '城关区', 3, 620100000000);
@@ -3469,7 +3467,7 @@ INSERT INTO `zz_area_code` VALUES (623024000000, '迭部县', 3, 623000000000);
INSERT INTO `zz_area_code` VALUES (623025000000, '玛曲县', 3, 623000000000);
INSERT INTO `zz_area_code` VALUES (623026000000, '碌曲县', 3, 623000000000);
INSERT INTO `zz_area_code` VALUES (623027000000, '夏河县', 3, 623000000000);
INSERT INTO `zz_area_code` VALUES (630000000000, '青海省', 1, NULL);
INSERT INTO `zz_area_code` VALUES (630000000000, '青海省', 1, null);
INSERT INTO `zz_area_code` VALUES (630100000000, '西宁市', 2, 630000000000);
INSERT INTO `zz_area_code` VALUES (630101000000, '市辖区', 3, 630100000000);
INSERT INTO `zz_area_code` VALUES (630102000000, '城东区', 3, 630100000000);
@@ -3524,7 +3522,7 @@ INSERT INTO `zz_area_code` VALUES (632821000000, '乌兰县', 3, 632800000000);
INSERT INTO `zz_area_code` VALUES (632822000000, '都兰县', 3, 632800000000);
INSERT INTO `zz_area_code` VALUES (632823000000, '天峻县', 3, 632800000000);
INSERT INTO `zz_area_code` VALUES (632857000000, '大柴旦行政委员会', 3, 632800000000);
INSERT INTO `zz_area_code` VALUES (640000000000, '宁夏回族自治区', 1, NULL);
INSERT INTO `zz_area_code` VALUES (640000000000, '宁夏回族自治区', 1, null);
INSERT INTO `zz_area_code` VALUES (640100000000, '银川市', 2, 640000000000);
INSERT INTO `zz_area_code` VALUES (640101000000, '市辖区', 3, 640100000000);
INSERT INTO `zz_area_code` VALUES (640104000000, '兴庆区', 3, 640100000000);
@@ -3557,7 +3555,7 @@ INSERT INTO `zz_area_code` VALUES (640501000000, '市辖区', 3, 640500000000);
INSERT INTO `zz_area_code` VALUES (640502000000, '沙坡头区', 3, 640500000000);
INSERT INTO `zz_area_code` VALUES (640521000000, '中宁县', 3, 640500000000);
INSERT INTO `zz_area_code` VALUES (640522000000, '海原县', 3, 640500000000);
INSERT INTO `zz_area_code` VALUES (650000000000, '新疆维吾尔自治区', 1, NULL);
INSERT INTO `zz_area_code` VALUES (650000000000, '新疆维吾尔自治区', 1, null);
INSERT INTO `zz_area_code` VALUES (650100000000, '乌鲁木齐市', 2, 650000000000);
INSERT INTO `zz_area_code` VALUES (650101000000, '市辖区', 3, 650100000000);
INSERT INTO `zz_area_code` VALUES (650102000000, '天山区', 3, 650100000000);
@@ -3681,634 +3679,4 @@ INSERT INTO `zz_area_code` VALUES (659004000000, '五家渠市', 3, 659000000000
INSERT INTO `zz_area_code` VALUES (659006000000, '铁门关市', 3, 659000000000);
COMMIT;
-- ----------------------------
-- Table structure for zz_class
-- ----------------------------
DROP TABLE IF EXISTS `zz_class`;
CREATE TABLE `zz_class` (
`class_id` bigint(20) NOT NULL COMMENT '班级Id',
`class_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '班级名称',
`school_id` bigint(20) NOT NULL COMMENT '学校Id',
`leader_id` bigint(20) NOT NULL COMMENT '学生班长Id',
`finish_class_hour` int(11) NOT NULL DEFAULT '0' COMMENT '已完成课时数量',
`class_level` tinyint(4) NOT NULL COMMENT '班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)',
`create_user_id` bigint(20) NOT NULL COMMENT '创建用户',
`create_time` datetime NOT NULL COMMENT '班级创建时间',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '班级状态(0: 正常 1: 解散)',
PRIMARY KEY (`class_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_class
-- ----------------------------
BEGIN;
INSERT INTO `zz_class` VALUES (1016971499387228160, '小学一年级随堂班', 1015817732197453824, 1015842628948463616, 15, 0, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016971692685922304, '小学二年级随堂班', 1015818056597508096, 1018000939508568064, 20, 0, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016971755373989888, '小学三年级随堂班', 1015817732197453824, 1015842628948463616, 100, 0, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016971816040402944, '小学四年级随堂班', 1015817732197453824, 1015852853839532032, 0, 0, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016971872105664512, '小学五年级随堂班', 1015818056597508096, 1018001219050541056, 0, 0, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016971931153076224, '小学六年级随堂班', 1015817732197453824, 1015852480873631744, 0, 0, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972016347779072, '小学一年级提高班', 1015817732197453824, 1015842628948463616, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972071955861504, '小学二年级提高班', 1015817732197453824, 1015852480873631744, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972128667045888, '小学三年级提高班', 1015818056597508096, 1018001219050541056, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972187949338624, '小学四年级提高班', 1015817732197453824, 1015852480873631744, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972236452270080, '小学五年级提高班', 1015817732197453824, 1015852480873631744, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972308355223552, '小学六年级提高班', 1015818056597508096, 1018000939508568064, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972406023786496, '小学奥林匹克竞赛班', 1015818056597508096, 1018001219050541056, 0, 1, 1093809448606765057, '2020-10-17 00:00:00', 1);
INSERT INTO `zz_class` VALUES (1016972484746678272, '小学毕业提分班', 1015818056597508096, 1018000939508568064, 0, 2, 1093809448606765057, '2020-10-17 00:00:00', 1);
COMMIT;
-- ----------------------------
-- Table structure for zz_class_course
-- ----------------------------
DROP TABLE IF EXISTS `zz_class_course`;
CREATE TABLE `zz_class_course` (
`class_id` bigint(20) NOT NULL COMMENT '班级Id',
`course_id` bigint(20) NOT NULL COMMENT '课程Id',
`course_order` tinyint(4) NOT NULL DEFAULT '0' COMMENT '课程顺序(数值越小越靠前)',
PRIMARY KEY (`class_id`,`course_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_class_course
-- ----------------------------
BEGIN;
INSERT INTO `zz_class_course` VALUES (1016971499387228160, 1016699195411402752, 1);
INSERT INTO `zz_class_course` VALUES (1016971499387228160, 1016920878164480000, 0);
INSERT INTO `zz_class_course` VALUES (1016971499387228160, 1016923276064854016, 0);
INSERT INTO `zz_class_course` VALUES (1016971692685922304, 1016917385529790464, 1);
INSERT INTO `zz_class_course` VALUES (1016971755373989888, 1016917732260319232, 0);
INSERT INTO `zz_class_course` VALUES (1016971755373989888, 1016917900699373568, 0);
INSERT INTO `zz_class_course` VALUES (1016971755373989888, 1016918360520921088, 0);
INSERT INTO `zz_class_course` VALUES (1016971755373989888, 1016918605715738624, 0);
INSERT INTO `zz_class_course` VALUES (1016971755373989888, 1016918836729614336, 0);
COMMIT;
-- ----------------------------
-- Table structure for zz_class_student
-- ----------------------------
DROP TABLE IF EXISTS `zz_class_student`;
CREATE TABLE `zz_class_student` (
`class_id` bigint(20) NOT NULL COMMENT '班级Id',
`student_id` bigint(20) NOT NULL COMMENT '学生Id',
PRIMARY KEY (`class_id`,`student_id`) USING BTREE,
KEY `idx_student_id` (`student_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_class_student
-- ----------------------------
BEGIN;
INSERT INTO `zz_class_student` VALUES (1016971499387228160, 1015842628948463616);
INSERT INTO `zz_class_student` VALUES (1016971692685922304, 1015842628948463616);
INSERT INTO `zz_class_student` VALUES (1016971499387228160, 1015852480873631744);
INSERT INTO `zz_class_student` VALUES (1016971692685922304, 1015852853839532032);
INSERT INTO `zz_class_student` VALUES (1016972016347779072, 1018000939508568064);
INSERT INTO `zz_class_student` VALUES (1016972016347779072, 1018001219050541056);
COMMIT;
-- ----------------------------
-- Table structure for zz_course
-- ----------------------------
DROP TABLE IF EXISTS `zz_course`;
CREATE TABLE `zz_course` (
`course_id` bigint(20) NOT NULL COMMENT '主键Id',
`course_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '课程名称',
`price` decimal(10,2) NOT NULL COMMENT '课程价格',
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '课程描述',
`difficulty` int(11) NOT NULL COMMENT '课程难度(0: 容易 1: 普通 2: 很难)',
`grade_id` tinyint(4) NOT NULL COMMENT '年级Id',
`subject_id` tinyint(4) NOT NULL COMMENT '学科Id',
`class_hour` int(11) NOT NULL COMMENT '课时数量',
`picture_url` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '多张课程图片地址',
`create_user_id` bigint(20) NOT NULL COMMENT '创建用户Id',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`course_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_course
-- ----------------------------
BEGIN;
INSERT INTO `zz_course` VALUES (1016699195411402752, '小学一年级拼音基础练习', 299.00, '小学一年级拼音基础练习', 0, 1, 0, 10, '[{\"name\":\"IMG_0003.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"b09ef09478d8452d908600ff98b6f1ce.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016917385529790464, '小学二年级语文课程', 980.00, '小学二年级课程', 1, 2, 0, 25, '[{\"name\":\"IMG_0455.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"79651a658e88408888f847366fbf98d0.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016917732260319232, '小学三年级语文课程', 1080.00, '小学三年级语文课程', 1, 3, 0, 30, '[{\"name\":\"IMG_0001.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"0d11548eb91142d49a9253c0060d3f94.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016917900699373568, '小学四年级语文课程', 888.00, '小学四年级语文课程', 1, 4, 0, 27, '[{\"name\":\"IMG_0002.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"7358b520e31e4ee0b2b8c4f9c31614d9.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016918360520921088, '小学五年级语文课程', 1199.00, '小学五年级语文课程', 2, 5, 0, 30, '[{\"name\":\"IMG_0004.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"cf804a5e14fb498fa8bf3745cad39bca.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016918605715738624, '小学六年级语文课程', 1288.00, '小学六年级语文课程', 2, 6, 0, 32, '[{\"name\":\"IMG_0006.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"a0d0476fac9c46f08b7ebef597b8765a.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016918836729614336, '天津小学一年级语文课程', 300.00, '天津小学一年级语文课程', 0, 1, 0, 20, '[{\"name\":\"IMG_0003.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"7f64971a69944b0082f21a6036c31efd.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016920152549888000, '天津小学二年级语文课程', 699.00, '天津小学二年级语文课程', 1, 2, 0, 20, '[{\"name\":\"IMG_0007.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"4baf08c1da8741bb808caf09475e49a9.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016920339255136256, '天津小学三年级语文课程', 998.00, '天津小学三年级语文课程', 1, 3, 0, 25, '[{\"name\":\"IMG_0009.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"6bc1eaab831d49708e4b1e0a5d657d61.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 21:22:54');
INSERT INTO `zz_course` VALUES (1016920878164480000, '小学数学一年级课程', 388.00, '小学数学一年级课程', 0, 1, 1, 15, '[{\"name\":\"IMG_0010.JPG\",\"downloadUri\":\"/admin/coursepaper/course/download\",\"filename\":\"7e9583aba9594a98b1e0268837d2a5d0.JPG\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016921053566078976, '小学数学二年级课程', 700.00, '小学数学二年级课程', 0, 2, 1, 20, '[{\"name\":\"shuxue2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"7a1fdc70976f4820aa019f91514de272.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016921250996162560, '小学数学三年级课程', 700.00, '小学数学三年级课程', 1, 3, 1, 20, '[{\"name\":\"shuxue.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"f14c0f101146453c80607230e842f1c9.jpg\"},{\"name\":\"shuxue2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"b8451e95fa314facaa8a3cd720888574.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016921446102601728, '小学数学四年级课程', 800.00, '小学数学四年级课程', 1, 4, 1, 21, '[{\"name\":\"shuxue2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"78e1cac8c4284c8a82c7ea4bef5162a4.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016921667582824448, '小学数学五年级课程', 900.00, '小学数学五年级课程', 2, 5, 1, 25, '[{\"name\":\"shuxue.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"167967c0c025406483861eed038111a0.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016922210208321536, '小学数学六年级课程', 1099.00, '小学数学六年级课程', 2, 6, 1, 20, '[{\"name\":\"shuxue2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"7f79d414e4b14ce19d75f038306088a9.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016922414236045312, '天津数学一年级课程', 499.00, '天津数学一年级课程', 0, 1, 1, 20, '[{\"name\":\"shuxue.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"59d6f1cea3584a1ab637ab6a69ebacd6.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016922587657932800, '天津数学二年级课程', 500.00, '天津数学二年级课程', 1, 2, 1, 25, '[{\"name\":\"shuxue2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"830a0f67737e4b79a605ecbbd20f9418.jpg\"},{\"name\":\"shuxue.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"5f9be80c275c48bda8a67562276aa04e.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016922752997396480, '天津数学三年级课程', 799.00, '天津数学三年级课程', 2, 3, 1, 24, '[{\"name\":\"shuxue2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"0fb454a0d56843e6b77bfc874f8a4a0f.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016923276064854016, '小学英语一年级课程', 399.00, '小学英语一年级课程', 0, 1, 2, 15, '[{\"name\":\"english.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"44177c3674f543fda24222b8297ef203.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016923512082534400, '小学英语二年级课程', 428.00, '小学英语二年级课程', 0, 2, 2, 15, '[{\"name\":\"english2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"1a775271ccf9436c8b4e92a841556d79.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016924065042796544, '小学英语三年级课程', 666.00, '小学英语三年级课程', 1, 3, 2, 25, '[{\"name\":\"english2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"d9eded33a06d4931ae326cac3871948f.jpg\"},{\"name\":\"english.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"f179474ce95e4210b4e2a04d480c6535.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016924308048187392, '小学英语四年级课程', 700.00, '小学英语四年级课程', 1, 4, 2, 25, '[{\"name\":\"english.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"c71da8ce21b44dd8bb761fa93b09a341.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016924664354312192, '小学英语五年级课程', 805.00, '小学英语五年级课程', 2, 5, 2, 28, '[{\"name\":\"english2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"0d81493585d94962acbcdc81c074224a.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016924985629609984, '小学英语六年级课程', 998.00, '小学英语六年级课程', 2, 6, 2, 30, '[{\"name\":\"english.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"17b2b4380fc746659666f9c51bfa7618.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016925257013661696, '天津英语一年级课程', 499.00, '天津英语一年级课程', 0, 1, 2, 20, '[{\"name\":\"english2.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"dd15b00b79154c398a3daa9fb8cff9f9.jpg\"},{\"name\":\"english.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"2a0b1f0d262649a294a9f647421f5a7e.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1016925420855758848, '天津英语二年级课程', 528.00, '天津英语二年级课程', 1, 2, 2, 23, '[{\"name\":\"english.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"7dc07373076f452eac02d9405ac83479.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
INSERT INTO `zz_course` VALUES (1018007994936070144, '小学一年级语文课程B', 1111.00, '1112222', 0, 1, 1, 23, '[{\"name\":\"微信图片_20190406094309.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"b11699acb7094c11a1c1efa71d53ee19.jpg\"},{\"name\":\"微信图片_20190406094305.jpg\",\"downloadUri\":\"/admin/app/course/download\",\"filename\":\"e248874a47e849e29dd7b699b2685d30.jpg\"}]', 1093809448606765057, '2020-10-17 00:00:00', '2020-10-17 00:00:00');
COMMIT;
-- ----------------------------
-- Table structure for zz_course_trans_stats
-- ----------------------------
DROP TABLE IF EXISTS `zz_course_trans_stats`;
CREATE TABLE `zz_course_trans_stats` (
`stats_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键Id',
`stats_date` date NOT NULL COMMENT '统计日期',
`subject_id` tinyint(4) NOT NULL COMMENT '科目Id',
`grade_id` tinyint(4) NOT NULL COMMENT '年级Id',
`grade_name` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '年级名称',
`course_id` bigint(20) NOT NULL COMMENT '课程Id',
`course_name` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '课程名称',
`student_attend_count` int(11) NOT NULL COMMENT '学生上课次数',
`student_flower_amount` int(11) NOT NULL COMMENT '学生献花数量',
`student_flower_count` int(11) NOT NULL COMMENT '学生献花次数',
PRIMARY KEY (`stats_id`) USING BTREE,
UNIQUE KEY `uk_stats_date_subject_id_grade_course_id` (`stats_date`,`grade_id`,`course_id`) USING BTREE,
KEY `idx_grade_id` (`grade_id`) USING BTREE,
KEY `idx_course_id` (`course_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_course_trans_stats
-- ----------------------------
BEGIN;
INSERT INTO `zz_course_trans_stats` VALUES (1, '2020-01-10', 0, 1, NULL, 1016699195411402752, '小学一年级拼音基础练习', 1, 0, 0);
INSERT INTO `zz_course_trans_stats` VALUES (2, '2020-01-10', 0, 2, NULL, 1016917385529790464, '小学二年级语文课程', 2, 55, 1);
INSERT INTO `zz_course_trans_stats` VALUES (3, '2020-01-10', 0, 3, NULL, 1016917732260319232, '小学三年级语文课程', 2, 118, 2);
INSERT INTO `zz_course_trans_stats` VALUES (4, '2020-01-10', 0, 4, NULL, 1016917900699373568, '小学四年级语文课程', 0, 40, 1);
INSERT INTO `zz_course_trans_stats` VALUES (5, '2020-01-11', 0, 1, NULL, 1016699195411402752, '小学一年级拼音基础练习', 3, 119, 2);
INSERT INTO `zz_course_trans_stats` VALUES (6, '2020-01-11', 0, 2, NULL, 1016917385529790464, '小学二年级语文课程', 1, 36, 1);
INSERT INTO `zz_course_trans_stats` VALUES (7, '2020-01-11', 0, 3, NULL, 1016917732260319232, '小学三年级语文课程', 1, 147, 2);
INSERT INTO `zz_course_trans_stats` VALUES (8, '2020-01-11', 0, 4, NULL, 1016917900699373568, '小学四年级语文课程', 0, 76, 1);
COMMIT;
-- ----------------------------
-- Table structure for zz_grade
-- ----------------------------
DROP TABLE IF EXISTS `zz_grade`;
CREATE TABLE `zz_grade` (
`grade_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键Id',
`grade_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '年级名称',
`status` int(11) NOT NULL COMMENT '是否正在使用0不是1',
PRIMARY KEY (`grade_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_grade
-- ----------------------------
BEGIN;
INSERT INTO `zz_grade` VALUES (1, '一年级', 1);
INSERT INTO `zz_grade` VALUES (2, '二年级', 1);
INSERT INTO `zz_grade` VALUES (3, '三年级', 1);
INSERT INTO `zz_grade` VALUES (4, '四年级', 1);
INSERT INTO `zz_grade` VALUES (5, '五年级', 1);
INSERT INTO `zz_grade` VALUES (6, '六年级', 1);
INSERT INTO `zz_grade` VALUES (7, '初一', 1);
INSERT INTO `zz_grade` VALUES (8, '初二', 1);
INSERT INTO `zz_grade` VALUES (9, '初三', 1);
INSERT INTO `zz_grade` VALUES (10, '高一', 1);
INSERT INTO `zz_grade` VALUES (11, '高二', 1);
INSERT INTO `zz_grade` VALUES (12, '高三', 1);
COMMIT;
-- ----------------------------
-- Table structure for zz_material_edition
-- ----------------------------
DROP TABLE IF EXISTS `zz_material_edition`;
CREATE TABLE `zz_material_edition` (
`edition_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键Id',
`edition_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '教材版本名称',
`status` int(11) NOT NULL COMMENT '是否正在使用0不是1',
PRIMARY KEY (`edition_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_material_edition
-- ----------------------------
BEGIN;
INSERT INTO `zz_material_edition` VALUES (1, '苏教版', 1);
INSERT INTO `zz_material_edition` VALUES (2, '人教版', 1);
INSERT INTO `zz_material_edition` VALUES (3, '湘教版', 1);
INSERT INTO `zz_material_edition` VALUES (4, '沪教版', 1);
COMMIT;
-- ----------------------------
-- Table structure for zz_school_info
-- ----------------------------
DROP TABLE IF EXISTS `zz_school_info`;
CREATE TABLE `zz_school_info` (
`school_id` bigint(20) NOT NULL COMMENT '学校Id',
`school_name` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT '学校名称',
`province_id` bigint(20) NOT NULL COMMENT '所在省Id',
`city_id` bigint(20) NOT NULL COMMENT '所在城市Id',
PRIMARY KEY (`school_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_school_info
-- ----------------------------
BEGIN;
INSERT INTO `zz_school_info` VALUES (1014065909648330752, '公司总部', 110000000000, 110100000000);
INSERT INTO `zz_school_info` VALUES (1015817732197453824, '北京校区', 110000000000, 110100000000);
INSERT INTO `zz_school_info` VALUES (1015818056597508096, '天津校区', 120000000000, 120100000000);
INSERT INTO `zz_school_info` VALUES (1015818992220901376, '浙江校区', 330000000000, 330100000000);
COMMIT;
-- ----------------------------
-- Table structure for zz_student
-- ----------------------------
DROP TABLE IF EXISTS `zz_student`;
CREATE TABLE `zz_student` (
`student_id` bigint(20) NOT NULL COMMENT '学生Id',
`login_mobile` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '登录手机',
`student_name` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '学生姓名',
`province_id` bigint(20) NOT NULL COMMENT '所在省份Id',
`city_id` bigint(20) NOT NULL COMMENT '所在城市Id',
`district_id` bigint(20) NOT NULL COMMENT '区县Id',
`gender` int(11) NOT NULL COMMENT '学生性别 (0: 女生 1: 男生)',
`birthday` date NOT NULL COMMENT '生日',
`experience_level` tinyint(4) NOT NULL COMMENT '经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)',
`total_coin` int(11) NOT NULL DEFAULT '0' COMMENT '总共充值学币数量',
`left_coin` int(11) NOT NULL DEFAULT '0' COMMENT '可用学币数量',
`grade_id` int(11) NOT NULL COMMENT '年级Id',
`school_id` bigint(20) NOT NULL COMMENT '校区Id',
`register_time` datetime NOT NULL COMMENT '注册时间',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '学生状态 (0: 正常 1: 锁定 2: 注销)',
PRIMARY KEY (`student_id`) USING BTREE,
KEY `idx_login_mobile` (`login_mobile`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_student
-- ----------------------------
BEGIN;
INSERT INTO `zz_student` VALUES (1015842628948463616, '13834561230', '张三', 110000000000, 110100000000, 110105000000, 1, '2010-08-19', 1, 3412, 1077, 4, 1015817732197453824, '2020-10-17 00:00:00', 0);
INSERT INTO `zz_student` VALUES (1015852480873631744, '13945651267', '李军', 110000000000, 110100000000, 110107000000, 1, '2011-11-18', 1, 3178, 3024, 3, 1015817732197453824, '2020-10-17 00:00:00', 0);
INSERT INTO `zz_student` VALUES (1015852853839532032, '13709481736', '王石', 110000000000, 110100000000, 110108000000, 1, '2015-01-15', 0, 3187, 2199, 1, 1015817732197453824, '2020-10-17 00:00:00', 0);
INSERT INTO `zz_student` VALUES (1018000939508568064, '13700023451', '天津二哥', 120000000000, 120100000000, 120103000000, 1, '2010-06-10', 0, 1287, 634, 3, 1015818056597508096, '2020-10-17 00:00:00', 0);
INSERT INTO `zz_student` VALUES (1018001219050541056, '13903122987', '南开学霸', 120000000000, 120100000000, 120104000000, 0, '2009-07-17', 2, 8721, 7023, 4, 1015818056597508096, '2020-10-17 00:00:00', 0);
INSERT INTO `zz_student` VALUES (1023072888777609216, '13920134567', 'aaa', 120000000000, 120100000000, 120103000000, 1, '2020-01-08', 1, 0, 0, 1, 1015818992220901376, '2020-10-17 00:00:00', 0);
COMMIT;
-- ----------------------------
-- Table structure for zz_student_action_stats
-- ----------------------------
DROP TABLE IF EXISTS `zz_student_action_stats`;
CREATE TABLE `zz_student_action_stats` (
`stats_id` bigint(20) NOT NULL COMMENT '主键Id',
`stats_date` date NOT NULL COMMENT '统计日期',
`stats_month` date DEFAULT NULL COMMENT '统计小时',
`grade_id` int(11) NOT NULL COMMENT '年级Id',
`province_id` bigint(20) NOT NULL COMMENT '学生所在省Id',
`city_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '学生所在城市Id',
`buy_course_amount` int(11) NOT NULL DEFAULT '0' COMMENT '购课学币数量',
`buy_course_count` int(11) NOT NULL DEFAULT '0' COMMENT '购买课程次数',
`buy_video_amount` int(11) NOT NULL DEFAULT '0' COMMENT '购买视频学币数量',
`buy_video_count` int(11) NOT NULL DEFAULT '0' COMMENT '购买视频次数',
`buy_paper_amount` int(11) NOT NULL DEFAULT '0' COMMENT '购买作业学币数量',
`buy_paper_count` int(11) NOT NULL DEFAULT '0' COMMENT '购买作业次数',
`buy_flower_amount` int(11) NOT NULL DEFAULT '0' COMMENT '购买献花数量',
`buy_flower_count` int(11) NOT NULL DEFAULT '0' COMMENT '购买献花次数',
`recharge_coin_amount` int(11) NOT NULL DEFAULT '0' COMMENT '充值学币数量',
`recharge_coin_count` int(11) NOT NULL DEFAULT '0' COMMENT '充值学币次数',
`do_course_count` int(11) NOT NULL COMMENT '线下课程上课次数',
`watch_video_count` int(11) NOT NULL DEFAULT '0' COMMENT '观看视频次数',
`watch_video_total_second` int(11) NOT NULL COMMENT '购买献花消费学币数量',
`do_exercise_count` int(11) NOT NULL DEFAULT '0' COMMENT '做题数量',
`do_exercise_correct_count` int(11) NOT NULL DEFAULT '0' COMMENT '做题正确的数量',
PRIMARY KEY (`stats_id`) USING BTREE,
UNIQUE KEY `uk_stats_date_grade_id_region_id` (`stats_date`,`grade_id`,`province_id`,`city_id`) USING BTREE,
KEY `idx_province_id` (`province_id`) USING BTREE,
KEY `idx_city_id` (`city_id`) USING BTREE,
KEY `idx_grade_id` (`grade_id`) USING BTREE,
KEY `idx_stats_month` (`stats_month`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_student_action_stats
-- ----------------------------
BEGIN;
INSERT INTO `zz_student_action_stats` VALUES (1293010719117148160, '2020-01-10', NULL, 1, 110000000000, 110100000000, 16, 5, 0, 0, 14, 2, 123, 3, 2694, 5, 3, 3, 707, 3, 0);
INSERT INTO `zz_student_action_stats` VALUES (1293010719121342468, '2020-01-10', NULL, 2, 110000000000, 110100000000, 8, 3, 0, 0, 6, 1, 133, 2, 1717, 3, 3, 0, 0, 4, 0);
INSERT INTO `zz_student_action_stats` VALUES (1293010719121342475, '2020-01-10', NULL, 4, 110000000000, 110100000000, 0, 0, 0, 0, 16, 2, 55, 2, 1881, 4, 2, 6, 2987, 2, 0);
INSERT INTO `zz_student_action_stats` VALUES (1293010719121342482, '2020-01-10', NULL, 2, 120000000000, 120100000000, 12, 4, 0, 0, 0, 0, 134, 2, 292, 2, 3, 1, 434, 1, 1);
INSERT INTO `zz_student_action_stats` VALUES (1293010719121342489, '2020-01-10', NULL, 3, 120000000000, 120100000000, 5, 2, 0, 0, 18, 3, 79, 2, 1343, 2, 2, 4, 2266, 5, 5);
INSERT INTO `zz_student_action_stats` VALUES (1293010719121342497, '2020-01-10', NULL, 4, 120000000000, 120100000000, 10, 3, 0, 0, 33, 4, 212, 4, 766, 2, 3, 2, 1480, 4, 4);
INSERT INTO `zz_student_action_stats` VALUES (1293010719297503232, '2020-01-11', NULL, 1, 110000000000, 110100000000, 12, 3, 0, 0, 13, 2, 216, 3, 1119, 2, 3, 2, 511, 2, 2);
INSERT INTO `zz_student_action_stats` VALUES (1293010719297503240, '2020-01-11', NULL, 2, 110000000000, 110100000000, 7, 4, 0, 0, 20, 3, 142, 2, 509, 2, 3, 3, 1699, 3, 3);
INSERT INTO `zz_student_action_stats` VALUES (1293010719297503248, '2020-01-11', NULL, 3, 110000000000, 110100000000, 2, 1, 0, 0, 11, 2, 158, 3, 1571, 2, 3, 0, 0, 3, 3);
INSERT INTO `zz_student_action_stats` VALUES (1293010719297503255, '2020-01-11', NULL, 2, 120000000000, 120100000000, 0, 0, 0, 0, 15, 2, 0, 0, 1741, 3, 2, 3, 1280, 3, 3);
INSERT INTO `zz_student_action_stats` VALUES (1293010719301697539, '2020-01-11', NULL, 3, 120000000000, 120100000000, 3, 2, 0, 0, 0, 0, 176, 3, 1702, 2, 2, 2, 1306, 2, 2);
INSERT INTO `zz_student_action_stats` VALUES (1293010719301697545, '2020-01-11', NULL, 4, 120000000000, 120100000000, 7, 2, 0, 0, 9, 2, 122, 2, 1257, 3, 0, 3, 1210, 2, 2);
COMMIT;
-- ----------------------------
-- Table structure for zz_student_action_trans
-- ----------------------------
DROP TABLE IF EXISTS `zz_student_action_trans`;
CREATE TABLE `zz_student_action_trans` (
`trans_id` bigint(20) NOT NULL COMMENT '主键Id',
`student_id` bigint(20) NOT NULL COMMENT '学生Id',
`student_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '学生名称',
`school_id` bigint(20) NOT NULL COMMENT '学生校区',
`grade_id` int(11) NOT NULL COMMENT '年级Id',
`action_type` tinyint(4) NOT NULL COMMENT '行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)',
`device_type` tinyint(4) NOT NULL COMMENT '设备类型(0: iOS 1: Android 2: PC)',
`watch_video_seconds` int(11) DEFAULT NULL COMMENT '看视频秒数',
`flower_count` int(11) DEFAULT NULL COMMENT '购买献花数量',
`paper_count` int(11) DEFAULT NULL COMMENT '购买作业数量',
`video_count` int(11) DEFAULT NULL COMMENT '购买视频数量',
`course_count` int(11) DEFAULT NULL COMMENT '购买课程数量',
`coin_count` int(11) DEFAULT NULL COMMENT '充值学币数量',
`exercise_correct_flag` tinyint(4) DEFAULT NULL COMMENT '做题是否正确标记',
`create_time` datetime NOT NULL COMMENT '发生时间',
PRIMARY KEY (`trans_id`) USING BTREE,
KEY `idx_student_id` (`student_id`) USING BTREE,
KEY `idx_grade_id` (`grade_id`) USING BTREE,
KEY `idx_action_type` (`action_type`) USING BTREE,
KEY `idx_create_time` (`create_time`) USING BTREE,
KEY `idx_device_type` (`action_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- ----------------------------
-- Records of zz_student_action_trans
-- ----------------------------
BEGIN;
INSERT INTO `zz_student_action_trans` VALUES (1018423001834328064, 1015841864515588096, '张大', 1015817732197453824, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, 617, NULL, '2020-01-10 11:13:23');
INSERT INTO `zz_student_action_trans` VALUES (1018803416562667520, 1015841864515588096, '张大', 1015817732197453824, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, 468, NULL, '2020-01-10 11:13:25');
INSERT INTO `zz_student_action_trans` VALUES (1018803445553696768, 1015841864515588096, '张大', 1015817732197453824, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, 548, NULL, '2020-01-10 11:13:30');
INSERT INTO `zz_student_action_trans` VALUES (1018803590760501248, 1015841864515588096, '张大', 1015817732197453824, 1, 0, 2, NULL, NULL, NULL, NULL, NULL, 250, NULL, '2020-01-10 11:13:35');
INSERT INTO `zz_student_action_trans` VALUES (1018803838299934720, 1015841864515588096, '张大', 1015817732197453824, 1, 0, 2, NULL, NULL, NULL, NULL, NULL, 811, NULL, '2020-01-10 11:13:40');
INSERT INTO `zz_student_action_trans` VALUES (1018803855614021632, 1015841864515588096, '张大', 1015817732197453824, 1, 1, 2, NULL, NULL, NULL, NULL, 5, NULL, NULL, '2020-01-10 11:13:45');
INSERT INTO `zz_student_action_trans` VALUES (1018803873183961088, 1015841864515588096, '张大', 1015817732197453824, 1, 1, 1, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-10 11:13:50');
INSERT INTO `zz_student_action_trans` VALUES (1018803890552573952, 1015841864515588096, '张大', 1015817732197453824, 1, 1, 0, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-10 11:13:55');
INSERT INTO `zz_student_action_trans` VALUES (1018803897053745152, 1015841864515588096, '张大', 1015817732197453824, 1, 1, 0, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-10 11:14:00');
INSERT INTO `zz_student_action_trans` VALUES (1018803910555209728, 1015841864515588096, '张大', 1015817732197453824, 1, 1, 0, NULL, NULL, NULL, NULL, 1, NULL, NULL, '2020-01-10 11:14:05');
INSERT INTO `zz_student_action_trans` VALUES (1018803926451621888, 1015841864515588096, '张大', 1015817732197453824, 1, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:10');
INSERT INTO `zz_student_action_trans` VALUES (1018803940418654208, 1015841864515588096, '张大', 1015817732197453824, 1, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:15');
INSERT INTO `zz_student_action_trans` VALUES (1018803955727863808, 1015841864515588096, '张大', 1015817732197453824, 1, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:20');
INSERT INTO `zz_student_action_trans` VALUES (1018803973427826688, 1015841864515588096, '张大', 1015817732197453824, 1, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:25');
INSERT INTO `zz_student_action_trans` VALUES (1018803982235865088, 1015841864515588096, '张大', 1015817732197453824, 1, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:30');
INSERT INTO `zz_student_action_trans` VALUES (1018803988154028032, 1015841864515588096, '张大', 1015817732197453824, 1, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:35');
INSERT INTO `zz_student_action_trans` VALUES (1018804009414955008, 1015841864515588096, '张大', 1015817732197453824, 1, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:40');
INSERT INTO `zz_student_action_trans` VALUES (1018804025521082368, 1015841864515588096, '张大', 1015817732197453824, 1, 4, 1, 342, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:45');
INSERT INTO `zz_student_action_trans` VALUES (1018804040956121088, 1015841864515588096, '张大', 1015817732197453824, 1, 4, 0, 324, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:50');
INSERT INTO `zz_student_action_trans` VALUES (1018804057104191488, 1015841864515588096, '张大', 1015817732197453824, 1, 4, 2, 41, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:14:55');
INSERT INTO `zz_student_action_trans` VALUES (1018804073457782784, 1015841864515588096, '张大', 1015817732197453824, 1, 5, 2, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:15:00');
INSERT INTO `zz_student_action_trans` VALUES (1018804090696372224, 1015841864515588096, '张大', 1015817732197453824, 1, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:15:05');
INSERT INTO `zz_student_action_trans` VALUES (1018804111659503616, 1015841864515588096, '张大', 1015817732197453824, 1, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:15:10');
INSERT INTO `zz_student_action_trans` VALUES (1018804134585569280, 1015841864515588096, '张大', 1015817732197453824, 1, 9, 0, NULL, 15, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:15:15');
INSERT INTO `zz_student_action_trans` VALUES (1018804139606151168, 1015841864515588096, '张大', 1015817732197453824, 1, 9, 0, NULL, 60, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:15:20');
INSERT INTO `zz_student_action_trans` VALUES (1018804156295286784, 1015841864515588096, '张大', 1015817732197453824, 1, 9, 1, NULL, 48, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:15:25');
INSERT INTO `zz_student_action_trans` VALUES (1018804244874792960, 1015841864515588096, '张大', 1015817732197453824, 1, 10, 1, NULL, NULL, 4, NULL, NULL, NULL, NULL, '2020-01-10 11:15:30');
INSERT INTO `zz_student_action_trans` VALUES (1018804264130842624, 1015841864515588096, '张大', 1015817732197453824, 1, 10, 0, NULL, NULL, 10, NULL, NULL, NULL, NULL, '2020-01-10 11:15:35');
INSERT INTO `zz_student_action_trans` VALUES (1018806531059879936, 1015841864515588096, '张大', 1015817732197453824, 2, 0, 0, NULL, NULL, NULL, NULL, NULL, 545, NULL, '2020-01-10 11:15:40');
INSERT INTO `zz_student_action_trans` VALUES (1018806537225506816, 1015841864515588096, '张大', 1015817732197453824, 2, 0, 0, NULL, NULL, NULL, NULL, NULL, 743, NULL, '2020-01-10 11:15:45');
INSERT INTO `zz_student_action_trans` VALUES (1018806554631868416, 1015841864515588096, '张大', 1015817732197453824, 2, 0, 1, NULL, NULL, NULL, NULL, NULL, 429, NULL, '2020-01-10 11:15:50');
INSERT INTO `zz_student_action_trans` VALUES (1018806571031597056, 1015841864515588096, '张大', 1015817732197453824, 2, 1, 1, NULL, NULL, NULL, NULL, 3, NULL, NULL, '2020-01-10 11:15:55');
INSERT INTO `zz_student_action_trans` VALUES (1018806573841780736, 1015841864515588096, '张大', 1015817732197453824, 2, 1, 1, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-10 11:16:00');
INSERT INTO `zz_student_action_trans` VALUES (1018806589612363776, 1015841864515588096, '张大', 1015817732197453824, 2, 1, 2, NULL, NULL, NULL, NULL, 3, NULL, NULL, '2020-01-10 11:16:05');
INSERT INTO `zz_student_action_trans` VALUES (1018806602698592256, 1015841864515588096, '张大', 1015817732197453824, 2, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:16:10');
INSERT INTO `zz_student_action_trans` VALUES (1018806617378656256, 1015841864515588096, '张大', 1015817732197453824, 2, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:16:15');
INSERT INTO `zz_student_action_trans` VALUES (1018806622076276736, 1015841864515588096, '张大', 1015817732197453824, 2, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:16:20');
INSERT INTO `zz_student_action_trans` VALUES (1018806639230980096, 1015841864515588096, '张大', 1015817732197453824, 2, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:16:25');
INSERT INTO `zz_student_action_trans` VALUES (1018806643047796736, 1015841864515588096, '张大', 1015817732197453824, 2, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:16:30');
INSERT INTO `zz_student_action_trans` VALUES (1018806664732348416, 1015841864515588096, '张大', 1015817732197453824, 2, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:16:35');
INSERT INTO `zz_student_action_trans` VALUES (1018806668976984064, 1015841864515588096, '张大', 1015817732197453824, 2, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:16:40');
INSERT INTO `zz_student_action_trans` VALUES (1018806682558140416, 1015841864515588096, '张大', 1015817732197453824, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:16:45');
INSERT INTO `zz_student_action_trans` VALUES (1018806691030634496, 1015841864515588096, '张大', 1015817732197453824, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:16:50');
INSERT INTO `zz_student_action_trans` VALUES (1018806709733036032, 1015841864515588096, '张大', 1015817732197453824, 2, 9, 1, NULL, 49, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:16:55');
INSERT INTO `zz_student_action_trans` VALUES (1018806725126131712, 1015841864515588096, '张大', 1015817732197453824, 2, 9, 0, NULL, 84, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:00');
INSERT INTO `zz_student_action_trans` VALUES (1018806755786493952, 1015841864515588096, '张大', 1015817732197453824, 2, 10, 0, NULL, NULL, 6, NULL, NULL, NULL, NULL, '2020-01-10 11:17:05');
INSERT INTO `zz_student_action_trans` VALUES (1018806774576975872, 1015841864515588096, '张大', 1015817732197453824, 4, 10, 0, NULL, NULL, 8, NULL, NULL, NULL, NULL, '2020-01-10 11:17:10');
INSERT INTO `zz_student_action_trans` VALUES (1018806780532887552, 1015841864515588096, '张大', 1015817732197453824, 4, 10, 0, NULL, NULL, 8, NULL, NULL, NULL, NULL, '2020-01-10 11:17:15');
INSERT INTO `zz_student_action_trans` VALUES (1018806796135698432, 1015841864515588096, '张大', 1015817732197453824, 4, 9, 0, NULL, 33, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:20');
INSERT INTO `zz_student_action_trans` VALUES (1018806799491141632, 1015841864515588096, '张大', 1015817732197453824, 4, 9, 0, NULL, 22, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:25');
INSERT INTO `zz_student_action_trans` VALUES (1018806813844049920, 1015841864515588096, '张大', 1015817732197453824, 4, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:17:30');
INSERT INTO `zz_student_action_trans` VALUES (1018806817694420992, 1015841864515588096, '张大', 1015817732197453824, 4, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2020-01-10 11:17:35');
INSERT INTO `zz_student_action_trans` VALUES (1018806836275187712, 1015841864515588096, '张大', 1015817732197453824, 4, 4, 0, 627, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:40');
INSERT INTO `zz_student_action_trans` VALUES (1018806840423354368, 1015841864515588096, '张大', 1015817732197453824, 4, 4, 0, 463, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:45');
INSERT INTO `zz_student_action_trans` VALUES (1018806858966372352, 1015841864515588096, '张大', 1015817732197453824, 4, 4, 1, 104, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:50');
INSERT INTO `zz_student_action_trans` VALUES (1018806862112100352, 1015841864515588096, '张大', 1015817732197453824, 4, 4, 1, 329, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:17:55');
INSERT INTO `zz_student_action_trans` VALUES (1018806877714911232, 1015841864515588096, '张大', 1015817732197453824, 4, 4, 2, 601, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:18:00');
INSERT INTO `zz_student_action_trans` VALUES (1018806899365908480, 1015841864515588096, '张大', 1015817732197453824, 4, 4, 2, 863, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:18:05');
INSERT INTO `zz_student_action_trans` VALUES (1018806913865617408, 1015841864515588096, '张大', 1015817732197453824, 4, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:18:10');
INSERT INTO `zz_student_action_trans` VALUES (1018806916679995392, 1015841864515588096, '张大', 1015817732197453824, 4, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:18:15');
INSERT INTO `zz_student_action_trans` VALUES (1018806932240863232, 1015841864515588096, '张大', 1015817732197453824, 4, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:18:20');
INSERT INTO `zz_student_action_trans` VALUES (1018806950439948288, 1015841864515588096, '张大', 1015817732197453824, 4, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:18:25');
INSERT INTO `zz_student_action_trans` VALUES (1018806964746719232, 1015841864515588096, '张大', 1015817732197453824, 4, 0, 1, NULL, NULL, NULL, NULL, NULL, 618, NULL, '2020-01-10 11:18:30');
INSERT INTO `zz_student_action_trans` VALUES (1018806967473016832, 1015841864515588096, '张大', 1015817732197453824, 4, 0, 1, NULL, NULL, NULL, NULL, NULL, 25, NULL, '2020-01-10 11:18:35');
INSERT INTO `zz_student_action_trans` VALUES (1018806982023057408, 1015841864515588096, '张大', 1015817732197453824, 4, 0, 0, NULL, NULL, NULL, NULL, NULL, 523, NULL, '2020-01-10 11:18:40');
INSERT INTO `zz_student_action_trans` VALUES (1018806984879378432, 1015841864515588096, '张大', 1015817732197453824, 4, 0, 0, NULL, NULL, NULL, NULL, NULL, 715, NULL, '2020-01-10 11:18:45');
INSERT INTO `zz_student_action_trans` VALUES (1018807041246629888, 1015842628948463616, '张三', 1015818056597508096, 2, 0, 0, NULL, NULL, NULL, NULL, NULL, 269, NULL, '2020-01-10 11:18:50');
INSERT INTO `zz_student_action_trans` VALUES (1018807044560130048, 1015842628948463616, '张三', 1015818056597508096, 2, 0, 0, NULL, NULL, NULL, NULL, NULL, 23, NULL, '2020-01-10 11:18:55');
INSERT INTO `zz_student_action_trans` VALUES (1018807060251021312, 1015842628948463616, '张三', 1015818056597508096, 2, 1, 0, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-10 11:19:00');
INSERT INTO `zz_student_action_trans` VALUES (1018807064650846208, 1015842628948463616, '张三', 1015818056597508096, 2, 1, 0, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-10 11:19:05');
INSERT INTO `zz_student_action_trans` VALUES (1018807069302329344, 1015842628948463616, '张三', 1015818056597508096, 2, 1, 0, NULL, NULL, NULL, NULL, 5, NULL, NULL, '2020-01-10 11:19:10');
INSERT INTO `zz_student_action_trans` VALUES (1018807073211420672, 1015842628948463616, '张三', 1015818056597508096, 2, 1, 0, NULL, NULL, NULL, NULL, 1, NULL, NULL, '2020-01-10 11:19:15');
INSERT INTO `zz_student_action_trans` VALUES (1018807086876463104, 1015842628948463616, '张三', 1015818056597508096, 2, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:20');
INSERT INTO `zz_student_action_trans` VALUES (1018807102311501824, 1015842628948463616, '张三', 1015818056597508096, 2, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:25');
INSERT INTO `zz_student_action_trans` VALUES (1018807118379880448, 1015842628948463616, '张三', 1015818056597508096, 2, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:30');
INSERT INTO `zz_student_action_trans` VALUES (1018807134397927424, 1015842628948463616, '张三', 1015818056597508096, 2, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:35');
INSERT INTO `zz_student_action_trans` VALUES (1018807148918607872, 1015842628948463616, '张三', 1015818056597508096, 2, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:40');
INSERT INTO `zz_student_action_trans` VALUES (1018807151863009280, 1015842628948463616, '张三', 1015818056597508096, 2, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:45');
INSERT INTO `zz_student_action_trans` VALUES (1018807176013811712, 1015842628948463616, '张三', 1015818056597508096, 2, 4, 1, 434, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:19:50');
INSERT INTO `zz_student_action_trans` VALUES (1018807190026981376, 1015842628948463616, '张三', 1015818056597508096, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:19:55');
INSERT INTO `zz_student_action_trans` VALUES (1018807205868867584, 1015842628948463616, '张三', 1015818056597508096, 2, 9, 1, NULL, 100, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:20:00');
INSERT INTO `zz_student_action_trans` VALUES (1018807221144522752, 1015842628948463616, '张三', 1015818056597508096, 2, 9, 0, NULL, 34, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:20:05');
INSERT INTO `zz_student_action_trans` VALUES (1018807245962219520, 1015842628948463616, '张三', 1015818056597508096, 3, 9, 0, NULL, 57, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:20:10');
INSERT INTO `zz_student_action_trans` VALUES (1018807249124724736, 1015842628948463616, '张三', 1015818056597508096, 3, 9, 0, NULL, 22, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:20:15');
INSERT INTO `zz_student_action_trans` VALUES (1018807263423107072, 1015842628948463616, '张三', 1015818056597508096, 3, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:20:20');
INSERT INTO `zz_student_action_trans` VALUES (1018807267189592064, 1015842628948463616, '张三', 1015818056597508096, 3, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:20:25');
INSERT INTO `zz_student_action_trans` VALUES (1018807284394627072, 1015842628948463616, '张三', 1015818056597508096, 3, 10, 0, NULL, NULL, 6, NULL, NULL, NULL, NULL, '2020-01-10 11:20:30');
INSERT INTO `zz_student_action_trans` VALUES (1018807287661989888, 1015842628948463616, '张三', 1015818056597508096, 3, 10, 0, NULL, NULL, 4, NULL, NULL, NULL, NULL, '2020-01-10 11:20:35');
INSERT INTO `zz_student_action_trans` VALUES (1018807304527286272, 1015842628948463616, '张三', 1015818056597508096, 3, 10, 2, NULL, NULL, 8, NULL, NULL, NULL, NULL, '2020-01-10 11:20:40');
INSERT INTO `zz_student_action_trans` VALUES (1018807321082204160, 1015842628948463616, '张三', 1015818056597508096, 3, 5, 2, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:20:45');
INSERT INTO `zz_student_action_trans` VALUES (1018807323640729600, 1015842628948463616, '张三', 1015818056597508096, 3, 5, 2, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:20:50');
INSERT INTO `zz_student_action_trans` VALUES (1018807341474910208, 1015842628948463616, '张三', 1015818056597508096, 3, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:20:55');
INSERT INTO `zz_student_action_trans` VALUES (1018807358168240128, 1015842628948463616, '张三', 1015818056597508096, 3, 4, 1, 109, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:00');
INSERT INTO `zz_student_action_trans` VALUES (1018807377902440448, 1015842628948463616, '张三', 1015818056597508096, 3, 4, 0, 923, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:05');
INSERT INTO `zz_student_action_trans` VALUES (1018807396172828672, 1015842628948463616, '张三', 1015818056597508096, 3, 4, 2, 598, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:10');
INSERT INTO `zz_student_action_trans` VALUES (1018807399939313664, 1015842628948463616, '张三', 1015818056597508096, 3, 4, 2, 636, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:15');
INSERT INTO `zz_student_action_trans` VALUES (1018807412731940864, 1015842628948463616, '张三', 1015818056597508096, 3, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:20');
INSERT INTO `zz_student_action_trans` VALUES (1018807416288710656, 1015842628948463616, '张三', 1015818056597508096, 3, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:25');
INSERT INTO `zz_student_action_trans` VALUES (1018807429895032832, 1015842628948463616, '张三', 1015818056597508096, 3, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:30');
INSERT INTO `zz_student_action_trans` VALUES (1018807443853676544, 1015842628948463616, '张三', 1015818056597508096, 3, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:35');
INSERT INTO `zz_student_action_trans` VALUES (1018807458953170944, 1015842628948463616, '张三', 1015818056597508096, 3, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:21:40');
INSERT INTO `zz_student_action_trans` VALUES (1018807471968096256, 1015842628948463616, '张三', 1015818056597508096, 3, 1, 0, NULL, NULL, NULL, NULL, 3, NULL, NULL, '2020-01-10 11:21:45');
INSERT INTO `zz_student_action_trans` VALUES (1018807475562614784, 1015842628948463616, '张三', 1015818056597508096, 3, 1, 0, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-10 11:21:50');
INSERT INTO `zz_student_action_trans` VALUES (1018807497494630400, 1015842628948463616, '张三', 1015818056597508096, 3, 0, 1, NULL, NULL, NULL, NULL, NULL, 546, NULL, '2020-01-10 11:21:55');
INSERT INTO `zz_student_action_trans` VALUES (1018807510580858880, 1015842628948463616, '张三', 1015818056597508096, 3, 0, 2, NULL, NULL, NULL, NULL, NULL, 797, NULL, '2020-01-10 11:22:00');
INSERT INTO `zz_student_action_trans` VALUES (1018807530558328832, 1015842628948463616, '张三', 1015818056597508096, 4, 0, 2, NULL, NULL, NULL, NULL, NULL, 668, NULL, '2020-01-10 11:22:05');
INSERT INTO `zz_student_action_trans` VALUES (1018807544810573824, 1015842628948463616, '张三', 1015818056597508096, 4, 0, 2, NULL, NULL, NULL, NULL, NULL, 98, NULL, '2020-01-10 11:22:10');
INSERT INTO `zz_student_action_trans` VALUES (1018807559650021376, 1015842628948463616, '张三', 1015818056597508096, 4, 1, 2, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-10 11:22:15');
INSERT INTO `zz_student_action_trans` VALUES (1018807565647876096, 1015842628948463616, '张三', 1015818056597508096, 4, 1, 2, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-10 11:22:20');
INSERT INTO `zz_student_action_trans` VALUES (1018807581548482560, 1015842628948463616, '张三', 1015818056597508096, 4, 1, 1, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-10 11:22:25');
INSERT INTO `zz_student_action_trans` VALUES (1018807596224352256, 1015842628948463616, '张三', 1015818056597508096, 4, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:22:30');
INSERT INTO `zz_student_action_trans` VALUES (1018807598866763776, 1015842628948463616, '张三', 1015818056597508096, 4, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:22:35');
INSERT INTO `zz_student_action_trans` VALUES (1018807614889005056, 1015842628948463616, '张三', 1015818056597508096, 4, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:22:40');
INSERT INTO `zz_student_action_trans` VALUES (1018807628856037376, 1015842628948463616, '张三', 1015818056597508096, 4, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:22:45');
INSERT INTO `zz_student_action_trans` VALUES (1018807632249229312, 1015842628948463616, '张三', 1015818056597508096, 4, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:22:50');
INSERT INTO `zz_student_action_trans` VALUES (1018807646891544576, 1015842628948463616, '张三', 1015818056597508096, 4, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:22:55');
INSERT INTO `zz_student_action_trans` VALUES (1018807659432513536, 1015842628948463616, '张三', 1015818056597508096, 4, 4, 0, 931, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:23:00');
INSERT INTO `zz_student_action_trans` VALUES (1018807675786104832, 1015842628948463616, '张三', 1015818056597508096, 4, 4, 1, 549, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:23:05');
INSERT INTO `zz_student_action_trans` VALUES (1018807693569953792, 1015842628948463616, '张三', 1015818056597508096, 4, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:23:10');
INSERT INTO `zz_student_action_trans` VALUES (1018807696216559616, 1015842628948463616, '张三', 1015818056597508096, 4, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:23:15');
INSERT INTO `zz_student_action_trans` VALUES (1018807710099705856, 1015842628948463616, '张三', 1015818056597508096, 4, 5, 2, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:23:20');
INSERT INTO `zz_student_action_trans` VALUES (1018807726746898432, 1015842628948463616, '张三', 1015818056597508096, 4, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-10 11:23:25');
INSERT INTO `zz_student_action_trans` VALUES (1018807743188570112, 1015842628948463616, '张三', 1015818056597508096, 4, 9, 0, NULL, 89, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:23:30');
INSERT INTO `zz_student_action_trans` VALUES (1018807747508703232, 1015842628948463616, '张三', 1015818056597508096, 4, 9, 0, NULL, 45, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:23:35');
INSERT INTO `zz_student_action_trans` VALUES (1018807762734026752, 1015842628948463616, '张三', 1015818056597508096, 4, 9, 1, NULL, 26, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:23:40');
INSERT INTO `zz_student_action_trans` VALUES (1018807779007926272, 1015842628948463616, '张三', 1015818056597508096, 4, 9, 2, NULL, 52, NULL, NULL, NULL, NULL, NULL, '2020-01-10 11:23:45');
INSERT INTO `zz_student_action_trans` VALUES (1018807795281825792, 1015842628948463616, '张三', 1015818056597508096, 4, 10, 2, NULL, NULL, 9, NULL, NULL, NULL, NULL, '2020-01-10 11:23:50');
INSERT INTO `zz_student_action_trans` VALUES (1018807814282022912, 1015842628948463616, '张三', 1015818056597508096, 4, 10, 1, NULL, NULL, 9, NULL, NULL, NULL, NULL, '2020-01-10 11:23:55');
INSERT INTO `zz_student_action_trans` VALUES (1018807818304360448, 1015842628948463616, '张三', 1015818056597508096, 4, 10, 1, NULL, NULL, 10, NULL, NULL, NULL, NULL, '2020-01-10 11:24:00');
INSERT INTO `zz_student_action_trans` VALUES (1018807839112302592, 1015842628948463616, '张三', 1015818056597508096, 4, 10, 0, NULL, NULL, 5, NULL, NULL, NULL, NULL, '2020-01-10 11:24:05');
INSERT INTO `zz_student_action_trans` VALUES (1018807937338707968, 1015852480873631744, '李军', 1015817732197453824, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, 868, NULL, '2020-01-11 11:24:10');
INSERT INTO `zz_student_action_trans` VALUES (1018807958184398848, 1015852480873631744, '李军', 1015817732197453824, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, 251, NULL, '2020-01-11 11:24:15');
INSERT INTO `zz_student_action_trans` VALUES (1018807973283893248, 1015852480873631744, '李军', 1015817732197453824, 1, 1, 1, NULL, NULL, NULL, NULL, 3, NULL, NULL, '2020-01-11 11:24:20');
INSERT INTO `zz_student_action_trans` VALUES (1018807976429621248, 1015852480873631744, '李军', 1015817732197453824, 1, 1, 1, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-11 11:24:25');
INSERT INTO `zz_student_action_trans` VALUES (1018807990446985216, 1015852480873631744, '李军', 1015817732197453824, 1, 1, 0, NULL, NULL, NULL, NULL, 5, NULL, NULL, '2020-01-11 11:24:30');
INSERT INTO `zz_student_action_trans` VALUES (1018808007266144256, 1015852480873631744, '李军', 1015817732197453824, 1, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:24:35');
INSERT INTO `zz_student_action_trans` VALUES (1018808010520924160, 1015852480873631744, '李军', 1015817732197453824, 1, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:24:40');
INSERT INTO `zz_student_action_trans` VALUES (1018808029248491520, 1015852480873631744, '李军', 1015817732197453824, 1, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:24:45');
INSERT INTO `zz_student_action_trans` VALUES (1018808046189285376, 1015852480873631744, '李军', 1015817732197453824, 1, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:24:50');
INSERT INTO `zz_student_action_trans` VALUES (1018808049536339968, 1015852480873631744, '李军', 1015817732197453824, 1, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:24:55');
INSERT INTO `zz_student_action_trans` VALUES (1018808063356571648, 1015852480873631744, '李军', 1015817732197453824, 1, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:25:00');
INSERT INTO `zz_student_action_trans` VALUES (1018808090606964736, 1015852480873631744, '李军', 1015817732197453824, 1, 4, 0, 331, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:25:05');
INSERT INTO `zz_student_action_trans` VALUES (1018808105442217984, 1015852480873631744, '李军', 1015817732197453824, 1, 4, 1, 180, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:25:10');
INSERT INTO `zz_student_action_trans` VALUES (1018808123947487232, 1015852480873631744, '李军', 1015817732197453824, 1, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:25:15');
INSERT INTO `zz_student_action_trans` VALUES (1018808139374137344, 1015852480873631744, '李军', 1015817732197453824, 1, 5, 2, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:25:20');
INSERT INTO `zz_student_action_trans` VALUES (1018808163239727104, 1015852480873631744, '李军', 1015817732197453824, 1, 9, 2, NULL, 73, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:25:25');
INSERT INTO `zz_student_action_trans` VALUES (1018808178884481024, 1015852480873631744, '李军', 1015817732197453824, 1, 9, 1, NULL, 85, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:25:30');
INSERT INTO `zz_student_action_trans` VALUES (1018808202037039104, 1015852480873631744, '李军', 1015817732197453824, 1, 9, 0, NULL, 58, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:25:35');
INSERT INTO `zz_student_action_trans` VALUES (1018808225227345920, 1015852480873631744, '李军', 1015817732197453824, 1, 10, 0, NULL, NULL, 3, NULL, NULL, NULL, NULL, '2020-01-11 11:25:40');
INSERT INTO `zz_student_action_trans` VALUES (1018808239072743424, 1015852480873631744, '李军', 1015817732197453824, 1, 10, 1, NULL, NULL, 10, NULL, NULL, NULL, NULL, '2020-01-11 11:25:45');
INSERT INTO `zz_student_action_trans` VALUES (1018808259285094400, 1015852480873631744, '李军', 1015817732197453824, 2, 10, 1, NULL, NULL, 6, NULL, NULL, NULL, NULL, '2020-01-11 11:25:50');
INSERT INTO `zz_student_action_trans` VALUES (1018808281019977728, 1015852480873631744, '李军', 1015817732197453824, 2, 10, 0, NULL, NULL, 6, NULL, NULL, NULL, NULL, '2020-01-11 11:25:55');
INSERT INTO `zz_student_action_trans` VALUES (1018808284450918400, 1015852480873631744, '李军', 1015817732197453824, 2, 10, 0, NULL, NULL, 8, NULL, NULL, NULL, NULL, '2020-01-11 11:26:00');
INSERT INTO `zz_student_action_trans` VALUES (1018808301647564800, 1015852480873631744, '李军', 1015817732197453824, 2, 9, 0, NULL, 44, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:05');
INSERT INTO `zz_student_action_trans` VALUES (1018808305003008000, 1015852480873631744, '李军', 1015817732197453824, 2, 9, 0, NULL, 98, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:10');
INSERT INTO `zz_student_action_trans` VALUES (1018808319687266304, 1015852480873631744, '李军', 1015817732197453824, 2, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:26:15');
INSERT INTO `zz_student_action_trans` VALUES (1018808334279249920, 1015852480873631744, '李军', 1015817732197453824, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:26:20');
INSERT INTO `zz_student_action_trans` VALUES (1018808337051684864, 1015852480873631744, '李军', 1015817732197453824, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:26:25');
INSERT INTO `zz_student_action_trans` VALUES (1018808352482529280, 1015852480873631744, '李军', 1015817732197453824, 2, 4, 1, 829, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:30');
INSERT INTO `zz_student_action_trans` VALUES (1018808368341192704, 1015852480873631744, '李军', 1015817732197453824, 2, 4, 2, 143, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:35');
INSERT INTO `zz_student_action_trans` VALUES (1018808371201708032, 1015852480873631744, '李军', 1015817732197453824, 2, 4, 2, 727, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:40');
INSERT INTO `zz_student_action_trans` VALUES (1018808386959708160, 1015852480873631744, '李军', 1015817732197453824, 2, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:45');
INSERT INTO `zz_student_action_trans` VALUES (1018808389941858304, 1015852480873631744, '李军', 1015817732197453824, 2, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:50');
INSERT INTO `zz_student_action_trans` VALUES (1018808403061641216, 1015852480873631744, '李军', 1015817732197453824, 2, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:26:55');
INSERT INTO `zz_student_action_trans` VALUES (1018808417364217856, 1015852480873631744, '李军', 1015817732197453824, 2, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:27:00');
INSERT INTO `zz_student_action_trans` VALUES (1018808431247364096, 1015852480873631744, '李军', 1015817732197453824, 2, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:27:05');
INSERT INTO `zz_student_action_trans` VALUES (1018808434900602880, 1015852480873631744, '李军', 1015817732197453824, 2, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:27:10');
INSERT INTO `zz_student_action_trans` VALUES (1018808450344030208, 1015852480873631744, '李军', 1015817732197453824, 2, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:27:15');
INSERT INTO `zz_student_action_trans` VALUES (1018808468366954496, 1015852480873631744, '李军', 1015817732197453824, 2, 1, 0, NULL, NULL, NULL, NULL, 1, NULL, NULL, '2020-01-11 11:27:20');
INSERT INTO `zz_student_action_trans` VALUES (1018808471776923648, 1015852480873631744, '李军', 1015817732197453824, 2, 1, 0, NULL, NULL, NULL, NULL, 1, NULL, NULL, '2020-01-11 11:27:25');
INSERT INTO `zz_student_action_trans` VALUES (1018808486574428160, 1015852480873631744, '李军', 1015817732197453824, 2, 1, 1, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-11 11:27:30');
INSERT INTO `zz_student_action_trans` VALUES (1018808489720156160, 1015852480873631744, '李军', 1015817732197453824, 2, 1, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, '2020-01-11 11:27:35');
INSERT INTO `zz_student_action_trans` VALUES (1018808519092867072, 1015852480873631744, '李军', 1015817732197453824, 2, 0, 1, NULL, NULL, NULL, NULL, NULL, 23, NULL, '2020-01-11 11:27:40');
INSERT INTO `zz_student_action_trans` VALUES (1018808533722599424, 1015852480873631744, '李军', 1015817732197453824, 2, 0, 0, NULL, NULL, NULL, NULL, NULL, 486, NULL, '2020-01-11 11:27:45');
INSERT INTO `zz_student_action_trans` VALUES (1018808549908418560, 1015852480873631744, '李军', 1015817732197453824, 3, 0, 0, NULL, NULL, NULL, NULL, NULL, 937, NULL, '2020-01-11 11:27:50');
INSERT INTO `zz_student_action_trans` VALUES (1018808553595211776, 1015852480873631744, '李军', 1015817732197453824, 3, 0, 0, NULL, NULL, NULL, NULL, NULL, 634, NULL, '2020-01-11 11:27:55');
INSERT INTO `zz_student_action_trans` VALUES (1018808567696461824, 1015852480873631744, '李军', 1015817732197453824, 3, 1, 0, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-11 11:28:00');
INSERT INTO `zz_student_action_trans` VALUES (1018808589381013504, 1015852480873631744, '李军', 1015817732197453824, 3, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:05');
INSERT INTO `zz_student_action_trans` VALUES (1018808603381600256, 1015852480873631744, '李军', 1015817732197453824, 3, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:10');
INSERT INTO `zz_student_action_trans` VALUES (1018808627708563456, 1015852853839532032, '王石', 1015817732197453824, 3, 2, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:15');
INSERT INTO `zz_student_action_trans` VALUES (1018808643911159808, 1015852853839532032, '王石', 1015817732197453824, 3, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:20');
INSERT INTO `zz_student_action_trans` VALUES (1018808647878971392, 1015852853839532032, '王石', 1015817732197453824, 3, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:25');
INSERT INTO `zz_student_action_trans` VALUES (1018808662647115776, 1015852853839532032, '王石', 1015817732197453824, 3, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:30');
INSERT INTO `zz_student_action_trans` VALUES (1018808676190523392, 1015852853839532032, '王石', 1015817732197453824, 3, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:28:35');
INSERT INTO `zz_student_action_trans` VALUES (1018808679671795712, 1015852853839532032, '王石', 1015817732197453824, 3, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:28:40');
INSERT INTO `zz_student_action_trans` VALUES (1018808713146535936, 1015841864515588096, '张大', 1015817732197453824, 3, 5, 2, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:28:45');
INSERT INTO `zz_student_action_trans` VALUES (1018808727696576512, 1015841864515588096, '张大', 1015817732197453824, 3, 9, 2, NULL, 93, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:50');
INSERT INTO `zz_student_action_trans` VALUES (1018808730968133632, 1015841864515588096, '张大', 1015817732197453824, 3, 9, 2, NULL, 39, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:28:55');
INSERT INTO `zz_student_action_trans` VALUES (1018808745056800768, 1015841864515588096, '张大', 1015817732197453824, 3, 9, 0, NULL, 26, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:29:00');
INSERT INTO `zz_student_action_trans` VALUES (1018808762224087040, 1015841864515588096, '张大', 1015817732197453824, 3, 10, 0, NULL, NULL, 4, NULL, NULL, NULL, NULL, '2020-01-11 11:29:05');
INSERT INTO `zz_student_action_trans` VALUES (1018808766552608768, 1015841864515588096, '张大', 1015817732197453824, 3, 10, 0, NULL, NULL, 7, NULL, NULL, NULL, NULL, '2020-01-11 11:29:10');
INSERT INTO `zz_student_action_trans` VALUES (1018808834777157632, 1015841864515588096, '张大', 1015818056597508096, 2, 10, 0, NULL, NULL, 8, NULL, NULL, NULL, NULL, '2020-01-11 11:29:15');
INSERT INTO `zz_student_action_trans` VALUES (1018808837880942592, 1015841864515588096, '张大', 1015818056597508096, 2, 10, 0, NULL, NULL, 7, NULL, NULL, NULL, NULL, '2020-01-11 11:29:20');
INSERT INTO `zz_student_action_trans` VALUES (1018808852263211008, 1015841864515588096, '张大', 1015818056597508096, 2, 5, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:29:25');
INSERT INTO `zz_student_action_trans` VALUES (1018808870055448576, 1015841864515588096, '张大', 1015818056597508096, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:29:30');
INSERT INTO `zz_student_action_trans` VALUES (1018808872664305664, 1015841864515588096, '张大', 1015818056597508096, 2, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:29:35');
INSERT INTO `zz_student_action_trans` VALUES (1018808889886117888, 1015841864515588096, '张大', 1015818056597508096, 2, 3, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:29:40');
INSERT INTO `zz_student_action_trans` VALUES (1018808905585397760, 1015841864515588096, '张大', 1015818056597508096, 2, 4, 1, 756, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:29:45');
INSERT INTO `zz_student_action_trans` VALUES (1018808924665286656, 1015841864515588096, '张大', 1015818056597508096, 2, 4, 2, 35, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:29:50');
INSERT INTO `zz_student_action_trans` VALUES (1018808927844569088, 1015841864515588096, '张大', 1015818056597508096, 2, 4, 2, 489, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:29:55');
INSERT INTO `zz_student_action_trans` VALUES (1018808941014683648, 1015841864515588096, '张大', 1015818056597508096, 2, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:30:00');
INSERT INTO `zz_student_action_trans` VALUES (1018808944089108480, 1015841864515588096, '张大', 1015818056597508096, 2, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:30:05');
INSERT INTO `zz_student_action_trans` VALUES (1018808963789754368, 1015841864515588096, '张大', 1015818056597508096, 2, 0, 2, NULL, NULL, NULL, NULL, NULL, 342, NULL, '2020-01-11 11:30:10');
INSERT INTO `zz_student_action_trans` VALUES (1018808967061311488, 1015841864515588096, '张大', 1015818056597508096, 2, 0, 2, NULL, NULL, NULL, NULL, NULL, 894, NULL, '2020-01-11 11:30:15');
INSERT INTO `zz_student_action_trans` VALUES (1018808971549216768, 1015841864515588096, '张大', 1015818056597508096, 2, 0, 2, NULL, NULL, NULL, NULL, NULL, 505, NULL, '2020-01-11 11:30:20');
INSERT INTO `zz_student_action_trans` VALUES (1018809014373060608, 1015841864515588096, '张大', 1015818056597508096, 3, 0, 2, NULL, NULL, NULL, NULL, NULL, 870, NULL, '2020-01-11 11:30:25');
INSERT INTO `zz_student_action_trans` VALUES (1018809017279713280, 1015841864515588096, '张大', 1015818056597508096, 3, 0, 2, NULL, NULL, NULL, NULL, NULL, 832, NULL, '2020-01-11 11:30:30');
INSERT INTO `zz_student_action_trans` VALUES (1018809030013620224, 1015841864515588096, '张大', 1015818056597508096, 3, 1, 2, NULL, NULL, NULL, NULL, 1, NULL, NULL, '2020-01-11 11:30:35');
INSERT INTO `zz_student_action_trans` VALUES (1018809043577999360, 1015841864515588096, '张大', 1015818056597508096, 3, 1, 0, NULL, NULL, NULL, NULL, 2, NULL, NULL, '2020-01-11 11:30:40');
INSERT INTO `zz_student_action_trans` VALUES (1018809058333560832, 1015841864515588096, '张大', 1015818056597508096, 3, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:30:45');
INSERT INTO `zz_student_action_trans` VALUES (1018809068521525248, 1015841864515588096, '张大', 1015818056597508096, 3, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:30:50');
INSERT INTO `zz_student_action_trans` VALUES (1018809083839123456, 1015841864515588096, '张大', 1015818056597508096, 3, 4, 0, 484, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:30:55');
INSERT INTO `zz_student_action_trans` VALUES (1018809101107073024, 1015841864515588096, '张大', 1015818056597508096, 3, 4, 1, 822, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:31:00');
INSERT INTO `zz_student_action_trans` VALUES (1018809116709883904, 1015841864515588096, '张大', 1015818056597508096, 3, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:31:05');
INSERT INTO `zz_student_action_trans` VALUES (1018809119352295424, 1015841864515588096, '张大', 1015818056597508096, 3, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:31:10');
INSERT INTO `zz_student_action_trans` VALUES (1018809140072157184, 1015841864515588096, '张大', 1015818056597508096, 3, 9, 1, NULL, 92, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:31:15');
INSERT INTO `zz_student_action_trans` VALUES (1018809153410043904, 1015841864515588096, '张大', 1015818056597508096, 3, 9, 0, NULL, 23, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:31:20');
INSERT INTO `zz_student_action_trans` VALUES (1018809156404776960, 1015841864515588096, '张大', 1015818056597508096, 3, 9, 0, NULL, 61, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:31:25');
INSERT INTO `zz_student_action_trans` VALUES (1018809187635564544, 1015841864515588096, '张大', 1015818056597508096, 4, 9, 0, NULL, 26, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:31:30');
INSERT INTO `zz_student_action_trans` VALUES (1018809205096452096, 1015841864515588096, '张大', 1015818056597508096, 4, 9, 1, NULL, 96, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:31:35');
INSERT INTO `zz_student_action_trans` VALUES (1018809219889762304, 1015841864515588096, '张大', 1015818056597508096, 4, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:31:40');
INSERT INTO `zz_student_action_trans` VALUES (1018809223115182080, 1015841864515588096, '张大', 1015818056597508096, 4, 5, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, '2020-01-11 11:31:45');
INSERT INTO `zz_student_action_trans` VALUES (1018809241318461440, 1015841864515588096, '张大', 1015818056597508096, 4, 10, 1, NULL, NULL, 4, NULL, NULL, NULL, NULL, '2020-01-11 11:31:50');
INSERT INTO `zz_student_action_trans` VALUES (1018809244799733760, 1015841864515588096, '张大', 1015818056597508096, 4, 10, 1, NULL, NULL, 5, NULL, NULL, NULL, NULL, '2020-01-11 11:31:55');
INSERT INTO `zz_student_action_trans` VALUES (1018809259483992064, 1015841864515588096, '张大', 1015818056597508096, 4, 4, 1, 244, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:32:00');
INSERT INTO `zz_student_action_trans` VALUES (1018809272926736384, 1015841864515588096, '张大', 1015818056597508096, 4, 4, 0, 736, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:32:05');
INSERT INTO `zz_student_action_trans` VALUES (1018809275388792832, 1015841864515588096, '张大', 1015818056597508096, 4, 4, 0, 230, NULL, NULL, NULL, NULL, NULL, NULL, '2020-01-11 11:32:10');
INSERT INTO `zz_student_action_trans` VALUES (1018809289016086528, 1015841864515588096, '张大', 1015818056597508096, 4, 1, 0, NULL, NULL, NULL, NULL, 3, NULL, NULL, '2020-01-11 11:32:15');
INSERT INTO `zz_student_action_trans` VALUES (1018809291985653760, 1015841864515588096, '张大', 1015818056597508096, 4, 1, 0, NULL, NULL, NULL, NULL, 4, NULL, NULL, '2020-01-11 11:32:20');
INSERT INTO `zz_student_action_trans` VALUES (1018809313879920640, 1015841864515588096, '张大', 1015818056597508096, 4, 0, 0, NULL, NULL, NULL, NULL, NULL, 441, NULL, '2020-01-11 11:32:25');
INSERT INTO `zz_student_action_trans` VALUES (1018809333760921600, 1015841864515588096, '张大', 1015818056597508096, 4, 0, 1, NULL, NULL, NULL, NULL, NULL, 202, NULL, '2020-01-11 11:32:30');
INSERT INTO `zz_student_action_trans` VALUES (1018809347316912128, 1015841864515588096, '张大', 1015818056597508096, 4, 0, 2, NULL, NULL, NULL, NULL, NULL, 614, NULL, '2020-01-11 11:32:35');
COMMIT;
-- ----------------------------
-- Table structure for zz_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `zz_sys_user`;
CREATE TABLE `zz_sys_user` (
`user_id` bigint(20) NOT NULL COMMENT '主键Id',
`login_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '用户登录名称',
`password` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '密码',
`show_name` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '用户显示名称',
`user_type` int(11) NOT NULL COMMENT '用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)',
`head_image_url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户头像的Url',
`user_status` int(11) NOT NULL COMMENT '状态(0: 正常 1: 锁定)',
`create_user_id` bigint(20) NOT NULL COMMENT '创建者',
`create_username` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '创建用户名',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '最后更新时间',
`deleted_flag` int(11) NOT NULL COMMENT '删除标记(1: 正常 -1: 已删除)',
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE KEY `uk_login_name` (`login_name`) USING BTREE,
KEY `idx_status` (`user_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT COMMENT='系统用户表';
-- ----------------------------
-- Records of zz_sys_user
-- ----------------------------
BEGIN;
INSERT INTO `zz_sys_user` VALUES (1317453102294503425, 'admin', '$2a$10$xBslnuRm.kzZ3aYbMB/HPe3cdYp1LWQFXGxXadbPkePg2TeVu.EWy', '管理员', 0, 'CHANGE TO YOUR HEAD IMAGE URL!!!', 0, 1317453102294503425, '管理员', '2020-10-17 00:00:00', '2020-10-17 00:00:00', 1);
INSERT INTO `zz_sys_user` VALUES (1317455515172737024, '111', '$2a$10$oiJwJAALeSAsphcCmZYHcOuiq4fvcNZ3Av8JCSpmHWfYQESbQZeqe', '111', 2, NULL, 0, 1317453102294503425, '管理员', '2020-10-17 21:20:47', '2020-10-17 21:20:50', -1);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,39 @@
-- ----------------------------
-- 请仅在下面的数据库链接中执行该脚本。
-- 主数据源 [localhost:3306/zzdemo-single]
-- ----------------------------
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- 系统用户表
-- ----------------------------
DROP TABLE IF EXISTS `zz_sys_user`;
CREATE TABLE `zz_sys_user` (
`user_id` bigint(20) NOT NULL COMMENT '主键Id',
`login_name` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '用户登录名称',
`password` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '密码',
`show_name` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '用户显示名称',
`user_type` int(11) NOT NULL COMMENT '用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)',
`head_image_url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户头像的Url',
`user_status` int(11) NOT NULL COMMENT '状态(0: 正常 1: 锁定)',
`create_user_id` bigint(20) NOT NULL COMMENT '创建者Id',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_user_id` bigint(20) NOT NULL COMMENT '更新者Id',
`update_time` datetime NOT NULL COMMENT '最后更新时间',
`deleted_flag` int(11) NOT NULL COMMENT '删除标记(1: 正常 -1: 已删除)',
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE KEY `uk_login_name` (`login_name`) USING BTREE,
KEY `idx_status` (`user_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT COMMENT='系统用户表';
-- ----------------------------
-- 管理员账号数据
-- ----------------------------
BEGIN;
INSERT INTO `zz_sys_user` VALUES(1356949260217618433,'admin','$2a$10$kgLilf1w72o13TJJYefgH.ZZuqrxh4PYinBvl5wrrcao7ZCm5Rh.i','管理员',0,'CHANGE TO YOUR HEAD IMAGE URL!!!',0,1356949260217618433,CURDATE(),1356949260217618433,CURDATE(),1);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,16 @@
version: '3.2'
services:
redis:
container_name: redis
build:
context: services/redis/
args:
- REDIS_VER=4
ports:
- "6379:6379"
volumes:
- ./services/redis/redis.conf:/usr/local/etc/redis/redis.conf:rw
- ./data/redis:/data:rw
- ./logs/redis:/var/log/:rw

View File

@@ -0,0 +1,13 @@
ARG REDIS_VER
FROM redis:${REDIS_VER}
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD ["redis-server", "/usr/local/etc/redis/redis.conf"]
# 设置时区为上海
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Ubuntu软件源选择中国的服务器
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list