Browse Source

最新代码

liu 2 years ago
parent
commit
997b27ea79
40 changed files with 328 additions and 100 deletions
  1. 1 1
      src/main/java/com/studenthotel/api/FaceRecognitionApi.java
  2. 2 0
      src/main/java/com/studenthotel/api/UserApi.java
  3. 2 2
      src/main/java/com/studenthotel/config/MyBatisPlusConfig.java
  4. 37 0
      src/main/java/com/studenthotel/config/MySecurity.java
  5. 10 19
      src/main/java/com/studenthotel/controller/FaceRecognitionController.java
  6. 45 5
      src/main/java/com/studenthotel/controller/UserController.java
  7. 1 0
      src/main/java/com/studenthotel/core/JwtAuthenticationInterceptor.java
  8. 1 0
      src/main/java/com/studenthotel/model/vo/UserVo.java
  9. 2 2
      src/main/java/com/studenthotel/services/impl/ColdWaterServiceImpl.java
  10. 2 2
      src/main/java/com/studenthotel/services/impl/ElectricServiceImpl.java
  11. 7 7
      src/main/java/com/studenthotel/services/impl/FaceRecognitionServiceImpl.java
  12. 6 4
      src/main/java/common/dto/LoginDto.java
  13. 3 3
      src/main/java/common/utils/JWTUtil.java
  14. 1 1
      src/main/java/common/utils/RSAUtils.java
  15. 2 2
      src/main/resources/application-dev.yml
  16. 10 8
      src/test/java/com/video/WrapperTest.java
  17. 0 42
      target/classes/META-INF/spring-configuration-metadata.json
  18. 2 2
      target/classes/application-dev.yml
  19. BIN
      target/classes/com/studenthotel/api/FaceRecognitionApi.class
  20. BIN
      target/classes/com/studenthotel/config/MyBatisPlusConfig.class
  21. BIN
      target/classes/com/studenthotel/config/MySecurity.class
  22. BIN
      target/classes/com/studenthotel/controller/FaceRecognitionController.class
  23. BIN
      target/classes/com/studenthotel/controller/UserController.class
  24. BIN
      target/classes/com/studenthotel/core/JwtAuthenticationInterceptor.class
  25. BIN
      target/classes/com/studenthotel/model/vo/UserVo.class
  26. BIN
      target/classes/com/studenthotel/services/impl/ColdWaterServiceImpl.class
  27. BIN
      target/classes/com/studenthotel/services/impl/ElectricServiceImpl.class
  28. BIN
      target/classes/com/studenthotel/services/impl/FaceRecognitionServiceImpl.class
  29. BIN
      target/classes/common/dto/LoginDto.class
  30. BIN
      target/classes/common/utils/JWTUtil.class
  31. BIN
      target/classes/common/utils/RSAUtils.class
  32. 3 0
      target/maven-archiver/pom.properties
  33. 96 0
      target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  34. 91 0
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  35. 2 0
      target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
  36. 2 0
      target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
  37. BIN
      target/studenthotel_houtai-0.0.1-SNAPSHOT.jar
  38. BIN
      target/studenthotel_houtai-0.0.1-SNAPSHOT.jar.original
  39. BIN
      target/test-classes/com/video/MybatisPlusApplicationTests.class
  40. BIN
      target/test-classes/com/video/WrapperTest.class

+ 1 - 1
src/main/java/com/studenthotel/api/FaceRecognitionApi.java

@@ -14,7 +14,7 @@ public interface FaceRecognitionApi {
 
 
     @ApiOperation(value = "宿舍出入人员信息", notes = "例如:1-2学生公寓进门", httpMethod = "GET")
     @ApiOperation(value = "宿舍出入人员信息", notes = "例如:1-2学生公寓进门", httpMethod = "GET")
     @GetMapping("/list")
     @GetMapping("/list")
-    CommonResult list(String build,Integer page,Integer size);
+    CommonResult list(String build,String date);
 
 
     @ApiOperation(value = "宿舍归寝率", notes = "楼栋的数字是中文的,例如:1栋;2栋", httpMethod = "GET")
     @ApiOperation(value = "宿舍归寝率", notes = "楼栋的数字是中文的,例如:1栋;2栋", httpMethod = "GET")
     @GetMapping("/returning")
     @GetMapping("/returning")

+ 2 - 0
src/main/java/com/studenthotel/api/UserApi.java

@@ -3,6 +3,7 @@ package com.studenthotel.api;
 import com.studenthotel.model.utils.CommonResult;
 import com.studenthotel.model.utils.CommonResult;
 import com.studenthotel.model.vo.UserVo;
 import com.studenthotel.model.vo.UserVo;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -14,4 +15,5 @@ public interface UserApi {
     @ApiOperation(value = "登入", notes = "", httpMethod = "POST")
     @ApiOperation(value = "登入", notes = "", httpMethod = "POST")
     CommonResult login(@RequestBody UserVo user);
     CommonResult login(@RequestBody UserVo user);
 
 
+
 }
 }

