月球大数据地理空间分析展示平台-【后端】-月球后台服务
1
13693261870
2023-07-10 864a545636b2ca6aeee4afbdb4d6b0acd6238925
1
已修改2个文件
41 ■■■■ 文件已修改
src/main/java/com/moon/server/config/InitConfig.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/controller/sys/ResController.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/config/InitConfig.java
@@ -7,11 +7,12 @@
import com.moon.server.helper.PathHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
 * 初始化完成配置类
@@ -21,16 +22,16 @@
public class InitConfig implements ApplicationRunner {
    private final static Log log = LogFactory.getLog(InitConfig.class);
    @Autowired
    @Resource
    PathHelper pathHelper;
    @Autowired
    @Resource
    ArgsService argsService;
    @Autowired
    @Resource
    Environment env;
    //@Autowired
    //@Resource
    //TestService testService;
    @Override
src/main/java/com/moon/server/controller/sys/ResController.java
@@ -5,6 +5,7 @@
import com.moon.server.entity.all.ResponseMsg;
import com.moon.server.entity.sys.ResEntity;
import com.moon.server.entity.sys.UserEntity;
import com.moon.server.service.all.PermsService;
import com.moon.server.service.all.UploadAttachService;
import com.moon.server.service.sys.ResService;
import com.moon.server.service.sys.TokenService;
@@ -12,10 +13,10 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@@ -28,13 +29,16 @@
@RestController
@RequestMapping("/res")
public class ResController extends BaseController {
    @Autowired
    @Resource
    ResService resService;
    @Autowired
    @Resource
    TokenService tokenService;
    @Autowired
    @Resource
    PermsService permsService;
    @Resource
    UploadAttachService uploadAttachService;
    private final static String TAB_NAME = "lf.sys_res";
@@ -161,6 +165,9 @@
            }
            int count = resService.insert(entity);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -184,6 +191,9 @@
            }
            int count = resService.inserts(list);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -200,6 +210,9 @@
    public ResponseMsg<Integer> delete(int id) {
        try {
            int count = resService.delete(id);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -220,6 +233,9 @@
            }
            int count = resService.deletes(ids);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -242,6 +258,9 @@
            }
            int count = resService.update(entity);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -266,6 +285,9 @@
            }
            int count = resService.updates(list);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {