parent
685b582d04
commit
a3dedc2c98
@ -0,0 +1,16 @@ |
||||
package net.lensfrex.dscape.dao.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import net.lensfrex.dscape.dao.entity.ComputeHistory; |
||||
|
||||
|
||||
/** |
||||
* @author lensfrex |
||||
* @description compute_historyMapper |
||||
* @date 2022-08-22 |
||||
*/ |
||||
@Mapper |
||||
public interface ComputeHistoryMapper extends BaseMapper<ComputeHistory> { |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
package net.lensfrex.dscape.dao.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import net.lensfrex.dscape.dao.entity.PatientData; |
||||
|
||||
/** |
||||
* @author lensfrex |
||||
* @description patient_dataMapper |
||||
* @date 2022-08-22 |
||||
*/ |
||||
@Mapper |
||||
public interface PatientDataMapper extends BaseMapper<PatientData> { |
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package net.lensfrex.dscape.dao.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
||||
import net.lensfrex.dscape.dao.entity.ComputeHistory; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author lensfrex |
||||
* @description compute_history服务层 |
||||
* @date 2022-08-22 |
||||
*/ |
||||
@Service |
||||
public interface ComputeHistoryService extends IService<ComputeHistory> { |
||||
long count(SFunction<ComputeHistory, ?> indexColum, Object index); |
||||
|
||||
List<ComputeHistory> getHistory(String uid, int page, int limit); |
||||
|
||||
List<Long> getHistoryIds(String uid, int page, int limit); |
||||
|
||||
boolean remove(Long id); |
||||
|
||||
String getHistoryUser(Long rid); |
||||
} |
@ -0,0 +1,21 @@ |
||||
package net.lensfrex.dscape.dao.service; |
||||
|
||||
import net.lensfrex.dscape.dao.entity.PatientData; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author lensfrex |
||||
* @description patient_data服务层 |
||||
* @date 2022-08-22 |
||||
*/ |
||||
@Service |
||||
public interface PatientDataService extends IService<PatientData> { |
||||
List<PatientData> getData(List<Long> ids); |
||||
|
||||
PatientData getData(Long id); |
||||
|
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dao.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import net.lensfrex.dscape.dao.entity.ComputeHistory; |
||||
import net.lensfrex.dscape.dao.mapper.ComputeHistoryMapper; |
||||
import net.lensfrex.dscape.dao.service.ComputeHistoryService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class ComputeHistoryServiceImpl extends ServiceImpl<ComputeHistoryMapper, ComputeHistory> implements ComputeHistoryService { |
||||
@Override |
||||
public long count(SFunction<ComputeHistory, ?> indexColum, Object index) { |
||||
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.eq(indexColum, index); |
||||
|
||||
return this.count(wrapper); |
||||
} |
||||
|
||||
@Override |
||||
public List<ComputeHistory> getHistory(String uid, int page, int limit) { |
||||
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.eq(ComputeHistory::getUid, uid); |
||||
|
||||
return this.page(new Page<>(page, limit), wrapper).getRecords(); |
||||
} |
||||
|
||||
@Override |
||||
public List<Long> getHistoryIds(String uid, int page, int limit) { |
||||
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.select(ComputeHistory::getRid) |
||||
.eq(ComputeHistory::getUid, uid); |
||||
|
||||
List<ComputeHistory> results = this.page(new Page<>(page, limit), wrapper).getRecords(); |
||||
|
||||
List<Long> ids = new ArrayList<>(results.size()); |
||||
results.forEach(result -> ids.add(result.getRid())); |
||||
|
||||
return ids; |
||||
} |
||||
|
||||
@Override |
||||
public boolean remove(Long id) { |
||||
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.eq(ComputeHistory::getRid, id); |
||||
|
||||
return this.remove(wrapper); |
||||
} |
||||
|
||||
@Override |
||||
public String getHistoryUser(Long rid) { |
||||
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.select(ComputeHistory::getUid) |
||||
.eq(ComputeHistory::getRid, rid); |
||||
|
||||
return this.getOne(wrapper).getUid(); |
||||
} |
||||
} |
@ -0,0 +1,36 @@ |
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dao.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import net.lensfrex.dscape.dao.entity.PatientData; |
||||
import net.lensfrex.dscape.dao.mapper.PatientDataMapper; |
||||
import net.lensfrex.dscape.dao.service.PatientDataService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service |
||||
public class PatientDataServiceImpl extends ServiceImpl<PatientDataMapper, PatientData> implements PatientDataService { |
||||
@Override |
||||
public List<PatientData> getData(List<Long> ids) { |
||||
QueryWrapper<PatientData> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.in(PatientData::getId, ids) |
||||
.orderByDesc(PatientData::getId); |
||||
|
||||
return this.list(wrapper); |
||||
} |
||||
|
||||
@Override |
||||
public PatientData getData(Long id) { |
||||
QueryWrapper<PatientData> wrapper = new QueryWrapper<>(); |
||||
wrapper.lambda() |
||||
.eq(PatientData::getId, id); |
||||
|
||||
return this.getOne(wrapper); |
||||
} |
||||
} |
@ -1,36 +0,0 @@ |
||||
|
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.admin; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.Expose; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class CreateUserResponse { |
||||
|
||||
@Expose |
||||
private long role; |
||||
@Expose |
||||
private String uid; |
||||
|
||||
public long getRole() { |
||||
return role; |
||||
} |
||||
|
||||
public void setRole(long role) { |
||||
this.role = role; |
||||
} |
||||
|
||||
public String getUid() { |
||||
return uid; |
||||
} |
||||
|
||||
public void setUid(String uid) { |
||||
this.uid = uid; |
||||
} |
||||
|
||||
} |
@ -1,62 +0,0 @@ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.admin; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.Expose; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class UserRegisterApplicationResponseData { |
||||
|
||||
@Expose |
||||
private long id; |
||||
@Expose |
||||
private String ip; |
||||
@Expose |
||||
private String name; |
||||
@Expose |
||||
private String time; |
||||
@Expose |
||||
private String uid; |
||||
|
||||
public long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getIp() { |
||||
return ip; |
||||
} |
||||
|
||||
public void setIp(String ip) { |
||||
this.ip = ip; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getTime() { |
||||
return time; |
||||
} |
||||
|
||||
public void setTime(String time) { |
||||
this.time = time; |
||||
} |
||||
|
||||
public String getUid() { |
||||
return uid; |
||||
} |
||||
|
||||
public void setUid(String uid) { |
||||
this.uid = uid; |
||||
} |
||||
|
||||
} |
@ -1,87 +0,0 @@ |
||||
|
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.compute; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.Expose; |
||||
import com.google.gson.annotations.SerializedName; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class ComputeHistoryReponseData { |
||||
|
||||
@Expose |
||||
private long cpg; |
||||
@Expose |
||||
private long ctdna; |
||||
@Expose |
||||
private Boolean hcc; |
||||
@SerializedName("hcc_infer") |
||||
private Boolean hccInfer; |
||||
@Expose |
||||
private long id; |
||||
@Expose |
||||
private long pid; |
||||
@Expose |
||||
private String time; |
||||
|
||||
public long getCpg() { |
||||
return cpg; |
||||
} |
||||
|
||||
public void setCpg(long cpg) { |
||||
this.cpg = cpg; |
||||
} |
||||
|
||||
public long getCtdna() { |
||||
return ctdna; |
||||
} |
||||
|
||||
public void setCtdna(long ctdna) { |
||||
this.ctdna = ctdna; |
||||
} |
||||
|
||||
public Boolean getHcc() { |
||||
return hcc; |
||||
} |
||||
|
||||
public void setHcc(Boolean hcc) { |
||||
this.hcc = hcc; |
||||
} |
||||
|
||||
public Boolean getHccInfer() { |
||||
return hccInfer; |
||||
} |
||||
|
||||
public void setHccInfer(Boolean hccInfer) { |
||||
this.hccInfer = hccInfer; |
||||
} |
||||
|
||||
public long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public long getPid() { |
||||
return pid; |
||||
} |
||||
|
||||
public void setPid(long pid) { |
||||
this.pid = pid; |
||||
} |
||||
|
||||
public String getTime() { |
||||
return time; |
||||
} |
||||
|
||||
public void setTime(String time) { |
||||
this.time = time; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.compute; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class ComputeHistoryResponseData { |
||||
private long cpg; |
||||
|
||||
private long ctdna; |
||||
|
||||
private Boolean hcc; |
||||
|
||||
@JsonProperty("hcc_infer") |
||||
private Boolean hccInfer; |
||||
|
||||
private long id; |
||||
|
||||
private long pid; |
||||
|
||||
private String time; |
||||
} |
@ -1,36 +0,0 @@ |
||||
|
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.compute; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.Expose; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class ComputeStatusQueryResponse { |
||||
|
||||
@Expose |
||||
private String id; |
||||
@Expose |
||||
private int status; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public int getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(int status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
} |
@ -1,26 +0,0 @@ |
||||
|
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.compute; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.Expose; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class ComputeTaskResponseData { |
||||
|
||||
@Expose |
||||
private String id; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
} |
@ -1,66 +0,0 @@ |
||||
|
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.user; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.SerializedName; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class LoginResponseData { |
||||
|
||||
@SerializedName("access_token") |
||||
private String mAccessToken; |
||||
@SerializedName("expired") |
||||
private long mExpired; |
||||
@SerializedName("refresh_token") |
||||
private String mRefreshToken; |
||||
@SerializedName("role") |
||||
private long mRole; |
||||
@SerializedName("uid") |
||||
private String mUid; |
||||
|
||||
public String getAccessToken() { |
||||
return mAccessToken; |
||||
} |
||||
|
||||
public void setAccessToken(String accessToken) { |
||||
mAccessToken = accessToken; |
||||
} |
||||
|
||||
public long getExpired() { |
||||
return mExpired; |
||||
} |
||||
|
||||
public void setExpired(long expired) { |
||||
mExpired = expired; |
||||
} |
||||
|
||||
public String getRefreshToken() { |
||||
return mRefreshToken; |
||||
} |
||||
|
||||
public void setRefreshToken(String refreshToken) { |
||||
mRefreshToken = refreshToken; |
||||
} |
||||
|
||||
public long getRole() { |
||||
return mRole; |
||||
} |
||||
|
||||
public void setRole(long role) { |
||||
mRole = role; |
||||
} |
||||
|
||||
public String getUid() { |
||||
return mUid; |
||||
} |
||||
|
||||
public void setUid(String uid) { |
||||
mUid = uid; |
||||
} |
||||
|
||||
} |
@ -1,4 +1,8 @@ |
||||
package net.lensfrex.dscape.dto.response.user; |
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.user; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
import lombok.Data; |
@ -1,26 +0,0 @@ |
||||
|
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
package net.lensfrex.dscape.dto.response.data.user; |
||||
|
||||
import javax.annotation.Generated; |
||||
import com.google.gson.annotations.Expose; |
||||
|
||||
@Generated("net.hexar.json2pojo") |
||||
@SuppressWarnings("unused") |
||||
public class RegisterResponseData { |
||||
|
||||
@Expose |
||||
private String uid; |
||||
|
||||
public String getUid() { |
||||
return uid; |
||||
} |
||||
|
||||
public void setUid(String uid) { |
||||
this.uid = uid; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,51 @@ |
||||
/* |
||||
* Class created by lensfrex. |
||||
*/ |
||||
|
||||
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.PatientData; |
||||
import net.lensfrex.dscape.dao.service.ComputeHistoryService; |
||||
import net.lensfrex.dscape.dao.service.PatientDataService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@Slf4j |
||||
@Service |
||||
public class HistoryService { |
||||
|
||||
private final ComputeHistoryService computeHistoryService; |
||||
|
||||
private final PatientDataService patientDataService; |
||||
|
||||
public HistoryService(ComputeHistoryService computeHistoryService, |
||||
PatientDataService patientDataService) { |
||||
this.computeHistoryService = computeHistoryService; |
||||
|
||||
this.patientDataService = patientDataService; |
||||
} |
||||
|
||||
public long getTotalCount(String uid) { |
||||
return computeHistoryService.count(ComputeHistory::getUid, uid); |
||||
} |
||||
|
||||
public List<Long> getUserHistoryId(String uid, int page, int limit) { |
||||
return computeHistoryService.getHistoryIds(uid, page, limit); |
||||
} |
||||
|
||||
public List<PatientData> getUserHistoryData(String uid, int page, int limit) { |
||||
return patientDataService.getData(getUserHistoryId(uid, page, limit)); |
||||
} |
||||
|
||||
public String getHistoryUser(Long rid) { |
||||
return computeHistoryService.getHistoryUser(rid); |
||||
} |
||||
|
||||
public void deleteHistoryData(Long rid) { |
||||
computeHistoryService.remove(rid); |
||||
} |
||||
} |
Loading…
Reference in new issue