Ver código fonte

代码整理优化

gaodm 6 anos atrás
pai
commit
edcb6696a9

+ 2 - 3
icssman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -27,11 +27,10 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .csrf().disable()
                 .authorizeRequests()
                 .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
-                .antMatchers("/file/deleteRemoteFile").permitAll()
-                .antMatchers("/file/uploadImage").permitAll()
+//                .antMatchers("/icssfile/deleteRemoteFile").permitAll()
+//                .antMatchers("/icssfile/uploadImage").permitAll()
                 .antMatchers("/introduceInfo/saveIntroduce").permitAll()
                 .antMatchers("/dictionaryInfo/getList").permitAll()
-                .antMatchers("/deptInfo/getAllDepts").permitAll()
                 .antMatchers("/getIcssEnumsData").permitAll()
                 .antMatchers("/**").authenticated();
 //                        .antMatchers("/**").permitAll();

+ 2 - 3
icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -89,11 +89,10 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/druid/**", request)
                 || matchers("/actuator/**", request)
                 || matchers("/hystrix/**", request)
-                || matchers("/file/deleteRemoteFile", request)
-                || matchers("/file/uploadImage", request)
+//                || matchers("/icssfile/deleteRemoteFile", request)
+//                || matchers("/icssfile/uploadImage", request)
                 || matchers("/getIcssEnumsData", request)
                 || matchers("/dictionaryInfo/getList", request)
-                || matchers("/deptInfo/getAllDepts", request)
                 || matchers("/", request)) {
             return true;
         }

+ 48 - 48
icssman-service/src/main/java/com/diagbot/web/UploadController.java

@@ -1,48 +1,48 @@
-package com.diagbot.web;
-
-import com.diagbot.dto.FileDTO;
-import com.diagbot.facade.UploadFacade;
-import com.diagbot.util.FastJsonUtils;
-import com.diagbot.util.StringUtil;
-import io.swagger.annotations.Api;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-@RestController
-@Api(value = "文件上传API", tags = { "文件上传API" })
-@RequestMapping(value = "/file")
-@SuppressWarnings("unchecked")
-public class UploadController {
-    @Autowired
-    private UploadFacade uploadFacade;
-
-    @CrossOrigin(allowCredentials = "true", allowedHeaders = "*", methods = { RequestMethod.POST }, origins = "*")
-    @PostMapping(value = "/uploadImage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
-    public String singleFileUpload(@RequestParam("upfile") MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
-        FileDTO fileDTO = uploadFacade.singleFileUpload(file);
-        String data = FastJsonUtils.getBeanToJson(fileDTO);
-        response.setContentType("text/plain;charset=UTF-8");
-
-        String callback = request.getParameter("callback");//客户端请求参数
-        if (callback != null && StringUtil.isNotBlank(callback)) {
-            data = callback + "(" + data + ")";
-        }
-        return data;
-    }
-
-    @PostMapping("/deleteRemoteFile")
-    public String deleteRemoteFile(@RequestParam("path") String path) {
-        String data = FastJsonUtils.getBeanToJson(uploadFacade.deleteRemoteFile(path));
-        return data;
-    }
-}
+//package com.diagbot.web;
+//
+//import com.diagbot.dto.FileDTO;
+//import com.diagbot.facade.UploadFacade;
+//import com.diagbot.util.FastJsonUtils;
+//import com.diagbot.util.StringUtil;
+//import io.swagger.annotations.Api;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.http.MediaType;
+//import org.springframework.web.bind.annotation.CrossOrigin;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RequestMethod;
+//import org.springframework.web.bind.annotation.RequestParam;
+//import org.springframework.web.bind.annotation.RestController;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//
+//@RestController
+//@Api(value = "文件上传API", tags = { "文件上传API" })
+//@RequestMapping(value = "/icssfile")
+//@SuppressWarnings("unchecked")
+//public class UploadController {
+//    @Autowired
+//    private UploadFacade uploadFacade;
+//
+//    @CrossOrigin(allowCredentials = "true", allowedHeaders = "*", methods = { RequestMethod.POST }, origins = "*")
+//    @PostMapping(value = "/uploadImage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+//    public String singleFileUpload(@RequestParam("upfile") MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
+//        FileDTO fileDTO = uploadFacade.singleFileUpload(file);
+//        String data = FastJsonUtils.getBeanToJson(fileDTO);
+//        response.setContentType("text/plain;charset=UTF-8");
+//
+//        String callback = request.getParameter("callback");//客户端请求参数
+//        if (callback != null && StringUtil.isNotBlank(callback)) {
+//            data = callback + "(" + data + ")";
+//        }
+//        return data;
+//    }
+//
+//    @PostMapping("/deleteRemoteFile")
+//    public String deleteRemoteFile(@RequestParam("path") String path) {
+//        String data = FastJsonUtils.getBeanToJson(uploadFacade.deleteRemoteFile(path));
+//        return data;
+//    }
+//}