fix: 调整 applicaiton 接口校验规则
This commit is contained in:
@@ -95,10 +95,13 @@ public class GitController {
|
||||
for (Map<String, String> file : files) {
|
||||
String action = T.MapUtil.getStr(file, "action");
|
||||
String path = T.MapUtil.getStr(file, "path");
|
||||
String content = T.MapUtil.getStr(file, "content");
|
||||
if (T.StrUtil.hasEmpty(action, path, content)) {
|
||||
if (T.StrUtil.hasEmpty(action, path)) {
|
||||
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);
|
||||
return R.ok();
|
||||
|
||||
Reference in New Issue
Block a user