采集时间VO
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
00ad7b3fb9
commit
e3a9cff289
@ -87,11 +87,21 @@ public class EcgdataController {
|
||||
}
|
||||
|
||||
@GetMapping("/getByUserId")
|
||||
@Operation(summary = "根据用户ID获得心电数据采集")
|
||||
@Operation(summary = "根据用户ID获得心电采集时间列表")
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "1024")
|
||||
public CommonResult<List<EcgdataRespVO>> getEcgdataByUserId(@RequestParam("userId") Integer userId) {
|
||||
public CommonResult<List<EcgdataTimeRespVO>> getEcgdataByUserId(@RequestParam("userId") Integer userId) {
|
||||
List<EcgdataDO> ecgdataList = ecgdataService.getEcgdataByUserId(userId);
|
||||
return success(BeanUtils.toBean(ecgdataList, EcgdataRespVO.class));
|
||||
return success(BeanUtils.toBean(ecgdataList, EcgdataTimeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByTime")
|
||||
@Operation(summary = "根据时间戳和用户ID获得心电数据")
|
||||
@Parameter(name = "collecttime", description = "采集时间戳", required = true)
|
||||
@Parameter(name = "userId", description = "用户编号", required = true)
|
||||
public CommonResult<EcgdataRespVO> getEcgdataByTime(@RequestParam("collecttime") Long collecttime,
|
||||
@RequestParam("userId") Integer userId) {
|
||||
EcgdataDO ecgdata = ecgdataService.getEcgdataByTime(collecttime, userId);
|
||||
return success(BeanUtils.toBean(ecgdata, EcgdataRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 心电数据采集时间 Response VO")
|
||||
@Data
|
||||
public class EcgdataTimeRespVO {
|
||||
|
||||
@Schema(description = "采集时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime collecttime;
|
||||
|
||||
}
|
@ -60,4 +60,13 @@ public interface EcgdataService {
|
||||
*/
|
||||
List<EcgdataDO> getEcgdataByUserId(Integer userId);
|
||||
|
||||
/**
|
||||
* 根据时间戳和用户ID获得心电数据采集
|
||||
*
|
||||
* @param collecttime 采集时间戳
|
||||
* @param userId 用户编号
|
||||
* @return 心电数据采集
|
||||
*/
|
||||
EcgdataDO getEcgdataByTime(Long collecttime, Integer userId);
|
||||
|
||||
}
|
@ -79,4 +79,12 @@ public class EcgdataServiceImpl implements EcgdataService {
|
||||
.orderByDesc(EcgdataDO::getId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EcgdataDO getEcgdataByTime(Long collecttime, Integer userId) {
|
||||
return ecgdataMapper.selectOne(new LambdaQueryWrapperX<EcgdataDO>()
|
||||
.eq(EcgdataDO::getUserid, userId)
|
||||
.eq(EcgdataDO::getCollecttime, new Date(collecttime))
|
||||
.orderByDesc(EcgdataDO::getId));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user