管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-25 4ddfd502023662f6d25c4be416d88751e206d91a
src/main/java/com/lf/server/controller/sys/AuthController.java
@@ -5,6 +5,7 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.sys.AuthEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.service.all.PermsService;
import com.lf.server.service.sys.AuthService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
@@ -31,6 +32,9 @@
    @Autowired
    TokenService tokenService;
    @Autowired
    PermsService permsService;
    @SysLog()
    @ApiOperation(value = "查询记录数")
@@ -136,6 +140,9 @@
            }
            int count = authService.insertAuth(entity);
            if (count > 0) {
                permsService.clearPermsCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -159,6 +166,9 @@
            }
            int count = authService.insertAuths(list);
            if (count > 0) {
                permsService.clearPermsCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -175,6 +185,9 @@
    public ResponseMsg<Integer> deleteAuth(int id) {
        try {
            int count = authService.deleteAuth(id);
            if (count > 0) {
                permsService.clearPermsCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -193,7 +206,12 @@
            if (ids == null || ids.isEmpty()) {
                return fail("id数组不能为空", -1);
            }
            int count = authService.deleteAuths(ids);
            if (count > 0) {
                permsService.clearPermsCache();
            }
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
@@ -215,6 +233,9 @@
            }
            int count = authService.updateAuth(entity);
            if (count > 0) {
                permsService.clearPermsCache();
            }
            return success(count);
        } catch (Exception ex) {