Spring boot 开发 GA/T1400 协议之注册、保活、注销、校时功能
开发GA/T 1400协议之前 需要了解整个1400协议的流程及基础架构,各位准备进行开发的同学应该基本上都有文档了,我就不多阐述,直接开始:
===》 GA/T 1400 注册模块接口
controller代码:
/**
* @description: 注册功能
* @create: 2020-10-13 14:00
**/
@RestController
@RequestMapping("/VIID/System")
@Slf4j
public class Ga1400RegisterController {
@Autowired
Ga1400RegisterService ga1400RegisterService;
/**
* @param register
* @description: 采集设备注册接口
* @create: 2020-10-13 14:00
**/
@ApiOperation(value = "Register", notes = "GA/T1400注册")
@PostMapping(value = "Register")
public String register(@RequestBody JSONObject register, HttpServletRequest request, HttpServletResponse response) throws IOException {
String deviceId = register.getJSONObject("RegisterObject").getString("DeviceID");
return ga1400RegisterService.register(deviceId, response).toJSONString();
}
/**
* @param keepalive
* @description: 采集设备保活接口
* @create: 2020-10-13 14:00
**/
@ApiOperation(value = "Keepalive", notes = "GA/T1400保活")
@PostMapping(value = "Keepalive")
public String keepalive(@RequestBody JSONObject keepalive, HttpServletResponse response) {
log.info(" keepalive --->");
String deviceId = keepalive.getJSONObject("KeepaliveObject").getString("DeviceID");
log.info("Device ke