/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.alibaba.fastjson.JSON * com.jby.common.advisor.annotation.ParamBarrier * com.jby.common.result.Result * com.jby.office.api.FileServiceApi * com.jby.office.domain.param.DownloadFileParam * com.jby.office.domain.param.DownloadParam * com.jby.office.domain.param.FileParam * com.jby.office.domain.param.GenerateFileParam * com.jby.office.domain.param.OfficeFileParseParam * com.jby.office.domain.param.OfficeFileParseRecordParam * com.jby.office.domain.vo.OfficeFileDownloadScheduleVO * com.jby.office.domain.vo.OfficeFileInfoVO * com.jby.office.domain.vo.OfficeFileParseRecordVO * com.jby.office.domain.vo.OfficeFileParseVO * com.jby.officecore.annotation.CostTime * com.jby.officecore.domain.dto.CreateWordDTO * com.jby.officecore.utils.WordExportUtil * com.jby.system.domain.param.NodeParam * javax.annotation.Resource * org.map.utils.BeanMapping * org.slf4j.Logger * org.slf4j.LoggerFactory * org.springframework.web.bind.annotation.GetMapping * org.springframework.web.bind.annotation.PathVariable * org.springframework.web.bind.annotation.PostMapping * org.springframework.web.bind.annotation.RequestBody * org.springframework.web.bind.annotation.RequestMapping * org.springframework.web.bind.annotation.RestController */ package com.jby.officefile.controller; import com.alibaba.fastjson.JSON; import com.jby.common.advisor.annotation.ParamBarrier; import com.jby.common.result.Result; import com.jby.office.api.FileServiceApi; import com.jby.office.domain.param.DownloadFileParam; import com.jby.office.domain.param.DownloadParam; import com.jby.office.domain.param.FileParam; import com.jby.office.domain.param.GenerateFileParam; import com.jby.office.domain.param.OfficeFileParseParam; import com.jby.office.domain.param.OfficeFileParseRecordParam; import com.jby.office.domain.vo.OfficeFileDownloadScheduleVO; import com.jby.office.domain.vo.OfficeFileInfoVO; import com.jby.office.domain.vo.OfficeFileParseRecordVO; import com.jby.office.domain.vo.OfficeFileParseVO; import com.jby.officecore.annotation.CostTime; import com.jby.officecore.domain.dto.CreateWordDTO; import com.jby.officecore.utils.WordExportUtil; import com.jby.officefile.service.FileService; import com.jby.system.domain.param.NodeParam; import java.util.List; import java.util.Objects; import javax.annotation.Resource; import org.map.utils.BeanMapping; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(value={"/file"}) public class FileController implements FileServiceApi { private static final Logger log = LoggerFactory.getLogger(FileController.class); @Resource private FileService fileService; @CostTime @PostMapping(value={"/generate/by/url"}) public Result generateFileByUrl(@RequestBody GenerateFileParam param) { log.info("\u901a\u8fc7word\u8d44\u6e90\u5730\u5740\u751f\u6210\u5728\u7ebf\u7f16\u8f91\u6587\u4ef6(\u5b8c\u6574\u6587\u6863), param={}", (Object)JSON.toJSONString((Object)param)); OfficeFileInfoVO result = this.fileService.generateFileByUrl(param); return Result.success((Object)result); } @CostTime @PostMapping(value={"/generate/by/file"}, consumes={"multipart/form-data"}) public Result generateFileByFile(FileParam param) { log.info("\u901a\u8fc7word\u8d44\u6e90\u6587\u4ef6\u751f\u6210\u5728\u7ebf\u7f16\u8f91\u6587\u4ef6(\u5b8c\u6574\u6587\u6863), param={}", (Object)JSON.toJSONString((Object)param)); OfficeFileInfoVO result = this.fileService.generateFileByFile(param); return Result.success((Object)result); } @CostTime @PostMapping(value={"/parse"}, consumes={"multipart/form-data"}) public Result parseOfficeFile(OfficeFileParseParam param) { OfficeFileParseVO parseVO = this.fileService.parseOfficeFile(param); return Result.success((Object)parseVO); } @CostTime @PostMapping(value={"/download"}, consumes={"multipart/form-data"}) public Result downloadOfficeFile(DownloadFileParam param) { log.info("\u4e0b\u8f7d\u5728\u7ebf\u7f16\u8f91\u6587\u4ef6, file={}, param={}", (Object)Objects.nonNull(param.getPdfFile()), (Object)JSON.toJSONString((Object)param)); String fileUrl = this.fileService.downloadOfficeFile(param); return Result.success((Object)fileUrl); } @CostTime @PostMapping(value={"/v2/download"}) public Result downloadFile(@RequestBody DownloadParam param) { log.info("\u4e0b\u8f7d\u5728\u7ebf\u7f16\u8f91\u6587\u4ef6V2, param={}", (Object)JSON.toJSONString((Object)param)); DownloadFileParam fileParam = (DownloadFileParam)BeanMapping.toBean((Object)param, DownloadFileParam.class); String fileUrl = this.fileService.downloadOfficeFile(fileParam); return Result.success((Object)fileUrl); } @Deprecated @CostTime @PostMapping(value={"/batch/download"}) public Result batchDownloadOfficeFile(@RequestBody NodeParam rootNode) { log.info("\u6279\u91cf\u4e0b\u8f7d\u5728\u7ebf\u6587\u4ef6, \u8282\u70b9\u53c2\u6570rootNode={}", (Object)JSON.toJSONString((Object)rootNode)); OfficeFileDownloadScheduleVO result = this.fileService.batchDownloadOfficeFile(rootNode); return Result.success((Object)result); } @CostTime @PostMapping(value={"/download/word"}) public Result downloadWord(@RequestBody CreateWordDTO param) { log.info("\u4e0b\u8f7dword\u6587\u4ef6, param={}", (Object)JSON.toJSONString((Object)param)); String result = WordExportUtil.createWord((CreateWordDTO)param); return Result.success((Object)result); } @GetMapping(value={"/parse/record/{md5}"}) public Result getOfficeFileParseRecordByMd5(@PathVariable String md5) { OfficeFileParseRecordVO result = this.fileService.getOfficeFileParseRecordByMd5(md5); return Result.success((Object)result); } @PostMapping(value={"/parse/record"}) public Result saveOfficeFileParseRecord(@RequestBody OfficeFileParseRecordParam param) { this.fileService.saveOfficeFileParseRecord(param); return Result.success(); } @PostMapping(value={"/parse/record/query"}) @ParamBarrier(value={"fileIds"}) public Result> queryFileUrlByFileIds(@RequestBody OfficeFileParseRecordParam param) { List result = this.fileService.queryFileUrlByFileIds(param); return Result.success(result); } }