hotfix:
修改部分API注释bug
This commit is contained in:
@@ -35,7 +35,7 @@ public class ProjectObjectDataListener implements ReadListener<ProtectObject> {
|
||||
private void saveData() {
|
||||
Boolean success = protectObjectService.newProtectObjects(cachedDataList);
|
||||
if (!success) {
|
||||
throw new RuntimeException("Error reading data in /proobj/new");
|
||||
throw new RuntimeException("在/proobj/upload中读取数据时出现了错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
|
||||
@Override
|
||||
@PostMapping("/upload")
|
||||
public ResponseResult uploadFile(
|
||||
@NotNull(message = "uploadFile cannot be null. ") MultipartFile uploadFile
|
||||
@NotNull(message = "uploadFile字段不能为空") MultipartFile uploadFile
|
||||
) throws IOException {
|
||||
EasyExcel.read(uploadFile.getInputStream(), ProtectObject.class,
|
||||
new ProjectObjectDataListener(protectObjectService)).sheet().doRead();
|
||||
@@ -85,6 +85,10 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
|
||||
@GetMapping("/{protectObjectId}/query")
|
||||
public ResponseResult queryProtectObject(@PathVariable Integer protectObjectId) throws IllegalAccessException {
|
||||
ProtectObject protectObject = protectObjectService.queryProtectObject(protectObjectId);
|
||||
if (protectObject == null) {
|
||||
return ResponseResult.invalid()
|
||||
.setMessage("无效的防护对象ID,也许该ID指定的防护对象不存在?");
|
||||
}
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(EntityUtils.entityToMap(protectObject));
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface ProtectObjectControllerApi {
|
||||
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "上传文件")
|
||||
)
|
||||
ResponseResult uploadFile(
|
||||
@NotNull(message = "uploadFile cannot be null. ") MultipartFile uploadFile
|
||||
@NotNull(message = "uploadFile字段不能为空") MultipartFile uploadFile
|
||||
) throws IOException;
|
||||
|
||||
@GetMapping("/download")
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ProtectObjectService {
|
||||
public Map<String, Object> changeProtectObjectAuditStatus(Integer protectObjectId, Integer auditStatus) {
|
||||
Integer originalAuditStatus = protectObjectMapper.queryProtectObject(protectObjectId).getProtectObjectAuditStatus();
|
||||
if (!AuditStatusValidator.setOriginal(originalAuditStatus).checkValidate(auditStatus)) {
|
||||
throw new IllegalArgumentException("invalid audit status");
|
||||
throw new IllegalArgumentException("无效的审核状态");
|
||||
}
|
||||
Boolean success = protectObjectMapper.changeProtectObjectAuditStatus(protectObjectId, auditStatus);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TemplateController implements TemplateControllerApi {
|
||||
Template template = templateService.queryTemplate(templateId);
|
||||
if (template == null) {
|
||||
return ResponseResult.invalid()
|
||||
.setMessage("invalid templateId, maybe this template doesn't exist?");
|
||||
.setMessage("无效的策略模板ID,也许该模板不存在?");
|
||||
}
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(EntityUtils.entityToMap(template));
|
||||
|
||||
Reference in New Issue
Block a user