fix: 按文档调整 git update 接口,create,update 动作必须存在内容

This commit is contained in:
shizhendong
2024-11-04 18:04:58 +08:00
parent e210cb7cd0
commit 25992507a6

View File

@@ -152,10 +152,10 @@ public class GitController {
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);
// }
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();