package com.moral.api.controller;
|
|
import com.moral.api.pojo.dto.user.UserDTO;
|
import com.moral.api.pojo.dto.user.UserQueryDTO;
|
import com.moral.api.pojo.form.user.UserInsertForm;
|
import com.moral.api.pojo.form.user.UserQueryForm;
|
import com.moral.api.pojo.form.user.UserUpdateForm;
|
import com.moral.api.pojo.vo.user.UserQueryVO;
|
import com.moral.api.service.DeviceAdjustValueService;
|
import com.moral.api.service.DeviceService;
|
import com.moral.api.service.UserService;
|
import com.moral.api.util.CacheUtils;
|
import com.moral.constant.ResponseCodeEnum;
|
import com.moral.constant.ResultMessage;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.Map;
|
|
/**
|
* @ClassName UserController
|
* @Description 用户管理
|
* @Author 陈凯裕
|
* @Date 2021/3/22 13:52
|
* @Version TODO
|
**/
|
@Slf4j
|
@Api(tags = {"公共功能"})
|
@RestController
|
@RequestMapping("/pub")
|
public class PubController {
|
@Autowired
|
private CacheUtils cacheUtils;
|
@Autowired
|
private DeviceService deviceService;
|
@Resource
|
private DeviceAdjustValueService deviceAdjustValueService;
|
|
@GetMapping("deviceAlarmInfo")
|
@ApiOperation(value = "设备因子", notes = "设备因子")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String")
|
})
|
public ResultMessage refreshDeviceAlarmInfo() {
|
cacheUtils.refreshDeviceAlarmInfo();
|
|
return new ResultMessage();
|
}
|
|
@GetMapping("sensor")
|
@ApiOperation(value = "sensor编码", notes = "sensor编码")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String")
|
})
|
public ResultMessage sensor() {
|
cacheUtils.refreshSensor();
|
return new ResultMessage();
|
}
|
|
@GetMapping(value = "adjust")
|
@ApiOperation(value = "adjust编码", notes = "adjust编码")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String")
|
})
|
public ResultMessage adjust() {
|
Map<String,Object> resultMap = deviceAdjustValueService.refreshRedis();
|
return new ResultMessage();
|
}
|
|
@GetMapping(value = "device")
|
@ApiOperation(value = "redis重新编译device", notes = "redis重新编译device")
|
public ResultMessage device() {
|
deviceService.setRedisDevice();
|
return new ResultMessage();
|
}
|
|
@GetMapping(value = "selectDeviceInfoById")
|
@ApiOperation(value = "获取信息", notes = "获取信息")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String")
|
})
|
public ResultMessage selectDeviceInfoById(Integer mac) {
|
Map<String,Object> resultMap = deviceService.selectDeviceInfoById(mac);
|
return new ResultMessage();
|
}
|
|
}
|