package org.springnewfiber.dataadapter.xf.controller; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springnewfiber.dataadapter.config.R; import org.springnewfiber.dataadapter.xf.entity.monitor.MonitorPointData; import org.springnewfiber.dataadapter.xf.enums.EDataAccessType; import org.springnewfiber.dataadapter.xf.service.DataAccessRecordService; /** * @program: newfiber-data-adapter * @description: 点表监测数据接口 * @author: djt * @create: 2022-07-01 17:22 **/ @RestController @RequiredArgsConstructor //@PreAuth(AuthConstant.PERMISSION_ALL) @RequestMapping("/pointData") @Api(value = "点表监测数据接口", tags = "点表监测数据接口") @Slf4j public class MonitorPointDataController { private final DataAccessRecordService dataAccessRecordService; @PostMapping("/realData") public R xfInterfaceSingle(@RequestBody MonitorPointData monitorPointData) { dataAccessRecordService.save(EDataAccessType.IflytekPlcRealtime, EDataAccessType.IflytekPlcRealtime.name(), JSONObject.toJSONString(monitorPointData)); return R.status(true); } }