+ 2 - 2
src/main/java/com/studenthotel/config/MyBatisPlusConfig.java

@@ -38,7 +38,7 @@ public class MyBatisPlusConfig {
 
 
     /**
     /**
      * SQL执行效率插件
      * SQL执行效率插件
-     */
+     *//*
     @Bean
     @Bean
     @Profile({"dev","test"})// 设置 dev test 环境开启,保证我们的效率
     @Profile({"dev","test"})// 设置 dev test 环境开启,保证我们的效率
     public PerformanceInterceptor performanceInterceptor() {
     public PerformanceInterceptor performanceInterceptor() {
@@ -46,6 +46,6 @@ public class MyBatisPlusConfig {
         performanceInterceptor.setMaxTime(3000); //ms 设置sql执行的最大时间,如果超过了则不执行
         performanceInterceptor.setMaxTime(3000); //ms 设置sql执行的最大时间,如果超过了则不执行
         performanceInterceptor.setFormat(true);
         performanceInterceptor.setFormat(true);
         return performanceInterceptor;
         return performanceInterceptor;
-    }
+    }*/
 
 
 }
 }

+ 37 - 0
src/main/java/com/studenthotel/config/MySecurity.java

@@ -0,0 +1,37 @@
+package com.studenthotel.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+//@ConfigurationProperties(prefix = "my-security")
+public class MySecurity {
+    @Value("${my-security.privateKey}")
+    public String privateKey;
+    @Value("${my-security.publicKey}")
+    public String publicKey;
+
+    public String getPrivateKey() {
+        return privateKey;
+    }
+
+    public String getPublicKey() {
+        return publicKey;
+    }
+
+    @Override
+    public String toString() {
+        return "MySecurity{" +
+                "privateKey='" + privateKey + '\'' +
+                ", publicKey='" + publicKey + '\'' +
+                '}';
+    }
+
+    public void setPrivateKey(String privateKey) {
+        this.privateKey = privateKey;
+    }
+
+    public void setPublicKey(String publicKey) {
+        this.publicKey = publicKey;
+    }
+}

+ 10 - 19
src/main/java/com/studenthotel/controller/FaceRecognitionController.java

@@ -84,7 +84,7 @@ public class FaceRecognitionController implements FaceRecognitionApi {
             personnelAccessDto.setDate(localStart.format(dateTimeFormatter));
             personnelAccessDto.setDate(localStart.format(dateTimeFormatter));
             int i1 = new Random().nextInt(100);
             int i1 = new Random().nextInt(100);
             int i2 = new Random().nextInt(10);
             int i2 = new Random().nextInt(10);
-            personnelAccessDto.setCount(i1*i2);
+            personnelAccessDto.setCount(i1*(i2+1));
 
 
             personnelAccessDtos.add(personnelAccessDto);
             personnelAccessDtos.add(personnelAccessDto);
         }
         }
@@ -95,24 +95,20 @@ public class FaceRecognitionController implements FaceRecognitionApi {
     }
     }
 
 
     @Override
     @Override
-    public CommonResult list(String build, Integer page, Integer size) {
+    public CommonResult list(String build,String date) {
         if (ObjectUtils.isEmpty(build)) {
         if (ObjectUtils.isEmpty(build)) {
             return CommonResult.fail();
             return CommonResult.fail();
         }
         }
-        if (ObjectUtils.isEmpty(page) || page <= 0) {
-            page = 1;
-        }
-        if (ObjectUtils.isEmpty(size) || size <= 0) {
-            size = 5;
-        }
+
 
 
         LambdaQueryWrapper<FaceRecognition> wrapper=new LambdaQueryWrapper<>();
         LambdaQueryWrapper<FaceRecognition> wrapper=new LambdaQueryWrapper<>();
         wrapper.eq(FaceRecognition::getChannelName,build);
         wrapper.eq(FaceRecognition::getChannelName,build);
+        wrapper.ge(FaceRecognition::getPassingTime,date);
         wrapper.orderByDesc(FaceRecognition::getPassingTime);
         wrapper.orderByDesc(FaceRecognition::getPassingTime);
 
 
-        IPage<FaceRecognition> page1 = faceRecognitionService.page(new Page<>(page, size), wrapper);
+        List<FaceRecognition> records = faceRecognitionService.list( wrapper);
+
 
 
-        List<FaceRecognition> records = page1.getRecords();
 
 
 
 
         ArrayList<FaceRecognitionDto> faceRecognitionDtoList = new ArrayList<>();
         ArrayList<FaceRecognitionDto> faceRecognitionDtoList = new ArrayList<>();
@@ -133,24 +129,19 @@ public class FaceRecognitionController implements FaceRecognitionApi {
                 SchoolUser schoolUser = schoolUserService.getById(schoolUserId);
                 SchoolUser schoolUser = schoolUserService.getById(schoolUserId);
                 faceRecognitionDto.setClazz(schoolUser.getClazz());
                 faceRecognitionDto.setClazz(schoolUser.getClazz());
             }
             }
-
+//完善图片路径
             String picturePath = record.getPicturePath();
             String picturePath = record.getPicturePath();
-            picturePath="http://192.168.161.224:12345/"+picturePath;
+            picturePath="http://172.16.20.72/dev-img/"+picturePath;
             faceRecognitionDto.setPictureUrl(picturePath);
             faceRecognitionDto.setPictureUrl(picturePath);
 
 
             faceRecognitionDtoList.add(faceRecognitionDto);
             faceRecognitionDtoList.add(faceRecognitionDto);
 
 
         }
         }
