feat: bookmark replace
This commit is contained in:
parent
a5e2631adc
commit
00665a19a2
@ -101,7 +101,7 @@ public class BookmarkQuery {
|
||||
|
||||
for (CTBookmark bookmark : bookmarks) {
|
||||
String name = bookmark.getName();
|
||||
results.add(new BookmarkQueryDataModel(name, null));
|
||||
results.add(new BookmarkQueryDataModel(name, BookmarkType.TEXT));
|
||||
}
|
||||
|
||||
return new ArrayList<>(results);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.wmyun.farmwork.word.core.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.wmyun.farmwork.word.core.enums.BookmarkType;
|
||||
@ -16,13 +17,17 @@ import lombok.Data;
|
||||
@Data
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
property = "type"
|
||||
property = "type",
|
||||
visible = true
|
||||
)
|
||||
@JsonSubTypes({
|
||||
@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 {
|
||||
|
||||
@JsonProperty("type")
|
||||
private BookmarkType type;
|
||||
|
||||
private String value;
|
||||
|
@ -13,6 +13,9 @@ spring:
|
||||
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
||||
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
||||
|
||||
codec:
|
||||
max-in-memory-size: 25MB
|
||||
|
||||
cloud:
|
||||
# Spring Cloud Gateway 配置项,对应 GatewayProperties 类
|
||||
gateway:
|
||||
|
@ -33,8 +33,8 @@ public class OfficePreviewController {
|
||||
|
||||
@GetMapping("/files/{fileId}")
|
||||
@PermitAll
|
||||
public ResponseEntity<CheckFileInfoVo> getFileInfo(@PathVariable("fileId") String fileId) {
|
||||
return ResponseEntity.ok().body(previewService.createPreviewInfo(fileId));
|
||||
public ResponseEntity<CheckFileInfoVo> getFileInfo(@PathVariable("fileId") String fileId, @RequestParam String access_token) {
|
||||
return ResponseEntity.ok().body(previewService.createPreviewInfo(fileId, access_token));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/files/{fileId}/contents")
|
||||
|
@ -15,7 +15,7 @@ import java.io.InputStream;
|
||||
|
||||
public interface FilePreviewService {
|
||||
|
||||
CheckFileInfoVo createPreviewInfo(String fileId);
|
||||
CheckFileInfoVo createPreviewInfo(String fileId, String access_token);
|
||||
|
||||
FileDO queryFileInfoByFileId(String fileId);
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class FilePreviewServiceImpl implements FilePreviewService {
|
||||
private ConfigService configService;
|
||||
|
||||
@Override
|
||||
public CheckFileInfoVo createPreviewInfo(String fileId) {
|
||||
public CheckFileInfoVo createPreviewInfo(String fileId, String access_token) {
|
||||
FileDO file = queryFileInfoByFileId(fileId);
|
||||
if (file == null) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user