dev-active
lensfrex 2 years ago
parent 7898265800
commit bb90b69df0
Signed by: lensfrex
GPG Key ID: 947ADABD8533C476
  1. 293
      API-Document.md
  2. 11
      pom.xml
  3. 2
      src/main/java/net/lensfrex/dscape/ServerMain.java
  4. 19
      src/main/java/net/lensfrex/dscape/auth/StpInterfaceImpl.java
  5. 49
      src/main/java/net/lensfrex/dscape/configure/MybatisPlusConfigure.java
  6. 29
      src/main/java/net/lensfrex/dscape/configure/RedisConfigure.java
  7. 12
      src/main/java/net/lensfrex/dscape/dao/PatientDataDao.java
  8. 5
      src/main/java/net/lensfrex/dscape/dao/UserBasicDao.java
  9. 35
      src/main/java/net/lensfrex/dscape/dao/entity/ComputeHistory.java
  10. 67
      src/main/java/net/lensfrex/dscape/dao/entity/PatientData.java
  11. 72
      src/main/java/net/lensfrex/dscape/dao/entity/UserBasic.java
  12. 12
      src/main/java/net/lensfrex/dscape/dao/mappers/PatientDataMapper.java
  13. 10
      src/main/java/net/lensfrex/dscape/dao/mappers/UserBasicMapper.java
  14. 142
      src/main/java/net/lensfrex/dscape/domain/PatientData.java
  15. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/admin/CreateUserResponse.java
  16. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/admin/UserRegisterApplicationResponseData.java
  17. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeHistoryReponseData.java
  18. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeStatusQueryResponse.java
  19. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeTaskResponseData.java
  20. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/user/LoginResponseData.java
  21. 2
      src/main/java/net/lensfrex/dscape/dto/response/data/user/RegisterResponseData.java
  22. 24
      src/main/java/net/lensfrex/dscape/dto/response/general/Response.java
  23. 35
      src/main/java/net/lensfrex/dscape/dto/response/general/ResponseCode.java
  24. 2
      src/main/java/net/lensfrex/dscape/enums/user/UserBasic.java
  25. 2
      src/main/java/net/lensfrex/dscape/enums/user/UserRole.java
  26. 2
      src/main/java/net/lensfrex/dscape/enums/user/UserStatus.java
  27. 1
      src/main/java/net/lensfrex/dscape/web/controllers/Error.java
  28. 6
      src/main/java/net/lensfrex/dscape/web/controllers/Index.java
  29. 9
      src/main/java/net/lensfrex/dscape/web/controllers/compute/Compute.java
  30. 9
      src/main/java/net/lensfrex/dscape/web/controllers/history/History.java
  31. 11
      src/main/java/net/lensfrex/dscape/web/controllers/user/User.java
  32. 15
      src/main/java/net/lensfrex/dscape/web/controllers/user/admin/Admin.java
  33. 13
      src/main/resources/application.yml
  34. 40
      src/main/resources/database.sql