-        IPage<FaceRecognitionDto> pageDto=new Page<>();
-        pageDto.setRecords(faceRecognitionDtoList);
-        pageDto.setTotal(page1.getTotal());
-        pageDto.setPages(page1.getPages());
-        pageDto.setSize(page1.getSize());
-        pageDto.setCurrent(page1.getCurrent());
 
 
 
 
 
 
-        return CommonResult.ok(pageDto);
+
+        return CommonResult.ok(faceRecognitionDtoList);
     }
     }
 
 
     @Override
     @Override

+ 45 - 5
src/main/java/com/studenthotel/controller/UserController.java

@@ -6,13 +6,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.studenthotel.annotation.PassToken;
 import com.studenthotel.annotation.PassToken;
 import com.studenthotel.api.UserApi;
 import com.studenthotel.api.UserApi;
+import com.studenthotel.config.MySecurity;
 import com.studenthotel.model.pojo.User;
 import com.studenthotel.model.pojo.User;
 import com.studenthotel.model.utils.CommonResult;
 import com.studenthotel.model.utils.CommonResult;
 import com.studenthotel.model.vo.UserVo;
 import com.studenthotel.model.vo.UserVo;
 import com.studenthotel.services.UserService;
 import com.studenthotel.services.UserService;
 import common.dto.LoginDto;
 import common.dto.LoginDto;
 import common.utils.JWTUtil;
 import common.utils.JWTUtil;
+import common.utils.RSAUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -31,6 +34,9 @@ public class UserController implements UserApi {
     @Autowired
     @Autowired
     UserService userService;
     UserService userService;
 
 
+    @Autowired
+    MySecurity mySecurity;
+
     @Override
     @Override
     @PassToken
     @PassToken
     public CommonResult login(UserVo userVo) {
     public CommonResult login(UserVo userVo) {
@@ -39,20 +45,54 @@ public class UserController implements UserApi {
         }
         }
 
 
         String user = userVo.getUser();
         String user = userVo.getUser();
-
         LambdaQueryWrapper<User> wrapper=new LambdaQueryWrapper<>();
         LambdaQueryWrapper<User> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(User::getUser,userVo.getUser());
         User one = userService.getOne(wrapper);
         User one = userService.getOne(wrapper);
+        if (ObjectUtils.isEmpty(one)) {
+            return CommonResult.fail("500","账号不存在");
+        }
         String passWord = one.getPassWord();
         String passWord = one.getPassWord();
 
 
-        if (!passWord.equals(userVo.getPassWord())) {
+        //        获取私钥
+        String privateKey = mySecurity.getPrivateKey();
+        String decrypt;
+        try {
+//            将传过来的密码解密
+            decrypt= RSAUtils.decrypt(userVo.getPassWord(), RSAUtils.getPrivateKey(privateKey));
+            passWord= RSAUtils.decrypt(passWord, RSAUtils.getPrivateKey(privateKey));
+        } catch (Exception e) {
+            return CommonResult.fail("500", "解密失败");
+        }
+
+
+        if (!passWord.equals(decrypt)){
             return CommonResult.fail("500","密码错误");
             return CommonResult.fail("500","密码错误");
         }
         }
-        String token = JWTUtil.getToken(one);
+        String build = userVo.getBuild();
+        if ("1".equals(build)) {
+            build="1,2";
+        }else if ("2".equals(build)){
+            build="3,4";
+        }else if ("3".equals(build)){
+            build="5,6";
+        }else if ("4".equals(build)){
+            build="7,8";
+        }else if ("5".equals(build)){
+            build="9,10";
+        }else if ("6".equals(build)){
+            build="11,12";
+        }else if ("7".equals(build)){
+            build="13,14";
+        }else if ("8".equals(build)){
+            build="15,16";
+        }
+
+        String token = JWTUtil.getToken(one,build);
         LoginDto login = new LoginDto();
         LoginDto login = new LoginDto();
         login.setToken(token);
         login.setToken(token);
-        login.setTokenTtl(JWTUtil.getExpired());
+//        login.setTokenTtl(JWTUtil.getExpired());
         login.setUserName(one.getUser());
         login.setUserName(one.getUser());
-
+        login.setBuild(build);
 
 
         return CommonResult.ok(login);
         return CommonResult.ok(login);
     }
     }

