parent
7898265800
commit
bb90b69df0
@ -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; |
||||
|
||||
/** |
||||
* 是否为hcc,0: 否, 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 + |
||||
'}'; |
||||
} |
||||
} |
@ -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 com.google.gson.annotations.Expose; |
@ -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 { |
||||
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; |
||||
|
@ -1,4 +1,4 @@ |
||||
package net.lensfrex.dscape.domain.user; |
||||
package net.lensfrex.dscape.enums.user; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue; |
||||
|
Loading…
Reference in new issue