| | |
| | | attach.setOrderByCreateTime(true); |
| | | attach.setAreaCode(HeaderUtils.getAreaCode()); |
| | | |
| | | List<Integer> integers = Arrays.asList(0, 2, 4, 5); |
| | | List<String> integers = Arrays.asList("0", "2", "4", "5"); |
| | | attach.setResultTypes(integers); |
| | | List<Integer> resultTypes = attach.getResultTypes(); |
| | | List<String> resultTypes = attach.getResultTypes(); |
| | | String wordOrderType = attach.getWordOrderType(); |
| | | settingResultType(attach, wordOrderType, resultTypes); |
| | | |
| | |
| | | * @param wordOrderType |
| | | * @param resultTypes |
| | | */ |
| | | private static void settingResultType(AttachVO attach, String wordOrderType, List<Integer> resultTypes) { |
| | | private static void settingResultType(AttachVO attach, String wordOrderType, List<String> resultTypes) { |
| | | if (!StringUtils.isEmpty(wordOrderType) && !CollectionUtils.isEmpty(resultTypes)) { |
| | | if ("-1".equals(wordOrderType)) { |
| | | attach.setWordOrderType(null); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public BladeFile saveAttachFile(MultipartFile file, String fileName, Integer type) throws IOException { |
| | | public BladeFile saveAttachFile(MultipartFile file, String fileName, String type) throws IOException { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(pojo.getBucket(),fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile, type); |
| | | bladeFile.setAttachId(attachId); |
| | |
| | | return bladeFile; |
| | | } |
| | | |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile, Integer type) { |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile, String type) { |
| | | String fileExtension = FileUtil.getFileExtension(fileName); |
| | | Attach attach = new Attach(); |
| | | attach.setDomainUrl(bladeFile.getDomain()); |