fix (接口定义): 全局环境设置更新

This commit is contained in:
fit2-zhao 2021-08-23 17:16:56 +08:00 committed by fit2-zhao
parent a38b3998b4
commit c376d92947
1 changed files with 6 additions and 1 deletions

View File

@ -21,8 +21,13 @@ public class ApiDefinitionEnvService {
env.setId(UUID.randomUUID().toString());
env.setCreateTime(System.currentTimeMillis());
env.setUpdateTime(System.currentTimeMillis());
if (this.get(env.getUserId()) == null) {
ApiDefinitionEnv apiDefinitionEnv = this.get(env.getUserId());
if (apiDefinitionEnv == null) {
apiDefinitionEnvMapper.insert(env);
} else {
apiDefinitionEnv.setEnvId(env.getEnvId());
apiDefinitionEnv.setUpdateTime(System.currentTimeMillis());
apiDefinitionEnvMapper.updateByPrimaryKey(apiDefinitionEnv);
}
}