Merge branch 'feature/REQ-3540' into 'master'
Revert "REQ-3540: rename element to precise names" See merge request universal/infrastructure/backend/nanopart!130
This commit is contained in:
commit
d4e4c138be
49
doc/doc-api/pom.xml
Normal file
49
doc/doc-api/pom.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>doc</artifactId>
|
||||
<groupId>cn.axzo.nanopart</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>doc-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>doc-api</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.maokai</groupId>
|
||||
<artifactId>maokai-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-openfeign-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-common-domain</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework.rocketmq</groupId>
|
||||
<artifactId>axzo-common-rocketmq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-common-domain</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,92 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.anonymous;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.anonymous.request.AnonymousCreateDirRequest;
|
||||
import cn.axzo.nanopart.doc.api.anonymous.request.AnonymousCreateFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.anonymous.request.AnonymousUploadFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeInfo;
|
||||
import cn.axzo.nanopart.doc.api.index.request.CopyNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.DeleteNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.GetNodeInfoRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.RenameNodeRequest;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface DocAnonymousDatabaseApi {
|
||||
|
||||
/**
|
||||
* 创建文件夹
|
||||
*
|
||||
* @return 文件夹编码, 需要由业务存储
|
||||
*/
|
||||
@PostMapping("/api/anonymous/createDir")
|
||||
CommonResponse<String> createDir(@RequestBody @Valid AnonymousCreateDirRequest request);
|
||||
|
||||
/**
|
||||
* 创建新文件
|
||||
*
|
||||
* @return 文件编码, 需要由业务存储
|
||||
*/
|
||||
@PostMapping("/api/anonymous/createFile")
|
||||
CommonResponse<String> createFile(@RequestBody @Valid AnonymousCreateFileRequest request);
|
||||
|
||||
/**
|
||||
* 创建新文件
|
||||
*
|
||||
* @return 文件编码, 需要由业务存储
|
||||
*/
|
||||
@PostMapping("/api/anonymous/createFile2")
|
||||
CommonResponse<IndexNodeInfo> createFile2(@RequestBody @Valid AnonymousCreateFileRequest request);
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @return 文件编码, 需要由业务存储
|
||||
*/
|
||||
@PostMapping("/api/anonymous/uploadFile")
|
||||
CommonResponse<String> uploadFile(@RequestBody @Valid AnonymousUploadFileRequest request);
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @return 文件编码, 需要由业务存储
|
||||
*/
|
||||
@PostMapping("/api/anonymous/uploadFile2")
|
||||
CommonResponse<IndexNodeInfo> uploadFile2(@RequestBody @Valid AnonymousUploadFileRequest request);
|
||||
|
||||
/**
|
||||
* 拷贝节点 (文件)
|
||||
*
|
||||
* @return 根节点的code
|
||||
*/
|
||||
@PostMapping("/api/anonymous/copy")
|
||||
CommonResponse<String> copy(@RequestBody @Valid CopyNodeRequest request);
|
||||
|
||||
/**
|
||||
* 删除节点 (文件)
|
||||
*/
|
||||
@PostMapping("/api/anonymous/delete")
|
||||
CommonResponse<Void> delete(@RequestBody @Valid DeleteNodeRequest request);
|
||||
|
||||
/**
|
||||
* 重命名节点 (文件)
|
||||
*/
|
||||
@PostMapping("/api/anonymous/rename")
|
||||
CommonResponse<Void> rename(@RequestBody @Valid RenameNodeRequest request);
|
||||
|
||||
/**
|
||||
* 获取节点信息
|
||||
*/
|
||||
@PostMapping("/api/anonymous/getNodeInfo")
|
||||
CommonResponse<IndexNodeInfo> getNodeInfo(@RequestBody @Valid GetNodeInfoRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.anonymous.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class AnonymousCreateDirRequest extends NodeCreateAnonymous {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package cn.axzo.nanopart.doc.api.anonymous.request;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFormat;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class AnonymousCreateFileRequest extends NodeCreateAnonymous {
|
||||
|
||||
/**
|
||||
* 文件格式. EXCEL, WORD, PDF
|
||||
*/
|
||||
@NotNull(message = "文件格式不能为空")
|
||||
private FileFormat format;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package cn.axzo.nanopart.doc.api.anonymous.request;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.OssFile;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class AnonymousUploadFileRequest extends NodeCreateAnonymous {
|
||||
|
||||
/**
|
||||
* 上传的文件信息
|
||||
*/
|
||||
@Valid
|
||||
@NotNull(message = "上传的文件信息不能为空")
|
||||
private OssFile ossFile;
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.anonymous.request;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeAttributes;
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeScope;
|
||||
import cn.axzo.nanopart.doc.api.domain.NodeCreate;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeContext;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
abstract class NodeCreateAnonymous implements NodeCreate, IndexNodeScope {
|
||||
|
||||
/**
|
||||
* 父节点code, 创建在根目录时可以不传
|
||||
*/
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* 节点(文件名/文件夹), 不含后缀
|
||||
*/
|
||||
@NotBlank(message = "name不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 业务(场景)
|
||||
*/
|
||||
@NotBlank(message = "biz不能为空")
|
||||
private String biz;
|
||||
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
@NotBlank(message = "bizCode不能为空")
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 创建人personId
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
@Override
|
||||
public String biz() {
|
||||
return biz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String bizCode() {
|
||||
return bizCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long operatorId() {
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IndexNodeScope nodeScope() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IndexNodeContext context() {
|
||||
return IndexNodeContext.FILE_DATABASE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final DatabaseScope scope() {
|
||||
return DatabaseScope.ANONYMOUS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String parentCode() {
|
||||
return parentCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IndexNodeAttributes attributes() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.autoconfig;
|
||||
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@EnableFeignClients("cn.axzo.nanopart.doc")
|
||||
public class DocAutoConfiguration {
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.CooperationAccessOption;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseManageOption;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class DatabaseAccessConfig {
|
||||
|
||||
/**
|
||||
* 谁可以管理该空间. PEOPLE_HAS_MANAGE_PERMISSION: 拥有"可管理"权限的所有人, WORKSPACE_AND_DATABASE_SUPER_ADMIN: 租房超级管理员、空间超管
|
||||
*/
|
||||
private DatabaseManageOption manageOption;
|
||||
|
||||
/**
|
||||
* 协作企业可见范围. ALL_ORGS_IN_PROJECT: 项目内所有企业可见, ORGS_BY_COOPERATE_TYPES: 指定参建单位可见
|
||||
*/
|
||||
private CooperationAccessOption coopAccessOption;
|
||||
|
||||
/**
|
||||
* 指定参建单位可见. 1: 总包, 13: 设计单位, 12: 勘察单位, 3: 监理单位, 5: 专业分包, 4: 劳务分包, 9: 项目内班组
|
||||
*/
|
||||
private Set<Integer> accessCooperateTypes = Collections.emptySet();
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.CooperationType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class DatabaseAttributes {
|
||||
|
||||
/**
|
||||
* PRIVATE: 协作模式, SHARED: 共享模式
|
||||
*/
|
||||
private CooperationType databaseCooperationType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileTemplateFeeType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class DatabaseFeeConfig {
|
||||
|
||||
/**
|
||||
* 空间收费方式. FREE: 免费, ANNUAL: 年费制, ONE_TIME_FEE: 买断
|
||||
*/
|
||||
private FileTemplateFeeType feeType;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
/**
|
||||
* 基础容量
|
||||
*/
|
||||
private Integer basicCapacity;
|
||||
|
||||
/**
|
||||
* 是否支持扩容
|
||||
*/
|
||||
private Boolean extendable;
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class DirectoryAttributes {
|
||||
|
||||
/**
|
||||
* mock字段, 暂时避免序列化错误
|
||||
*/
|
||||
private boolean placeholder;
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFormat;
|
||||
import com.aliyuncs.utils.StringUtils;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileAttributes {
|
||||
|
||||
/**
|
||||
* 文件后缀, 比如:
|
||||
*/
|
||||
private String fileExtension;
|
||||
|
||||
/**
|
||||
* 文件格式. EXCEL, WORD, PDF
|
||||
*/
|
||||
private FileFormat fileFormat;
|
||||
|
||||
/**
|
||||
* oss文件key
|
||||
*/
|
||||
private String ossFileKey;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 文档创建者 Id
|
||||
*/
|
||||
private String creatorId;
|
||||
|
||||
/**
|
||||
* 文档最后修改者 Id
|
||||
*/
|
||||
private String modifierId;
|
||||
|
||||
/**
|
||||
* 返回version
|
||||
* version最小为1
|
||||
*/
|
||||
public Integer fetchVersion(){
|
||||
if (Objects.isNull(version) || version <= 0) {
|
||||
return 1;
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回modifierId
|
||||
* 修改人为空则返回创建人
|
||||
*/
|
||||
public String fetchModifierId(){
|
||||
if (StringUtils.isEmpty(modifierId)) {
|
||||
return creatorId;
|
||||
}
|
||||
return modifierId;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileTemplateState;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateNodeInfo {
|
||||
|
||||
/**
|
||||
* 文件模版状态. UNPUBLISH: 未上架, PUBLISHED: 已上架
|
||||
*/
|
||||
private FileTemplateState state;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class IndexNodeAttributes {
|
||||
|
||||
/**
|
||||
* 是否为自定义的图标
|
||||
*/
|
||||
private Boolean customIcon;
|
||||
|
||||
/**
|
||||
* 是否资料库创建的节点
|
||||
*/
|
||||
private Boolean templateDatabaseNode;
|
||||
|
||||
/**
|
||||
* 数据库属性
|
||||
*/
|
||||
private DatabaseAttributes databaseAttributes;
|
||||
|
||||
/**
|
||||
* 目录属性
|
||||
*/
|
||||
private DirectoryAttributes directoryAttributes;
|
||||
|
||||
/**
|
||||
* 文件属性
|
||||
*/
|
||||
private FileAttributes fileAttributes;
|
||||
|
||||
public static IndexNodeAttributes create() {
|
||||
return new IndexNodeAttributes();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
public DatabaseAttributes getOrCreateDatabaseAttributes() {
|
||||
if (databaseAttributes == null)
|
||||
databaseAttributes = new DatabaseAttributes();
|
||||
return databaseAttributes;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
public DirectoryAttributes getOrCreateDirectoryAttributes() {
|
||||
if (directoryAttributes == null)
|
||||
directoryAttributes = new DirectoryAttributes();
|
||||
return directoryAttributes;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
public FileAttributes getOrCreateFileAttributes() {
|
||||
if (fileAttributes == null)
|
||||
fileAttributes = new FileAttributes();
|
||||
return fileAttributes;
|
||||
}
|
||||
|
||||
public IndexNodeAttributes copy() {
|
||||
return JSON.parseObject(JSON.toJSONString(this), IndexNodeAttributes.class);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,174 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import cn.axzo.maokai.api.vo.response.tree.NodeValue;
|
||||
import cn.axzo.maokai.api.vo.response.tree.ValueContainer;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeContext;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeState;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeType;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.domain.TemplateDatabaseInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class IndexNodeInfo implements NodeValue, ValueContainer<IndexNodeInfo> {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 系统编码, 文件编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 父节点code
|
||||
*/
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* 根节点code
|
||||
*/
|
||||
private String rootCode;
|
||||
|
||||
/**
|
||||
* 业务编码, 空间或文件夹在页面上填的编码
|
||||
*/
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 节点类型. DATABASE: 空间(数据库), DIRECTORY: 目录, FILE: 文件
|
||||
*/
|
||||
private IndexNodeType nodeType;
|
||||
|
||||
/**
|
||||
* 上下文. NONE: 无上下文, SYSTEM: 系统内置, FILE_TEMPLATE: 文件模版, TEMPLATE_DATABASE: 模版数据库, FILE_DATABASE: 数据库
|
||||
*/
|
||||
private IndexNodeContext context;
|
||||
|
||||
/**
|
||||
* 作用范围. NONE: 无, ENT_DATABASE: 企业数据库, PROJECT_DATABASE: 项目数据库, PERSONAL_DATABASE: 个人数据库
|
||||
*/
|
||||
private DatabaseScope scope;
|
||||
|
||||
/**
|
||||
* 作用范围code
|
||||
*/
|
||||
private String scopeCode;
|
||||
|
||||
/**
|
||||
* 路径, id拼起来, 以斜杠开头和结束. /1/2/3/
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 文件的大小(bytes), 只有文件才存这个字段
|
||||
*/
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 状态. VALID: 有效的
|
||||
*/
|
||||
private IndexNodeState state;
|
||||
|
||||
/**
|
||||
* 子结点, 只有getTree接口会返回
|
||||
*/
|
||||
private List<IndexNodeInfo> children;
|
||||
|
||||
@Override
|
||||
public void addChild(IndexNodeInfo child) {
|
||||
if (children == null)
|
||||
children = new ArrayList<>();
|
||||
children.add(child);
|
||||
}
|
||||
|
||||
// !! custom
|
||||
|
||||
/**
|
||||
* 是否可以添加更多的子节点, 只有getTree接口会返回
|
||||
*/
|
||||
private boolean addMoreChildren;
|
||||
|
||||
/**
|
||||
* 模版市场节点相关的信息
|
||||
*/
|
||||
private FileTemplateNodeInfo fileTemplateNodeInfo;
|
||||
|
||||
/**
|
||||
* 资料库信息
|
||||
*/
|
||||
private TemplateDatabaseInfo templateDatabaseInfo;
|
||||
|
||||
private IndexNodeAttributes attributes;
|
||||
|
||||
public Path path() {
|
||||
return Path.wrap(path);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@JSONField(serialize = false)
|
||||
public IndexNodeAttributes getOrCreateAttributes() {
|
||||
if (attributes == null)
|
||||
attributes = new IndexNodeAttributes();
|
||||
return attributes;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@JSONField(serialize = false)
|
||||
public FileTemplateNodeInfo getOrCreateFileTemplateNodeInfo() {
|
||||
if (fileTemplateNodeInfo == null)
|
||||
fileTemplateNodeInfo = new FileTemplateNodeInfo();
|
||||
return fileTemplateNodeInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long parentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@JSONField(serialize = false)
|
||||
public boolean isValueRoot() {
|
||||
return parentId == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public interface IndexNodeParentScope {
|
||||
|
||||
IndexNodeScope nodeScope();
|
||||
|
||||
default String parentCode() {
|
||||
return IndexNodeScope.TREE_ROOT_NODE_CODE;
|
||||
}
|
||||
|
||||
IndexNodeParentScope TEMPLATE_DATABASE_ALL_SCOPES_ROOT = () -> IndexNodeScope.TEMPLATE_DATABASE_ALL_SCOPES;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeContext;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public interface IndexNodeScope {
|
||||
|
||||
IndexNodeContext context();
|
||||
|
||||
default DatabaseScope scope() {
|
||||
return DatabaseScope.NONE;
|
||||
}
|
||||
|
||||
default String scopeCode() {
|
||||
return TREE_ROOT_NODE_CODE;
|
||||
}
|
||||
|
||||
String TREE_ROOT_NODE_CODE = "";
|
||||
|
||||
Long TREE_ROOT_NODE_ID = 0L;
|
||||
|
||||
IndexNodeScope FILE_TEMPLATE = () -> IndexNodeContext.FILE_TEMPLATE;
|
||||
|
||||
IndexNodeScope TEMPLATE_DATABASE_ALL_SCOPES = () -> IndexNodeContext.TEMPLATE_DATABASE;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public interface NodeCreate extends IndexNodeParentScope {
|
||||
|
||||
default String biz() {
|
||||
return "";
|
||||
}
|
||||
|
||||
default String bizCode() {
|
||||
return "";
|
||||
}
|
||||
|
||||
default void setBizCode(String bizCode) {
|
||||
}
|
||||
|
||||
default String name() {
|
||||
return "";
|
||||
}
|
||||
|
||||
default String description() {
|
||||
return "";
|
||||
}
|
||||
|
||||
default String icon() {
|
||||
return "";
|
||||
}
|
||||
|
||||
default IndexNodeAttributes attributes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default Long operatorId() {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class OssFile {
|
||||
|
||||
/**
|
||||
* 格式. EXCEL, WORD, PDF
|
||||
*/
|
||||
private FileFormat format;
|
||||
/**
|
||||
* 大小, bytes大小
|
||||
*/
|
||||
private int size;
|
||||
/**
|
||||
* oss文件key
|
||||
*/
|
||||
private String ossFileKey;
|
||||
/**
|
||||
* 文件后缀, 比如: doc, docx
|
||||
*/
|
||||
private String extension;
|
||||
|
||||
public static OssFile create(FileFormat format, String extension, int size, String ossFileKey) {
|
||||
OssFile ossFile = new OssFile();
|
||||
ossFile.setFormat(format);
|
||||
ossFile.setExtension(extension);
|
||||
ossFile.setSize(size);
|
||||
ossFile.setOssFileKey(ossFileKey);
|
||||
return ossFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class Path {
|
||||
|
||||
private static final Splitter SPLITTER = Splitter.on("/").omitEmptyStrings().trimResults();
|
||||
|
||||
private final List<String> segments;
|
||||
|
||||
public static Path wrap(String path) {
|
||||
return new Path(SPLITTER.splitToList(path));
|
||||
}
|
||||
|
||||
public static Path empty() {
|
||||
return new Path(Collections.emptyList());
|
||||
}
|
||||
|
||||
public Path append(String path) {
|
||||
ArrayList<String> segments = new ArrayList<>(this.segments.size() + 1);
|
||||
segments.addAll(this.segments);
|
||||
segments.add(path);
|
||||
return new Path(segments);
|
||||
}
|
||||
|
||||
public Path append(Path path) {
|
||||
ArrayList<String> segments = new ArrayList<>(this.segments.size() + path.segments.size());
|
||||
segments.addAll(this.segments);
|
||||
segments.addAll(path.segments);
|
||||
return new Path(segments);
|
||||
}
|
||||
|
||||
public int depth() {
|
||||
return segments.size();
|
||||
}
|
||||
|
||||
public Path reverse() {
|
||||
ArrayList<String> segments = new ArrayList<>(this.segments);
|
||||
Collections.reverse(segments);
|
||||
return new Path(segments);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (segments.isEmpty())
|
||||
return "";
|
||||
return String.format("/%s/", String.join("/", segments));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum CooperationAccessOption {
|
||||
|
||||
NONE,
|
||||
// 项目内所有企业可见
|
||||
ALL_ORGS_IN_PROJECT,
|
||||
// 指定参建单位可见
|
||||
ORGS_BY_COOPERATE_TYPES
|
||||
|
||||
;
|
||||
|
||||
public boolean isNone() {
|
||||
return this == NONE;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum CooperationType {
|
||||
NONE, PRIVATE, SHARED
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum DatabaseManageOption {
|
||||
|
||||
// 拥有"可管理"权限的所有人
|
||||
PEOPLE_HAS_MANAGE_PERMISSION,
|
||||
// 租房超级管理员、空间超管
|
||||
WORKSPACE_AND_DATABASE_SUPER_ADMIN,
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum DatabaseScope {
|
||||
|
||||
// 无含义, 只有系统预定义用途的才能使用这个值
|
||||
NONE(DatabaseType.NONE, null, null),
|
||||
// 匿名数据库
|
||||
ANONYMOUS(DatabaseType.NONE, true, false),
|
||||
// 企业数据库
|
||||
ENT_DATABASE(DatabaseType.CREATED_BY_SYSTEM, false, true),
|
||||
// 项目数据库
|
||||
PROJECT_DATABASE(DatabaseType.CREATED_BY_SYSTEM, false, true),
|
||||
// 个人数据库: 为单位建的
|
||||
PERSONAL_FOR_ENT(DatabaseType.CREATED_BY_USER_FOR_ENT, false, true);
|
||||
|
||||
private final DatabaseType databaseType;
|
||||
private final Boolean childNameDuplicatable;
|
||||
private final Boolean limitChildrenCount;
|
||||
|
||||
public boolean isFeeAware() {
|
||||
return databaseType != DatabaseType.NONE;
|
||||
}
|
||||
|
||||
public Integer getWorkspaceType() {
|
||||
if (this == ENT_DATABASE)
|
||||
return 1;
|
||||
else if (this == PROJECT_DATABASE)
|
||||
return 2;
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum DatabaseType {
|
||||
|
||||
NONE,
|
||||
// 平台资料库
|
||||
CREATED_BY_SYSTEM,
|
||||
// 专属资料库
|
||||
CREATED_BY_USER_FOR_ENT
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum FileDatabaseState {
|
||||
|
||||
// 开通中
|
||||
ACTIVATING,
|
||||
// 已开通
|
||||
ACTIVATED,
|
||||
// 已到期
|
||||
EXPIRED,
|
||||
// 容量已满
|
||||
CAPACITY_EXHAUSTED
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum FileFeeType {
|
||||
|
||||
// 用户买断
|
||||
ONE_TIME_FEE_PER_PERSON,
|
||||
// 按项目买断
|
||||
ONE_TIME_FEE_PER_PROJECT
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Getter
|
||||
@Accessors(fluent = true)
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public enum FileFormat {
|
||||
|
||||
EXCEL(true, "Excel", "xlsx"),
|
||||
WORD(true, "Word", "docx"),
|
||||
PDF(false, "PDF", "pdf"),
|
||||
PPT(true, "PPT", "pptx");
|
||||
|
||||
private final boolean creatable;
|
||||
private final String readableName;
|
||||
private final String createFileExtension;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum FileTemplateFeeType {
|
||||
// 免费
|
||||
FREE,
|
||||
// 年费制
|
||||
ANNUAL,
|
||||
// 买断
|
||||
ONE_TIME_FEE
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum FileTemplateState {
|
||||
|
||||
UNPUBLISH, PUBLISHED, DELETED
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum FileVipFeeType {
|
||||
// 会员免费
|
||||
VIP_FREE,
|
||||
// 会员折扣
|
||||
VIP_DISCOUNT
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum IndexNodeContext {
|
||||
NONE,
|
||||
// 文件模版
|
||||
FILE_TEMPLATE,
|
||||
// 模版数据库
|
||||
TEMPLATE_DATABASE,
|
||||
// 数据库
|
||||
FILE_DATABASE
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum IndexNodeState {
|
||||
|
||||
// 有效的
|
||||
VALID,
|
||||
// 已删除
|
||||
DELETED
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum IndexNodeType {
|
||||
|
||||
// 空间(数据库)
|
||||
DATABASE,
|
||||
// 目录
|
||||
DIRECTORY,
|
||||
// 文件
|
||||
FILE
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public enum TemplateDatabaseState {
|
||||
// 有效的
|
||||
VALID,
|
||||
// 删除
|
||||
DELETED
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.enums;
|
||||
|
||||
import cn.axzo.framework.domain.web.code.IRespCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/03/21
|
||||
* @description wps错误码枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WpsErrorCodeEnum implements IRespCode {
|
||||
|
||||
TOKEN_INVALID("40002", "用户凭证,即x-weboffice-token头, 无效"),
|
||||
NO_PERMISSION("40003", "用户操作权限不足"),
|
||||
FILE_NOT_EXIST("40004", "文档不存在"),
|
||||
REQUEST_PARAMETER_ERROR("40005", "请求参数错误"),
|
||||
STORAGE_SPACE_IS_FULL("40006", "存储空间已满"),
|
||||
CUSTOM_ERROR("40007", "自定义错误,可以用来返回自定义错误信息"),
|
||||
FILE_NAME_CONFLICT("40008", "文档名称冲突,例如重命名文档时"),
|
||||
FILE_VERSION_NOT_EXIST("40009", "文档版本不存在"),
|
||||
USER_NOT_EXIST("40010", "用户不存在"),
|
||||
UPLOAD_ERROR("41001", "文件未正确上传"),
|
||||
SYSTEM_ERROR("50001", "系统错误导致的请求不能正常响应"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
private static Set<Integer> codes = Arrays.stream(WpsErrorCodeEnum.values()).map(item -> Integer.parseInt(item.getCode())).collect(Collectors.toSet());
|
||||
|
||||
/**
|
||||
* 所有的codes
|
||||
*/
|
||||
public static Set<Integer> codes() {
|
||||
return codes;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package cn.axzo.nanopart.doc.api.file;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeInfo;
|
||||
import cn.axzo.nanopart.doc.api.index.request.GetNodeInfoRequest;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface IndexNodeApi {
|
||||
|
||||
/**
|
||||
* 获取节点信息
|
||||
*/
|
||||
@PostMapping("/api/indexNode/getNodeInfo")
|
||||
CommonResponse<IndexNodeInfo> getNodeInfo(@RequestBody @Valid GetNodeInfoRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseAbortRequest;
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseRenewRequest;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseActiveRequest;
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseAddWorkspaceRequest;
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseExpandCapacityRequest;
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseRemoveRequest;
|
||||
import cn.axzo.nanopart.doc.api.filedb.request.FileDatabaseSearchRequest;
|
||||
import cn.axzo.nanopart.doc.api.filedb.response.FileDatabaseInfoResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface FileDatabaseApi {
|
||||
|
||||
/**
|
||||
* 添加添加租户
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/createDatabase")
|
||||
CommonResponse<Void> addWorkspace(@RequestBody @Valid FileDatabaseAddWorkspaceRequest request);
|
||||
|
||||
/**
|
||||
* 开通
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/active")
|
||||
CommonResponse<Void> active(@RequestBody @Valid FileDatabaseActiveRequest request);
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/reject")
|
||||
CommonResponse<Void> reject(@RequestBody @Valid FileDatabaseAbortRequest request);
|
||||
|
||||
/**
|
||||
* 扩容
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/expandCapacity")
|
||||
CommonResponse<Void> expandCapacity(@RequestBody @Valid FileDatabaseExpandCapacityRequest request);
|
||||
|
||||
/**
|
||||
* 续费
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/renew")
|
||||
CommonResponse<Void> renew(@RequestBody @Valid FileDatabaseRenewRequest request);
|
||||
|
||||
/**
|
||||
* 移除
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/remove")
|
||||
CommonResponse<Void> remove(@RequestBody @Valid FileDatabaseRemoveRequest request);
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
@PostMapping("/api/fileDatabase/search")
|
||||
CommonResponse<Page<FileDatabaseInfoResponse>> search(@RequestBody @Valid FileDatabaseSearchRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseAbortRequest {
|
||||
/**
|
||||
* 资料库code
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseActiveRequest {
|
||||
/**
|
||||
* 资料库code
|
||||
*/
|
||||
@NotNull(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 容量, 单位GB
|
||||
*/
|
||||
@NotNull(message = "allowedCapacity不能为空")
|
||||
@Min(1)
|
||||
private Integer allowedCapacity;
|
||||
|
||||
/**
|
||||
* 过期时间, unix时间戳
|
||||
*/
|
||||
private Long expiredDateMs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseAddWorkspaceRequest {
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@NotNull(message = "workspaceId不能为空")
|
||||
private Long workspaceId;
|
||||
|
||||
/**
|
||||
* 资料库code
|
||||
*/
|
||||
@NotBlank(message = "templateDatabaseCode不能为空")
|
||||
private String templateDatabaseCode;
|
||||
|
||||
/**
|
||||
* 容量, 单位GB
|
||||
*/
|
||||
@NotNull(message = "allowedCapacity不能为空")
|
||||
@Min(1)
|
||||
private Integer allowedCapacity;
|
||||
|
||||
/**
|
||||
* 过期时间, unix时间戳
|
||||
*/
|
||||
private Long expiredDateMs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseExpandCapacityRequest extends FileDatabaseActiveRequest {
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseRemoveRequest {
|
||||
|
||||
/**
|
||||
* 资料库code
|
||||
*/
|
||||
@NotNull(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public class FileDatabaseRenewRequest extends FileDatabaseActiveRequest {
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.request;
|
||||
|
||||
import cn.axzo.basics.common.page.PageRequest;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseType;
|
||||
import cn.axzo.nanopart.doc.api.enums.FileDatabaseState;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseSearchRequest extends PageRequest {
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
private String workspaceName;
|
||||
|
||||
/**
|
||||
* 资料库状态. ACTIVATING: 开通中, ACTIVATED: 已开通, EXPIRED: 已到期
|
||||
*/
|
||||
private FileDatabaseState state;
|
||||
|
||||
/**
|
||||
* 资料库类型. CREATED_BY_SYSTEM: 平台资料库, CREATED_BY_USER_FOR_ENT: 专属资料库
|
||||
*/
|
||||
private DatabaseType databaseType;
|
||||
|
||||
/**
|
||||
* 资料库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filedb.response;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseType;
|
||||
import cn.axzo.nanopart.doc.api.enums.FileDatabaseState;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.domain.TemplateDatabaseInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileDatabaseInfoResponse {
|
||||
|
||||
/**
|
||||
* 资料库code
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 资料库类型. CREATED_BY_SYSTEM: 平台资料库, CREATED_BY_USER_FOR_ENT: 专属资料库
|
||||
*/
|
||||
private DatabaseType databaseType;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private Long workspaceId;
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
private String workspaceName;
|
||||
|
||||
/**
|
||||
* 租房类型. 1: 单位, 2: 项目
|
||||
*/
|
||||
private Integer workspaceType;
|
||||
|
||||
/**
|
||||
* 租户类型描述
|
||||
*/
|
||||
private String workspaceTypeDesc;
|
||||
|
||||
/**
|
||||
* 租户注册时间, unix时间戳
|
||||
*/
|
||||
private Long workspaceRegisterTimeMs;
|
||||
|
||||
/**
|
||||
* 状态. ACTIVATING: 开通中, ACTIVATED: 已开通, EXPIRED: 已到期
|
||||
*/
|
||||
private FileDatabaseState state;
|
||||
|
||||
/**
|
||||
* 资料库名称
|
||||
*/
|
||||
private String fileDatabaseName;
|
||||
|
||||
/**
|
||||
* (上次)购买时间
|
||||
*/
|
||||
private Long purchaseTimeMs;
|
||||
|
||||
/**
|
||||
* 过期时间, unix时间戳
|
||||
*/
|
||||
private Long expireDateMs;
|
||||
|
||||
/**
|
||||
* 购买容量, 单位GB
|
||||
*/
|
||||
private Integer allowedCapacity;
|
||||
|
||||
/**
|
||||
* 已使用的容量, 单位GB
|
||||
*/
|
||||
private BigDecimal usedCapacity;
|
||||
|
||||
/**
|
||||
* 资料库信息
|
||||
*/
|
||||
private TemplateDatabaseInfo databaseInfo;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.filetemplate.request.FileTemplateCreateDirRequest;
|
||||
import cn.axzo.nanopart.doc.api.filetemplate.request.FileTemplateCreateFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.filetemplate.request.FileTemplateGetFileInfoRequest;
|
||||
import cn.axzo.nanopart.doc.api.filetemplate.request.FileTemplateUpdateFileInfoRequest;
|
||||
import cn.axzo.nanopart.doc.api.filetemplate.request.FileTemplateUploadFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.filetemplate.response.FileTemplateGetFileInfoResponse;
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeInfo;
|
||||
import cn.axzo.nanopart.doc.api.index.request.CopyNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.DeleteNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.IndexNodeSearchRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.MoveNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.RenameNodeRequest;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface FileTemplateApi {
|
||||
|
||||
/**
|
||||
* 文件模版: 创建新文件夹
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/createDir")
|
||||
CommonResponse<String> createDir(@RequestBody @Valid FileTemplateCreateDirRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 创建新文件
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/createFile")
|
||||
CommonResponse<String> createFile(@RequestBody @Valid FileTemplateCreateFileRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 上传文件
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/uploadFile")
|
||||
CommonResponse<String> uploadFile(@RequestBody @Valid FileTemplateUploadFileRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 重新命名
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/rename")
|
||||
CommonResponse<Void> rename(@RequestBody @Valid RenameNodeRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 克隆
|
||||
* @return 根节点的code
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/copy")
|
||||
CommonResponse<String> copy(@RequestBody @Valid CopyNodeRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 移动
|
||||
* @return 根节点的code
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/move")
|
||||
CommonResponse<String> move(@RequestBody @Valid MoveNodeRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 删除子树
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/delete")
|
||||
CommonResponse<Void> delete(@RequestBody @Valid DeleteNodeRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 获取树
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/getTree")
|
||||
CommonResponse<List<IndexNodeInfo>> getTree();
|
||||
|
||||
/**
|
||||
* 文件模版: 搜索
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/search")
|
||||
CommonResponse<Page<IndexNodeInfo>> search(@RequestBody @Valid IndexNodeSearchRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 获取文件信息
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/getFileInfo")
|
||||
CommonResponse<FileTemplateGetFileInfoResponse> getFileInfo(
|
||||
@RequestBody @Valid FileTemplateGetFileInfoRequest request);
|
||||
|
||||
/**
|
||||
* 文件模版: 更新文档信息, 传需要传的字段, 不传的字段不会更新
|
||||
*/
|
||||
@PostMapping("/api/fileTemplate/updateFileInfo")
|
||||
CommonResponse<Void> updateFileInfo(@RequestBody @Valid FileTemplateUpdateFileInfoRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateCreateDirRequest extends NodeCreateFileTemplate {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.request;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateCreateFileRequest extends NodeCreateFileTemplate {
|
||||
|
||||
/**
|
||||
* 文件格式. EXCEL, WORD, PDF
|
||||
*/
|
||||
@NotNull(message = "文件格式不能为空")
|
||||
private FileFormat format;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.request;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateGetFileInfoRequest {
|
||||
/**
|
||||
* 文件模板code
|
||||
*/
|
||||
@NotBlank(message = "文件模板code不能为空")
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.request;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFeeType;
|
||||
import cn.axzo.nanopart.doc.api.enums.FileTemplateState;
|
||||
import cn.axzo.nanopart.doc.api.enums.FileVipFeeType;
|
||||
import cn.axzo.nanopart.doc.api.util.YesOrNo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateUpdateFileInfoRequest {
|
||||
|
||||
/**
|
||||
* 文件节点编码
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 状态. DRAFT: 草稿, PUBLISHED: 已发布, DELETED: 已删除
|
||||
*/
|
||||
private FileTemplateState state;
|
||||
|
||||
/**
|
||||
* 是否需要付费. YES: 是, NO: 否
|
||||
*/
|
||||
private YesOrNo needFee;
|
||||
|
||||
/**
|
||||
* 收费模版, ONE_TIME_FEE_PER_PERSON: 用户买断, ONE_TIME_FEE_PER_PROJECT: 按项目买断
|
||||
*/
|
||||
private FileFeeType feeType;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
/**
|
||||
* 会员收费方式. VIP_FREE: 会员免费, VIP_DISCOUNT: 会员折扣
|
||||
*/
|
||||
private FileVipFeeType vipFeeType;
|
||||
|
||||
/**
|
||||
* 会员费用
|
||||
*/
|
||||
private BigDecimal vipFee;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.request;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.OssFile;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateUploadFileRequest extends NodeCreateFileTemplate {
|
||||
|
||||
/**
|
||||
* 上传的文件信息
|
||||
*/
|
||||
@Valid
|
||||
@NotNull(message = "上传的文件信息不能为空")
|
||||
private OssFile ossFile;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.request;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeAttributes;
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeScope;
|
||||
import cn.axzo.nanopart.doc.api.domain.NodeCreate;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
abstract class NodeCreateFileTemplate implements NodeCreate {
|
||||
|
||||
/**
|
||||
* 父节点code
|
||||
*/
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* 节点名称(文件夹/文件)不能为空
|
||||
*/
|
||||
@NotBlank(message = "节点名称不能为空")
|
||||
private String name;
|
||||
|
||||
private Long operatorId;
|
||||
|
||||
@Override
|
||||
public IndexNodeScope nodeScope() {
|
||||
return IndexNodeScope.FILE_TEMPLATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String parentCode() {
|
||||
return parentCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
final public String bizCode() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String description() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long operatorId() {
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IndexNodeAttributes attributes() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.filetemplate.response;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFeeType;
|
||||
import cn.axzo.nanopart.doc.api.enums.FileTemplateState;
|
||||
import cn.axzo.nanopart.doc.api.enums.FileVipFeeType;
|
||||
import cn.axzo.nanopart.doc.api.util.YesOrNo;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class FileTemplateGetFileInfoResponse {
|
||||
|
||||
/**
|
||||
* 文件节点编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 是否需要付费. YES: 是, NO: 否
|
||||
*/
|
||||
private YesOrNo needFee;
|
||||
|
||||
/**
|
||||
* 收费模版, ONE_TIME_FEE_PER_PERSON: 用户买断, ONE_TIME_FEE_PER_PROJECT: 按项目买断
|
||||
*/
|
||||
private FileFeeType feeType;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
/**
|
||||
* 会员收费方式. VIP_FREE: 会员免费, VIP_DISCOUNT: 会员折扣
|
||||
*/
|
||||
private FileVipFeeType vipFeeType;
|
||||
|
||||
/**
|
||||
* 会员费用
|
||||
*/
|
||||
private BigDecimal vipFee;
|
||||
|
||||
/**
|
||||
* 状态. UNPUBLISH: 未发布, PUBLISHED: 已发布
|
||||
*/
|
||||
private FileTemplateState state;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class CopyNodeRequest {
|
||||
/**
|
||||
* 需要拷贝的结点
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 目标父节点, 如果为空, 就拷贝到根目录下
|
||||
*/
|
||||
private String destParentCode;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeleteNodeRequest {
|
||||
|
||||
/**
|
||||
* 需要删除的(根)结点
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class GetNodeChildrenRequest {
|
||||
|
||||
/**
|
||||
* 父节点code
|
||||
*/
|
||||
private String parentCode;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class GetNodeInfoRequest {
|
||||
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
@NotBlank(message = "节点编码不能为空")
|
||||
private String code;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.basics.common.page.PageRequest;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class IndexNodeSearchRequest extends PageRequest {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 搜索类型, 不指定就搜索所有类型, DATABASE: 空间, DIRECTORY: 目录, FILE: 文件
|
||||
*/
|
||||
private Set<IndexNodeType> nodeTypes;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class MoveNodeRequest {
|
||||
/**
|
||||
* 需要拷贝的结点
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 目标父节点, 如果为空, 就移动到根目录下
|
||||
*/
|
||||
private String destParentCode;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.index.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class RenameNodeRequest {
|
||||
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
@NotBlank(message = "节点编码不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 新名称
|
||||
*/
|
||||
@NotBlank(message = "新名称不能为空")
|
||||
private String newName;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.templatedb.domain.TemplateDatabaseInfo;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseSearchRequest;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeInfo;
|
||||
import cn.axzo.nanopart.doc.api.index.request.CopyNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.DeleteNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.IndexNodeSearchRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.MoveNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.index.request.RenameNodeRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseCreateDatabaseRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseCreateDirRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseCreateFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseGetDatabaseOrDirInfoRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseUpdateDatabaseOrDirInfoRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.reqeust.TemplateDatabaseUploadFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.response.TemplateDatabaseGetDatabaseOrDirInfoResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface TemplateDatabaseApi {
|
||||
|
||||
/**
|
||||
* 项企资料库: 创建资料库
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/createDatabase")
|
||||
CommonResponse<String> createDatabase(@RequestBody @Valid TemplateDatabaseCreateDatabaseRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 创建新文件夹/空间
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/createDir")
|
||||
CommonResponse<String> createDir(@RequestBody @Valid TemplateDatabaseCreateDirRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 创建新文件
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/createFile")
|
||||
CommonResponse<String> createFile(@RequestBody @Valid TemplateDatabaseCreateFileRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 上传文件
|
||||
* @return 节点code
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/uploadFile")
|
||||
CommonResponse<String> uploadFile(@RequestBody @Valid TemplateDatabaseUploadFileRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 重新命名
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/rename")
|
||||
CommonResponse<Void> rename(@RequestBody @Valid RenameNodeRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 克隆
|
||||
* @return 根节点的code
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/copy")
|
||||
CommonResponse<String> copy(@RequestBody @Valid CopyNodeRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 移动
|
||||
* @return 根节点的code
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/move")
|
||||
CommonResponse<String> move(@RequestBody @Valid MoveNodeRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 删除子树
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/delete")
|
||||
CommonResponse<Void> delete(@RequestBody @Valid DeleteNodeRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 获取子节点
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/getTree")
|
||||
CommonResponse<List<IndexNodeInfo>> getTree();
|
||||
|
||||
/**
|
||||
* 项企资料库: 搜索
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/search")
|
||||
CommonResponse<Page<IndexNodeInfo>> search(@RequestBody @Valid IndexNodeSearchRequest request);
|
||||
|
||||
/**
|
||||
* 搜索资料库
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/searchDatabase")
|
||||
CommonResponse<Page<TemplateDatabaseInfo>> searchDatabase(@RequestBody @Valid TemplateDatabaseSearchRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 获取资料库或文件夹信息
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/getDatabaseOrDirInfo")
|
||||
CommonResponse<TemplateDatabaseGetDatabaseOrDirInfoResponse> getDatabaseOrDirInfo(
|
||||
@RequestBody @Valid TemplateDatabaseGetDatabaseOrDirInfoRequest request);
|
||||
|
||||
/**
|
||||
* 项企资料库: 更新资料库或文件夹信息
|
||||
*/
|
||||
@PostMapping("/api/templateDatabase/updateDatabaseOrDirInfo")
|
||||
CommonResponse<Void> updateDatabaseOrDirInfo(
|
||||
@RequestBody @Valid TemplateDatabaseUpdateDatabaseOrDirInfoRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.domain;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class DatabaseOrDirInfo {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 归属. ENT_DATABASE: 企业数据库, PROJECT_DATABASE: 项目数据库
|
||||
*/
|
||||
private DatabaseScope scope;
|
||||
|
||||
/**
|
||||
* 是否为自定义的图标
|
||||
*/
|
||||
private boolean customIcon;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.domain;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.DatabaseAccessConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.DatabaseFeeConfig;
|
||||
import cn.axzo.nanopart.doc.api.enums.CooperationType;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseInfo {
|
||||
|
||||
/**
|
||||
* 资料库名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资料库编译
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 类型. CREATED_BY_SYSTEM: 平台资料库, CREATED_BY_USER_FOR_ENT: 专属资料库
|
||||
*/
|
||||
private DatabaseType databaseType;
|
||||
|
||||
/**
|
||||
* 费用配置
|
||||
*/
|
||||
private DatabaseFeeConfig feeConfig;
|
||||
|
||||
/**
|
||||
* 安全管理
|
||||
*/
|
||||
private DatabaseAccessConfig accessConfig;
|
||||
|
||||
/**
|
||||
* 协作模式. NONE: 无, PRIVATE: 专属, SHARED: 共享
|
||||
*/
|
||||
private CooperationType coopType;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class TemplateDatabaseInfos {
|
||||
|
||||
private final List<TemplateDatabaseInfo> templateDatabaseInfos;
|
||||
|
||||
public static TemplateDatabaseInfos wrap(List<TemplateDatabaseInfo> databaseInfos) {
|
||||
return new TemplateDatabaseInfos(databaseInfos);
|
||||
}
|
||||
|
||||
public TemplateDatabaseInfo findOrNull(String code) {
|
||||
return templateDatabaseInfos.stream().filter(d -> d.getCode().equals(code)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeAttributes;
|
||||
import cn.axzo.nanopart.doc.api.domain.IndexNodeScope;
|
||||
import cn.axzo.nanopart.doc.api.domain.NodeCreate;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeContext;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public abstract class NodeCreateTemplateDatabase implements NodeCreate {
|
||||
|
||||
/**
|
||||
* 父节点code
|
||||
*/
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* 节点名称(文件夹/文件)不能为空
|
||||
*/
|
||||
@NotBlank(message = "节点名称不能为空")
|
||||
private String name;
|
||||
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 归属. ENT_DATABASE: 企业数据库, PROJECT_DATABASE: 项目数据库
|
||||
*/
|
||||
private DatabaseScope scope;
|
||||
|
||||
@Override
|
||||
public IndexNodeScope nodeScope() {
|
||||
return new IndexNodeScope() {
|
||||
@Override
|
||||
public IndexNodeContext context() {
|
||||
return IndexNodeContext.TEMPLATE_DATABASE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseScope scope() {
|
||||
return scope;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return StringUtils.isBlank(name) ? "" : name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String parentCode() {
|
||||
return StringUtils.isBlank(parentCode) ? "" : parentCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long operatorId() {
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IndexNodeAttributes attributes() {
|
||||
IndexNodeAttributes attributes = IndexNodeAttributes.create();
|
||||
attributes.setTemplateDatabaseNode(true);
|
||||
return attributes;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.CooperationType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseCreateDatabaseRequest extends TemplateDatabaseCreateDirRequest {
|
||||
|
||||
/**
|
||||
* 协作模式. NONE: 无, PRIVATE: 专属, SHARED: 共享
|
||||
*/
|
||||
private CooperationType coopType;
|
||||
|
||||
public String icon() {
|
||||
return StringUtils.isBlank(getIcon()) ? "" : getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseCreateDirRequest extends NodeCreateTemplateDatabase {
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@NotBlank(message = "bizCode不能为空")
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
public String icon() {
|
||||
return StringUtils.isBlank(icon) ? "" : icon;
|
||||
}
|
||||
|
||||
public String bizCode() {
|
||||
return StringUtils.isBlank(bizCode) ? "" : bizCode;
|
||||
}
|
||||
|
||||
public String description() {
|
||||
return StringUtils.isBlank(description) ? "" : description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFormat;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseCreateFileRequest extends NodeCreateTemplateDatabase {
|
||||
|
||||
/**
|
||||
* 文件格式. EXCEL, WORD, PDF
|
||||
*/
|
||||
@NotNull(message = "文件格式不能为空")
|
||||
private FileFormat format;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseGetDatabaseOrDirInfoRequest {
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import cn.axzo.basics.common.page.PageRequest;
|
||||
import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseSearchRequest extends PageRequest {
|
||||
|
||||
/**
|
||||
* 搜索的名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 归属. ENT_DATABASE: 企业数据库, PROJECT_DATABASE: 项目数据库
|
||||
*/
|
||||
private Set<DatabaseScope> scopes;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.DatabaseAccessConfig;
|
||||
import cn.axzo.nanopart.doc.api.domain.DatabaseFeeConfig;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.domain.DatabaseOrDirInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseUpdateDatabaseOrDirInfoRequest {
|
||||
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
@NotBlank(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 基础信息, 传了就更新
|
||||
*/
|
||||
private DatabaseOrDirInfo databaseOrDirInfo;
|
||||
|
||||
/**
|
||||
* 如果是空间的话, 空间的费用配置, 传了就更新
|
||||
*/
|
||||
private DatabaseFeeConfig feeConfig;
|
||||
|
||||
/**
|
||||
* 如果是空间的话, 空间的安全管理配置, 传了就更新
|
||||
*/
|
||||
private DatabaseAccessConfig accessConfig;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.reqeust;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.OssFile;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseUploadFileRequest extends NodeCreateTemplateDatabase {
|
||||
|
||||
/**
|
||||
* 上传的文件信息
|
||||
*/
|
||||
@Valid
|
||||
@NotNull(message = "上传的文件信息不能为空")
|
||||
private OssFile ossFile;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.templatedb.response;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.domain.DatabaseAccessConfig;
|
||||
import cn.axzo.nanopart.doc.api.domain.DatabaseFeeConfig;
|
||||
import cn.axzo.nanopart.doc.api.enums.IndexNodeType;
|
||||
import cn.axzo.nanopart.doc.api.templatedb.domain.DatabaseOrDirInfo;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class TemplateDatabaseGetDatabaseOrDirInfoResponse {
|
||||
|
||||
/**
|
||||
* 节点类型. DATABASE: 空间(数据库), DIRECTORY: 目录, FILE: 文件
|
||||
*/
|
||||
private IndexNodeType nodeType;
|
||||
|
||||
/**
|
||||
* 基础信息
|
||||
*/
|
||||
private DatabaseOrDirInfo databaseOrDirInfo = new DatabaseOrDirInfo();
|
||||
|
||||
/**
|
||||
* 如果是空间的话, 空间的费用配置
|
||||
*/
|
||||
private DatabaseFeeConfig feeConfig;
|
||||
|
||||
/**
|
||||
* 如果是空间的话, 空间的安全管理配置
|
||||
*/
|
||||
private DatabaseAccessConfig accessConfig;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.util;
|
||||
|
||||
import cn.axzo.basics.common.exception.ServiceException;
|
||||
import cn.axzo.basics.common.util.AssertUtil;
|
||||
import cn.axzo.framework.domain.web.result.ApiListResult;
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.helpers.MessageFormatter;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Slf4j
|
||||
public class BizAssertions {
|
||||
|
||||
public static ServiceException fail(Exception e) {
|
||||
return new ServiceException(e);
|
||||
}
|
||||
|
||||
public static ServiceException fail(String message, Object... args) {
|
||||
return new ServiceException(MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
public static ServiceException fail(Exception e, String message, Object... args) {
|
||||
return new ServiceException(MessageFormatter.arrayFormat(message, args).getMessage(), e);
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言集合为空
|
||||
*/
|
||||
public static void assertEmpty(Collection<?> actual, String message, Object... args) {
|
||||
AssertUtil.isEmpty(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言为NULL
|
||||
*/
|
||||
public static void assertNull(Object actual, String message, Object... args) {
|
||||
AssertUtil.isNull(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言不为NULL
|
||||
*/
|
||||
public static void assertNotNull(Object actual, String message, Object... args) {
|
||||
AssertUtil.notNull(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言集合不为空
|
||||
*/
|
||||
public static void assertNotEmpty(Collection<?> actual, String message, Object... args) {
|
||||
AssertUtil.notEmpty(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言数组不为空
|
||||
*/
|
||||
public static <T> void assertNotEmpty(T[] actual, String message, Object... args) {
|
||||
AssertUtil.notEmpty(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言值为真
|
||||
*/
|
||||
public static void assertTrue(boolean actual, String message, Object... args) {
|
||||
AssertUtil.isTrue(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言值不为真
|
||||
*/
|
||||
public static void assertFalse(boolean actual, String message, Object... args) {
|
||||
AssertUtil.isFalse(actual, MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言值2个值是否equals
|
||||
*/
|
||||
public static void assertEquals(Object expected, Object actual, String message, Object... args) {
|
||||
if (!Objects.equals(expected, actual)) {
|
||||
throw new ServiceException(MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言值2个值是否不equals
|
||||
*/
|
||||
public static void assertNotEquals(Object expected, Object actual, String message, Object... args) {
|
||||
if (Objects.equals(expected, actual)) {
|
||||
throw new ServiceException(MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertNotBlank(String content, String message, Object... args) {
|
||||
if (StringUtils.isBlank(content)) {
|
||||
throw new ServiceException(MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertBlank(String content, String message, Object... args) {
|
||||
if (StringUtils.isNotBlank(content)) {
|
||||
throw new ServiceException(MessageFormatter.arrayFormat(message, args).getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static String messageOrTemplateMessage(String message, String template, Object... args) {
|
||||
if (message != null) {
|
||||
return message;
|
||||
}
|
||||
return MessageFormatter.arrayFormat(template, args).getMessage();
|
||||
}
|
||||
|
||||
public static <T> T assertResponse(CommonResponse<T> response) {
|
||||
return assertResponse(response, "error resp={}", JSON.toJSONString(response));
|
||||
}
|
||||
|
||||
public static <T> T assertResponse(CommonResponse<T> response, String message, Object... args) {
|
||||
if (response == null || response.getCode() != HttpStatus.HTTP_OK) {
|
||||
ServiceException e = new ServiceException(
|
||||
messageOrTemplateMessage(response == null ? null : response.getMsg(), message, args));
|
||||
log.warn("remote call response with error, response={}", JSON.toJSONString(response), e);
|
||||
throw e;
|
||||
}
|
||||
return response.getData();
|
||||
}
|
||||
|
||||
public static <T> T assertResponse(ApiResult<T> response) {
|
||||
return assertResponse(response, "error resp={}", JSON.toJSONString(response));
|
||||
}
|
||||
|
||||
public static <T> T assertResponse(ApiResult<T> response, String message, Object... args) {
|
||||
if (!response.isSuccess()) {
|
||||
ServiceException e = new ServiceException(messageOrTemplateMessage(response.getMsg(), message, args));
|
||||
log.warn("remote call response with error", e);
|
||||
throw e;
|
||||
}
|
||||
return response.getData();
|
||||
}
|
||||
|
||||
public static <T> List<T> assertResponse(ApiListResult<T> response) {
|
||||
return assertResponse(response, "error resp={}", JSON.toJSONString(response));
|
||||
}
|
||||
|
||||
public static <T> List<T> assertResponse(ApiListResult<T> response, String message, Object... args) {
|
||||
if (!response.isSuccess()) {
|
||||
ServiceException e = new ServiceException(messageOrTemplateMessage(response.getMsg(), message, args));
|
||||
log.warn("remote call response with error", e);
|
||||
throw e;
|
||||
}
|
||||
return response.getData();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.axzo.nanopart.doc.api.util;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/21
|
||||
* @description 静态类
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
/**
|
||||
* WPS-上传地址的content-type
|
||||
*/
|
||||
public static final String WPS_UPLOAD_ADDRESS_CONTENT_TYPE = "Content-Type";
|
||||
|
||||
/**
|
||||
* WPS-上传地址的form-data
|
||||
*/
|
||||
public static final String WPS_UPLOAD_ADDRESS_FORM_DATA = "multipart/form-data";
|
||||
|
||||
/**
|
||||
* WPS-上传地址的Host
|
||||
*/
|
||||
public static final String WPS_UPLOAD_ADDRESS_HOST = "Host";
|
||||
|
||||
/**
|
||||
* WPS-上传地址的PUT
|
||||
*/
|
||||
public static final String WPS_UPLOAD_ADDRESS_PUT = "PUT";
|
||||
|
||||
|
||||
/**
|
||||
* WPS-准备上传摘要算法-sha1
|
||||
*/
|
||||
public static final String WPS_UPLOAD_PREPARE_SHA1 = "sha1";
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.util;
|
||||
|
||||
import static java.util.stream.Collectors.joining;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class IdBuilder {
|
||||
|
||||
private final List<Object> buf = new ArrayList<>();
|
||||
private final boolean appendAbsentValue;
|
||||
private final String delimiter;
|
||||
|
||||
public static IdBuilder idbuilder(String delimiter) {
|
||||
return new IdBuilder(false, delimiter);
|
||||
}
|
||||
|
||||
public static IdBuilder idbuilder() {
|
||||
return new IdBuilder(false, "_");
|
||||
}
|
||||
|
||||
public static IdBuilder idbuilder(boolean appendAbsentValue) {
|
||||
return new IdBuilder(appendAbsentValue, "_");
|
||||
}
|
||||
|
||||
public IdBuilder append(Object value) {
|
||||
if (isAbsentValue(value) && !appendAbsentValue)
|
||||
return this;
|
||||
buf.add(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
private static boolean isAbsentValue(Object value) {
|
||||
if (value == null)
|
||||
return true;
|
||||
if (value instanceof String)
|
||||
return StringUtils.isBlank((String) value);
|
||||
return false;
|
||||
}
|
||||
|
||||
public String build() {
|
||||
return buf.stream().map(String::valueOf).collect(joining(delimiter));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* UUID生成器
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/10/5
|
||||
* @version 1.0
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public final class UUIDUtil {
|
||||
|
||||
public static String uuidString() {
|
||||
String str = UUID.randomUUID().toString();
|
||||
return str.replaceAll("-", "");
|
||||
}
|
||||
|
||||
public static String uuidRawString() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.util;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
import cn.axzo.basics.common.constant.enums.CodeDefinition;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public enum YesOrNo implements CodeDefinition<String> {
|
||||
YES("YES", "是"), NO("NO", "是");
|
||||
|
||||
@EnumValue
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
public static YesOrNo valueOf(boolean value) {
|
||||
return value ? YES : NO;
|
||||
}
|
||||
|
||||
public boolean booleanValue() {
|
||||
return this == YES;
|
||||
}
|
||||
|
||||
public boolean isYes() {
|
||||
return this == YES;
|
||||
}
|
||||
|
||||
public boolean isNo() {
|
||||
return this == NO;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsFetchDownloadRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsFetchFileRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsPermissionRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsRenameRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsUsersRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsFetchDownloadResponse;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsFetchFileResponse;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsPermissionResponse;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsRenameResponse;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsUsersResponse;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xudawei
|
||||
* @date 2025/03/07
|
||||
* @desc wps对接
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface WpsBaseApi {
|
||||
|
||||
/**
|
||||
* 获取文件信息
|
||||
* 本节介绍文档预览相关的接口,接入方必须全部实现才能正常打开并预览文档。
|
||||
*
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/fetchFile")
|
||||
ApiResult<WpsFetchFileResponse> fetchFile(@Validated @RequestBody WpsFetchFileRequest request);
|
||||
|
||||
/**
|
||||
* 获取文件下载地址
|
||||
* 说明:在线协同系统需要下载文件原件以提供协同服务,该接口需要返回指定文件 ID 所对应的下载地址
|
||||
*
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/fetchDownload")
|
||||
ApiResult<WpsFetchDownloadResponse> fetchDownload(@Validated @RequestBody WpsFetchDownloadRequest request);
|
||||
|
||||
/**
|
||||
* 文档用户权限
|
||||
* 说明:任何需要用户鉴权的行为都会触发该接口的调用,并且 WebOffice 会根据指定的权限位来限定特定的操作
|
||||
* 如 download 指定该用户是否具有下载文档权限。 此接口用于标识用户具备哪些操作权限,具体的功能支持还需您的服务实现相关回调。
|
||||
*
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/permission")
|
||||
ApiResult<WpsPermissionResponse> permission(@Validated @RequestBody WpsPermissionRequest request);
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
* 该组接口用于获取协同场景下的用户信息,如查看历史改动,在线协同用户头像等。
|
||||
*
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/users")
|
||||
ApiResult<WpsUsersResponse> users(@Validated @RequestBody WpsUsersRequest request);
|
||||
|
||||
/**
|
||||
* 文档重命名
|
||||
* 说明:该接口用于在 WebOffice 侧重命名文档。
|
||||
*
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/rename")
|
||||
ApiResult<WpsRenameResponse> rename(@Validated @RequestBody WpsRenameRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsEditUploadAddressRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsEditUploadCompleteRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.request.WpsEditUploadPrepareRequest;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsEditUploadAddressResponse;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsEditUploadCompleteResponse;
|
||||
import cn.axzo.nanopart.doc.api.wps.response.WpsEditUploadPrepareResponse;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xudawei
|
||||
* @date 2025/03/07
|
||||
* @desc wps对接
|
||||
*/
|
||||
@FeignClient(name = "nanopart", url = "${axzo.service.nanopart:http://nanopart:8080}")
|
||||
public interface WpsEditApi {
|
||||
|
||||
/**
|
||||
* 文档编辑
|
||||
* 三阶段保存:三阶段保存在对接协议上较为复杂,但是对于一些较为复杂的系统(如多数据中心,就近接入等)
|
||||
* 三阶段的实现反而能较为灵活的满足接入方需求。
|
||||
*
|
||||
* 1 准备上传阶段
|
||||
* 说明:三阶段保存的第一步主要用于 WebOffice 与接入方进行参数协商,目前主要协商摘要算法。
|
||||
*
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/files/upload/prepare")
|
||||
ApiResult<WpsEditUploadPrepareResponse> uploadPrepare(@Validated @RequestBody WpsEditUploadPrepareRequest request);
|
||||
|
||||
/**
|
||||
* 文档编辑
|
||||
* 2 获取上传地址
|
||||
* 说明:三阶段保存第二步主要用于获取上传地址,WebOffice 将上传保存后的文档到该地址。
|
||||
* 此外,回调中也会带上本次保存的一些额外信息,如文档大小,手动/自动保存等。
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/files/upload/address")
|
||||
ApiResult<WpsEditUploadAddressResponse> uploadAddress(@Validated @RequestBody WpsEditUploadAddressRequest request);
|
||||
|
||||
/**
|
||||
* 文档编辑
|
||||
* 3 上传完成后,回调通知上传结果
|
||||
* 说明:WebOffice 在将新版本文件上传到指定地址后,将会回调通知接入方
|
||||
*/
|
||||
@PostMapping(value = "/v3/3rd/files/upload/complete")
|
||||
ApiResult<WpsEditUploadCompleteResponse> uploadComplete(
|
||||
@Validated @RequestBody WpsEditUploadCompleteRequest request);
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.axzo.nanopart.doc.api.wps.exception;
|
||||
|
||||
import cn.axzo.framework.domain.web.code.IRespCode;
|
||||
import cn.axzo.nanopart.doc.api.enums.WpsErrorCodeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/21
|
||||
* @description Wps异常
|
||||
*/
|
||||
@Data
|
||||
public class WpsException extends RuntimeException {
|
||||
|
||||
private Integer errorCode;
|
||||
private String errorMessage;
|
||||
|
||||
public WpsException(Integer code, String msg) {
|
||||
super(msg);
|
||||
this.errorCode = code;
|
||||
this.errorMessage = msg;
|
||||
}
|
||||
|
||||
public WpsException(IRespCode code) {
|
||||
super(code.getMessage());
|
||||
this.errorCode = Integer.parseInt(code.getCode());
|
||||
this.errorMessage = code.getMessage();
|
||||
}
|
||||
|
||||
public static void isThrowException(Integer code, String msg) {
|
||||
if (Objects.nonNull(code) && WpsErrorCodeEnum.codes().contains(code)) {
|
||||
throw new WpsException(code, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取上传地址
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsEditUploadAddressRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档大小,单位 byte
|
||||
*/
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 文档校验和,key 为算法,value 为结果值
|
||||
*/
|
||||
private Map<String, String> digest;
|
||||
|
||||
/**
|
||||
* 是否手动保存,即用户手动 ctrl/cmd + s 或点击保存版本触发的保存,区别于定时触发的自动保存
|
||||
*/
|
||||
private Boolean isManual;
|
||||
|
||||
/**
|
||||
* 文档内包含的附件的大小,单位 byte
|
||||
*/
|
||||
private Integer attachmentSize;
|
||||
|
||||
/**
|
||||
* 文档的 MIME 类型
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件请求
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsEditUploadCompleteRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 获取上传地址时相同的请求
|
||||
*/
|
||||
private Object request;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档大小,单位 byte
|
||||
*/
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 文档校验和,key 为算法,value 为结果值
|
||||
*/
|
||||
private Map<String, String> digest;
|
||||
|
||||
/**
|
||||
* 是否手动保存,即用户手动 ctrl/cmd + s 或点击保存版本触发的保存,区别于定时触发的自动保存
|
||||
*/
|
||||
private Boolean isManual;
|
||||
|
||||
/**
|
||||
* 文档内包含的附件的大小,单位 byte
|
||||
*/
|
||||
private Integer attachmentSize;
|
||||
|
||||
/**
|
||||
* 文档的 MIME 类型
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* 上传文档完成后,存储服务返回的 HTTP Response
|
||||
*/
|
||||
private Object response;
|
||||
|
||||
/**
|
||||
* 上传文档时,存储服务返回的 HTTP Response Status
|
||||
*/
|
||||
private Integer statusCode;
|
||||
|
||||
/**
|
||||
* 上传文档时,存储服务返回的 HTTP Response Header
|
||||
*/
|
||||
private Map<String, String> headers;
|
||||
/**
|
||||
* 上传文档时,存储服务返回的 HTTP Response Body 的 base64 编码
|
||||
*/
|
||||
private Byte[] body;
|
||||
|
||||
/**
|
||||
* 获取上传地址时,要求原样带回的额外参数
|
||||
*/
|
||||
private Map<String, String> sendBackParams;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String modifierId;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件请求
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsEditUploadPrepareRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件下载地址
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsFetchDownloadRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件请求
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsFetchFileRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件请求
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsPermissionRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String personId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 文件重命名
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsRenameRequest {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
@NotBlank(message = "文档编码不能为空")
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 新文档名称
|
||||
*/
|
||||
@NotBlank(message = "新文档名称不能为空")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件请求
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsUsersRequest {
|
||||
|
||||
/**
|
||||
* 用户Id集合
|
||||
*/
|
||||
@NotEmpty(message = "personIds not empty")
|
||||
@Size(max = 1000, message = "personIds max length:1000")
|
||||
private List<String> personIds;
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 文档用户权限
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsEditUploadAddressResponse {
|
||||
|
||||
/**
|
||||
* 上传文档的 URL
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 上传文档的 HTTP Method,暂只支持 PUT,文件实体将在 Body 传递
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 上传文档时需要携带的额外请求头
|
||||
*/
|
||||
private Map<String, String> headers;
|
||||
|
||||
/**
|
||||
* 上传文档时需要携带的额外参数,PUT 方式下在 Query 传递
|
||||
*/
|
||||
private Map<String, String> params;
|
||||
|
||||
/**
|
||||
* 上传文档后,请求完成上传接口需要原样带回的额外参数
|
||||
*/
|
||||
private Map<String, String> sendBackParams;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 文档用户权限
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsEditUploadCompleteResponse {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档版本号,从 1 开始,每次保存后递增
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 文档大小,单位 byte
|
||||
*/
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 文档创建时间戳,单位纪元秒
|
||||
*/
|
||||
private Long createTime;
|
||||
|
||||
/**
|
||||
* 文档最后修改时间戳,单位纪元秒
|
||||
*/
|
||||
private Long modifyTime;
|
||||
|
||||
/**
|
||||
* 文档创建者 Id
|
||||
*/
|
||||
private String creatorId;
|
||||
|
||||
/**
|
||||
* 文档最后修改者 Id
|
||||
*/
|
||||
private String modifierId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 文档用户权限
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsEditUploadPrepareResponse {
|
||||
|
||||
/**
|
||||
* 文档校验和算法 md5 sha1 sha256
|
||||
*/
|
||||
private String[] digestTypes;
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件下载地址
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsFetchDownloadResponse {
|
||||
|
||||
/**
|
||||
* 文档下载地址,该地址需确保外网可访问且排除访问时防火墙的限制
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 文档校验和 (checksum)
|
||||
*/
|
||||
private String digest;
|
||||
|
||||
/**
|
||||
* 文档校验和算法 md5 或者 sha1
|
||||
*/
|
||||
private String digestType;
|
||||
|
||||
/**
|
||||
* 请求文档下载地址所需要的额外请求头,例如某些云存储商会要求额外的签名头等
|
||||
*/
|
||||
private Map<String, String> headers;
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 获取文件请求
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsFetchFileResponse {
|
||||
|
||||
/**
|
||||
* 文档编码
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 文档名称,最大长度 240,不能包含下列特殊字符:\/|":*?<>
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档版本号,无符号 int32 位,
|
||||
* 从 1 开始,每次保存后递增,如果已经迭代了多个版本,这里您需要返回最新的版本号
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 文档创建时间戳,单位纪元秒
|
||||
*/
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 文档创建时间戳,单位纪元秒
|
||||
*/
|
||||
private Date createAt;
|
||||
|
||||
/**
|
||||
* 文档最后修改时间戳,单位纪元秒
|
||||
*/
|
||||
private Date updateAt;
|
||||
|
||||
/**
|
||||
* 文档创建者 Id
|
||||
*/
|
||||
private String creatorId;
|
||||
|
||||
/**
|
||||
* 文档最后修改者 Id
|
||||
*/
|
||||
private String modifierId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 文档用户权限
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsPermissionResponse {
|
||||
|
||||
/**
|
||||
* 当前用户 Id,当 update=1;print=1时必须返回当前用户的 user_id
|
||||
*/
|
||||
private String personId;
|
||||
|
||||
/**
|
||||
* 是否具有预览权限,0-无 1-有
|
||||
*/
|
||||
private Integer read;
|
||||
|
||||
/**
|
||||
* 是否具有编辑权限,0-无 1-有
|
||||
*/
|
||||
private Integer update;
|
||||
|
||||
/**
|
||||
* 是否具有下载文档权限,0-无 1-有
|
||||
*/
|
||||
private Integer download;
|
||||
|
||||
/**
|
||||
* 是否具有重命名文档权限,0-无 1-有
|
||||
*/
|
||||
private Integer rename;
|
||||
|
||||
/**
|
||||
* 是否具有查看文档历史记录权限,0-无 1-有
|
||||
*/
|
||||
private Integer history;
|
||||
|
||||
/**
|
||||
* 是否具有拷贝文档内容权限,0-无 1-有
|
||||
*/
|
||||
private Integer copy;
|
||||
|
||||
/**
|
||||
* 是否具有打印文档权限,0-无 1-有
|
||||
*/
|
||||
private Integer print;
|
||||
|
||||
/**
|
||||
* 是否具有另存当前文档权限,0-无 1-有。该属性现阶段暂无相关入口,开发者可不用关注
|
||||
*/
|
||||
private Integer saveas;
|
||||
|
||||
/**
|
||||
* 是否具有评论文档权限,0-无 1-有。
|
||||
*/
|
||||
private Integer comment;
|
||||
|
||||
/**
|
||||
* 预览文档权限
|
||||
*/
|
||||
public static WpsPermissionResponse preview(String personId) {
|
||||
return WpsPermissionResponse.builder()
|
||||
.personId(personId)
|
||||
.read(1)
|
||||
.update(0)
|
||||
.download(0)
|
||||
.rename(0)
|
||||
.history(0)
|
||||
.copy(0)
|
||||
.print(0)
|
||||
.saveas(0)
|
||||
.comment(0)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/11
|
||||
* @description 文件重命名
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
//@AllArgsConstructor
|
||||
//@NoArgsConstructor
|
||||
public class WpsRenameResponse {
|
||||
|
||||
private boolean updateFlag;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
|
||||
package cn.axzo.nanopart.doc.api.wps.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2025/3/12
|
||||
* @description 文档用户
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WpsUsersResponse {
|
||||
|
||||
private List<WpsUser> users;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class WpsUser {
|
||||
/**
|
||||
* 当前用户 ID
|
||||
*/
|
||||
private String personId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户头像 URL,需要是https链接
|
||||
*/
|
||||
private String avatarUrl;
|
||||
}
|
||||
|
||||
}
|
||||
2
doc/doc-api/src/main/resources/META-INF/spring.factories
Normal file
2
doc/doc-api/src/main/resources/META-INF/spring.factories
Normal file
@ -0,0 +1,2 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
cn.axzo.nanopart.doc.api.autoconfig.DocAutoConfiguration
|
||||
108
doc/doc-server/pom.xml
Normal file
108
doc/doc-server/pom.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.axzo.nanopart</groupId>
|
||||
<artifactId>doc</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>doc-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>doc-server</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.oss</groupId>
|
||||
<artifactId>oss-http-api</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-web-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-spring-cloud-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-consumer-spring-cloud-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-processor-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis-plus-->
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-mybatisplus-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- swagger-yapi -->
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-swagger-yapi-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-logger-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework.rocketmq</groupId>
|
||||
<artifactId>axzo-common-rocketmq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.pokonyan</groupId>
|
||||
<artifactId>pokonyan</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.nanopart</groupId>
|
||||
<artifactId>doc-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.basics</groupId>
|
||||
<artifactId>basics-profiles-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.basics</groupId>
|
||||
<artifactId>basics-domainless-api</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.platform</groupId>
|
||||
<artifactId>axzo-log-api</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.basics</groupId>
|
||||
<artifactId>basics-profiles-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user