fix: 调整 applicaiton 接口校验规则
This commit is contained in:
@@ -95,10 +95,13 @@ public class GitController {
|
|||||||
for (Map<String, String> file : files) {
|
for (Map<String, String> file : files) {
|
||||||
String action = T.MapUtil.getStr(file, "action");
|
String action = T.MapUtil.getStr(file, "action");
|
||||||
String path = T.MapUtil.getStr(file, "path");
|
String path = T.MapUtil.getStr(file, "path");
|
||||||
String content = T.MapUtil.getStr(file, "content");
|
if (T.StrUtil.hasEmpty(action, path)) {
|
||||||
if (T.StrUtil.hasEmpty(action, path, content)) {
|
|
||||||
return R.error(RCode.PARAM_CANNOT_EMPTY);
|
return R.error(RCode.PARAM_CANNOT_EMPTY);
|
||||||
}
|
}
|
||||||
|
if (T.StrUtil.equalsAny(action, "create", "update")) {
|
||||||
|
String content = T.MapUtil.getStr(file, "content");
|
||||||
|
T.VerifyUtil.is(content).notEmpty(RCode.PARAM_CANNOT_EMPTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gitService.updateApplication(workspaceId, branchName, lastCommitId, message, files);
|
gitService.updateApplication(workspaceId, branchName, lastCommitId, message, files);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
Reference in New Issue
Block a user