| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @RestController |
| | | @RequestMapping("/lingyang") |
| | | public class AntelopeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SystemLoginService systemLoginService; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | | * @date 2022/04/18 18:12 |
| | |
| | | public ApiResponse<String> loginDemo( @RequestParam("token") String token , HttpServletRequest request) throws Exception{ |
| | | return ApiResponse.success(systemLoginService.loginLingYangDemo( token, request)); |
| | | } |
| | | @ApiOperation(value = "导入", notes = "导入", httpMethod = "POST", position = 6) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/importBatch", headers = "content-type=multipart/form-data") |
| | | public ApiResponse importmaterial(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | CommonsMultipartResolver multipartResovler = new CommonsMultipartResolver(); |
| | | String r = null; |
| | | if (multipartResovler.isMultipart(request)) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | Iterator<String> it = multipartRequest.getFileNames(); |
| | | |
| | | while (it.hasNext()) { |
| | | MultipartFile file = multipartRequest.getFile((String) it.next());// file |
| | | r = systemLoginService.importLyAuth(file,request); |
| | | break; |
| | | } |
| | | } |
| | | return ApiResponse.success( r); |
| | | } |
| | | } |