设备激活相关接口

This commit is contained in:
mi9688
2024-12-13 13:42:42 +08:00
parent 800f8e72ee
commit a96497c954
5 changed files with 96 additions and 13 deletions

View File

@ -0,0 +1,37 @@
package com.fastbee.data.controller.deviceActivation;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.iot.service.IDeviceActivationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "设备激活")
@RestController
@RequestMapping("/deviceactivation")
public class DeviceActivationController extends BaseController {
@Autowired
IDeviceActivationService deviceActivationService;
@PutMapping("/activation")
@ApiOperation("项目激活测试接口")
public AjaxResult getDevieceList(@RequestBody DeviceActivationDto deviceActivationDto)
{
//获取tenantId和tenantName
String[] idAndName=deviceActivationDto.tenantIdAndName.split(",",2);
Long tenantId= Long.valueOf(idAndName[0].replace(" ",""));
String tenantName=idAndName[1].trim();
return AjaxResult.success(deviceActivationService.selectDevice(deviceActivationDto.serialNumber,tenantId,tenantName,deviceActivationDto.longitude,deviceActivationDto.latitude,deviceActivationDto.imgUrl));
}
/*@GetMapping("/info/{userId}")
@ApiOperation("获取项目信息")
public AjaxResult getProjectInfo(@PathVariable("userId") Long userId){
return success(projectService.selectProjectByUserId(userId));
}*/
}

View File

@ -0,0 +1,10 @@
package com.fastbee.data.controller.deviceActivation;
public class DeviceActivationDto {
public String serialNumber;
public String tenantIdAndName;
public double longitude;
public double latitude;
public String imgUrl;
}