feat: get file tags

This commit is contained in:
zzs 2025-03-01 15:28:58 +08:00
parent bccdbb6a55
commit 3bb6a3249f
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
package com.wmyun.module.infra.controller.admin.word;
import com.wmyun.framework.common.exception.ErrorCode;
import com.wmyun.farmwork.word.core.model.gen.TagsGenDataModel;
import com.wmyun.framework.common.pojo.CommonResult;
import com.wmyun.module.infra.service.file.WordTemplateTagService;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Description: TODO
* @Date: 2025/3/1 10:31
@ -25,7 +27,7 @@ public class WordTemplateController {
private WordTemplateTagService wordService;
@PostMapping("file/{fileId}")
public CommonResult<Object> requestAllTags(@PathVariable("fileId") String fileId) {
public CommonResult<List<TagsGenDataModel>> requestAllTags(@PathVariable("fileId") String fileId) {
try {
return CommonResult.success(wordService.queryAllTag(fileId));
} catch (Exception e) {

View File

@ -1,5 +1,9 @@
package com.wmyun.module.infra.service.file;
import com.wmyun.farmwork.word.core.model.gen.TagsGenDataModel;
import java.util.List;
/**
* @Classname WordTemplateTagService
* @Description TODO
@ -9,5 +13,5 @@ package com.wmyun.module.infra.service.file;
public interface WordTemplateTagService {
Object queryAllTag(String fileId) throws Exception;
List<TagsGenDataModel> queryAllTag(String fileId) throws Exception;
}

View File

@ -33,7 +33,7 @@ public class WordTemplateTagServiceImpl implements WordTemplateTagService {
private FileConfigService fileConfigService;
@Override
public Object queryAllTag(String fileId) throws Exception {
public List<TagsGenDataModel> queryAllTag(String fileId) throws Exception {
FileDO file = previewService.queryFileInfoByFileId(fileId);
FileClient client = fileConfigService.getFileClient(file.getConfigId());
byte[] content = client.getContent(file.getPath());