feat: bookmark replace

This commit is contained in:
zzs 2025-03-06 14:23:47 +08:00
parent a5e2631adc
commit 00665a19a2
6 changed files with 15 additions and 7 deletions

View File

@ -101,7 +101,7 @@ public class BookmarkQuery {
for (CTBookmark bookmark : bookmarks) { for (CTBookmark bookmark : bookmarks) {
String name = bookmark.getName(); String name = bookmark.getName();
results.add(new BookmarkQueryDataModel(name, null)); results.add(new BookmarkQueryDataModel(name, BookmarkType.TEXT));
} }
return new ArrayList<>(results); return new ArrayList<>(results);

View File

@ -1,5 +1,6 @@
package com.wmyun.farmwork.word.core.model; package com.wmyun.farmwork.word.core.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.wmyun.farmwork.word.core.enums.BookmarkType; import com.wmyun.farmwork.word.core.enums.BookmarkType;
@ -16,13 +17,17 @@ import lombok.Data;
@Data @Data
@JsonTypeInfo( @JsonTypeInfo(
use = JsonTypeInfo.Id.NAME, use = JsonTypeInfo.Id.NAME,
property = "type" property = "type",
visible = true
) )
@JsonSubTypes({ @JsonSubTypes({
@JsonSubTypes.Type(value = TextExData.class, name = "TEXT"), @JsonSubTypes.Type(value = TextExData.class, name = "TEXT"),
@JsonSubTypes.Type(value = PictureExData.class, name = "PICTURE") @JsonSubTypes.Type(value = PictureExData.class, name = "PICTURE"),
@JsonSubTypes.Type(value = PictureExData.class, name = "PICTURE_DESC")
}) })
public class AbstractExData { public class AbstractExData {
@JsonProperty("type")
private BookmarkType type; private BookmarkType type;
private String value; private String value;

View File

@ -13,6 +13,9 @@ spring:
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置 - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
codec:
max-in-memory-size: 25MB
cloud: cloud:
# Spring Cloud Gateway 配置项,对应 GatewayProperties 类 # Spring Cloud Gateway 配置项,对应 GatewayProperties 类
gateway: gateway:

View File

@ -33,8 +33,8 @@ public class OfficePreviewController {
@GetMapping("/files/{fileId}") @GetMapping("/files/{fileId}")
@PermitAll @PermitAll
public ResponseEntity<CheckFileInfoVo> getFileInfo(@PathVariable("fileId") String fileId) { public ResponseEntity<CheckFileInfoVo> getFileInfo(@PathVariable("fileId") String fileId, @RequestParam String access_token) {
return ResponseEntity.ok().body(previewService.createPreviewInfo(fileId)); return ResponseEntity.ok().body(previewService.createPreviewInfo(fileId, access_token));
} }
@GetMapping(value = "/files/{fileId}/contents") @GetMapping(value = "/files/{fileId}/contents")

View File

@ -15,7 +15,7 @@ import java.io.InputStream;
public interface FilePreviewService { public interface FilePreviewService {
CheckFileInfoVo createPreviewInfo(String fileId); CheckFileInfoVo createPreviewInfo(String fileId, String access_token);
FileDO queryFileInfoByFileId(String fileId); FileDO queryFileInfoByFileId(String fileId);

View File

@ -45,7 +45,7 @@ public class FilePreviewServiceImpl implements FilePreviewService {
private ConfigService configService; private ConfigService configService;
@Override @Override
public CheckFileInfoVo createPreviewInfo(String fileId) { public CheckFileInfoVo createPreviewInfo(String fileId, String access_token) {
FileDO file = queryFileInfoByFileId(fileId); FileDO file = queryFileInfoByFileId(fileId);
if (file == null) { if (file == null) {
return null; return null;