1
0

27 Ревизии ee6d8f14b7 ... 336e1e6311

Автор SHA1 Съобщение Дата
  cuidi 336e1e6311 学生登陆模块 преди 1 година
  cuidi a4a5ade0b2 Merge branch 'master' into cuidi преди 1 година
  cuidi c33bde9238 pwd преди 1 година
  wuheng 0cb089babc Merge branch 'wheng' of wuheng/eas-system into master преди 1 година
  wuheng 656ffd8763 过滤器放行 token преди 1 година
  wuheng a229d1fb00 Merge branch 'wheng' of wuheng/eas-system into master преди 1 година
  wuheng 3f1b90f9ad token преди 1 година
  wuheng 2e5e451a83 Merge branch 'superb' of wuheng/eas-system into master преди 1 година
  superb 04e78d60b9 Merge branch 'master' into superb преди 1 година
  superb 86f185d35c docx преди 1 година
  superb f301d85f32 6 преди 1 година
  superb d7832269e0 合并最新master преди 1 година
  superb ed6aeaeb10 增加了根据token获取用户信息接口,粗略地写了导出学院信息到word преди 1 година
  wuheng 0b94263dec Merge branch 'wheng' of wuheng/eas-system into master преди 1 година
  wuheng 180883f439 login преди 1 година
  wuheng 90b10ae3d4 Merge branch 'wheng' of wuheng/eas-system into master преди 1 година
  wuheng 792f7e82ef admin 登录二次校验 преди 1 година
  wuheng 24858a86be Merge branch 'cuidi' of wuheng/eas-system into master преди 1 година
  wuheng b39e90a5c3 Merge branch 'wheng' of wuheng/eas-system into master преди 1 година
  wuheng 8271e54fe1 更新表结构 преди 1 година
  wuheng f5e3751a67 Merge branch 'cuidi' of wuheng/eas-system into master преди 1 година
  wuheng 91bcae7ae5 Merge branch 'cuidi' into wheng преди 1 година
  wuheng 4bbcc70acf Merge branch 'cuidi' into wheng преди 1 година
  wuheng 1ed088e0fd Merge branch 'master' of http://39.105.160.25:10880/wuheng/eas-system преди 1 година
  wuheng cd90ededdc Merge branch 'master' of http://39.105.160.25:10880/wuheng/eas-system преди 1 година
  wuheng 7ae73bde28 Merge branch 'master' of http://39.105.160.25:10880/wuheng/eas-system преди 1 година
  wuheng 8e30db5b35 word преди 1 година
променени са 33 файла, в които са добавени 1668 реда и са изтрити 47 реда
  1. 2 0
      .gitignore
  2. 4 0
      common/pom.xml
  3. 7 0
      common/src/main/java/com/koobietech/eas/common/utils/FileManager.java
  4. 1 1
      common/src/main/java/com/koobietech/eas/common/utils/JwtManager.java
  5. 13 12
      controller/src/main/java/com/koobietech/eas/controller/AdminLoginController.java
  6. 27 0
      controller/src/main/java/com/koobietech/eas/controller/EasStuProfileController.java
  7. 72 0
      controller/src/main/java/com/koobietech/eas/controller/StudentLoginController.java
  8. BIN
      controller/src/main/resources/Temp/StuRegistTemp.docx
  9. BIN
      controller/src/main/resources/Temp/kun1.jpeg
  10. BIN
      controller/src/main/resources/Temp/~$uRegistTemp.docx
  11. 1 1
      controller/src/main/resources/application-local.yaml
  12. BIN
      controller/src/main/resources/temp/StuRegistTemp.docx
  13. 5 4
      controller/src/test/java/com/koobietech/eas/controller/ControllerApplicationTests.java
  14. 1 1
      dao/src/main/java/com/koobietech/eas/dao/Pojo/AdminPojo.java
  15. 4 0
      dao/src/main/java/com/koobietech/eas/dao/mapper/AdminLoginMapper.java
  16. 59 0
      dao/src/main/resources/com/koobietech/eas/dao/mapper/AdminLoginMapper.xml
  17. 31 0
      mbg/src/main/java/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.java
  18. 6 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudents.java
  19. 2 2
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduClass.java
  20. 116 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelation.java
  21. 560 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelationExample.java
  22. 226 0
      mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.xml
  23. 29 24
      security/src/main/java/com/koobietech/eas/security/filter/EasSecurityFilter.java
  24. 82 0
      security/src/main/java/com/koobietech/eas/security/filter/EasStudentFilter.java
  25. 4 0
      service/pom.xml
  26. 1 0
      service/src/main/java/com/koobietech/eas/service/AdminLoginService.java
  27. 10 0
      service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java
  28. 19 0
      service/src/main/java/com/koobietech/eas/service/StudentLoginRedisService.java
  29. 19 0
      service/src/main/java/com/koobietech/eas/service/StudentLoginService.java
  30. 17 2
      service/src/main/java/com/koobietech/eas/service/impl/AdminLoginServiceImpl.java
  31. 105 0
      service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java
  32. 57 0
      service/src/main/java/com/koobietech/eas/service/impl/StudentLoginRedisServiceImpl.java
  33. 188 0
      service/src/main/java/com/koobietech/eas/service/impl/StudentLoginServiceImpl.java

+ 2 - 0
.gitignore

@@ -11,6 +11,8 @@ sys-debug*
 sys-info*
 sys-error*
 