+ 1 - 0
src/main/java/com/studenthotel/core/JwtAuthenticationInterceptor.java

@@ -67,6 +67,7 @@ public class JwtAuthenticationInterceptor implements HandlerInterceptor {
         res.put("code", 401);
         res.put("code", 401);
         res.put("message", "没有权限");
         res.put("message", "没有权限");
         res.put("result", "error");
         res.put("result", "error");
+        res.put("success","false");
         PrintWriter out = null;
         PrintWriter out = null;
         out = response.getWriter();
         out = response.getWriter();
         out.write(res.toString());
         out.write(res.toString());

+ 1 - 0
src/main/java/com/studenthotel/model/vo/UserVo.java

@@ -6,4 +6,5 @@ import lombok.Data;
 public class UserVo {
 public class UserVo {
     private String user;
     private String user;
     private String passWord;
     private String passWord;
+    private String build;
 }
 }

+ 2 - 2
src/main/java/com/studenthotel/services/impl/ColdWaterServiceImpl.java

@@ -46,8 +46,8 @@ public class ColdWaterServiceImpl extends ServiceImpl<ColdWaterMapper, ColdWater
     private Integer page = 1;
     private Integer page = 1;
     private Integer size = 8;
     private Integer size = 8;
 
 
-    //    每月1号每20分钟运行一次
-    @Scheduled(cron = "0/20 * * 1 * ? ")
+    //    每月1号每2分钟运行一次
+    @Scheduled(cron = "0/4 * * 1 * ? ")
 //    @Scheduled(cron = "0 0/1 * * * ? ")
 //    @Scheduled(cron = "0 0/1 * * * ? ")
     public void autoQueryOrder() {
     public void autoQueryOrder() {
         Page<Dorm> dPage = new Page<>(page, size);
         Page<Dorm> dPage = new Page<>(page, size);

+ 2 - 2
src/main/java/com/studenthotel/services/impl/ElectricServiceImpl.java

@@ -66,8 +66,8 @@ public class ElectricServiceImpl extends ServiceImpl<ElectricMapper, Electric> i
     }
     }
 
 
 
 
-//        每月1号每20分钟运行一次
-    @Scheduled(cron = "0/20 * * 1 * ?")
+//        每月1号每2分钟运行一次
+    @Scheduled(cron = "0/4 * * 1 * ?")
 //    @Scheduled(cron = "0 0/1 * * * ? ")
 //    @Scheduled(cron = "0 0/1 * * * ? ")
     public void autoQueryOrder() {
     public void autoQueryOrder() {
         Page<Dorm> dPage = new Page<>(page, size);
         Page<Dorm> dPage = new Page<>(page, size);

+ 7 - 7
src/main/java/com/studenthotel/services/impl/FaceRecognitionServiceImpl.java

@@ -49,15 +49,15 @@ public class FaceRecognitionServiceImpl extends ServiceImpl<FaceRecognitionMappe
 
 
     String id = "";
     String id = "";
 
 
-    @Scheduled(cron = "0 0 0/1 * * ? ")
-//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    @Scheduled(cron = "0 0 0/1 * * ? ")
+    @Scheduled(cron = "0 0/30 * * * ? ")
     public void getSubscription() {
     public void getSubscription() {
         log.info("开始事件订阅");
         log.info("开始事件订阅");
         SubscribePersonCondition subscribePersonCondition = new SubscribePersonCondition();
         SubscribePersonCondition subscribePersonCondition = new SubscribePersonCondition();
         subscribePersonCondition.setLibIDNum(0);
         subscribePersonCondition.setLibIDNum(0);
         JSONObject map = new JSONObject();
         JSONObject map = new JSONObject();
         map.put("AddressType", 0);
         map.put("AddressType", 0);
-        map.put("IPAddress", "192.168.161.224");
+        map.put("IPAddress", "172.16.20.72");
         map.put("Port", 5555);
         map.put("Port", 5555);
         map.put("Duration", 3600);
         map.put("Duration", 3600);
         map.put("SubscribePersonCondition", subscribePersonCondition);
         map.put("SubscribePersonCondition", subscribePersonCondition);
@@ -142,10 +142,10 @@ public class FaceRecognitionServiceImpl extends ServiceImpl<FaceRecognitionMappe
                                 String dataBase = "data:image/jpeg;base64," + bigImage.getString("Data");
                                 String dataBase = "data:image/jpeg;base64," + bigImage.getString("Data");
 
 
                                 String fileNameWithPath = FileUtil.getFileNameWithPath() + ".jpg";
                                 String fileNameWithPath = FileUtil.getFileNameWithPath() + ".jpg";
-//                                FileUtil.makeDirs(fileNameWithPath, "/home/nginx/html/image");
-//                                String imgFilePath = "/home/nginx/html/image/" + fileNameWithPath;
-                                FileUtil.makeDirs(fileNameWithPath, "E:\\image3");
-                                String imgFilePath = "E:\\image3\\" + fileNameWithPath;
+                                FileUtil.makeDirs(fileNameWithPath, "/home/nginx/html/image");
+                                String imgFilePath = "/home/nginx/html/image/" + fileNameWithPath;
+//                                FileUtil.makeDirs(fileNameWithPath, "E:\\image3");
+//                                String imgFilePath = "E:\\image3\\" + fileNameWithPath;
                                 try {
                                 try {
                                     Base64Utils.GenerateImage(dataBase, imgFilePath);
                                     Base64Utils.GenerateImage(dataBase, imgFilePath);
                                 } catch (IOException e) {
                                 } catch (IOException e) {

+ 6 - 4
src/main/java/common/dto/LoginDto.java

@@ -20,9 +20,11 @@ public class LoginDto {
      * 用户token
      * 用户token
      */
      */
     private String token;
     private String token;
-    /**
-     * token过期时间
-     */
-    private long tokenTtl;
+
+    private String build;
+//    /**
+//     * token过期时间
+//     */
+//    private long tokenTtl;
 
 
 }
 }

+ 3 - 3
src/main/java/common/utils/JWTUtil.java

@@ -33,7 +33,7 @@ public class JWTUtil {
      * 生成token 有过期时间
      * 生成token 有过期时间
      * @return 返回token
      * @return 返回token
      */
      */
-    public static String getToken(User user){
+    public static String getToken(User user,String build){
 
 
         // 签发时间
         // 签发时间
         Date iatDate = new Date();
         Date iatDate = new Date();
@@ -48,9 +48,9 @@ public class JWTUtil {
         map.put("typ", "JWT");
         map.put("typ", "JWT");
         String token = JWT.create()
         String token = JWT.create()
                 .withHeader(map) // header
                 .withHeader(map) // header
-                .withClaim("user", user.getUser()) // payload
+                .withClaim("user", user.getUser()+build) // payload
                 .withClaim("passWord", user.getPassWord())
                 .withClaim("passWord", user.getPassWord())
-                .withExpiresAt(new Date(CommonUtil.getCurrentTimestamp() + EXPIRED)) // 设置过期时间。过期时间要大于签发时间
+//                .withExpiresAt(new Date(CommonUtil.getCurrentTimestamp() + EXPIRED)) // 设置过期时间。过期时间要大于签发时间
                 .withIssuedAt(iatDate) // 设置签发时间
                 .withIssuedAt(iatDate) // 设置签发时间
                 .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
                 .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
 
 

+ 1 - 1
src/main/java/common/utils/RSAUtils.java

@@ -170,7 +170,7 @@ public class RSAUtils {
             // RSA加密
             // RSA加密
 //            String data = "admin.123456";
 //            String data = "admin.123456";
 //            String data = "15079248859";
 //            String data = "15079248859";
-            String data = "143891";
+            String data = "123456";
 //            String data = "{\"telPhone\":\"15079248859\",\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwaG9uZSI6IjE1MDc5MjQ4ODU5Iiwicm9sZUlkIjoxLCJleHAiOjE2ODI1ODM1NzUsImlhdCI6MTY4MjMyNDM3NX0.AhwOa7220k00hIlkhkHMHnRX-tRXTgntyU7Cdv2YvSs\",\"tokenTtl\":1682583575276,\"userName\":\"朱秀平\"}";
 //            String data = "{\"telPhone\":\"15079248859\",\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwaG9uZSI6IjE1MDc5MjQ4ODU5Iiwicm9sZUlkIjoxLCJleHAiOjE2ODI1ODM1NzUsImlhdCI6MTY4MjMyNDM3NX0.AhwOa7220k00hIlkhkHMHnRX-tRXTgntyU7Cdv2YvSs\",\"tokenTtl\":1682583575276,\"userName\":\"朱秀平\"}";
             String encryptData = encrypt(data, getPublicKey(publicKey));
             String encryptData = encrypt(data, getPublicKey(publicKey));
             System.out.println("encryptData = " + encryptData);
             System.out.println("encryptData = " + encryptData);

+ 2 - 2
src/main/resources/application-dev.yml

@@ -9,11 +9,11 @@ spring:
   #\u6570\u636E\u5E93\u914D\u7F6E\u94FE\u63A5
   #\u6570\u636E\u5E93\u914D\u7F6E\u94FE\u63A5
   datasource:
   datasource:
     username: root
     username: root
-    password: root
+    password: HuaWei@2022
     #password: chuanghai_2023.
     #password: chuanghai_2023.
     url: jdbc:mysql://localhost:3306/studenthotel_houtai?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     url: jdbc:mysql://localhost:3306/studenthotel_houtai?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
    # url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
    # url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-    driver-class-name: com.mysql.cj.jdbc.Driver
+    driver-class-name: com.mysql.jdbc.Driver
     cache:
     cache:
       type: redis
       type: redis
       redis:
       redis:

+ 10 - 8
src/test/java/com/video/WrapperTest.java

@@ -1,6 +1,8 @@
 package com.video;
 package com.video;
 
 
+import com.studenthotel.config.MySecurity;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
 
 
@@ -12,14 +14,14 @@ public class WrapperTest {
      String publicKey;
      String publicKey;
 
 
 //    @Autowired
 //    @Autowired
-    MySecurity mySecurity;
-
-    @Test
-    void contextLoads() {
-        System.out.println(mySecurity.toString());
-        System.out.println("privateKey = " + privateKey);
-        System.out.println("publicKey = " + publicKey);
-    }
+//    MySecurity mySecurity;
+//
+//    @Test
+//    void contextLoads() {
+//        System.out.println(mySecurity.toString());
+//        System.out.println("privateKey = " + privateKey);
+//        System.out.println("publicKey = " + publicKey);
+//    }
 
 
 
 
 //    @Autowired
 //    @Autowired

+ 0 - 42
target/classes/META-INF/spring-configuration-metadata.json

@@ -1,42 +0,0 @@
-{
-  "groups": [
-    {
-      "name": "tencentcloud",
-      "type": "com.studenthotel.config.smsConfig",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    }
-  ],
-  "properties": [
-    {
-      "name": "tencentcloud.sdk-appid",
-      "type": "java.lang.String",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    },
-    {
-      "name": "tencentcloud.secret-i-d",
-      "type": "java.lang.String",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    },
-    {
-      "name": "tencentcloud.secret-key",
-      "type": "java.lang.String",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    },
-    {
-      "name": "tencentcloud.sign-name",
-      "type": "java.lang.String",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    },
-    {
-      "name": "tencentcloud.sms-min",
-      "type": "java.lang.String",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    },
-    {
-      "name": "tencentcloud.template-id",
-      "type": "java.lang.String",
-      "sourceType": "com.studenthotel.config.smsConfig"
-    }
-  ],
-  "hints": []
-}

+ 2 - 2
target/classes/application-dev.yml

@@ -9,11 +9,11 @@ spring:
   #\u6570\u636E\u5E93\u914D\u7F6E\u94FE\u63A5
   #\u6570\u636E\u5E93\u914D\u7F6E\u94FE\u63A5
   datasource:
   datasource:
     username: root
     username: root
-    password: root
+    password: HuaWei@2022
     #password: chuanghai_2023.
     #password: chuanghai_2023.
     url: jdbc:mysql://localhost:3306/studenthotel_houtai?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     url: jdbc:mysql://localhost:3306/studenthotel_houtai?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
    # url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
    # url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-    driver-class-name: com.mysql.cj.jdbc.Driver
+    driver-class-name: com.mysql.jdbc.Driver
     cache:
     cache:
       type: redis
       type: redis
       redis:
       redis:

BIN
target/classes/com/studenthotel/api/FaceRecognitionApi.class


BIN
target/classes/com/studenthotel/config/MyBatisPlusConfig.class


BIN
target/classes/com/studenthotel/config/MySecurity.class


BIN
target/classes/com/studenthotel/controller/FaceRecognitionController.class


BIN
target/classes/com/studenthotel/controller/UserController.class


BIN
target/classes/com/studenthotel/core/JwtAuthenticationInterceptor.class


BIN
target/classes/com/studenthotel/model/vo/UserVo.class


BIN
target/classes/com/studenthotel/services/impl/ColdWaterServiceImpl.class


BIN
target/classes/com/studenthotel/services/impl/ElectricServiceImpl.class


BIN
target/classes/com/studenthotel/services/impl/FaceRecognitionServiceImpl.class


BIN
target/classes/common/dto/LoginDto.class


BIN
target/classes/common/utils/JWTUtil.class


BIN
target/classes/common/utils/RSAUtils.class


+ 3 - 0
target/maven-archiver/pom.properties

@@ -0,0 +1,3 @@
+artifactId=studenthotel_houtai
+groupId=com.chuanghai
+version=0.0.1-SNAPSHOT

+ 96 - 0
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,96 @@
+common\result\ResponseStatusEnum.class
+com\studenthotel\services\impl\DormServiceImpl.class
+com\studenthotel\api\FaceRecognitionApi.class
+com\studenthotel\controller\DormController.class
+com\studenthotel\controller\ContrastFailureController.class
+com\studenthotel\services\impl\UserServiceImpl.class
+common\dto\TotalEnergyDto.class
+com\studenthotel\api\ContrastFailureApi.class
+com\studenthotel\yushi\SubscriptionConfig$1.class
+common\result\Code.class
+com\studenthotel\services\impl\DormServiceImpl$2.class
+com\studenthotel\mapper\ContrastFailureMapper.class
+com\studenthotel\annotation\UserLoginCheck.class
+common\utils\smsUtil.class
+common\dto\FaceRecognitionDto.class
+com\studenthotel\core\CORSConfiguration.class
+com\studenthotel\config\MyBatisPlusConfig.class
+com\studenthotel\yushi\utils\SubscribePersonCondition.class
+com\studenthotel\controller\CircumferenceController.class
+com\studenthotel\yushi\utils\SubscriptionVo.class
+com\studenthotel\model\pojo\User.class
+com\studenthotel\StudenthotelHoutai.class
+com\studenthotel\annotation\ControllerIsShow.class
+com\studenthotel\services\impl\DormServiceImpl$3.class
+common\exception\EmsException.class
+com\studenthotel\model\pojo\SchoolUser.class
+common\utils\JWTUtil.class
+com\studenthotel\services\impl\ElectricServiceImpl.class
+com\studenthotel\config\MySecurity.class
+common\exception\EmsExceptionHandler.class
+com\studenthotel\model\pojo\Dorm.class
+com\studenthotel\services\ContrastFailureService.class
+com\studenthotel\services\DormService.class
+com\studenthotel\controller\FaceRecognitionController.class
+com\studenthotel\core\JwtlnterceptorConfig.class
+com\studenthotel\mapper\ColdWaterMapper.class
+common\dto\ClassesCountedDto.class
+com\studenthotel\api\ColdWaterApi.class
+com\studenthotel\yushi\utils\LibID.class
+com\studenthotel\handler\MyMetaObjectHandler.class
+com\studenthotel\services\SchoolUserService.class
+common\dto\DormitoryBuildingCountedDto.class
+common\utils\FileUtil.class
+com\studenthotel\controller\SchoolUserController.class
+com\studenthotel\services\UserService.class
+common\utils\HMAC.class
+com\studenthotel\services\impl\DormServiceImpl$1.class
+com\studenthotel\services\impl\SchoolUserServiceImpl.class
+com\studenthotel\model\pojo\BuildTotalPeople.class
+com\studenthotel\controller\ElectricController.class
+com\studenthotel\services\impl\ContrastFailureServiceImpl.class
+com\studenthotel\services\ElectricService.class
+com\studenthotel\yushi\BaseClass.class
+com\studenthotel\handle\NonStaticResourceHttpRequestHandler.class
+com\studenthotel\mapper\DormMapper.class
+com\studenthotel\controller\ColdWaterController.class
+com\studenthotel\model\vo\UserVo.class
+com\studenthotel\services\impl\FaceRecognitionServiceImpl.class
+com\studenthotel\services\impl\ColdWaterServiceImpl.class
+com\studenthotel\controller\UserController.class
+common\dto\BuildTotalPeopleDto.class
+com\studenthotel\core\CORSConfiguration$1.class
+com\studenthotel\mapper\ElectricMapper.class
+com\studenthotel\aop\LoginCheckAspect.class
+com\studenthotel\api\BuildTotalPeopleApi.class
+com\studenthotel\AutoCode.class
+com\studenthotel\core\SwaggerConfiguration.class
+common\utils\EncryptionUtil.class
+com\studenthotel\config\RestTemplastConfig.class
+common\dto\LoginDto.class
+com\studenthotel\model\pojo\Electric.class
+com\studenthotel\model\pojo\ColdWater.class
+com\studenthotel\mapper\UserMapper.class
+com\studenthotel\services\impl\BuildTotalPeopleServiceImpl.class
+com\studenthotel\controller\BuildTotalPeopleController.class
+com\studenthotel\model\utils\CommonResult.class
+com\studenthotel\services\FaceRecognitionService.class
+com\studenthotel\mapper\SchoolUserMapper.class
+com\studenthotel\core\JwtAuthenticationInterceptor.class
+com\studenthotel\api\UserApi.class
+com\studenthotel\mapper\FaceRecognitionMapper.class
+common\exception\MyCustomException.class
+common\utils\RSAUtils.class
+common\dto\PersonnelAccessDto.class
+common\utils\AesUtils.class
+common\utils\Base64Utils.class
+com\studenthotel\services\BuildTotalPeopleService.class
+common\utils\ValidateCode.class
+com\studenthotel\annotation\PassToken.class
+com\studenthotel\mapper\BuildTotalPeopleMapper.class
+com\studenthotel\model\utils\BaseResult.class
+com\studenthotel\services\ColdWaterService.class
+common\utils\CommonUtil.class
+com\studenthotel\model\pojo\FaceRecognition.class
+com\studenthotel\yushi\SubscriptionConfig.class
+com\studenthotel\model\pojo\ContrastFailure.class

+ 91 - 0
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1,91 @@
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\ElectricMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\FaceRecognitionController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\UserServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\BuildTotalPeople.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\DormService.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\yushi\utils\SubscriptionVo.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\utils\CommonResult.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\StudenthotelHoutai.java
+E:\company\studenthotel_houtai\src\main\java\common\exception\EmsExceptionHandler.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\ElectricServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\ContrastFailureServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\annotation\PassToken.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\annotation\ControllerIsShow.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\BuildTotalPeopleServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\Base64Utils.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\JWTUtil.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\UserMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\annotation\UserLoginCheck.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\core\SwaggerConfiguration.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\yushi\utils\LibID.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\CommonUtil.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\EncryptionUtil.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\ContrastFailureMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\ContrastFailureService.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\FaceRecognition.java
+E:\company\studenthotel_houtai\src\main\java\common\exception\EmsException.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\api\ContrastFailureApi.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\ColdWater.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\config\MySecurity.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\api\UserApi.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\config\MyBatisPlusConfig.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\config\RestTemplastConfig.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\FaceRecognitionMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\SchoolUser.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\aop\LoginCheckAspect.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\ClassesCountedDto.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\DormitoryBuildingCountedDto.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\ElectricController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\vo\UserVo.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\BuildTotalPeopleController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\DormController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\api\FaceRecognitionApi.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\ElectricService.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\UserController.java
+E:\company\studenthotel_houtai\src\main\java\common\result\Code.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\SchoolUserServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\ContrastFailureController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\Dorm.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\BuildTotalPeopleDto.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\TotalEnergyDto.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\yushi\BaseClass.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\BuildTotalPeopleMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\ContrastFailure.java
+E:\company\studenthotel_houtai\src\main\java\common\result\ResponseStatusEnum.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\AesUtils.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\core\CORSConfiguration.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\CircumferenceController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\api\ColdWaterApi.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\DormMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\core\JwtAuthenticationInterceptor.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\BuildTotalPeopleService.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\RSAUtils.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\SchoolUserMapper.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\User.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\utils\BaseResult.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\FaceRecognitionServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\handle\NonStaticResourceHttpRequestHandler.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\ColdWaterService.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\ColdWaterController.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\FileUtil.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\controller\SchoolUserController.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\yushi\SubscriptionConfig.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\mapper\ColdWaterMapper.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\FaceRecognitionDto.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\LoginDto.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\core\JwtlnterceptorConfig.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\UserService.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\yushi\utils\SubscribePersonCondition.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\model\pojo\Electric.java
+E:\company\studenthotel_houtai\src\main\java\common\exception\MyCustomException.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\api\BuildTotalPeopleApi.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\FaceRecognitionService.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\ColdWaterServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\smsUtil.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\HMAC.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\impl\DormServiceImpl.java
+E:\company\studenthotel_houtai\src\main\java\common\dto\PersonnelAccessDto.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\handler\MyMetaObjectHandler.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\AutoCode.java
+E:\company\studenthotel_houtai\src\main\java\com\studenthotel\services\SchoolUserService.java
+E:\company\studenthotel_houtai\src\main\java\common\utils\ValidateCode.java

+ 2 - 0
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst

@@ -0,0 +1,2 @@
+com\video\MybatisPlusApplicationTests.class
+com\video\WrapperTest.class

+ 2 - 0
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

@@ -0,0 +1,2 @@
+E:\company\studenthotel_houtai\src\test\java\com\video\MybatisPlusApplicationTests.java
+E:\company\studenthotel_houtai\src\test\java\com\video\WrapperTest.java

BIN
target/studenthotel_houtai-0.0.1-SNAPSHOT.jar


BIN
target/studenthotel_houtai-0.0.1-SNAPSHOT.jar.original


BIN
target/test-classes/com/video/MybatisPlusApplicationTests.class


BIN
target/test-classes/com/video/WrapperTest.class