修改返回值对象
parent
c723197c05
commit
9868e19cfe
|
@ -46,7 +46,7 @@ public class FenceController {
|
|||
public Result<String> insertFence(@RequestBody @Validated FenceAddRequest fenceAddRequest){
|
||||
//围栏添加
|
||||
fenceService.save(Fence.fenceBuildAdd(fenceAddRequest));
|
||||
return Result.success();
|
||||
return Result.success("","添加成功");
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class FenceController {
|
|||
//编辑电子围栏信息
|
||||
fenceService.updateById(fence);
|
||||
|
||||
return Result.success();
|
||||
return Result.success("","编辑成功");
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class FenceController {
|
|||
public Result<String> deleteFence(@RequestParam("fenceId") Integer fenceId){
|
||||
//根据围栏编号删除围栏
|
||||
fenceService.removeById(fenceId);
|
||||
return Result.success();
|
||||
return Result.success("","删除成功");
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class FenceController {
|
|||
public Result<TableDataInfo<Fence>> fenceListAndPage(@RequestBody FenceQueryRequest fenceQueryRequest){
|
||||
//分页查询围栏列表
|
||||
TableDataInfo<Fence> dataInfo = fenceService.fenceListAndPage(fenceQueryRequest);
|
||||
return Result.success(dataInfo);
|
||||
return Result.success(dataInfo,"查询成功");
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,6 +103,6 @@ public class FenceController {
|
|||
public Result<Fence> fenceById(@RequestParam("fenceId") Integer fenceId){
|
||||
//通过围栏Id查询围栏信息
|
||||
Fence fence = fenceService.getById(fenceId);
|
||||
return Result.success(fence);
|
||||
return Result.success(fence,"查询成功");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,9 @@ import org.springframework.context.annotation.Bean;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 监控车辆围栏实时数据
|
||||
|
@ -65,14 +67,14 @@ public class CarFenceMonitor {
|
|||
}
|
||||
|
||||
//围栏对象集合
|
||||
List<Fence> locationList = new ArrayList<>();
|
||||
Set<Fence> fences = new HashSet<>();
|
||||
|
||||
for (Fence row : rows) {
|
||||
locationList.add(row);
|
||||
fences.add(row);
|
||||
}
|
||||
|
||||
//存储redis
|
||||
redisService.setCacheList(car.getCarVinId()+"fence",locationList);
|
||||
redisService.setCacheSet("Fence"+car.getCarVinId(),fences);
|
||||
|
||||
}).start();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue