|
@ -9,10 +9,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@ -43,4 +40,18 @@ public class IotDeviceDictController extends EnvelopRestEndpoint {
|
|
|
List<IotDeviceDictDO> iotDeviceDicts = convertToModels(list, new ArrayList<>(list.size()), IotDeviceDictDO.class, fields);
|
|
|
return MixEnvelop.getSuccessList(IotRequestMapping.DeviceDict.message_success_find_functions,iotDeviceDicts);
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = IotRequestMapping.DeviceDict.api_create)
|
|
|
@ApiOperation(value = "创建编辑设备字典")
|
|
|
public MixEnvelop create(
|
|
|
@ApiParam(name = "jsonData", value = "设备体征字典json数据")
|
|
|
@RequestParam(value = "jsonData", required = false) String jsonData){
|
|
|
try {
|
|
|
IotDeviceDictDO dictDO = toEntity(jsonData, IotDeviceDictDO.class);
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create, iotDeviceDictService.create(dictDO));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|