|
@@ -25,7 +25,7 @@ public class PhysicalDataServiceImpl implements PhysicalDataService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void addPhysicalData(AddPhysicalDataRequest request) {
|
|
public void addPhysicalData(AddPhysicalDataRequest request) {
|
|
|
- Long userId = getCurrentUserId();
|
|
|
|
|
|
|
+ Long userId = work.baiyun.chronicdiseaseapp.util.SecurityUtils.getCurrentUserId();
|
|
|
PhysicalData physicalData = new PhysicalData();
|
|
PhysicalData physicalData = new PhysicalData();
|
|
|
BeanUtils.copyProperties(request, physicalData);
|
|
BeanUtils.copyProperties(request, physicalData);
|
|
|
physicalData.setUserId(userId);
|
|
physicalData.setUserId(userId);
|
|
@@ -34,7 +34,7 @@ public class PhysicalDataServiceImpl implements PhysicalDataService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Page<PhysicalDataResponse> listPhysicalData(BaseQueryRequest request) {
|
|
public Page<PhysicalDataResponse> listPhysicalData(BaseQueryRequest request) {
|
|
|
- Long userId = getCurrentUserId();
|
|
|
|
|
|
|
+ Long userId = work.baiyun.chronicdiseaseapp.util.SecurityUtils.getCurrentUserId();
|
|
|
Page<PhysicalData> page = new Page<>(request.getPageNum(), request.getPageSize());
|
|
Page<PhysicalData> page = new Page<>(request.getPageNum(), request.getPageSize());
|
|
|
LambdaQueryWrapper<PhysicalData> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PhysicalData> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(PhysicalData::getUserId, userId)
|
|
wrapper.eq(PhysicalData::getUserId, userId)
|
|
@@ -70,8 +70,5 @@ public class PhysicalDataServiceImpl implements PhysicalDataService {
|
|
|
return weight.divide(heightInMeters.pow(2), 2, RoundingMode.HALF_UP);
|
|
return weight.divide(heightInMeters.pow(2), 2, RoundingMode.HALF_UP);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private Long getCurrentUserId() {
|
|
|
|
|
- // TODO: replace with actual security context lookup
|
|
|
|
|
- return 1L;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|