This commit is contained in:
2025-01-23 09:31:56 +08:00
parent 38c4b553bc
commit 1aa1ae5e2b
18 changed files with 171 additions and 76 deletions

View File

@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* @Authorlongbinbin
* @Date2024/12/4 17:03
@ -39,8 +41,22 @@ AppFaceController {
return faceService.faceUpload(file,scenicId);
}
@GetMapping("/scenic/{scenicId}/list")
public ApiResponse<List<FaceRespVO>> list(@PathVariable("scenicId") String scenicId) {
JwtInfo worker = JwtTokenUtil.getWorker();
Long userId = worker.getUserId();
List<FaceRespVO> list = faceService.listByUser(userId, scenicId);
return ApiResponse.success(list);
}
@GetMapping("/{faceId}")
public ApiResponse<FaceRespVO> getById(@PathVariable("faceId") Long faceId) {
return faceService.getById(faceId);
}
@PostMapping("/{faceId}/match")
public ApiResponse match(@PathVariable("faceId") Long faceId) {
faceService.matchFaceId(faceId);
return ApiResponse.success("");
}
}

View File

@ -39,6 +39,10 @@ public class SourceController {
JwtInfo worker = JwtTokenUtil.getWorker();
return sourceService.getById(id, worker.getUserId());
}
@PostMapping("/{id}/cutVideo")
public ApiResponse cutVideo(@PathVariable("id") Long id) {
return sourceService.cutVideo(id);
}
@ApiOperation("添加视频源")
@PostMapping("/add")
public ApiResponse add(@RequestBody SourceEntity source) {

View File

@ -78,21 +78,22 @@ public class ViidController {
DeviceIdObject deviceIdObject = req.getRegisterObject();
log.info("注册的设备信息:{}", deviceIdObject);
// 保存设备注册时间
DeviceEntity device = deviceRepository.getDeviceByDeviceNo(deviceIdObject.getDeviceId());
String deviceId = deviceIdObject.getDeviceId();
DeviceEntity device = deviceRepository.getDeviceByDeviceNo(deviceId);
if (device == null) {
device = new DeviceEntity();
device.setName("未配置设备");
device.setNo(deviceIdObject.getDeviceId());
device.setNo(deviceId);
device.setOnline(1);
}
device.setKeepaliveAt(new Date());
device.setIpAddr(IpUtils.getIpAddr(request));
if (device.getId() != null) {
deviceMapper.updateEntity(device);
deviceRepository.clearDeviceCache(device.getId());
} else {
device.setId(SnowFlakeUtil.getLongId());
deviceMapper.addEntity(device);
deviceRepository.clearDeviceCache(deviceId);
}
return new VIIDBaseResp(
new ResponseStatusObject(serverId, "/VIID/System/Register", "0", "注册成功", sdfTime.format(new Date()))
@ -126,6 +127,7 @@ public class ViidController {
device.setIpAddr(IpUtils.getIpAddr(request));
device.setId(SnowFlakeUtil.getLongId());
deviceMapper.addEntity(device);
deviceRepository.clearDeviceCache(deviceId);
} else {
deviceRepository.updateOnlineStatus(device.getId(), IpUtils.getIpAddr(request), 1, new Date());
}