+temp/*
+
 ### STS ###
 .apt_generated
 .classpath

+ 4 - 0
common/pom.xml

@@ -14,6 +14,10 @@
     </parent>
 
     <dependencies>
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-redis</artifactId>

+ 7 - 0
common/src/main/java/com/koobietech/eas/common/utils/FileManager.java

@@ -0,0 +1,7 @@
+package com.koobietech.eas.common.utils;
+
+public class FileManager {
+//    public boolean saveDocument(XWPFDocument document, String savePath){
+//
+//    }
+}

+ 1 - 1
common/src/main/java/com/koobietech/eas/common/utils/JwtManager.java

@@ -70,7 +70,7 @@ public class JwtManager {
             jwtUserDto.setUsername(verify.getClaim("user").asString());
             jwtUserDto.setType(UserType.valueOf(verify.getClaim("type").asString()));
         } catch ( JWTVerificationException e){
-            //throw new EasException("token 不正确!");
+            throw new EasException("token 不正确!");
         }
         return jwtUserDto;
     }

+ 13 - 12
controller/src/main/java/com/koobietech/eas/controller/AdminLoginController.java

@@ -31,11 +31,24 @@ public class AdminLoginController {
     @Operation(summary = "管理员登录",  description = "用户名和密码为请求载荷,若登录成功,返回两token")
     public JsonResult adminLogin(@RequestBody AdminPojo adminPojo){
 
+        CaptchaVO captchaVO = new CaptchaVO();
+        captchaVO.setCaptchaVerification( adminPojo.getCaptchaVerification() );
+        ResponseModel response = captchaService.verification(captchaVO);
+        if (!response.isSuccess()) {
+            throw new EasException( response.getRepMsg() , Integer.parseInt(response.getRepCode()));
+        }
+
         LoginToken result = adminLoginService.adminLogin(adminPojo);
 
         return JsonResult.data(result);
     }
 
+    @GetMapping("getUserInfo")
+    @Operation(summary = "获取用户信息", description = "根据token获取用户信息")
+    public JsonResult getUserInfo(@RequestHeader("Authorization") String token) {
+        return JsonResult.data(adminLoginService.getUserInfo(token));
+    }
+
     @PostMapping("/refreshToken")
     @Operation(summary = "刷新token", description = "当token过期,在请求头中携带refresh token,若刷新成功,返回新的token和refresh token")
     public JsonResult refreshToken(@RequestHeader("Authorization") String refreshToken) {
@@ -55,16 +68,4 @@ public class AdminLoginController {
         return adminLoginService.verifyToJsonResult(captchaService.check(captchaVO));
     }
 
-    @PostMapping("/verify.judge")
-    @Operation(summary = "二次校验验证码", description = "校验滑动验证码结果,是否匹配上,传参:captchaVerification")
-    public JsonResult verify(@RequestBody CaptchaVO captchaVO) {
-        ResponseModel response = captchaService.verification(captchaVO);
-        if (!response.isSuccess()) {
-            throw new EasException( response.getRepMsg() , Integer.parseInt(response.getRepCode()));
-        }
-        return adminLoginService.verifyToJsonResult(response);
-    }
-
-
-
 }

+ 27 - 0
controller/src/main/java/com/koobietech/eas/controller/EasStuProfileController.java

@@ -0,0 +1,27 @@
+package com.koobietech.eas.controller;
+
+
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+import com.koobietech.eas.service.EasStuProfileService;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.io.FileNotFoundException;
+
+@RestController
+public class EasStuProfileController {
+
+    @Resource
+    private EasStuProfileService easStuProfileService;
+
+    @RequestMapping("/StuProfileDownload")
+    public JsonResult StuProfileDownload(@RequestBody  EasArcTlsStudents easArcTlsStudents) throws FileNotFoundException {
+
+        return easStuProfileService.StuProfileDownload(easArcTlsStudents);
+    }
+
+
+}

+ 72 - 0
controller/src/main/java/com/koobietech/eas/controller/StudentLoginController.java

@@ -0,0 +1,72 @@
+package com.koobietech.eas.controller;
+
+import com.anji.captcha.model.common.ResponseModel;
+import com.anji.captcha.model.vo.CaptchaVO;
+import com.anji.captcha.service.CaptchaService;
+import com.koobietech.eas.common.exception.EasException;
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.dao.Pojo.AdminPojo;
+import com.koobietech.eas.dao.adminLoginPojo.UserDetail;
+import com.koobietech.eas.dao.dto.LoginToken;
+import com.koobietech.eas.service.StudentLoginService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@Tag(name = "学生登陆模块")
+public class StudentLoginController {
+
+    @Resource
+    CaptchaService captchaService;
+
+    @Resource
+    StudentLoginService studentLoginService;
+
+    @PostMapping("/studentLogin")
+    @Operation(summary = "学生登陆", description = "用户名和密码为请求载荷,若登录成功,返回两个token")
+    public JsonResult studentLogin(@RequestBody AdminPojo adminPojo) {
+
+        CaptchaVO captchaVO = new CaptchaVO();
+        captchaVO.setCaptchaVerification(adminPojo.getCaptchaVerification());
+
+        ResponseModel response = captchaService.verification(captchaVO);
+        if (!response.isSuccess()) {
+            throw new EasException(response.getRepMsg(), Integer.parseInt(response.getRepCode()));
+        }
+
+        LoginToken ret = studentLoginService.studentLogin(adminPojo);
+        return JsonResult.data(ret);
+    }
+
+    @GetMapping("/getStudentInfo")
+    @Operation(summary = "获取学生信息", description = "根据Token获取学生信息")
+    public JsonResult getStudentInfo(@RequestHeader("Authorization") String token) {
+        UserDetail ret = studentLoginService.getStudentInfo(token);
+        return JsonResult.data(ret);
+    }
+
+    @PostMapping("/studentRefreshToken")
+    @Operation(summary = "刷新token", description = "当token过期,在请求头中携带refresh token,若刷新成功,返回新的token和refresh token")
+    public JsonResult refreshToken(@RequestHeader("AUthorization") String refreshToken) {
+        LoginToken ret = studentLoginService.refreshToken(refreshToken);
+        return JsonResult.data(ret);
+    }
+
+    @PostMapping("/studentVerifyGet")
+    @Operation(summary = "获取验证码", description = "前端发起获取验证码请求,后端访问静态资源返回滑动图片")
+    public JsonResult verifyGet(@RequestBody CaptchaVO captchaVO) {
+        JsonResult ret = studentLoginService.verifyToJsonResult(captchaService.get(captchaVO));
+        return JsonResult.data(ret);
+    }
+
+    @PostMapping("/studentVerifyCheck")
+    @Operation(summary = "核对验证码轨迹", description = "前端把用户的滑动轨迹转化成字符串传入后端,通过算法判断轨迹是否为真人")
+    public JsonResult verifyCheck(@RequestBody CaptchaVO captchaVO) {
+        JsonResult ret = studentLoginService.verifyToJsonResult(captchaService.check(captchaVO));
+        return JsonResult.data(ret);
+    }
+
+}

BIN
controller/src/main/resources/Temp/StuRegistTemp.docx


BIN
controller/src/main/resources/Temp/kun1.jpeg


BIN
controller/src/main/resources/Temp/~$uRegistTemp.docx


+ 1 - 1
controller/src/main/resources/application-local.yaml

@@ -4,7 +4,7 @@ spring:
   datasource:
     url: jdbc:mysql://127.0.0.1:3306/eas?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true&tinyInt1isBit=false
     username: root
-    password: 123456
+    password: 1234
     driver-class-name: com.mysql.cj.jdbc.Driver
   redis:
     host: localhost

BIN
controller/src/main/resources/temp/StuRegistTemp.docx


+ 5 - 4
controller/src/test/java/com/koobietech/eas/controller/ControllerApplicationTests.java

@@ -16,10 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.util.*;
 
 
@@ -28,6 +25,10 @@ class ControllerApplicationTests {
 
     @Test
     void contextLoads() throws IOException {
+
+        InputStream wordStream = this.getClass().getClassLoader().getResourceAsStream("\\temp\\StuRegistTemp.docx");
+        System.out.println( wordStream );
+
 //        List<Map> list = new ArrayList<>();
 //        Workbook workbook = null;
 //        ExportParams params = new ExportParams("大数据测试", "测试");

+ 1 - 1
dao/src/main/java/com/koobietech/eas/dao/Pojo/AdminPojo.java

@@ -6,5 +6,5 @@ import lombok.Data;
 public class AdminPojo {
     private String username;
     private String passwd;
-
+    private String captchaVerification;
 }

+ 4 - 0
dao/src/main/java/com/koobietech/eas/dao/mapper/AdminLoginMapper.java

@@ -13,6 +13,10 @@ public interface AdminLoginMapper {
 
     UserDetail getUserDetailById(Long adminId);
 
+    List<Permission> getStudentPermissionsById(Long adminId);
 
+    List<Department> getStudentDepartmentsById(Long adminId);
+
+    UserDetail getStudentDetailById(Long adminId);
 
 }

+ 59 - 0
dao/src/main/resources/com/koobietech/eas/dao/mapper/AdminLoginMapper.xml

@@ -33,6 +33,37 @@
         <result column="email" property="email"/>
     </resultMap>
 
+    <resultMap id="permissionResult" type="com.koobietech.eas.dao.adminLoginPojo.Permission">
+        <!-- 映射查询结果到实体类属性 -->
+        <id column="id" property="id"/>
+        <result column="name" property="name"/>
+        <result column="is_active" property="isActive"/>
+        <result column="create_time" property="createTime"/>
+        <result column="modify_time" property="modifyTime"/>
+        <result column="create_uid" property="createUid"/>
+        <result column="description" property="description"/>
+    </resultMap>
+
+    <resultMap id="departmentResult" type="com.koobietech.eas.dao.adminLoginPojo.Department">
+        <!-- 映射查询结果到实体类属性 -->
+        <id column="id" property="id"/>
+        <result column="depname" property="depname"/>
+        <result column="address" property="address"/>
+        <result column="phone" property="phone"/>
+        <result column="email" property="email"/>
+        <result column="manager" property="manager"/>
+        <result column="create_time" property="createTime"/>
+        <result column="modify_time" property="modifyTime"/>
+        <result column="create_uid" property="createUid"/>
+    </resultMap>
+
+    <resultMap id="studentDetailResult" type="com.koobietech.eas.dao.adminLoginPojo.UserDetail">
+        <!-- 映射查询结果到实体类属性 -->
+        <result column="id" property="id"/>
+        <result column="student_name" property="username"/>
+        <result column="phone" property="phone"/>
+        <result column="email" property="email"/>
+    </resultMap>
 
 
 
@@ -81,4 +112,32 @@
         WHERE id = #{adminId}
     </select>
 
+    <select id="getStudentDetailById" resultMap="studentDetailResult">
+        SELECT
+            id,
+            student_name,
+            phone,
+            email
+        FROM
+            eas_sys_student
+        WHERE
+            id = #{adminId}
+    </select>
+
+    <select id="getStudentPermissionsById" resultMap="permissionResult">
+        SELECT p.id, p.name, p.is_active, p.create_time, p.modify_time, p.create_uid, p.description
+        FROM eas_sys_student s
+                 JOIN eas_sys_pes_relation pr ON s.id = pr.department_id
+                 JOIN eas_sys_permission p ON pr.permission_id = p.id
+        WHERE s.id = #{adminId};
+    </select>
+
+    <select id="getStudentDepartmentsById" resultMap="departmentResult">
+        SELECT DISTINCT d.id, d.depname, d.address, d.phone, d.email, d.manager, d.create_time, d.modify_time, d.create_uid
+        FROM eas_sys_student s
+                 JOIN eas_sys_pes_relation pr ON s.id = pr.department_id
+                 JOIN eas_sys_department d ON pr.department_id = d.id
+        WHERE s.id = #{adminId}
+    </select>
+
 </mapper>

+ 31 - 0
mbg/src/main/java/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.java

@@ -0,0 +1,31 @@
+package com.koobietech.eas.mbg.mapper;
+
+import com.koobietech.eas.mbg.model.EasEduCltRelation;
+import com.koobietech.eas.mbg.model.EasEduCltRelationExample;
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface EasEduCltRelationMapper {
+    long countByExample(EasEduCltRelationExample example);
+
+    int deleteByExample(EasEduCltRelationExample example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(EasEduCltRelation record);
+
+    int insertSelective(EasEduCltRelation record);
+
+    List<EasEduCltRelation> selectByExample(EasEduCltRelationExample example);
+
+    EasEduCltRelation selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("record") EasEduCltRelation record, @Param("example") EasEduCltRelationExample example);
+
+    int updateByExample(@Param("record") EasEduCltRelation record, @Param("example") EasEduCltRelationExample example);
+
+    int updateByPrimaryKeySelective(EasEduCltRelation record);
+
+    int updateByPrimaryKey(EasEduCltRelation record);
+}

+ 6 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudents.java

@@ -1,6 +1,9 @@
 package com.koobietech.eas.mbg.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -51,6 +54,7 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生出生日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date birthdate;
 
     /**
@@ -83,6 +87,7 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生入学进入培训班日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date enrollmentDate;
 
     /**
@@ -91,6 +96,7 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生在培训班毕业日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date graduationDate;
 
     /**

+ 2 - 2
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduClass.java

@@ -6,11 +6,11 @@ import java.util.Date;
 
 public class EasEduClass implements Serializable {
     /**
-     * 学员ID
+     * 班级ID
      *
      * @mbg.generated
      */
