jinpengyong
2023-10-31 69790994b403a61e92a20cef7451b7f087b50ad2
screen-api/src/main/java/com/moral/api/controller/AppDevicController.java
@@ -15,8 +15,10 @@
import java.util.List;
import com.moral.api.entity.Device;
import com.moral.api.entity.MonitorPoint;
import com.moral.api.entity.Organization;
import com.moral.api.service.DeviceService;
import com.moral.api.service.MonitorPointService;
import com.moral.api.service.OrganizationService;
import com.moral.constant.ResponseCodeEnum;
import com.moral.constant.ResultMessage;
@@ -29,7 +31,7 @@
public class AppDevicController {
    @Autowired
    private OrganizationService organizationService;
    private MonitorPointService monitorPointService;
    @Autowired
    private DeviceService deviceService;
@@ -37,17 +39,17 @@
    @GetMapping("selectOrganization")
    @ApiOperation(value = "小程序获取组织")
    @ApiOperation(value = "小程序获取站点")
    public ResultMessage selectOrganization(){
        List<Organization> organizations = organizationService.getOrganizations();
        return ResultMessage.ok(organizations);
        List<MonitorPoint> monitorPoints = monitorPointService.getOrganizations();
        return ResultMessage.ok(monitorPoints);
    }
    @GetMapping("selectDevice")
    @ApiOperation(value = "小程序获取设备")
    public ResultMessage selectDevice(@RequestParam @ApiParam(value = "organizationId",name = "组织ID") Integer organizationId){
        List<Device> organizationDevice = deviceService.getOrganizationDevice(organizationId);
    public ResultMessage selectDevice(@RequestParam @ApiParam(value = "monitorPointId",name = "站点ID") Integer monitorPointId){
        List<Device> organizationDevice = deviceService.getOrganizationDevice(monitorPointId);
        return ResultMessage.ok(ObjectUtils.isEmpty(organizationDevice)?null:organizationDevice);
    }