|
@ -11,10 +11,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;
|
|
@ -47,4 +44,16 @@ public class IotSystemDictController extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = IotRequestMapping.System.createDict)
|
|
|
@ApiOperation(value = "创建字典", notes = "创建字典")
|
|
|
public MixEnvelop<IotSystemDictDO, IotSystemDictDO> create(@ApiParam(name = "jsonData", value = "字典json", defaultValue = "{\"value\":\"血糖\", \"dictName\":\"DEVICE_TYPE\"}")
|
|
|
@RequestParam String jsonData) {
|
|
|
try {
|
|
|
IotSystemDictDO dictDO = toEntity(jsonData, IotSystemDictDO.class);
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create, iotSystemDictService.create(dictDO));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|