parent
759dd2f151
commit
01b389ac1a
@ -1,118 +1,116 @@ |
||||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<parent> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-parent</artifactId> |
||||
<version>2.7.1</version> |
||||
<relativePath/> <!-- lookup parent from repository --> |
||||
</parent> |
||||
<groupId>net.lensfrex</groupId> |
||||
<artifactId>dscape-server</artifactId> |
||||
<version>0.0.1-dev</version> |
||||
<name>dscape-server</name> |
||||
<description>dscape-server</description> |
||||
<properties> |
||||
<java.version>1.8</java.version> |
||||
</properties> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter</artifactId> |
||||
<version>2.7.0</version> |
||||
</dependency> |
||||
|
||||
<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"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<groupId>me.lensfrex</groupId> |
||||
<artifactId>dscape-server</artifactId> |
||||
<version>0.0.1-dev</version> |
||||
<name>dscape-server</name> |
||||
<packaging>jar</packaging> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-test</artifactId> |
||||
<scope>test</scope> |
||||
</dependency> |
||||
|
||||
<properties> |
||||
<start-class>me.lensfrex.dscape.api.v1.ServerMain</start-class> |
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
<maven.compiler.target>1.8</maven.compiler.target> |
||||
<maven.compiler.source>1.8</maven.compiler.source> |
||||
<junit.version>5.8.1</junit.version> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-web</artifactId> |
||||
</dependency> |
||||
|
||||
</properties> |
||||
<parent> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-parent</artifactId> |
||||
<version>2.7.0</version> |
||||
<relativePath/> |
||||
</parent> |
||||
<dependency> |
||||
<groupId>com.baomidou</groupId> |
||||
<artifactId>mybatis-plus-boot-starter</artifactId> |
||||
<version>3.5.2</version> |
||||
</dependency> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>javax.servlet</groupId> |
||||
<artifactId>javax.servlet-api</artifactId> |
||||
<version>4.0.1</version> |
||||
<scope>provided</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.mariadb.jdbc</groupId> |
||||
<artifactId>mariadb-java-client</artifactId> |
||||
<version>3.0.5</version> |
||||
</dependency> |
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --> |
||||
<dependency> |
||||
<groupId>com.google.code.gson</groupId> |
||||
<artifactId>gson</artifactId> |
||||
<version>2.9.0</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> |
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.mindrot/jbcrypt --> |
||||
<dependency> |
||||
<groupId>org.mindrot</groupId> |
||||
<artifactId>jbcrypt</artifactId> |
||||
<version>0.4</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.fasterxml.jackson.core</groupId> |
||||
<artifactId>jackson-core</artifactId> |
||||
<version>2.13.3</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.fasterxml.jackson.core</groupId> |
||||
<artifactId>jackson-databind</artifactId> |
||||
<version>2.13.3</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.fasterxml.jackson.core</groupId> |
||||
<artifactId>jackson-annotations</artifactId> |
||||
<version>2.13.3</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> |
||||
<scope>runtime</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.jsonwebtoken</groupId> |
||||
<artifactId>jjwt-gson</artifactId> <!-- or jjwt-gson if Gson is preferred --> |
||||
<version>0.11.5</version> |
||||
<scope>runtime</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>commons-cli</groupId> |
||||
<artifactId>commons-cli</artifactId> |
||||
<version>1.5.0</version> |
||||
</dependency> |
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --> |
||||
<dependency> |
||||
<groupId>org.mybatis</groupId> |
||||
<artifactId>mybatis</artifactId> |
||||
<version>3.5.9</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-jackson</artifactId> |
||||
<version>0.11.5</version> |
||||
</dependency> |
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client --> |
||||
<dependency> |
||||
<groupId>org.mariadb.jdbc</groupId> |
||||
<artifactId>mariadb-java-client</artifactId> |
||||
<version>3.0.4</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.mindrot</groupId> |
||||
<artifactId>jbcrypt</artifactId> |
||||
<version>0.4</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>commons-io</groupId> |
||||
<artifactId>commons-io</artifactId> |
||||
<version>2.11.0</version> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<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-test</artifactId> |
||||
<scope>test</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-jetty</artifactId> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
</dependencies> |
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
</project> |
@ -1,10 +1,12 @@ |
||||
package me.lensfrex.dscape.api.v1; |
||||
package net.lensfrex.dscape; |
||||
|
||||
import org.mybatis.spring.annotation.MapperScan; |
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
||||
|
||||
@SpringBootApplication |
||||
@MapperScan("net.lensfrex.dscape.dao.mappers") |
||||
public class ServerMain extends SpringBootServletInitializer { |
||||
|
||||
public static void main(String[] args) { |
@ -0,0 +1,12 @@ |
||||
/* |
||||
* Coded by lensfrex. |
||||
*/ |
||||
|
||||
/* |
||||
* Coded by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dao; |
||||
|
||||
public class PatientDataDao { |
||||
} |
@ -0,0 +1,5 @@ |
||||
package net.lensfrex.dscape.dao; |
||||
|
||||
public class UserBasicDao { |
||||
|
||||
} |
@ -0,0 +1,12 @@ |
||||
/* |
||||
* Coded 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> { |
||||
|
||||
} |
@ -0,0 +1,10 @@ |
||||
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> { |
||||
|
||||
} |
@ -0,0 +1,139 @@ |
||||
package net.lensfrex.dscape.domain; |
||||
|
||||
import java.util.Date; |
||||
|
||||
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 + |
||||
'}'; |
||||
} |
||||
} |
@ -0,0 +1,62 @@ |
||||
package net.lensfrex.dscape.domain.user; |
||||
|
||||
public class UserBasic { |
||||
private String uid; |
||||
private String userName; |
||||
private String password; |
||||
private UserStatus status; |
||||
private UserRole role; |
||||
|
||||
public String getUid() { |
||||
return uid; |
||||
} |
||||
|
||||
public void setUid(String uid) { |
||||
this.uid = uid; |
||||
} |
||||
|
||||
public String getUserName() { |
||||
return userName; |
||||
} |
||||
|
||||
public void setUserName(String userName) { |
||||
this.userName = userName; |
||||
} |
||||
|
||||
public String getPassword() { |
||||
return password; |
||||
} |
||||
|
||||
public void setPassword(String password) { |
||||
this.password = password; |
||||
} |
||||
|
||||
public UserRole getRole() { |
||||
return role; |
||||
} |
||||
|
||||
public void setRole(UserRole role) { |
||||
this.role = role; |
||||
} |
||||
|
||||
public UserStatus getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(UserStatus status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
final StringBuffer sb = new StringBuffer("UserBasic{"); |
||||
sb.append("uid='").append(uid).append('\''); |
||||
sb.append(", userName='").append(userName).append('\''); |
||||
sb.append(", password='").append(password).append('\''); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", role=").append(role); |
||||
sb.append('}'); |
||||
return sb.toString(); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,17 @@ |
||||
package net.lensfrex.dscape.domain.user; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue; |
||||
|
||||
public enum UserRole { |
||||
ADMIN(1, "admin"), NORMAL_USER(0, "normal"); |
||||
|
||||
@EnumValue |
||||
private final int role; |
||||
|
||||
private final String desc; |
||||
|
||||
UserRole(int role, String desc) { |
||||
this.role = role; |
||||
this.desc = desc; |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
package net.lensfrex.dscape.domain.user; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue; |
||||
|
||||
public enum UserStatus { |
||||
|
||||
NORMAL(0), BANNED(1), DELETED(2); |
||||
|
||||
@EnumValue |
||||
private final int status; |
||||
|
||||
UserStatus(int status) { |
||||
this.status = status; |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
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.RequestMethod; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
@RestController |
||||
public class Index { |
||||
|
||||
@Resource |
||||
private UserBasicMapper userBasicMapper; |
||||
|
||||
@RequestMapping(value = "/", method = RequestMethod.GET) |
||||
public String returnIndexMessage() { |
||||
|
||||
|
||||
System.out.println("------test------"); |
||||
// List<UserBasic> userBasicList = userBasicMapper.selectList(null);
|
||||
|
||||
UserBasic userBasic = new UserBasic(); |
||||
|
||||
userBasic.setUserName("lensfrex"); |
||||
userBasic.setPassword("passwd"); |
||||
userBasic.setUid("uid"); |
||||
userBasic.setRole(UserRole.ADMIN); |
||||
|
||||
System.out.println(userBasicMapper.insert(userBasic)); |
||||
return "ヾ( ̄▽ ̄)"; |
||||
} |
||||
} |
@ -1 +1,22 @@ |
||||
server: |
||||
address: 127.0.0.1 |
||||
port: 6480 |
||||
http2: |
||||
enabled: false |
||||
ssl: |
||||
enabled: false |
||||
trust-certificate: |
||||
trust-certificate-private-key: |
||||
|
||||
spring: |
||||
datasource: |
||||
driver-class-name: org.mariadb.jdbc.Driver |
||||
url: jdbc:mariadb://localhost:33060/dscape?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
||||
username: "dscape_user" |
||||
password: |
||||
|
||||
|
||||
mybatis-plus: |
||||
configuration: |
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
||||
default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler |
||||
|
Loading…
Reference in new issue