-    @Schema(description = "学员ID")
+    @Schema(description = "班级ID")
     private Long id;
 
     /**

+ 116 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelation.java

@@ -0,0 +1,116 @@
+package com.koobietech.eas.mbg.model;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.io.Serializable;
+import java.util.Date;
+
+public class EasEduCltRelation implements Serializable {
+    private Integer id;
+
+    /**
+     * 班级ID
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "班级ID")
+    private Long classId;
+
+    /**
+     * 学员ID
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "学员ID")
+    private Integer studentId;
+
+    /**
+     * 创建时间
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "修改时间")
+    private Date modifyTime;
+
+    /**
+     * 创建用户ID
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "创建用户ID")
+    private Integer createUid;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Long getClassId() {
+        return classId;
+    }
+
+    public void setClassId(Long classId) {
+        this.classId = classId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getModifyTime() {
+        return modifyTime;
+    }
+
+    public void setModifyTime(Date modifyTime) {
+        this.modifyTime = modifyTime;
+    }
+
+    public Integer getCreateUid() {
+        return createUid;
+    }
+
+    public void setCreateUid(Integer createUid) {
+        this.createUid = createUid;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", classId=").append(classId);
+        sb.append(", studentId=").append(studentId);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", modifyTime=").append(modifyTime);
+        sb.append(", createUid=").append(createUid);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 560 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelationExample.java

@@ -0,0 +1,560 @@
+package com.koobietech.eas.mbg.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class EasEduCltRelationExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public EasEduCltRelationExample() {
+        oredCriteria = new ArrayList<>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdIsNull() {
+            addCriterion("class_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdIsNotNull() {
+            addCriterion("class_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdEqualTo(Long value) {
+            addCriterion("class_id =", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdNotEqualTo(Long value) {
+            addCriterion("class_id <>", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdGreaterThan(Long value) {
+            addCriterion("class_id >", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("class_id >=", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdLessThan(Long value) {
+            addCriterion("class_id <", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdLessThanOrEqualTo(Long value) {
+            addCriterion("class_id <=", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdIn(List<Long> values) {
+            addCriterion("class_id in", values, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdNotIn(List<Long> values) {
+            addCriterion("class_id not in", values, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdBetween(Long value1, Long value2) {
+            addCriterion("class_id between", value1, value2, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdNotBetween(Long value1, Long value2) {
+            addCriterion("class_id not between", value1, value2, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdIsNull() {
+            addCriterion("student_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdIsNotNull() {
+            addCriterion("student_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdEqualTo(Integer value) {
+            addCriterion("student_id =", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdNotEqualTo(Integer value) {
+            addCriterion("student_id <>", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdGreaterThan(Integer value) {
+            addCriterion("student_id >", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("student_id >=", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdLessThan(Integer value) {
+            addCriterion("student_id <", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdLessThanOrEqualTo(Integer value) {
+            addCriterion("student_id <=", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdIn(List<Integer> values) {
+            addCriterion("student_id in", values, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdNotIn(List<Integer> values) {
+            addCriterion("student_id not in", values, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdBetween(Integer value1, Integer value2) {
+            addCriterion("student_id between", value1, value2, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("student_id not between", value1, value2, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIsNull() {
+            addCriterion("modify_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIsNotNull() {
+            addCriterion("modify_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeEqualTo(Date value) {
+            addCriterion("modify_time =", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotEqualTo(Date value) {
+            addCriterion("modify_time <>", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeGreaterThan(Date value) {
+            addCriterion("modify_time >", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("modify_time >=", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeLessThan(Date value) {
+            addCriterion("modify_time <", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeLessThanOrEqualTo(Date value) {
+            addCriterion("modify_time <=", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIn(List<Date> values) {
+            addCriterion("modify_time in", values, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotIn(List<Date> values) {
+            addCriterion("modify_time not in", values, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeBetween(Date value1, Date value2) {
+            addCriterion("modify_time between", value1, value2, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotBetween(Date value1, Date value2) {
+            addCriterion("modify_time not between", value1, value2, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidIsNull() {
+            addCriterion("create_uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidIsNotNull() {
+            addCriterion("create_uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidEqualTo(Integer value) {
+            addCriterion("create_uid =", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidNotEqualTo(Integer value) {
+            addCriterion("create_uid <>", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidGreaterThan(Integer value) {
+            addCriterion("create_uid >", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("create_uid >=", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidLessThan(Integer value) {
+            addCriterion("create_uid <", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidLessThanOrEqualTo(Integer value) {
+            addCriterion("create_uid <=", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidIn(List<Integer> values) {
+            addCriterion("create_uid in", values, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidNotIn(List<Integer> values) {
+            addCriterion("create_uid not in", values, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidBetween(Integer value1, Integer value2) {
+            addCriterion("create_uid between", value1, value2, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidNotBetween(Integer value1, Integer value2) {
+            addCriterion("create_uid not between", value1, value2, "createUid");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 226 - 0
mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.xml

@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.koobietech.eas.mbg.mapper.EasEduCltRelationMapper">
+  <resultMap id="BaseResultMap" type="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="class_id" jdbcType="BIGINT" property="classId" />
+    <result column="student_id" jdbcType="INTEGER" property="studentId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
+    <result column="create_uid" jdbcType="INTEGER" property="createUid" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, class_id, student_id, create_time, modify_time, create_uid
+  </sql>
+  <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelationExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from eas_edu_clt_relation
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from eas_edu_clt_relation
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from eas_edu_clt_relation
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelationExample">
+    delete from eas_edu_clt_relation
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into eas_edu_clt_relation (class_id, student_id, create_time, 
+      modify_time, create_uid)
+    values (#{classId,jdbcType=BIGINT}, #{studentId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifyTime,jdbcType=TIMESTAMP}, #{createUid,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into eas_edu_clt_relation
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="classId != null">
+        class_id,
+      </if>
+      <if test="studentId != null">
+        student_id,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifyTime != null">
+        modify_time,
+      </if>
+      <if test="createUid != null">
+        create_uid,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="classId != null">
+        #{classId,jdbcType=BIGINT},
+      </if>
+      <if test="studentId != null">
+        #{studentId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyTime != null">
+        #{modifyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createUid != null">
+        #{createUid,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelationExample" resultType="java.lang.Long">
+    select count(*) from eas_edu_clt_relation
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update eas_edu_clt_relation
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.classId != null">
+        class_id = #{record.classId,jdbcType=BIGINT},
+      </if>
+      <if test="record.studentId != null">
+        student_id = #{record.studentId,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.modifyTime != null">
+        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.createUid != null">
+        create_uid = #{record.createUid,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update eas_edu_clt_relation
+    set id = #{record.id,jdbcType=INTEGER},
+      class_id = #{record.classId,jdbcType=BIGINT},
+      student_id = #{record.studentId,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
+      create_uid = #{record.createUid,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    update eas_edu_clt_relation
+    <set>
+      <if test="classId != null">
+        class_id = #{classId,jdbcType=BIGINT},
+      </if>
+      <if test="studentId != null">
+        student_id = #{studentId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyTime != null">
+        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createUid != null">
+        create_uid = #{createUid,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    update eas_edu_clt_relation
+    set class_id = #{classId,jdbcType=BIGINT},
+      student_id = #{studentId,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+      create_uid = #{createUid,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 29 - 24
security/src/main/java/com/koobietech/eas/security/filter/EasSecurityFilter.java

@@ -1,5 +1,6 @@
 package com.koobietech.eas.security.filter;
 
+import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.pojo.JwtUserDto;
 import com.koobietech.eas.common.utils.JwtManager;
 import com.koobietech.eas.dao.adminLoginPojo.Permission;
@@ -38,39 +39,43 @@ public class EasSecurityFilter extends OncePerRequestFilter {
         //从请求里面拿到token
         String token = request.getHeader("Authorization");
         //判断token是否存在
-        if (StringUtils.hasText(token) && false) {
+        if (StringUtils.hasText(token)) {
             //解析token成JwtUserDto
-            JwtUserDto jwtUserDto = jwtManager.decodeJwt(token);
-            //判断token是否有效
-            UserDetail userDetail = loginRedisService.checkToken(jwtUserDto);
+            JwtUserDto jwtUserDto = null;
+            try {
+                //过滤器 允许 Token 不正确, 后面Security 会拦截处理
+                jwtUserDto = jwtManager.decodeJwt(token);
+            } catch ( EasException e) {}
+            if ( Objects.nonNull(jwtUserDto) ) {
+                //判断token是否有效
+                UserDetail userDetail = loginRedisService.checkToken(jwtUserDto);
 
-            // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
-            SecurityContext context = SecurityContextHolder.getContext();
+                // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
+                SecurityContext context = SecurityContextHolder.getContext();
 
-            if (Objects.nonNull(userDetail)) {
-                // 如果获取到了有效的用户对象
+                if (Objects.nonNull(userDetail)) {
+                    // 如果获取到了有效的用户对象
 
-                // 获取用户的权限列表
-                List<Permission> permission = userDetail.getPermissions();
+                    // 获取用户的权限列表
+                    List<Permission> permission = userDetail.getPermissions();
 
-                // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
-                ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
+                    // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
+                    ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
 
-                // 遍历用户的权限列表
-                for (Permission adminPermission : permission) {
-                    // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
-                    SimpleGrantedAuthority authority = new SimpleGrantedAuthority(adminPermission.getDescription());
-                    objects.add(authority);
-                }
+                    // 遍历用户的权限列表
+                    for (Permission adminPermission : permission) {
+                        // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
+                        SimpleGrantedAuthority authority = new SimpleGrantedAuthority(adminPermission.getDescription());
+                        objects.add(authority);
+                    }
 
-                // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
-                UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
+                    // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
+                    UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
 
-                // 将身份验证令牌设置到当前的 SecurityContext 中
-                context.setAuthentication(authenticationToken);
+                    // 将身份验证令牌设置到当前的 SecurityContext 中
+                    context.setAuthentication(authenticationToken);
+                }
             }
-            //放行
-            filterChain.doFilter(request, response);
         }
         filterChain.doFilter(request, response);
     }

+ 82 - 0
security/src/main/java/com/koobietech/eas/security/filter/EasStudentFilter.java

@@ -0,0 +1,82 @@
+package com.koobietech.eas.security.filter;
+
+import com.koobietech.eas.common.exception.EasException;
+import com.koobietech.eas.common.pojo.JwtUserDto;
+import com.koobietech.eas.common.utils.JwtManager;
+import com.koobietech.eas.dao.adminLoginPojo.Permission;
+import com.koobietech.eas.dao.adminLoginPojo.UserDetail;
+import com.koobietech.eas.service.StudentLoginRedisService;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import javax.annotation.Resource;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Component
+public class EasStudentFilter extends OncePerRequestFilter {
+
+    @Resource
+    private StudentLoginRedisService studentLoginRedisService;
+
+    @Resource
+    JwtManager jwtManager;
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
+
+        //从请求里面拿到token
+        String token = request.getHeader("Authorization");
+        //判断token是否存在
+        if (StringUtils.hasText(token)) {
+            //解析token成JwtUserDto
+            JwtUserDto jwtUserDto = null;
+            try {
+                //过滤器 允许 Token 不正确, 后面Security 会拦截处理
+                jwtUserDto = jwtManager.decodeJwt(token);
+            } catch ( EasException e) {}
+            if ( Objects.nonNull(jwtUserDto) ) {
+                //判断token是否有效
+                UserDetail userDetail = studentLoginRedisService.checkToken(jwtUserDto);
+
+                // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
+                SecurityContext context = SecurityContextHolder.getContext();
+
+                // 如果获取到了有效的用户对象
+                if (Objects.nonNull(userDetail)) {
+
+                    // 获取用户的权限列表
+                    List<Permission> permissions = userDetail.getPermissions();
+                    // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
+                    ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
+
+                    // 遍历学生的权限
+                    for (Permission studentPermission : permissions) {
+                        // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
+                        SimpleGrantedAuthority authority = new SimpleGrantedAuthority(studentPermission.getDescription());
+                        objects.add(authority);
+                    }
+
+                    // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
+                    UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
+
+                    // 将身份验证令牌设置到当前的 SecurityContext 中
+                    context.setAuthentication(authenticationToken);
+                }
+            }
+        }
+        filterChain.doFilter(request, response);
+    }
+
+}

+ 4 - 0
service/pom.xml

@@ -8,6 +8,10 @@
     <description>service</description>
 
     <dependencies>
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.github.pagehelper</groupId>
             <artifactId>pagehelper-spring-boot-starter</artifactId>

+ 1 - 0
service/src/main/java/com/koobietech/eas/service/AdminLoginService.java

@@ -15,4 +15,5 @@ public interface AdminLoginService {
     JsonResult verifyToJsonResult(ResponseModel responseModel);
 
 
+    UserDetail getUserInfo(String token);
 }

+ 10 - 0
service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java

@@ -0,0 +1,10 @@
+package com.koobietech.eas.service;
+
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+
+import java.io.FileNotFoundException;
+
+public interface EasStuProfileService {
+    JsonResult StuProfileDownload(EasArcTlsStudents easArcTlsStudents) throws FileNotFoundException;
+}

+ 19 - 0
service/src/main/java/com/koobietech/eas/service/StudentLoginRedisService.java

@@ -0,0 +1,19 @@
+package com.koobietech.eas.service;
+
+import com.koobietech.eas.common.pojo.JwtUserDto;
+import com.koobietech.eas.dao.adminLoginPojo.UserDetail;
+
+public interface StudentLoginRedisService {
+
+    String createJwtTokenKey(JwtUserDto jwtUserDto);
+
+    String createJwtRefreshTokenKey(JwtUserDto jwtUserDto);
+
+    void loginSavaCache(String redisTokenKey, UserDetail userDetail, Integer token_expires);
+
+    UserDetail loginGetCache(String newRedisTokenKey);
+
+    UserDetail checkToken(JwtUserDto jwtUserDto);
+
+    Boolean loginDeleteCache(String newRedisRefreshTokenKey);
+}

+ 19 - 0
service/src/main/java/com/koobietech/eas/service/StudentLoginService.java

@@ -0,0 +1,19 @@
+package com.koobietech.eas.service;
+
+import com.anji.captcha.model.common.ResponseModel;
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.dao.Pojo.AdminPojo;
+import com.koobietech.eas.dao.adminLoginPojo.UserDetail;
+import com.koobietech.eas.dao.dto.LoginToken;
+
+
+public interface StudentLoginService {
+    LoginToken studentLogin(AdminPojo adminPojo);
+
+    LoginToken refreshToken(String refreshToken);
+
+    //将ResponseModel返回值类型转成JsonResult返回类型
+    JsonResult verifyToJsonResult(ResponseModel response);
+
+    UserDetail getStudentInfo(String token);
+}

+ 17 - 2
service/src/main/java/com/koobietech/eas/service/impl/AdminLoginServiceImpl.java

@@ -41,8 +41,8 @@ public class AdminLoginServiceImpl implements AdminLoginService {
     private JwtManager jwtManager;
 
     // token过期时间 单位:s
-    private final Integer token_expires = 30;
-    private final Integer refreshToken_expires = 60;
+    private final Integer token_expires = 60*3;
+    private final Integer refreshToken_expires = 60*7;
 
     @Override
     public LoginToken adminLogin(AdminPojo adminPojo) {
@@ -73,6 +73,8 @@ public class AdminLoginServiceImpl implements AdminLoginService {
             JwtUserDto jwtUserDto = new JwtUserDto(userDetailInRedis.getUsername(), userDetailInRedis.getId(), userType);
             String token = jwtManager.createJwt(jwtUserDto, token_expires);
             String refreshToken = jwtManager.createJwt(jwtUserDto, refreshToken_expires);
+            System.out.println("token:" + token);
+            System.out.println("refreshToken:" + refreshToken);
 
             // 生成redis key
             String redisTokenKey = loginRedisService.createJwtTokenKey(jwtUserDto);
@@ -130,6 +132,19 @@ public class AdminLoginServiceImpl implements AdminLoginService {
         return result;
     }
 
+    @Override
+    public UserDetail getUserInfo(String token) {
+
+        try {
+            // 解析token
+            JwtUserDto jwtUserDto = jwtManager.decodeJwt(token);
+            // 封装成字符以便在redis中查找
+            String tokenToRedisKey = loginRedisService.createJwtTokenKey(jwtUserDto);
+            return loginRedisService.loginGetCache(tokenToRedisKey);
+        } catch (Exception e) {
+            // 处理异常情况
+            throw new EasException("Token获取用户信息失败", e);
+        }}
 
 
     private EasSysUserinfo findAdminByUsername(String username, String password)  {

+ 105 - 0
service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java

@@ -0,0 +1,105 @@
+package com.koobietech.eas.service.impl;
+
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+import com.koobietech.eas.service.EasStuProfileService;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.apache.poi.xwpf.usermodel.XWPFTable;
+import org.apache.poi.xwpf.usermodel.XWPFTableCell;
+import org.apache.poi.xwpf.usermodel.XWPFTableRow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.io.*;
+import java.util.*;
+
+@Service
+public class EasStuProfileServiceImpl implements EasStuProfileService {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(EasStuProfileServiceImpl.class);
+    private static final String TEMPLATE_PATH = "temp/StuRegistTemp.docx";
+    private static final String PHOTO_PATH = "temp/kun1.jpeg";
+    private static final String OUTPUT_PATH = "D:\\myDesk\\test.docx";
+
+    @Override
+    public JsonResult StuProfileDownload(EasArcTlsStudents easArcTlsStudents) {
+        LOGGER.info("开始学员档案导出:{}", easArcTlsStudents);
+
+        try (InputStream wordStream = getClass().getClassLoader().getResourceAsStream(TEMPLATE_PATH)) {
+            assert wordStream != null;
+            XWPFDocument doc = new XWPFDocument(wordStream);
+
+            Map<String, Object> map = new HashMap<>();
+            map.put("student_name", easArcTlsStudents.getStudentName());
+            map.put("gender", easArcTlsStudents.getGender());
+            map.put("major", easArcTlsStudents.getMajor());
+            map.put("grade", easArcTlsStudents.getGrade());
+            map.put("enrollment_date", easArcTlsStudents.getEnrollmentDate());
+            map.put("phone", easArcTlsStudents.getPhone());
+            map.put("university", easArcTlsStudents.getUniversity());
+
+            InputStream photo = getClass().getClassLoader().getResourceAsStream(PHOTO_PATH);
+            map.put("avatar", photo);
+
+            replacePlaceholders(doc, map);
+
+            saveDocument(doc);
+        } catch (IOException e) {
+            LOGGER.error("学员档案导出失败:{}", e.getMessage(), e);
+            return JsonResult.fail("学员档案导出失败!");
+        }
+
+        LOGGER.info("学员档案导出成功!");
+        return JsonResult.ok("学员档案导出成功!");
+    }
+
+    private void replacePlaceholders(XWPFDocument document, Map<String, Object> map) {
+        Iterator<XWPFTable> it = document.getTablesIterator();
+
+        while (it.hasNext()) {
+            XWPFTable table = it.next();
+            int rcount = table.getNumberOfRows();
+            for (int n = 0; n < rcount; n++) {
+                XWPFTableRow wrow = table.getRow(n);
+                List<XWPFTableCell> cells = wrow.getTableCells();
+                for (XWPFTableCell cell : cells) {
+                    String cellText = cell.getText();
+                    if (!cellText.contains("${")) {
+                        continue;
+                    }
+                    map.forEach((key, value) -> {
+                        String placeholder = "${" + key + "}";
+                        if (cellText.contains(placeholder) && Objects.nonNull(value)) {
+                            try {
+                                cell.removeParagraph(0);
+                                if (value instanceof InputStream) {
+                                    //如果是放置图片的单元格,在这里添加一个计算图片合适大小的方法,按比例
+
+
+
+
+                                    // 计算合适的宽度和高度
+                                    cell.addParagraph().createRun().addPicture((InputStream) value, XWPFDocument.PICTURE_TYPE_JPEG, "avatar.jpg", 400000, 400000);
+                                } else {
+                                    cell.setText(cellText.replace(placeholder, value.toString()));
+                                }
+                            } catch (IOException | InvalidFormatException e) {
+                                throw new RuntimeException(e);
+                            }
+                        }
+                    });
+                }
+            }
+        }
+    }
+
+    private void saveDocument(XWPFDocument document) throws IOException {
+        try (FileOutputStream outputStream = new FileOutputStream(OUTPUT_PATH)) {
+            document.write(outputStream);
+        }
+    }
+
+
+}

+ 57 - 0
service/src/main/java/com/koobietech/eas/service/impl/StudentLoginRedisServiceImpl.java

@@ -0,0 +1,57 @@
+package com.koobietech.eas.service.impl;
+
+import com.koobietech.eas.common.exception.EasException;
+import com.koobietech.eas.common.pojo.JwtUserDto;
+import com.koobietech.eas.common.service.RedisService;
+import com.koobietech.eas.dao.adminLoginPojo.UserDetail;
+import com.koobietech.eas.service.StudentLoginRedisService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+@Service
+public class StudentLoginRedisServiceImpl implements StudentLoginRedisService {
+
+    @Resource
+    RedisService redisService;
+
+
+    @Override
+    public UserDetail checkToken(JwtUserDto jwtUserDto) {
+        String jwtKey = createJwtTokenKey(jwtUserDto);
+        //判断redis里面是否有这个key
+        if (!redisService.hasKey(jwtKey)) {
+            throw new EasException("token已过期");
+        }
+        return (UserDetail) redisService.get(jwtKey);
+    }
+
+    @Override
+    public Boolean loginDeleteCache(String newRedisRefreshTokenKey) {
+        return redisService.del(newRedisRefreshTokenKey);
+    }
+
+    public String createJwtTokenKey(JwtUserDto jwtUserDto) {
+        //根据jwtUserDto 生成jwtKey,格式为:eas_token_{id}_{username}_{type}
+        return "eas_token" + "_" + jwtUserDto.getId() + "_" + jwtUserDto.getUsername() + "_" + jwtUserDto.getType();
+    }
+
+    public String createJwtRefreshTokenKey(JwtUserDto jwtUserDto) {
+        //根据jwtUserDto 生成jwtKey,格式为:eas_refresh_{id}_{username}_{type}
+        return "eas_refresh" + "_" + jwtUserDto.getId() + "_" + jwtUserDto.getUsername() + "_" + jwtUserDto.getType();
+    }
+
+    public void loginSavaCache(String redisTokenKey, UserDetail userDetail, Integer token_expires) {
+        redisService.set(redisTokenKey, userDetail, token_expires);
+    }
+
+    public UserDetail loginGetCache(String newRedisTokenKey) {
+        //看看redis里面有没有这个key
+        if (redisService.hasKey(newRedisTokenKey)) {
+            //有的话,就从redis里面取出来
+            return (UserDetail) redisService.get(newRedisTokenKey);
+        }
+        return null;
+    }
+
+}

+ 188 - 0
service/src/main/java/com/koobietech/eas/service/impl/StudentLoginServiceImpl.java

@@ -0,0 +1,188 @@
+package com.koobietech.eas.service.impl;
+
+import com.anji.captcha.model.common.ResponseModel;
+import com.koobietech.eas.common.constant.UserType;
+import com.koobietech.eas.common.exception.EasException;
+import com.koobietech.eas.common.pojo.JwtUserDto;
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.common.utils.JwtManager;
+import com.koobietech.eas.common.utils.PasswordManager;
+import com.koobietech.eas.dao.Pojo.AdminPojo;
+import com.koobietech.eas.dao.adminLoginPojo.UserDetail;
+import com.koobietech.eas.dao.dto.LoginToken;
+import com.koobietech.eas.dao.mapper.AdminLoginMapper;
+import com.koobietech.eas.mbg.mapper.EasSysStudentMapper;
+import com.koobietech.eas.mbg.model.EasSysStudent;
+import com.koobietech.eas.mbg.model.EasSysStudentExample;
+import com.koobietech.eas.service.StudentLoginRedisService;
+import com.koobietech.eas.service.StudentLoginService;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class StudentLoginServiceImpl implements StudentLoginService {
+
+
+    @Resource
+    EasSysStudentMapper easSysStudentMapper;
+
+    @Resource
+    PasswordManager passwordManager;
+
+    @Resource
+    PasswordEncoder passwordEncoder;
+
+    @Resource
+    AdminLoginMapper adminLoginMapper;
+
+    @Resource
+    StudentLoginRedisService studentLoginRedisService;
+
+    @Resource
+    JwtManager jwtManager;
+
+    // token过期时间 单位:s
+    private final Integer token_expires = 60 * 3;
+
+    private final Integer refreshToken_expires = 60 * 7;
+
+    @Override
+    public LoginToken studentLogin(AdminPojo adminPojo) {
+        if (adminPojo.getUsername() == null || adminPojo.getPasswd() == null || adminPojo.getUsername().equals("") || adminPojo.getPasswd().equals("")) {
+            throw new EasException("用户不存在", 412);
+        }
+        EasSysStudent easSysStudent = findStudentByUsername(adminPojo.getUsername(), adminPojo.getPasswd());
+
+        // 接收到对象,根据这个信息去查询数据库,然后自定义sql查用户信息,存在redis里面当做token
+        System.out.println(easSysStudent);
+
+        Long adminId = easSysStudent.getId();
+
+        //先调用自定义sql查询detail类中的数据 最后把这个类封装到redis里面
+        UserDetail userDetail = adminLoginMapper.getStudentDetailById(adminId);
+        System.out.println("接收前" + userDetail);
+        userDetail.setDepartments(adminLoginMapper.getStudentDepartmentsById(adminId));
+        userDetail.setPermissions(adminLoginMapper.getStudentPermissionsById(adminId));
+        System.out.println("接收后" + userDetail);
+
+        // 先调用自定义sql查询学生详细信息、部门信息 和 权限信息
+        UserType student = UserType.MEMBER;
+
+        // 生成token
+        JwtUserDto jwtUserDto = new JwtUserDto(userDetail.getUsername(), userDetail.getId(), student);
+
+        String token = jwtManager.createJwt(jwtUserDto, token_expires);
+
+        String refreshToken = jwtManager.createJwt(jwtUserDto, refreshToken_expires);
+
+        System.out.println("token" + token);
+
+        System.out.println("refreshToken" + refreshToken);
+
+        // 生成redis key
+        String jwtTokenKey = studentLoginRedisService.createJwtTokenKey(jwtUserDto);
+
+        String jwtRefreshTokenKey = studentLoginRedisService.createJwtRefreshTokenKey(jwtUserDto);
+
+        // 将token存入redis
+        studentLoginRedisService.loginSavaCache(jwtTokenKey, userDetail, token_expires);
+
+        studentLoginRedisService.loginSavaCache(jwtRefreshTokenKey, userDetail, refreshToken_expires);
+
+        // 登录成功
+        return new LoginToken(token, refreshToken);
+    }
+
+    @Override
+    public LoginToken refreshToken(String refreshToken) {
+        // 解析refresh token
+        JwtUserDto jwtUserDto = jwtManager.decodeJwt(refreshToken);
+
+        //生成新的 刷新k值 (refresh_token)
+        String newRedisRefreshTokenKey = studentLoginRedisService.createJwtRefreshTokenKey(jwtUserDto);
+
+        //查询redis里面有没有这个k值
+        UserDetail userDetail = studentLoginRedisService.loginGetCache(newRedisRefreshTokenKey);
+
+        if (userDetail == null) {
+            throw new EasException("token已过期", 412);
+        }
+
+        //如果不为空 那UserDetail里面就封装了用户的信息 生成新的token和refresh token
+        String newToken = jwtManager.createJwt(jwtUserDto, token_expires);
+        String newRefreshToken = jwtManager.createJwt(jwtUserDto, refreshToken_expires);
+
+        //生成新的k值 (token)
+        String newRedisTokenKey = studentLoginRedisService.createJwtTokenKey(jwtUserDto);
+
+        // 更新Redis中的token和refresh token
+        studentLoginRedisService.loginSavaCache(newRedisTokenKey, userDetail, token_expires);
+        studentLoginRedisService.loginSavaCache(newRedisRefreshTokenKey, userDetail, refreshToken_expires);
+        return new LoginToken(newToken, newRefreshToken);
+    }
+
+    @Override
+    public JsonResult verifyToJsonResult(ResponseModel response) {
+        JsonResult result = new JsonResult();
+
+        if (response != null) {
+            result.setMsg(response.getRepMsg());
+            result.setCode(Integer.parseInt(response.getRepCode()));
+            result.setStatus(response.isSuccess());
+            result.setData(response.getRepData());
+        } else {
+            throw new EasException("ResponseModel参数为空", 9000);
+        }
+
+        return result;
+    }
+
+    @Override
+    public UserDetail getStudentInfo(String token) {
+
+        try {
+            // 解析token
+            JwtUserDto jwtUserDto = jwtManager.decodeJwt(token);
+            // 封装成字符以便在redis中查找
+            String jwtTokenKey = studentLoginRedisService.createJwtTokenKey(jwtUserDto);
+            UserDetail userDetail = studentLoginRedisService.loginGetCache(jwtTokenKey);
+            return userDetail;
+        } catch (EasException e) {
+            throw new EasException("Token获取学生信息失败", e);
+        }
+
+    }
+
+    private EasSysStudent findStudentByUsername(String username, String password) {
+        EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+        easSysStudentExample.createCriteria().andStudentNameEqualTo(username);
+        List<EasSysStudent> studentList = easSysStudentMapper.selectByExample(easSysStudentExample);
+        // 使用Optional简化判断
+        Optional<EasSysStudent> optionalStudent = studentList.stream().findFirst();
+
+        if (optionalStudent.isEmpty()) {
+            throw new EasException("用户不存在", 9902);
+        }
+        if (studentList.size() > 1) {
+            throw new EasException("用户数据异常", 9902);
+        }
+
+        EasSysStudent easSysStudent = optionalStudent.get();
+        // 验证密码 这个方法里面有解密 如果解密失败会抛出异常
+        validatePassword(password, easSysStudent.getPasswd());
+        return easSysStudent;
+    }
+
+    private void validatePassword(String inputPassword, String encryptedPassword) {
+        String decryptedPassword = passwordManager.decryptPassword(inputPassword);
+        System.out.println("解密密码decryptedPassword: " + decryptedPassword);
+        System.out.println("加密密码easSysUserinfo.getPasswd(): " + encryptedPassword);
+        if (!passwordEncoder.matches(encryptedPassword, decryptedPassword)) {
+            throw new EasException("密码不正确", 9901);
+        }
+    }
+}