|
|
@ -2,8 +2,10 @@ package com.iflytop.nuclear.controller; |
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.iflytop.nuclear.model.Camera; |
|
|
|
import com.iflytop.nuclear.model.NuclearCore; |
|
|
|
import com.iflytop.nuclear.model.NuclearStation; |
|
|
|
import com.iflytop.nuclear.service.CameraService; |
|
|
|
import com.iflytop.nuclear.service.NuclearCoreService; |
|
|
|
import com.iflytop.nuclear.service.NuclearStationService; |
|
|
|
import com.iflytop.nuclear.utils.ResponseData; |
|
|
@ -30,16 +32,26 @@ public class NuclearCoreController { |
|
|
|
@Autowired |
|
|
|
NuclearStationService nuclearStationService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
CameraService cameraService; |
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
public ResponseData list() { |
|
|
|
// 将数据中stationid转换为名称 |
|
|
|
List<NuclearCore> list = nuclearCoreService.list(); |
|
|
|
if (list.size() > 0){ |
|
|
|
for (NuclearCore l : list) { |
|
|
|
int id = l.getId(); |
|
|
|
// 根据id获取曝光时间等 |
|
|
|
Camera byId = cameraService.getById(id); |
|
|
|
NuclearStation nuclearStation = nuclearStationService.getById(l.getStationId()); |
|
|
|
if(nuclearStation != null) { |
|
|
|
l.setStationName(nuclearStation.getName()); |
|
|
|
} |
|
|
|
if (byId != null) { |
|
|
|
l.setExposure(byId.getExposure()); |
|
|
|
l.setBrightness(byId.getBrightness()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject res = new JSONObject(); |
|
|
|