feat: get file tags
This commit is contained in:
parent
bccdbb6a55
commit
3bb6a3249f
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user