@ -1,4 +1,4 @@
# Dscape Restful API文档 # DscapeAPI文档
这里是Dscape服务端的API文档。这里定义了该服务的接口以及调用方式。 这里是Dscape服务端的API文档。这里定义了该服务的接口以及调用方式。
@ -14,20 +14,45 @@
--- ---
## 0. 通用信息(非http状态码) # 目录
- [DscapeAPI文档](#dscapeapi文档)
- [目录](#目录)
- [通用状态码](#通用状态码)
- [登录认证](#登录认证)
- [用户登录](#用户登录)
- [用户注册(公共)](#用户注册公共)
- [计算相关](#计算相关)
- [请求计算](#请求计算)
- [计算记录查询](#计算记录查询)
- [计算记录删除](#计算记录删除)
- [计算状态查询](#计算状态查询)
- [用户管理相关](#用户管理相关)
- [添加用户](#添加用户)
- [修改密码](#修改密码)
- [封禁、删除用户](#封禁删除用户)
- [管理员获取待审批注册用户](#管理员获取待审批注册用户)
- [审核用户注册](#审核用户注册)
| code | 信息 | ---
| --- | --- |
| 20000 | 成功 | ## 通用状态码
| 30000 | 参数错误 |
| 30001 | token过期 | 这里的状态码是所有接口都有可能会返回的状态码
| 40300 | 权限不足 |
| 40000 | 非法请求 | | code | 信息 |
| ----- | -------------- |
| 20000 | 成功 |
| 30000 | 非法请求 |
| 30001 | 参数错误 |
| 40000 | 权限不足 |
| 40001 | token过期 |
| 40002 | token无效 |
| 50000 | 服务器内部错误 | | 50000 | 服务器内部错误 |
| 0 | 接口未实现 |
--- ---
## 1. 登录认证 ## 登录认证
### 用户登录 ### 用户登录
@ -36,10 +61,10 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | -------- | ------ | ----- | ------------------------------------------------ |
| userName | string | false |用户登录名,非空 | | userName | string | false | 用户登录名,非空 |
| password | string | false |用户登录密码,非空,其值为明文密码两次sha256加密 | | password | string | false | 用户登录密码,非空,其值为明文密码两次sha256加密 |
例如: 例如:
``` json ``` json
@ -51,13 +76,13 @@
- 返回数据 - 返回数据
| 参数 | 值类型 | 说明 | | 参数 | 值类型 | 说明 |
| --- | --- | --- | | ------------- | ------ | ------------------------------------------------------ |
| uid | string | 用户对应的uid | | uid | string | 用户对应的uid |
| role | int | 用户权限类型,0:普通用户,1:管理员 | | role | int | 用户权限类型,0:普通用户,1:管理员 |
| access_token | string | 本次登录得到的token,过期后应当用refresh_token重新获取 | | access_token | string | 本次登录得到的token,过期后应当用refresh_token重新获取 |
| refresh_token | string | 刷新用的token,过期后应当重新登录 | | refresh_token | string | 刷新用的token,过期后应当重新登录 |
| expired | long | access_token过期时间 | | expired | long | access_token过期时间 |
例如:(token为精简过的jwt) 例如:(token为精简过的jwt)
``` json ``` json
@ -75,10 +100,10 @@
``` ```
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | ---------------------- |
| 40301 | 用户名或密码错误 | | 40301 | 用户名或密码错误 |
| 40302 | 用户已被封禁 | | 40302 | 用户已被封禁 |
| 40305 | 上级管理员未认证该用户 | | 40305 | 上级管理员未认证该用户 |
--- ---
@ -94,11 +119,11 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | -------- | ------ | ----- | ------------------------------------------------ |
| userName | string | false | 用户登录名,非空 | | userName | string | false | 用户登录名,非空 |
| password | string | false | 用户登录密码,非空,其值为明文密码两次sha256加密 | | password | string | false | 用户登录密码,非空,其值为明文密码两次sha256加密 |
| superior | string | true | 上级管理员用户名 | | superior | string | true | 上级管理员用户名 |
例如: 例如:
``` json ``` json
@ -111,9 +136,9 @@
- 返回数据 - 返回数据
| 参数 | 值类型 | 说明 | | 参数 | 值类型 | 说明 |
| --- | --- | --- | | ---- | ------ | ------------- |
| uid | string | 用户对应的uid | | uid | string | 用户对应的uid |
例如: 例如:
``` json ``` json
@ -128,16 +153,16 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | ---------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
| 20001 | 用户已存在 | | 20001 | 用户已存在 |
> 管理员添加用户,详见[添加用户](#添加用户) > 管理员添加用户,详见[添加用户](#添加用户)
--- ---
## 2. 计算相关 ## 计算相关
### 请求计算 ### 请求计算
@ -146,12 +171,12 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ----- | -------------- | ----- | ------------------- |
| pid | string | false | 患者数据id | | pid | string | false | 患者数据id |
| ctdna | int | false | 患者ctDNA长度 | | ctdna | int | false | 患者ctDNA长度 |
| cpg | int | false | 患者甲基化位点数 | | cpg | int | false | 患者甲基化位点数 |
| token | string(header) | false |请求token,必须提供 | | token | string(header) | false | 请求token,必须提供 |
例如: 例如:
``` json ``` json
@ -164,9 +189,9 @@
- 返回数据 - 返回数据
| 参数 | 值类型 | 说明 | | 参数 | 值类型 | 说明 |
| --- | --- | --- | | ---- | ------ | -------------------- |
| id | string | 本次计算请求的任务id | | id | string | 本次计算请求的任务id |
例如: 例如:
``` json ``` json
@ -183,10 +208,10 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | ---------------------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
| 40303 | 计算请求的ip已被封禁 | | 40303 | 计算请求的ip已被封禁 |
| 40304 | 计算请求的用户已被封禁 | | 40304 | 计算请求的用户已被封禁 |
| 40305 | 用户的计算配额到达上限 | | 40305 | 用户的计算配额到达上限 |
@ -199,13 +224,13 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ------ | -------------- | ----- | --------------------- |
| uid | string(url) | false | 需要获取记录的用户uid | | uid | string(url) | false | 需要获取记录的用户uid |
| offset | int(url) | false | 分页数据偏移量 | | offset | int(url) | false | 分页数据偏移量 |
| limit | int(url) | false | 每页数据数量 | | limit | int(url) | false | 每页数据数量 |
| page | int(url) | false | 分页页码 | | page | int(url) | false | 分页页码 |
| token | string(header) | false | 请求token,必须提供 | | token | string(header) | false | 请求token,必须提供 |
例如,需要获取用户uid为`9a6d777c-997d-a7e5-35f4-8471b7582ac0`记录的第三页数据,每页10条数据: 例如,需要获取用户uid为`9a6d777c-997d-a7e5-35f4-8471b7582ac0`记录的第三页数据,每页10条数据:
``` ```
@ -216,15 +241,15 @@
> data部分以数组的形式返回 > data部分以数组的形式返回
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | --------- | ---------------- | ----------------- | ---- |
| id | int | 数据id | | id | int | 数据id |
| pid | int | 患者id | | pid | int | 患者id |
| ctdna | int | 患者ctDNA长度 | | ctdna | int | 患者ctDNA长度 |
| cpg | int | 患者甲基化位点数 | | cpg | int | 患者甲基化位点数 |
| hcc | boolean | 患者是否为HCC | | hcc | boolean | 患者是否为HCC |
| hcc_infer | boolean | 推算得出的HCC状态 | | hcc_infer | boolean | 推算得出的HCC状态 |
| time | datetime(string) | 时间 | | time | datetime(string) | 时间 |
例如: 例如:
``` json ``` json
@ -258,8 +283,8 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---
@ -271,10 +296,10 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ----- | -------------- | ----- | -------------------- |
| rid | int(url) | false | 欲删除的计算历史记录 | | rid | int(url) | false | 欲删除的计算历史记录 |
| token | string(header) | false |当前登录用户的token | | token | string(header) | false | 当前登录用户的token |
例如,需要获取id为`1145`的记录: 例如,需要获取id为`1145`的记录:
``` ```
@ -296,8 +321,8 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---
@ -309,9 +334,9 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ----- | -------------- | ----- | ------------------- |
| tid | string | false | 计算任务的id | | tid | string | false | 计算任务的id |
| token | string(header) | false | 当前登录用户的token | | token | string(header) | false | 当前登录用户的token |
例如: 例如:
@ -321,10 +346,10 @@
- 返回数据 - 返回数据
| 参数 | 值类型 | 说明 | | 参数 | 值类型 | 说明 |
| --- | --- | --- | | ------ | ------ | -------------------------------------------------------------- |
| id | string | 本次计算请求的任务id | | id | string | 本次计算请求的任务id |
| status | int | 计算状态,0:完成,1:计算中,3:排队中,4:已被终止或未被运行 | | status | int | 计算状态,0:完成,1:计算中,3:排队中,4:已被终止或未被运行 |
例如: 例如:
``` json ``` json
@ -340,13 +365,13 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---
## 3. 用户管理相关 ## 用户管理相关
> 这部分的的大部分接口只能由管理员调用使用 > 这部分的的大部分接口只能由管理员调用使用
@ -357,12 +382,12 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | -------- | -------------- | -------------------- | ------------------------------------------------ |
| userName | string | false | 用户登录名,非空 | | userName | string | false | 用户登录名,非空 |
| password | string | false | 用户登录密码,非空,其值为明文密码两次sha256加密 | | password | string | false | 用户登录密码,非空,其值为明文密码两次sha256加密 |
| role | int | true | 用户角色 | | role | int | true | 用户角色 |
| token | string(header) | 管理员的access_token | | token | string(header) | 管理员的access_token |
例如: 例如:
``` json ``` json
@ -375,10 +400,10 @@
- 返回数据 - 返回数据
| 字段 | 值类型 | 说明 | | 字段 | 值类型 | 说明 |
| --- | --- | --- | | ---- | ------ | ------------------------------------ |
| uid | string | 用户对应的uid | | uid | string | 用户对应的uid |
| role | int | 用户权限类型,0:普通用户,1:管理员 | | role | int | 用户权限类型,0:普通用户,1:管理员 |
例如: 例如:
@ -395,9 +420,9 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | ---------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
| 20001 | 用户已存在 | | 20001 | 用户已存在 |
--- ---
@ -411,12 +436,12 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ------------ | -------------- | ----- | --------------------------------------------------------------------------- |
| uid | string(url) | false |欲修改密码的用户uid | | uid | string(url) | false | 欲修改密码的用户uid |
| old_password | string | true |原始密码,其值为明文密码两次sha256加密,若不提供,则token拥有者应当为管理员 | | old_password | string | true | 原始密码,其值为明文密码两次sha256加密,若不提供,则token拥有者应当为管理员 |
| new_password | string | false | 新密码,其值为明文密码两次sha256加密 | | new_password | string | false | 新密码,其值为明文密码两次sha256加密 |
| token | string(header) | false | 当前对应用户的uid | | token | string(header) | false | 当前对应用户的uid |
例如: 例如:
``` json ``` json
@ -441,8 +466,8 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---
@ -454,11 +479,11 @@
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ------ | -------------- | ----------------- | ------------------------------------------------------------------------ |
| uid | string(url) | false | 欲修改状态的用户uid | | uid | string(url) | false | 欲修改状态的用户uid |
| status | int | false |修改状态,0:正常;1:彻底封禁(无法登录);2:注销(销号);3:计算封禁 | | status | int | false | 修改状态,0:正常;1:彻底封禁(无法登录);2:注销(销号);3:计算封禁 |
| token | string(header) | 当前对应用户的uid | | token | string(header) | 当前对应用户的uid |
例如: 例如:
``` json ``` json
@ -483,25 +508,25 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---
### 管理员获取待审批注册用户 ### 管理员获取待审批注册用户
- URL路径:`/user/admin/application/list?offset={offset}&limit={limit}&page={page}` - URL路径:`/user/admin/applications/list?offset={offset}&limit={limit}&page={page}`
- 方法:`GET` - 方法:`GET`
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ------ | -------------- | ----- | ------------------- |
| offset | int(url) | false | 分页数据偏移量 | | offset | int(url) | false | 分页数据偏移量 |
| limit | int(url) | false | 每页数据数量 | | limit | int(url) | false | 每页数据数量 |
| page | int(url) | false | 分页页码 | | page | int(url) | false | 分页页码 |
| token | string(header) | false | 请求token,必须提供 | | token | string(header) | false | 请求token,必须提供 |
例如,需要第三页数据,每页10条数据: 例如,需要第三页数据,每页10条数据:
``` ```
@ -512,13 +537,13 @@
> data部分以数组的形式返回 > data部分以数组的形式返回
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ---- | ---------------- | ------------------ | ---- |
| id | int | 审批记录id | | id | int | 审批记录id |
| uid | string | 待审批用户uid | | uid | string | 待审批用户uid |
| name | string | 待审批用户名 | | name | string | 待审批用户名 |
| ip | string | 用户发送审批时的ip | | ip | string | 用户发送审批时的ip |
| time | datetime(string) | 申请时间 | | time | datetime(string) | 申请时间 |
例如: 例如:
``` json ``` json
@ -548,23 +573,23 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---
### 审核用户注册 ### 审核用户注册
- URL路径:`/user/admin/application/deal/{uid}` - URL路径:`/user/admin/applications/deal/{uid}`
- 方法:`POST` - 方法:`POST`
- 请求参数: - 请求参数:
| 参数 | 值类型 | 可空 | 说明 | | 参数 | 值类型 | 可空 | 说明 |
| --- | --- | --- | --- | | ----- | -------------- | ----------------- | --------------------------------- |
| uid | string(url) | false | 处理的用户uid | | uid | string(url) | false | 处理的用户uid |
| idea | boolean | false | 处理意见,true:通过;false:拒绝 | | idea | boolean | false | 处理意见,true:通过;false:拒绝 |
| token | string(header) | 当前对应用户的uid | | token | string(header) | 当前对应用户的uid |
例如: 例如:
@ -590,8 +615,8 @@
- 错误信息 - 错误信息
| code | 错误 | | code | 错误 |
| --- | --- | | ----- | -------- |
| 40300 | 权限不足 | | 40300 | 权限不足 |
--- ---

@ -46,6 +46,12 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.30.0</version>
</dependency>
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
@ -116,6 +122,11 @@
<version>0.4</version> <version>0.4</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication @SpringBootApplication
@MapperScan("net.lensfrex.dscape.dao.mappers") @MapperScan("net.lensfrex.dscape.module.dao.mappers")
public class ServerMain extends SpringBootServletInitializer { public class ServerMain extends SpringBootServletInitializer {
public static void main(String[] args) { public static void main(String[] args) {

@ -0,0 +1,19 @@
package net.lensfrex.dscape.auth;
import cn.dev33.satoken.stp.StpInterface;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class StpInterfaceImpl implements StpInterface {
@Override
public List<String> getPermissionList(Object loginId, String loginType) {
return null;
}
@Override
public List<String> getRoleList(Object loginId, String loginType) {
return null;
}
}

@ -0,0 +1,49 @@
package net.lensfrex.dscape.configure;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
/**
* 分页功能的配置类
*/
@Slf4j
@Configuration
public class MybatisPlusConfigure {
@Resource
DataSourceProperties dataSourceProperties;
@Bean
public PaginationInnerInterceptor paginationInnerInterceptor() {
return new PaginationInnerInterceptor();
}
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
String databaseDriverName = dataSourceProperties.getDriverClassName();
PaginationInnerInterceptor paginationInnerInterceptor;
if (databaseDriverName.contains("mariadb")) {
log.info("使用Mariadb作为数据库");
paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MARIADB);
} else if (databaseDriverName.contains("mysql")) {
log.info("使用Mysql作为数据库");
paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL);
} else {
paginationInnerInterceptor = new PaginationInnerInterceptor();
log.warn("使用了可能不受支持的数据库:" + databaseDriverName);
}
paginationInnerInterceptor.setOptimizeJoin(true);
interceptor.addInnerInterceptor(paginationInnerInterceptor);
return interceptor;
}
}

@ -0,0 +1,29 @@
package net.lensfrex.dscape.configure;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
@EnableCaching
public class RedisConfigure extends CachingConfigurerSupport {
@Bean
public RedisTemplate<String, Object> redisTemplate(LettuceConnectionFactory redisConnectionFactory) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory);
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
}

@ -1,12 +0,0 @@
/*
* Class created by lensfrex.
*/
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao;
public class PatientDataDao {
}

@ -1,5 +0,0 @@
package net.lensfrex.dscape.dao;
public class UserBasicDao {
}

@ -0,0 +1,35 @@
package net.lensfrex.dscape.dao.entity;
import lombok.Data;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
/**
* @description compute_history
* @author lensfrex
* @date 2022-08-17
*/
@Data
public class ComputeHistory implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
/**
* id
*/
private Integer id;
/**
* 计算数据记录对应的用户uid
*/
private String uid;
/**
* 计算数据记录对应的患者数据id
*/
private Integer rid;
public ComputeHistory() {}
}

@ -0,0 +1,67 @@
package net.lensfrex.dscape.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
/**
* @description patient_data
* @author lensfrex
* @date 2022-08-17
*/
@Data
public class PatientData implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 数据id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 病人id
*/
private Integer pid;
/**
* ctdna长度
*/
private Integer ctdnaLength;
/**
* 甲基化位点数
*/
private Integer cpg;
/**
* 是否为hcc0: 1:
*/
private int isHcc;
/**
* 通过推断得出的hcc状态
*/
private int isInferHcc;
/**
* create_time
*/
private LocalDateTime createTime;
/**
* edit_time
*/
private LocalDateTime editTime;
/**
* is_deleted
*/
private int isDeleted;
public PatientData() {}
}

@ -0,0 +1,72 @@
package net.lensfrex.dscape.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
/**
* @description user_basic
* @author lensfrex
* @date 2022-08-17
*/
@Data
public class UserBasic implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 用户唯一uuid
*/
private String uid;
/**
* 用户用户名
*/
private String userName;
/**
* 用户密码
*/
private String password;
/**
* 账号对应的上级管理员若无上级管理员请设为null字符串
*/
private String superior;
/**
* 用户注册ip
*/
private String createIp;
/**
* 用户状态0正常1封禁2注销销号;3未激活
*/
private int status;
/**
* create_time
*/
private LocalDateTime createTime;
/**
* edit_time
*/
private LocalDateTime editTime;
/**
* is_deleted
*/
private int isDeleted;
public UserBasic() {}
}

@ -1,12 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.mappers;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lensfrex.dscape.domain.PatientData;
public interface PatientDataMapper extends BaseMapper<PatientData> {
}

@ -1,10 +0,0 @@
package net.lensfrex.dscape.dao.mappers;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lensfrex.dscape.domain.user.UserBasic;
import org.springframework.stereotype.Repository;
@Repository
public interface UserBasicMapper extends BaseMapper<UserBasic> {
}

@ -1,142 +0,0 @@
package net.lensfrex.dscape.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
@TableName("patient_data")
public class PatientData {
/**
* 患者数据id
*/
private int id;
/**
* 病人id
*/
private int pid;
/**
* ctDNA长度
*/
private int ctDNALength;
/**
* 甲基化位点数
*/
private int cpg;
/**
* 是否为hcc
*/
private boolean hccStatus;
/**
* 通过推断得出的hcc状态
*/
private boolean hccInferStatus;
/**
* create_time
*/
private Date createTime;
/**
* edit_time
*/
private Date editTime;
/**
* delete
*/
private boolean delete;
public PatientData() {}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public int getCtDNALength() {
return ctDNALength;
}
public void setCtDNALength(int ctDNALength) {
this.ctDNALength = ctDNALength;
}
public boolean isHccStatus() {
return hccStatus;
}
public void setHccStatus(boolean hccStatus) {
this.hccStatus = hccStatus;
}
public boolean isHccInferStatus() {
return hccInferStatus;
}
public void setHccInferStatus(boolean hccInferStatus) {
this.hccInferStatus = hccInferStatus;
}
public boolean isDelete() {
return delete;
}
public void setDelete(boolean delete) {
this.delete = delete;
}
public int getCpg() {
return cpg;
}
public void setCpg(int cpg) {
this.cpg = cpg;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getEditTime() {
return editTime;
}
public void setEditTime(Date editTime) {
this.editTime = editTime;
}
@Override
public String toString() {
return "PatientData{" + "id=" + id +
", pid=" + pid +
", ctDNALength=" + ctDNALength +
", cpg=" + cpg +
", hccStatus=" + hccStatus +
", hccInferStatus=" + hccInferStatus +
", createTime=" + createTime +
", editTime=" + editTime +
", delete=" + delete +
'}';
}
}

@ -3,7 +3,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response.data.admin; package net.lensfrex.dscape.dto.response.data.admin;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;

@ -1,5 +1,5 @@
package net.lensfrex.dscape.domain.response.data.admin; package net.lensfrex.dscape.dto.response.data.admin;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;

@ -3,7 +3,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response.data.compute; package net.lensfrex.dscape.dto.response.data.compute;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;

@ -3,7 +3,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response.data.compute; package net.lensfrex.dscape.dto.response.data.compute;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;

@ -3,7 +3,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response.data.compute; package net.lensfrex.dscape.dto.response.data.compute;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;

@ -3,7 +3,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response.data.user; package net.lensfrex.dscape.dto.response.data.user;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;

@ -3,7 +3,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response.data.user; package net.lensfrex.dscape.dto.response.data.user;
import javax.annotation.Generated; import javax.annotation.Generated;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;

@ -2,7 +2,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package net.lensfrex.dscape.domain.response; package net.lensfrex.dscape.dto.response.general;
//@JsonInclude(JsonInclude.Include.NON_NULL) //@JsonInclude(JsonInclude.Include.NON_NULL)
public class Response<T> { public class Response<T> {
@ -28,21 +28,19 @@ public class Response<T> {
return data; return data;
} }
@Override public static<T> Response<T> success(T data) {
public String toString() { return new Response<>(ResponseCode.SUCCESS.getCode(), "success", data);
final StringBuffer sb = new StringBuffer("Response{");
sb.append("code=").append(code);
sb.append(", message='").append(message).append('\'');
sb.append(", data=").append(data);
sb.append('}');
return sb.toString();
} }
public static<T> Response<T> success(T data) { public static<T> Response<T> success() {
return new Response<>(20000, "success", data); return success(null);
}
public static<T> Response<T> error(ResponseCode code, String message) {
return new Response<>(code.getCode(), message, null);
} }
public static Response<Object> error(int code, String message) { public static<T> Response<T> error(ResponseCode code) {
return new Response<>(code, message, null); return error(code, code.getMessage());
} }
} }

@ -0,0 +1,35 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.general;
public enum ResponseCode {
SUCCESS(20000, "成功"),
INVALID_REQUEST(30000, "非法请求"),
PARAM_WRONG(30001, "参数错误"),
PERMISSION_DENIED(40000, "权限不足"),
TOKEN_EXPIRED(40001, "token过期"),
TOKEN_INVALID(40002, "token无效"),
SERVER_INTERNAL_ERROR(50000, "服务器内部错误"),
API_NOT_IMPLEMENT(0, "接口未实现"),
;
private final int code;
private final String message;
ResponseCode(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}

@ -1,4 +1,4 @@
package net.lensfrex.dscape.domain.user; package net.lensfrex.dscape.enums.user;
public class UserBasic { public class UserBasic {
private String uid; private String uid;

@ -1,4 +1,4 @@
package net.lensfrex.dscape.domain.user; package net.lensfrex.dscape.enums.user;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;

@ -1,4 +1,4 @@
package net.lensfrex.dscape.domain.user; package net.lensfrex.dscape.enums.user;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;

@ -4,7 +4,6 @@
package net.lensfrex.dscape.web.controllers; package net.lensfrex.dscape.web.controllers;
import net.lensfrex.dscape.domain.response.Response;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;

@ -1,14 +1,8 @@
package net.lensfrex.dscape.web.controllers; package net.lensfrex.dscape.web.controllers;
import net.lensfrex.dscape.dao.mappers.UserBasicMapper;
import net.lensfrex.dscape.domain.user.UserBasic;
import net.lensfrex.dscape.domain.user.UserRole;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController @RestController
public class Index { public class Index {
@RequestMapping("/") @RequestMapping("/")

@ -4,7 +4,9 @@
package net.lensfrex.dscape.web.controllers.compute; package net.lensfrex.dscape.web.controllers.compute;
import net.lensfrex.dscape.domain.response.Response; import cn.dev33.satoken.stp.StpUtil;
import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@ -13,12 +15,13 @@ public class Compute {
@GetMapping(value = "/status/{tid}", produces = "application/json") @GetMapping(value = "/status/{tid}", produces = "application/json")
public Response status(@PathVariable String tid, public Response status(@PathVariable String tid,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); StpUtil.hasPermission("jsejdjjd");
return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@PostMapping(value = "/add", produces = "application/json") @PostMapping(value = "/add", produces = "application/json")
public Response addComputeTask(@RequestBody String body, public Response addComputeTask(@RequestBody String body,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
} }

@ -4,7 +4,8 @@
package net.lensfrex.dscape.web.controllers.history; package net.lensfrex.dscape.web.controllers.history;
import net.lensfrex.dscape.domain.response.Response; import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@ -12,15 +13,15 @@ import org.springframework.web.bind.annotation.*;
public class History { public class History {
@GetMapping(value = "/list/{uid}", produces = "application/json") @GetMapping(value = "/list/{uid}", produces = "application/json")
public Response list(@PathVariable String uid, public Response<Object> list(@PathVariable String uid,
@RequestParam int offset, @RequestParam int limit, @RequestParam int page, @RequestParam int offset, @RequestParam int limit, @RequestParam int page,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@RequestMapping(value = "/delete/{rid}", method = {RequestMethod.DELETE, RequestMethod.GET}, produces = "application/json") @RequestMapping(value = "/delete/{rid}", method = {RequestMethod.DELETE, RequestMethod.GET}, produces = "application/json")
public Response delete(@PathVariable int rid, public Response delete(@PathVariable int rid,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
} }

@ -6,9 +6,8 @@ package net.lensfrex.dscape.web.controllers.user;
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.domain.response.Response; import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.domain.response.data.user.LoginResponseData; import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.domain.response.data.user.RegisterResponseData;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@ -18,17 +17,17 @@ public class User {
@PostMapping(value = "/login" , produces = "application/json") @PostMapping(value = "/login" , produces = "application/json")
public Response login(@RequestBody String body) { public Response login(@RequestBody String body) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@PostMapping(value = "/register", produces = "application/json") @PostMapping(value = "/register", produces = "application/json")
public Response register(@RequestBody String body) { public Response register(@RequestBody String body) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@PostMapping(value = "/modifyPassword/{uid}", produces = "application/json") @PostMapping(value = "/modifyPassword/{uid}", produces = "application/json")
public Response modifyPassword(@RequestBody String body, @PathVariable String uid, public Response modifyPassword(@RequestBody String body, @PathVariable String uid,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
} }

@ -4,34 +4,37 @@
package net.lensfrex.dscape.web.controllers.user.admin; package net.lensfrex.dscape.web.controllers.user.admin;
import net.lensfrex.dscape.domain.response.Response; import cn.dev33.satoken.stp.StpUtil;
import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/user/admin") @RequestMapping("/user/admin")
public class Admin { public class Admin {
@PostMapping(value = "/add", produces = "application/json") @PostMapping(value = "/add", produces = "application/json")
public Response addUser(@RequestBody String body, public Response<Object> addUser(@RequestBody String body,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@PostMapping(value = "/modifyStatus/{uid}", produces = "application/json") @PostMapping(value = "/modifyStatus/{uid}", produces = "application/json")
public Response modifyStatus(@RequestBody String body, @PathVariable String uid, public Response modifyStatus(@RequestBody String body, @PathVariable String uid,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@GetMapping(value = "/application/list", produces = "application/json") @GetMapping(value = "/application/list", produces = "application/json")
public Response listApplication( public Response listApplication(
@RequestParam String offset, @RequestParam String limit, @RequestParam String page, @RequestParam String offset, @RequestParam String limit, @RequestParam String page,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
@PostMapping(value = "/application/deal/{uid}", produces = "application/json") @PostMapping(value = "/application/deal/{uid}", produces = "application/json")
public Response dealApplication(@RequestBody String body, @PathVariable String uid, public Response dealApplication(@RequestBody String body, @PathVariable String uid,
@RequestHeader String token) { @RequestHeader String token) {
return Response.error(0, "Not implement"); return Response.error(ResponseCode.API_NOT_IMPLEMENT);
} }
} }

@ -11,12 +11,21 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: org.mariadb.jdbc.Driver driver-class-name: org.mariadb.jdbc.Driver
url: jdbc:mariadb://localhost:33060/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: password: asdfasdf
mybatis-plus: mybatis-plus:
configuration: configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler
sa-token:
token-name: dscape_token
timeout: 259200
activity-timeout: -1
is-concurrent: true
is-share: false
token-style: random-64
is-log: true

@ -5,12 +5,7 @@ Backup Time: 2022-07-10 22:20:06
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `dscape`.`black_list`; CREATE TABLE dscape.`black_list` (
DROP TABLE IF EXISTS `dscape`.`compute_history`;
DROP TABLE IF EXISTS `dscape`.`patient_data`;
DROP TABLE IF EXISTS `dscape`.`role_permission`;
DROP TABLE IF EXISTS `dscape`.`user_basic`;
CREATE TABLE `black_list` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` tinyint(1) NOT NULL COMMENT '黑名单数据类型;\r\n0:ip;\r\n1:uid', `type` tinyint(1) NOT NULL COMMENT '黑名单数据类型;\r\n0:ip;\r\n1:uid',
`name` varchar(255) NOT NULL COMMENT '黑名单条目名称,可空', `name` varchar(255) NOT NULL COMMENT '黑名单条目名称,可空',
@ -22,7 +17,7 @@ CREATE TABLE `black_list` (
UNIQUE KEY `index_id` (`id`) USING BTREE, UNIQUE KEY `index_id` (`id`) USING BTREE,
KEY `index_data` (`data`) USING BTREE KEY `index_data` (`data`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `compute_history` ( CREATE TABLE dscape.`compute_history` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`uid` char(36) NOT NULL COMMENT '计算数据记录对应的用户uid', `uid` char(36) NOT NULL COMMENT '计算数据记录对应的用户uid',
`rid` int(11) NOT NULL COMMENT '计算数据记录对应的患者数据id', `rid` int(11) NOT NULL COMMENT '计算数据记录对应的患者数据id',
@ -31,7 +26,7 @@ CREATE TABLE `compute_history` (
KEY `index_uid` (`uid`) USING BTREE, KEY `index_uid` (`uid`) USING BTREE,
KEY `index_pid` (`rid`) USING BTREE KEY `index_pid` (`rid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `patient_data` ( CREATE TABLE dscape.`patient_data` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '数据id', `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '数据id',
`pid` int(15) NOT NULL COMMENT '病人id', `pid` int(15) NOT NULL COMMENT '病人id',
`ctDNA_length` int(4) NOT NULL COMMENT 'ctDNA长度', `ctDNA_length` int(4) NOT NULL COMMENT 'ctDNA长度',
@ -45,7 +40,7 @@ CREATE TABLE `patient_data` (
UNIQUE KEY `id` (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE,
KEY `pid` (`pid`) USING BTREE KEY `pid` (`pid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `role_permission` ( CREATE TABLE dscape.`role_permission` (
`id` int(4) unsigned NOT NULL AUTO_INCREMENT, `id` int(4) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL COMMENT '权限名称', `name` varchar(255) NOT NULL COMMENT '权限名称',
`permit` varchar(255) NOT NULL COMMENT '许可的用户角色,角色之间用";"(分号)隔开', `permit` varchar(255) NOT NULL COMMENT '许可的用户角色,角色之间用";"(分号)隔开',
@ -56,7 +51,7 @@ CREATE TABLE `role_permission` (
UNIQUE KEY `index_id` (`id`) USING BTREE, UNIQUE KEY `index_id` (`id`) USING BTREE,
UNIQUE KEY `index_name` (`name`) USING BTREE UNIQUE KEY `index_name` (`name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `user_basic` ( CREATE TABLE dscape.`user_basic` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`uid` char(36) NOT NULL COMMENT '用户唯一uuid', `uid` char(36) NOT NULL COMMENT '用户唯一uuid',
`user_name` varchar(32) NOT NULL COMMENT '用户用户名', `user_name` varchar(32) NOT NULL COMMENT '用户用户名',
@ -70,28 +65,3 @@ CREATE TABLE `user_basic` (
UNIQUE KEY `uid` (`uid`) USING BTREE, UNIQUE KEY `uid` (`uid`) USING BTREE,
UNIQUE KEY `user_name` (`user_name`) UNIQUE KEY `user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
BEGIN;
LOCK TABLES `dscape`.`black_list` WRITE;
DELETE FROM `dscape`.`black_list`;
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `dscape`.`compute_history` WRITE;
DELETE FROM `dscape`.`compute_history`;
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `dscape`.`patient_data` WRITE;
DELETE FROM `dscape`.`patient_data`;
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `dscape`.`role_permission` WRITE;
DELETE FROM `dscape`.`role_permission`;
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `dscape`.`user_basic` WRITE;
DELETE FROM `dscape`.`user_basic`;
UNLOCK TABLES;
COMMIT;

Loading…
Cancel
Save