| @@ -5,6 +5,9 @@ public class Constant { | |||||
| public final static int Image_Type_Pub = 1; // 公共镜像 | public final static int Image_Type_Pub = 1; // 公共镜像 | ||||
| public final static int Image_Type_Pri = 0; // 私有镜像 | public final static int Image_Type_Pri = 0; // 私有镜像 | ||||
| public final static int Code_Repo_Pub = 1; // 代码仓库可见性-公开 | |||||
| public final static int Code_Repo_Pri = 0; // 代码仓库可见性-私有 | |||||
| public final static int State_valid = 1; // 有效 | public final static int State_valid = 1; // 有效 | ||||
| public final static int State_invalid = 0; // 无效 | public final static int State_invalid = 0; // 无效 | ||||
| @@ -49,9 +49,16 @@ public class CodeConfigServiceImpl implements CodeConfigService { | |||||
| @Override | @Override | ||||
| public CodeConfig update(CodeConfig codeConfig) { | public CodeConfig update(CodeConfig codeConfig) { | ||||
| LoginUser loginUser = SecurityUtils.getLoginUser(); | LoginUser loginUser = SecurityUtils.getLoginUser(); | ||||
| codeConfig.setUpdateBy(loginUser.getUsername()); | codeConfig.setUpdateBy(loginUser.getUsername()); | ||||
| codeConfig.setUpdateTime(new Date()); | |||||
| if (codeConfig.getCodeRepoVis().equals(Constant.Code_Repo_Pub)) { | |||||
| codeConfig.setVerifyMode(null); | |||||
| codeConfig.setGitUserName(null); | |||||
| codeConfig.setGitPassword(null); | |||||
| codeConfig.setSshKey(null); | |||||
| } | |||||
| this.codeConfigDao.update(codeConfig); | this.codeConfigDao.update(codeConfig); | ||||
| return this.codeConfigDao.queryById(codeConfig.getId()); | return this.codeConfigDao.queryById(codeConfig.getId()); | ||||
| } | } | ||||
| @@ -23,18 +23,10 @@ | |||||
| <if test="codeConfig.gitBranch != null and codeConfig.gitBranch != ''"> | <if test="codeConfig.gitBranch != null and codeConfig.gitBranch != ''"> | ||||
| git_branch = #{codeConfig.gitBranch}, | git_branch = #{codeConfig.gitBranch}, | ||||
| </if> | </if> | ||||
| <if test="codeConfig.verifyMode != null"> | |||||
| verify_mode = #{codeConfig.verifyMode}, | |||||
| </if> | |||||
| <if test="codeConfig.gitUserName != null and codeConfig.gitUserName != ''"> | |||||
| git_user_name = #{codeConfig.gitUserName}, | |||||
| </if> | |||||
| <if test="codeConfig.gitPassword != null and codeConfig.gitPassword != ''"> | |||||
| git_password = #{codeConfig.gitPassword}, | |||||
| </if> | |||||
| <if test="codeConfig.sshKey != null and codeConfig.sshKey != ''"> | |||||
| ssh_key = #{codeConfig.sshKey}, | |||||
| </if> | |||||
| verify_mode = #{codeConfig.verifyMode}, | |||||
| git_user_name = #{codeConfig.gitUserName}, | |||||
| git_password = #{codeConfig.gitPassword}, | |||||
| ssh_key = #{codeConfig.sshKey}, | |||||
| <if test="codeConfig.createBy != null and codeConfig.createBy != ''"> | <if test="codeConfig.createBy != null and codeConfig.createBy != ''"> | ||||
| create_by = #{codeConfig.createBy}, | create_by = #{codeConfig.createBy}, | ||||
| </if> | </if> | ||||