SystemController.java
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.objecteye.controller;
import com.objecteye.handle.viid.CommonHandle;
import com.objecteye.pojo.DeviceIdParams;
import com.objecteye.pojo.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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;
/**
* @author: liuhaoyu
* @date: 2023/7/6
*/
@RestController
@RequestMapping("system")
@RequiredArgsConstructor
public class SystemController {
private final CommonHandle commonHandle;
@PostMapping("register")
public Result<Boolean> register(@RequestBody @Validated DeviceIdParams params) {
return Result.success(commonHandle.register(params.getDeviceId()));
}
@PostMapping("unregister")
public Result<Boolean> unregister(@RequestBody @Validated DeviceIdParams params) {
return Result.success(commonHandle.unregister(params.getDeviceId()));
}
@PostMapping("keepalive")
public Result<Boolean> keepalive(@RequestBody @Validated DeviceIdParams params) {
return Result.success(commonHandle.keepalive(params.getDeviceId()));
}
}