拆分项目模块

dev-active
lensfrex 2 years ago
parent e53862b226
commit 17f90ce524
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 77
      dscape-cache/pom.xml
  2. 10
      dscape-cache/src/main/java/net/lensfrex/dscape/cache/UserBasicCache.java
  3. 8
      dscape-cache/src/main/java/net/lensfrex/dscape/configure/GlobalConstant.java
  4. 8
      dscape-cache/src/main/java/net/lensfrex/dscape/configure/RedisConfigure.java
  5. 28
      dscape-compute/pom.xml
  6. 67
      dscape-dao/pom.xml
  7. 14
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/configure/MybatisPlusConfigure.java
  8. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/BlackListMapper.java
  9. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/ComputeHistoryMapper.java
  10. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/PatientDataMapper.java
  11. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/RegisterAppliesMapper.java
  12. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/RolePermissionMapper.java
  13. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/UserBasicMapper.java
  14. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/mapper/UserRoleMapper.java
  15. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/BlackListService.java
  16. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/ComputeHistoryService.java
  17. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/PatientDataService.java
  18. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/RegisterAppliesService.java
  19. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/RolePermissionService.java
  20. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/UserBasicService.java
  21. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/UserRoleService.java
  22. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/BlackListServiceImpl.java
  23. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/ComputeHistoryServiceImpl.java
  24. 10
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/PatientDataServiceImpl.java
  25. 10
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/RegisterAppliesServiceImpl.java
  26. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/RolePermissionServiceImpl.java
  27. 10
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/UserBasicServiceImpl.java
  28. 8
      dscape-dao/src/main/java/net/lensfrex/dscape/dao/service/impl/UserRoleServiceImpl.java
  29. 45
      dscape-entities/pom.xml
  30. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/BlackList.java
  31. 25
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/ComputeHistory.java
  32. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/PatientData.java
  33. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/RegisterApplies.java
  34. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/RolePermission.java
  35. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/UserBasic.java
  36. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dao/entity/UserRole.java
  37. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/request/UserLoginRequestBody.java
  38. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/request/user/PasswordModifyRequestBody.java
  39. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/request/user/RegisterRequestBody.java
  40. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/request/user/UserAddRequest.java
  41. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeHistoryResponseData.java
  42. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/response/data/user/RegisterResponseBody.java
  43. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/response/general/Response.java
  44. 8
      dscape-entities/src/main/java/net/lensfrex/dscape/dto/response/general/ResponseCode.java
  45. 22
      dscape-entities/src/main/java/net/lensfrex/dscape/enums/blacklist/BlackListTypeEnum.java
  46. 16
      dscape-entities/src/main/java/net/lensfrex/dscape/enums/user/UserRoleEnum.java
  47. 16
      dscape-entities/src/main/java/net/lensfrex/dscape/enums/user/UserStatusEnum.java
  48. 16
      dscape-entities/src/main/java/net/lensfrex/dscape/exception/GlobalException.java
  49. 55
      dscape-utils/pom.xml
  50. 14
      dscape-utils/src/main/java/net/lensfrex/dscape/utils/ObjectJsonSerializer.java
  51. 13
      dscape-utils/src/main/java/net/lensfrex/dscape/utils/ObjectSerializer.java
  52. 8
      dscape-utils/src/main/java/net/lensfrex/dscape/utils/validate/TextCheckUtil.java
  53. 24
      dscape-web/message-queue/pom.xml
  54. 21
      dscape-web/message-queue/src/main/java/net/lensfrex/dscape/mq/MessageQueueProducer.java
  55. 133
      dscape-web/pom.xml
  56. 4
      dscape-web/src/main/java/net/lensfrex/dscape/ServerMain.java
  57. 0
      dscape-web/src/main/java/net/lensfrex/dscape/annotation/NotInvalidChar.java
  58. 16
      dscape-web/src/main/java/net/lensfrex/dscape/auth/StpInterfaceImpl.java
  59. 34
      dscape-web/src/main/java/net/lensfrex/dscape/configure/RabbitMqConfigure.java
  60. 16
      dscape-web/src/main/java/net/lensfrex/dscape/exception/handler/GlobalExceptionHandler.java
  61. 13
      dscape-web/src/main/java/net/lensfrex/dscape/utils/NetworkUtil.java
  62. 12
      dscape-web/src/main/java/net/lensfrex/dscape/web/controllers/compute/ComputeController.java
  63. 12
      dscape-web/src/main/java/net/lensfrex/dscape/web/controllers/history/HistoryController.java
  64. 20
      dscape-web/src/main/java/net/lensfrex/dscape/web/controllers/user/UserController.java
  65. 18
      dscape-web/src/main/java/net/lensfrex/dscape/web/controllers/user/admin/AdminController.java
  66. 16
      dscape-web/src/main/java/net/lensfrex/dscape/web/service/data/HistoryService.java
  67. 26
      dscape-web/src/main/java/net/lensfrex/dscape/web/service/user/AdminService.java
  68. 34
      dscape-web/src/main/java/net/lensfrex/dscape/web/service/user/UserService.java
  69. 28
      dscape-web/src/main/java/net/lensfrex/dscape/web/service/user/admin/InviteCode.java
  70. 14
      dscape-web/src/main/resources/application.yml
  71. 0
      dscape-web/src/main/resources/database.sql
  72. 134
      pom.xml

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Class created by lensfrex.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-server</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dscape-cache</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-entities</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-utils</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -2,12 +2,20 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.cache; package net.lensfrex.dscape.cache;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.configure.GlobalConstant; import net.lensfrex.dscape.configure.GlobalConstant;
import net.lensfrex.dscape.dao.entity.UserBasic; import net.lensfrex.dscape.dao.entity.UserBasic;
import net.lensfrex.dscape.utils.ObjectJsonSerializer; import net.lensfrex.dscape.utils.ObjectJsonSerializer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.configure; package net.lensfrex.dscape.configure;
public class GlobalConstant { public class GlobalConstant {

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.configure; package net.lensfrex.dscape.configure;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurerSupport;

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-server</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dscape-compute</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-dao</artifactId>
<version>0.0.1-dev</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Class created by lensfrex.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-server</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dscape-dao</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-entities</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.0.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.11</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.11</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -1,4 +1,16 @@
package net.lensfrex.dscape.configure; /*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.configure;
import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mapper; package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.core.toolkit.support.SFunction;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service; package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

@ -2,13 +2,21 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.lensfrex.dscape.dao.entity.PatientData; import net.lensfrex.dscape.dao.entity.PatientData;
import net.lensfrex.dscape.dao.mapper.PatientDataMapper;
import net.lensfrex.dscape.dao.service.PatientDataService; import net.lensfrex.dscape.dao.service.PatientDataService;
import net.lensfrex.dscape.dao.mapper.PatientDataMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;

@ -2,12 +2,20 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.lensfrex.dscape.dao.entity.RegisterApplies;
import net.lensfrex.dscape.dao.mapper.RegisterAppliesMapper; import net.lensfrex.dscape.dao.mapper.RegisterAppliesMapper;
import net.lensfrex.dscape.dao.service.RegisterAppliesService; import net.lensfrex.dscape.dao.service.RegisterAppliesService;
import net.lensfrex.dscape.dao.entity.RegisterApplies;
public class RegisterAppliesServiceImpl extends ServiceImpl<RegisterAppliesMapper, RegisterApplies> implements RegisterAppliesService { public class RegisterAppliesServiceImpl extends ServiceImpl<RegisterAppliesMapper, RegisterApplies> implements RegisterAppliesService {

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -9,8 +17,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.lensfrex.dscape.dao.entity.UserBasic; import net.lensfrex.dscape.dao.entity.UserBasic;
import net.lensfrex.dscape.dao.mapper.UserBasicMapper;
import net.lensfrex.dscape.dao.service.UserBasicService; import net.lensfrex.dscape.dao.service.UserBasicService;
import net.lensfrex.dscape.dao.mapper.UserBasicMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl; package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Class created by lensfrex.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-server</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dscape-entities</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-annotation</artifactId>
<version>3.5.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.entity; package net.lensfrex.dscape.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;

@ -5,21 +5,22 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* @author lensfrex * @author lensfrex
* @description compute_history * @description compute_history
* @date 2022-08-17 * @date 2022-08-23
*/ */
@Data @Data
public class ComputeHistory implements Serializable { public class ComputeHistory implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
/** /**
* id * id
*/ */
@TableId(type = IdType.AUTO)
private Integer id; private Integer id;
/** /**
@ -32,6 +33,26 @@ public class ComputeHistory implements Serializable {
*/ */
private Long rid; private Long rid;
/**
* 状态0完成1计算中
*/
private int status;
/**
* create_time
*/
private LocalDateTime createTime;
/**
* edit_time
*/
private LocalDateTime editTime;
/**
* is_deleted
*/
private int isDeleted;
public ComputeHistory() { public ComputeHistory() {
} }
} }

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.entity; package net.lensfrex.dscape.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.entity; package net.lensfrex.dscape.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.entity; package net.lensfrex.dscape.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.entity; package net.lensfrex.dscape.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.entity; package net.lensfrex.dscape.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.request; package net.lensfrex.dscape.dto.request;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.request.user; package net.lensfrex.dscape.dto.request.user;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.request.user; package net.lensfrex.dscape.dto.request.user;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

@ -1,3 +1,11 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.request.user; package net.lensfrex.dscape.dto.request.user;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.compute; package net.lensfrex.dscape.dto.response.data.compute;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.user; package net.lensfrex.dscape.dto.response.data.user;
import lombok.Data; import lombok.Data;

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.general; package net.lensfrex.dscape.dto.response.general;
//@JsonInclude(JsonInclude.Include.NON_NULL) //@JsonInclude(JsonInclude.Include.NON_NULL)

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.general; package net.lensfrex.dscape.dto.response.general;
public enum ResponseCode { public enum ResponseCode {

@ -1,4 +1,24 @@
package net.lensfrex.dscape.enums.user; /*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.enums.blacklist;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter; import lombok.Getter;

@ -1,3 +1,19 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.enums.user; package net.lensfrex.dscape.enums.user;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;

@ -1,3 +1,19 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.enums.user; package net.lensfrex.dscape.enums.user;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;

@ -1,3 +1,19 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.exception; package net.lensfrex.dscape.exception;
import net.lensfrex.dscape.dto.response.general.ResponseCode; import net.lensfrex.dscape.dto.response.general.ResponseCode;

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Class created by lensfrex.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-server</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dscape-utils</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -2,13 +2,19 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.utils; package net.lensfrex.dscape.utils;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.stereotype.Component;
@Component
public class ObjectJsonSerializer { public class ObjectJsonSerializer {
/** /**
* 序列化对象到json字符串 * 序列化对象到json字符串
@ -16,7 +22,7 @@ public class ObjectJsonSerializer {
* @param obj 待序列化的对象 * @param obj 待序列化的对象
* @return 序列化后的数据 * @return 序列化后的数据
*/ */
public String serialize(Object obj) { public static String serialize(Object obj) {
try { try {
return new ObjectMapper().registerModule(new JavaTimeModule()).writeValueAsString(obj); return new ObjectMapper().registerModule(new JavaTimeModule()).writeValueAsString(obj);
} catch (Exception e) { } catch (Exception e) {
@ -30,7 +36,7 @@ public class ObjectJsonSerializer {
* @param data 源数据 * @param data 源数据
* @return 反序列化后的对象 * @return 反序列化后的对象
*/ */
public <T> T deserialize(String data, Class<T> valueType) { public static <T> T deserialize(String data, Class<T> valueType) {
try { try {
return new ObjectMapper().registerModule(new JavaTimeModule()).readValue(data, valueType); return new ObjectMapper().registerModule(new JavaTimeModule()).readValue(data, valueType);
} catch (Exception e) { } catch (Exception e) {

@ -2,6 +2,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.utils; package net.lensfrex.dscape.utils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -13,7 +21,6 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream; import java.io.ObjectOutputStream;
@Slf4j @Slf4j
@Component
public class ObjectSerializer { public class ObjectSerializer {
/** /**
* 序列化对象到二进制 * 序列化对象到二进制
@ -21,7 +28,7 @@ public class ObjectSerializer {
* @param obj 待序列化的对象 * @param obj 待序列化的对象
* @return 序列化后的数据 * @return 序列化后的数据
*/ */
public byte[] serialize(Object obj) { public static byte[] serialize(Object obj) {
try { try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
new ObjectOutputStream(byteArrayOutputStream).writeObject(obj); new ObjectOutputStream(byteArrayOutputStream).writeObject(obj);
@ -38,7 +45,7 @@ public class ObjectSerializer {
* @param data 源数据 * @param data 源数据
* @return 反序列化后的对象 * @return 反序列化后的对象
*/ */
public Object deserialize(byte[] data) { public static Object deserialize(byte[] data) {
try { try {
return new ObjectInputStream(new ByteArrayInputStream(data)).readObject(); return new ObjectInputStream(new ByteArrayInputStream(data)).readObject();
} catch (Exception e) { } catch (Exception e) {

@ -6,6 +6,14 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.utils.validate; package net.lensfrex.dscape.utils.validate;
public class TextCheckUtil { public class TextCheckUtil {

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Class created by lensfrex.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-web</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>message-queue</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

@ -0,0 +1,21 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.mq;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
@Component
public class MessageQueueProducer {
private final RabbitTemplate rabbit;
public MessageQueueProducer(RabbitTemplate rabbit) {
this.rabbit = rabbit;
}
public void sendObject(Object data) {
rabbit.convertAndSend(data);
}
}

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dscape-server</artifactId>
<groupId>net.lensfrex</groupId>
<version>0.0.1-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>message-queue</module>
</modules>
<artifactId>dscape-web</artifactId>
<description>dscape后端主服务</description>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-dao</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-cache</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-entities</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>dscape-utils</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>net.lensfrex</groupId>
<artifactId>message-queue</artifactId>
<version>0.0.1-dev</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.7.3</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.7.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
<version>0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<version>2.7.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.30.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -1,3 +1,7 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape; package net.lensfrex.dscape;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;

@ -1,3 +1,19 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.auth; package net.lensfrex.dscape.auth;
import cn.dev33.satoken.stp.StpInterface; import cn.dev33.satoken.stp.StpInterface;

@ -0,0 +1,34 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.configure;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitMqConfigure {
@Bean
public Queue queue() {
return new Queue("dscape-compute-queue", true, false, false);
}
@Bean
public DirectExchange directExchange() {
return new DirectExchange("dscape-compute-exchange", true, false);
}
@Bean
public Binding binding() {
return BindingBuilder
.bind(this.queue())
.to(this.directExchange())
.with("dscape-compute");
}
}

@ -1,3 +1,19 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.exception.handler; package net.lensfrex.dscape.exception.handler;
import cn.dev33.satoken.exception.NotLoginException; import cn.dev33.satoken.exception.NotLoginException;

@ -1,12 +1,15 @@
package net.lensfrex.dscape.utils; /*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
import org.springframework.context.annotation.Scope; package net.lensfrex.dscape.utils;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@Component
@Scope("singleton")
public class NetworkUtil { public class NetworkUtil {
public static String getRealIP(HttpServletRequest request) { public static String getRealIP(HttpServletRequest request) {

@ -2,6 +2,18 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.controllers.compute; package net.lensfrex.dscape.web.controllers.compute;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;

@ -2,6 +2,18 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.controllers.history; package net.lensfrex.dscape.web.controllers.history;
import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckLogin;

@ -2,6 +2,18 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.controllers.user; package net.lensfrex.dscape.web.controllers.user;
import cn.dev33.satoken.stp.SaTokenInfo; import cn.dev33.satoken.stp.SaTokenInfo;
@ -9,15 +21,15 @@ import cn.dev33.satoken.stp.StpUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import net.lensfrex.dscape.dto.request.UserLoginRequestBody; import net.lensfrex.dscape.dto.request.UserLoginRequestBody;
import net.lensfrex.dscape.dto.request.user.PasswordModifyRequestBody;
import net.lensfrex.dscape.dto.request.user.RegisterRequestBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.general.Response; import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode; import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.exception.GlobalException; import net.lensfrex.dscape.exception.GlobalException;
import net.lensfrex.dscape.web.service.user.UserService;
import net.lensfrex.dscape.dto.request.user.PasswordModifyRequestBody;
import net.lensfrex.dscape.dto.request.user.RegisterRequestBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.utils.NetworkUtil; import net.lensfrex.dscape.utils.NetworkUtil;
import net.lensfrex.dscape.utils.validate.TextCheckUtil; import net.lensfrex.dscape.utils.validate.TextCheckUtil;
import net.lensfrex.dscape.web.service.user.UserService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;

@ -2,17 +2,29 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.controllers.user.admin; package net.lensfrex.dscape.web.controllers.user.admin;
import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.dto.request.user.UserAddRequest;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.general.Response; import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode; import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.enums.user.UserRoleEnum; import net.lensfrex.dscape.enums.user.UserRoleEnum;
import net.lensfrex.dscape.exception.GlobalException; import net.lensfrex.dscape.exception.GlobalException;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.dto.request.user.UserAddRequest;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.utils.NetworkUtil; import net.lensfrex.dscape.utils.NetworkUtil;
import net.lensfrex.dscape.web.service.user.AdminService; import net.lensfrex.dscape.web.service.user.AdminService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

@ -2,13 +2,25 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.service.data; package net.lensfrex.dscape.web.service.data;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.dao.entity.ComputeHistory; import net.lensfrex.dscape.dao.entity.ComputeHistory;
import net.lensfrex.dscape.dao.entity.PatientData; import net.lensfrex.dscape.dao.entity.PatientData;
import net.lensfrex.dscape.dao.service.ComputeHistoryService;
import net.lensfrex.dscape.dao.service.PatientDataService; import net.lensfrex.dscape.dao.service.PatientDataService;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.dao.service.ComputeHistoryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;

@ -6,22 +6,34 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.service.user; package net.lensfrex.dscape.web.service.user;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import net.lensfrex.dscape.cache.InviteCodeService; import net.lensfrex.dscape.web.service.user.admin.InviteCode;
import net.lensfrex.dscape.cache.UserBasicCache; import net.lensfrex.dscape.cache.UserBasicCache;
import net.lensfrex.dscape.dao.entity.BlackList; import net.lensfrex.dscape.dao.entity.BlackList;
import net.lensfrex.dscape.dao.entity.UserBasic; import net.lensfrex.dscape.dao.entity.UserBasic;
import net.lensfrex.dscape.dao.service.BlackListService; import net.lensfrex.dscape.dao.service.BlackListService;
import net.lensfrex.dscape.dao.service.UserBasicService; import net.lensfrex.dscape.dao.service.UserBasicService;
import net.lensfrex.dscape.dto.request.user.UserAddRequest; import net.lensfrex.dscape.dto.request.user.UserAddRequest;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.general.ResponseCode; import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.enums.user.BlackListTypeEnum; import net.lensfrex.dscape.enums.blacklist.BlackListTypeEnum;
import net.lensfrex.dscape.enums.user.UserRoleEnum; import net.lensfrex.dscape.enums.user.UserRoleEnum;
import net.lensfrex.dscape.exception.GlobalException; import net.lensfrex.dscape.exception.GlobalException;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -37,7 +49,7 @@ public class AdminService {
private final BlackListService blackListService; private final BlackListService blackListService;
private final InviteCodeService inviteCodeService; private final InviteCode inviteCode;
private final UserBasicCache userBasicCache; private final UserBasicCache userBasicCache;
@ -45,19 +57,19 @@ public class AdminService {
UserBasicService userBasicService, UserBasicService userBasicService,
UserService userService, UserService userService,
BlackListService blackListService, BlackListService blackListService,
InviteCodeService inviteCodeService, InviteCode inviteCode,
UserBasicCache userBasicCache) { UserBasicCache userBasicCache) {
this.redis = redis; this.redis = redis;
this.userBasicService = userBasicService; this.userBasicService = userBasicService;
this.userService = userService; this.userService = userService;
this.blackListService = blackListService; this.blackListService = blackListService;
this.inviteCodeService = inviteCodeService; this.inviteCode = inviteCode;
this.userBasicCache = userBasicCache; this.userBasicCache = userBasicCache;
} }
public List<String> generateInviteCode(long expired, int count) { public List<String> generateInviteCode(long expired, int count) {
return inviteCodeService.generateInviteCode(expired, count); return inviteCode.generateInviteCode(expired, count, StpUtil.getLoginIdAsString());
} }
public void modifyUserStatus(String uid, int status) { public void modifyUserStatus(String uid, int status) {

@ -2,24 +2,36 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.service.user; package net.lensfrex.dscape.web.service.user;
import cn.dev33.satoken.stp.SaTokenInfo; import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.cache.InviteCodeService;
import net.lensfrex.dscape.cache.UserBasicCache;
import net.lensfrex.dscape.dao.entity.UserBasic; import net.lensfrex.dscape.dao.entity.UserBasic;
import net.lensfrex.dscape.dao.entity.UserRole;
import net.lensfrex.dscape.dao.service.UserBasicService; import net.lensfrex.dscape.dao.service.UserBasicService;
import net.lensfrex.dscape.dao.service.UserRoleService;
import net.lensfrex.dscape.dto.request.UserLoginRequestBody; import net.lensfrex.dscape.dto.request.UserLoginRequestBody;
import net.lensfrex.dscape.dto.request.user.RegisterRequestBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.general.ResponseCode; import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.enums.user.UserRoleEnum; import net.lensfrex.dscape.enums.user.UserRoleEnum;
import net.lensfrex.dscape.enums.user.UserStatusEnum; import net.lensfrex.dscape.enums.user.UserStatusEnum;
import net.lensfrex.dscape.exception.GlobalException; import net.lensfrex.dscape.exception.GlobalException;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.web.service.user.admin.InviteCode;
import net.lensfrex.dscape.cache.UserBasicCache;
import net.lensfrex.dscape.dao.entity.UserRole;
import net.lensfrex.dscape.dao.service.UserRoleService;
import net.lensfrex.dscape.dto.request.user.RegisterRequestBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import org.mindrot.jbcrypt.BCrypt; import org.mindrot.jbcrypt.BCrypt;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -36,18 +48,18 @@ public class UserService {
private final UserRoleService userRoleService; private final UserRoleService userRoleService;
private final InviteCodeService inviteCodeService; private final InviteCode inviteCode;
@Autowired @Autowired
public UserService(UserBasicCache userBasicCache, public UserService(UserBasicCache userBasicCache,
UserBasicService userBasicService, UserBasicService userBasicService,
UserRoleService userRoleService, UserRoleService userRoleService,
InviteCodeService inviteCodeService) { InviteCode inviteCode) {
this.userBasicCache = userBasicCache; this.userBasicCache = userBasicCache;
this.userBasicService = userBasicService; this.userBasicService = userBasicService;
this.userRoleService = userRoleService; this.userRoleService = userRoleService;
this.inviteCodeService = inviteCodeService; this.inviteCode = inviteCode;
} }
public SaTokenInfo checkLogin() { public SaTokenInfo checkLogin() {
@ -129,7 +141,7 @@ public class UserService {
String uid = addUserToDatabase(requestBody.getUserName(), requestBody.getPassword(), "null", UserRoleEnum.ADMIN, registerIp); String uid = addUserToDatabase(requestBody.getUserName(), requestBody.getPassword(), "null", UserRoleEnum.ADMIN, registerIp);
registerResponseBody.setUid(uid); registerResponseBody.setUid(uid);
} else { } else {
String superior = inviteCodeService.useInviteCode(inviteCode); String superior = this.inviteCode.useInviteCode(inviteCode);
String uid = addUserToDatabase(requestBody.getUserName(), requestBody.getPassword(), superior, UserRoleEnum.NORMAL_USER, registerIp); String uid = addUserToDatabase(requestBody.getUserName(), requestBody.getPassword(), superior, UserRoleEnum.NORMAL_USER, registerIp);
registerResponseBody.setUid(uid); registerResponseBody.setUid(uid);

@ -2,14 +2,25 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.cache; /*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.service.user.admin;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaFoxUtil;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.configure.GlobalConstant; import net.lensfrex.dscape.configure.GlobalConstant;
import net.lensfrex.dscape.dto.response.general.ResponseCode; import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.exception.GlobalException; import net.lensfrex.dscape.exception.GlobalException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -19,7 +30,7 @@ import java.util.List;
@Slf4j @Slf4j
@Service @Service
public class InviteCodeService { public class InviteCode {
private static final int INVITE_CODE_LENGTH = 6; private static final int INVITE_CODE_LENGTH = 6;
private static final String REGISTER_INVITE_CODE_KEY = GlobalConstant.REGISTER_INVITE_CODE_KEY; private static final String REGISTER_INVITE_CODE_KEY = GlobalConstant.REGISTER_INVITE_CODE_KEY;
@ -28,12 +39,11 @@ public class InviteCodeService {
private final RedisTemplate<String, String> redis; private final RedisTemplate<String, String> redis;
public InviteCodeService(RedisTemplate<String, String> redis) { public InviteCode(RedisTemplate<String, String> redis) {
this.redis = redis; this.redis = redis;
} }
public List<String> generateInviteCode(long expired, int count) { public List<String> generateInviteCode(long expired, int count, String adminUid) {
String adminUid = StpUtil.getLoginIdAsString();
String adminInviteCodeCounterKey = String.format(ADMIN_INVITE_CODE_COUNTER_KEY, adminUid); String adminInviteCodeCounterKey = String.format(ADMIN_INVITE_CODE_COUNTER_KEY, adminUid);
String countResult = redis.opsForValue().get(adminInviteCodeCounterKey); String countResult = redis.opsForValue().get(adminInviteCodeCounterKey);
@ -45,7 +55,7 @@ public class InviteCodeService {
List<String> inviteCodes = new ArrayList<>(count); List<String> inviteCodes = new ArrayList<>(count);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
inviteCodes.add(SaFoxUtil.getRandomString(INVITE_CODE_LENGTH)); inviteCodes.add(RandomStringUtils.randomAlphanumeric(INVITE_CODE_LENGTH));
} }
HashMap<String, String> codeAdmin = new HashMap<>(count); HashMap<String, String> codeAdmin = new HashMap<>(count);
inviteCodes.forEach(inviteCode -> codeAdmin.put(inviteCode, adminUid)); inviteCodes.forEach(inviteCode -> codeAdmin.put(inviteCode, adminUid));

@ -1,3 +1,9 @@
spring:
profiles:
active: dev
---
server: server:
address: 127.0.0.1 address: 127.0.0.1
port: 6480 port: 6480
@ -16,6 +22,11 @@ spring:
url: jdbc:mariadb://localhost:3306/dscape?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mariadb://localhost:3306/dscape?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: "dscape_user" username: "dscape_user"
password: asdfasdf password: asdfasdf
rabbitmq:
host: 127.0.0.1
port: 5672
username: dscape-test
password: asdfasdf
redis: redis:
client-name: dscape client-name: dscape
host: 127.0.0.1 host: 127.0.0.1
@ -29,6 +40,9 @@ spring:
max-wait: -1 max-wait: -1
max-idle: 8 max-idle: 8
min-idle: 0 min-idle: 0
config:
activate:
on-profile: dev
mybatis-plus: mybatis-plus:
configuration: configuration:

@ -2,6 +2,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>dscape-compute</module>
<module>dscape-web</module>
<module>dscape-dao</module>
<module>dscape-cache</module>
<module>dscape-entities</module>
<module>dscape-utils</module>
</modules>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
@ -12,130 +21,17 @@
<artifactId>dscape-server</artifactId> <artifactId>dscape-server</artifactId>
<version>0.0.1-dev</version> <version>0.0.1-dev</version>
<name>dscape-server</name> <name>dscape-server</name>
<description>dscape-server</description> <description>dscape后端</description>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
</properties> </properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.30.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.0.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.11</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.11</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-gson</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
<version>0.4</version>
</dependency>
<dependencies>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!-- 性能分析用的 --> <!-- 性能分析用的 -->
<dependency> <dependency>
<groupId>cn.langpy</groupId> <groupId>cn.langpy</groupId>
@ -145,12 +41,12 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId> <artifactId>spring-boot-starter-freemarker</artifactId>
<version>2.7.1</version> <version>2.7.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
<version>2.7.1</version> <version>2.7.3</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -160,8 +56,10 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>net.lensfrex.dscape.ServerMain</mainClass>
</configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

Loading…
Cancel
Save