Skip to content

Commit 91e9123

Browse files
committed
[Bug][dinky-admin] Database postgresql adaptation problem
1 parent 0fa4db5 commit 91e9123

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

dinky-admin/src/main/java/org/dinky/service/impl/TenantServiceImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4747
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
48+
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4849
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
4950
import com.fasterxml.jackson.databind.JsonNode;
5051

@@ -175,8 +176,10 @@ public Result<Void> removeTenantById(Integer tenantId) {
175176
if (CollectionUtil.isNotEmpty(userTenants)) {
176177
return Result.failed(Status.TENANT_BINDING_USER);
177178
}
178-
Integer deleteByIdResult = baseMapper.deleteById(tenantId);
179-
if (deleteByIdResult > 0) {
179+
LambdaUpdateWrapper<Tenant> updateWrapper = new LambdaUpdateWrapper<>();
180+
updateWrapper.eq(Tenant::getId, tenantId);
181+
updateWrapper.set(Tenant::getIsDelete, true);
182+
if (update(updateWrapper)) {
180183
return Result.succeed(Status.DELETE_SUCCESS);
181184
} else {
182185
return Result.failed(Status.DELETE_FAILED);

dinky-admin/src/main/java/org/dinky/service/impl/UserServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import org.springframework.util.CollectionUtils;
6969

7070
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
71+
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
7172

7273
import cn.dev33.satoken.secure.SaSecureUtil;
7374
import cn.dev33.satoken.stp.StpUtil;
@@ -162,7 +163,10 @@ public Boolean removeUser(Integer id) {
162163
if (user.getSuperAdminFlag()) {
163164
throw new BusException(Status.USER_SUPERADMIN_CANNOT_DELETE);
164165
}
165-
return baseMapper.deleteById(id) > 0;
166+
LambdaUpdateWrapper<User> updateWrapper = new LambdaUpdateWrapper<>();
167+
updateWrapper.eq(User::getId, id);
168+
updateWrapper.set(User::getIsDelete, true);
169+
return update(updateWrapper);
166170
}
167171

168172
/**

dinky-admin/src/main/resources/mapper/UserMapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
<!-- recoveryUser -->
5151
<update id="recoveryUser" parameterType="java.lang.Integer" >
52-
update dinky_user set is_delete = 0 where id = #{id}
52+
update dinky_user set is_delete = false where id = #{id}
5353
</update>
5454

5555
</mapper>

dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesGateway.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ protected void initConfig() {
118118
final String oldContainerImageKey = "kubernetes.container.image";
119119
if (k8sConfiguration.containsKey(oldContainerImageKey)) {
120120
String containerImageValue = k8sConfiguration.get(oldContainerImageKey);
121-
k8sConfiguration.remove(oldContainerImageKey);
122121
k8sConfiguration.put(KubernetesConfigOptions.CONTAINER_IMAGE.key(), containerImageValue);
123122
}
124123
// -------------------Note: the sequence can not be changed, priority problem----------------

0 commit comments

Comments
 (0)