mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
5.1
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
<?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>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-admin-backend</artifactId>
|
||||
<version>5.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>website-web</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>backend-service</artifactId>
|
||||
<version>5.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@@ -1,67 +0,0 @@
|
||||
package com.gitee.sop.admin.controller.website;
|
||||
|
||||
import com.gitee.sop.admin.common.annotation.NoToken;
|
||||
import com.gitee.sop.admin.common.resp.Result;
|
||||
import com.gitee.sop.admin.common.util.CopyUtil;
|
||||
import com.gitee.sop.admin.controller.website.vo.DocAppVO;
|
||||
import com.gitee.sop.admin.controller.website.vo.DocInfoViewVO;
|
||||
import com.gitee.sop.admin.controller.website.vo.DocInfoTreeVO;
|
||||
import com.gitee.sop.admin.service.doc.dto.DocAppDTO;
|
||||
import com.gitee.sop.admin.service.doc.dto.DocInfoTreeDTO;
|
||||
import com.gitee.sop.admin.service.doc.dto.DocInfoViewDTO;
|
||||
import com.gitee.sop.admin.service.website.WebsiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提供给网站的接口,不需要校验token
|
||||
*
|
||||
* @author 六如
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("website")
|
||||
@NoToken
|
||||
public class WebsiteController {
|
||||
|
||||
@Autowired
|
||||
private WebsiteService websiteService;
|
||||
|
||||
/**
|
||||
* 获取文档应用列表
|
||||
*/
|
||||
@GetMapping("docapp/list")
|
||||
public Result<List<DocAppVO>> listDocApp() {
|
||||
List<DocAppDTO> docAppDTOS = websiteService.listDocApp();
|
||||
List<DocAppVO> docAppVOS = CopyUtil.deepCopyList(docAppDTOS, DocAppVO.class);
|
||||
return Result.ok(docAppVOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档菜单树
|
||||
*
|
||||
* @param docAppId 应用id
|
||||
*/
|
||||
@GetMapping("docinfo/tree")
|
||||
public Result<List<DocInfoTreeVO>> listDocMenuTree(Long docAppId) {
|
||||
List<DocInfoTreeDTO> docInfoTreeDTOS = websiteService.listDocMenuTree(docAppId);
|
||||
List<DocInfoTreeVO> docAppVOS = CopyUtil.deepCopyList(docInfoTreeDTOS, DocInfoTreeVO.class);
|
||||
return Result.ok(docAppVOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档详情
|
||||
*
|
||||
* @param id id
|
||||
*/
|
||||
@GetMapping("docinfo/detail")
|
||||
public Result<DocInfoViewVO> getDocDetail(Long id) {
|
||||
DocInfoViewDTO docInfoViewDTO = websiteService.getDocDetail(id);
|
||||
DocInfoViewVO docInfoViewVO = CopyUtil.deepCopy(docInfoViewDTO, DocInfoViewVO.class);
|
||||
return Result.ok(docInfoViewVO);
|
||||
}
|
||||
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
package com.gitee.sop.admin.controller.website.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 备注:文档应用
|
||||
*
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class DocAppVO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 应用名称
|
||||
*/
|
||||
private String appName;
|
||||
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
package com.gitee.sop.admin.controller.website.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class DocInfoConfigVO {
|
||||
|
||||
private String openProdUrl;
|
||||
private String openSandboxUrl;
|
||||
|
||||
}
|
@@ -1,100 +0,0 @@
|
||||
package com.gitee.sop.admin.controller.website.vo;
|
||||
|
||||
import com.gitee.fastmybatis.core.support.TreeNode;
|
||||
import com.gitee.sop.admin.common.constants.YesOrNo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* 备注:文档信息
|
||||
*
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class DocInfoTreeVO implements TreeNode<DocInfoTreeVO, Long> {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* doc_app.id
|
||||
*/
|
||||
private Long docAppId;
|
||||
|
||||
/**
|
||||
* 文档id
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 文档标题
|
||||
*/
|
||||
private String docTitle;
|
||||
|
||||
/**
|
||||
* 文档code
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 文档类型,1-dubbo,2-富文本,3-Markdown
|
||||
*/
|
||||
private Integer docType;
|
||||
|
||||
/**
|
||||
* 来源类型,1-torna,2-自建
|
||||
*/
|
||||
private Integer sourceType;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String docName;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String docVersion;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 是否分类
|
||||
*/
|
||||
private Integer isFolder;
|
||||
|
||||
/**
|
||||
* 父节点id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
|
||||
private List<DocInfoTreeVO> children;
|
||||
|
||||
|
||||
@Override
|
||||
public Long takeId() {
|
||||
return docId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long takeParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
|
||||
public String getDocName() {
|
||||
if (Objects.equals(isFolder, YesOrNo.YES)) {
|
||||
return "";
|
||||
}
|
||||
return docName;
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
package com.gitee.sop.admin.controller.website.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class DocInfoViewVO {
|
||||
|
||||
private TornaDocInfoViewVO docInfoView;
|
||||
|
||||
private DocInfoConfigVO docInfoConfig;
|
||||
|
||||
}
|
@@ -1,179 +0,0 @@
|
||||
package com.gitee.sop.admin.controller.website.vo;
|
||||
|
||||
import com.gitee.sop.admin.service.doc.dto.torna.TornaDocParamDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tanghc
|
||||
*/
|
||||
@Data
|
||||
public class TornaDocInfoViewVO {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档概述
|
||||
*/
|
||||
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 0:http,1:dubbo
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 访问URL
|
||||
*/
|
||||
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version = "";
|
||||
|
||||
private String docKey;
|
||||
|
||||
/**
|
||||
* http方法
|
||||
*/
|
||||
|
||||
private String httpMethod;
|
||||
|
||||
/**
|
||||
* contentType
|
||||
*/
|
||||
|
||||
private String contentType;
|
||||
|
||||
|
||||
/**
|
||||
* 是否是分类,0:不是,1:是
|
||||
*/
|
||||
private Byte isFolder;
|
||||
|
||||
/**
|
||||
* 父节点
|
||||
*/
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 模块id,module.id
|
||||
*/
|
||||
|
||||
private Long moduleId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 是否使用全局请求参数
|
||||
*/
|
||||
|
||||
private Byte isUseGlobalHeaders;
|
||||
|
||||
/**
|
||||
* 是否使用全局请求参数
|
||||
*/
|
||||
|
||||
private Byte isUseGlobalParams;
|
||||
|
||||
/**
|
||||
* 是否使用全局返回参数
|
||||
*/
|
||||
|
||||
private Byte isUseGlobalReturns;
|
||||
|
||||
/**
|
||||
* 是否请求数组
|
||||
*/
|
||||
|
||||
private Byte isRequestArray;
|
||||
|
||||
/**
|
||||
* 是否返回数组
|
||||
*/
|
||||
|
||||
private Byte isResponseArray;
|
||||
|
||||
/**
|
||||
* 请求数组时元素类型
|
||||
*/
|
||||
|
||||
private String requestArrayType;
|
||||
|
||||
/**
|
||||
* 返回数组时元素类型
|
||||
*/
|
||||
|
||||
private String responseArrayType;
|
||||
|
||||
/**
|
||||
* 文档状态
|
||||
*/
|
||||
|
||||
private Byte status;
|
||||
|
||||
private String remark;
|
||||
|
||||
private Integer orderIndex;
|
||||
|
||||
/**
|
||||
* 数据库字段:gmt_create
|
||||
*/
|
||||
private LocalDateTime gmtCreate;
|
||||
|
||||
/**
|
||||
* 数据库字段:gmt_modified
|
||||
*/
|
||||
private LocalDateTime gmtModified;
|
||||
|
||||
|
||||
private List<TornaDocParamDTO> pathParams = Collections.emptyList();
|
||||
|
||||
|
||||
private List<TornaDocParamDTO> headerParams = Collections.emptyList();
|
||||
|
||||
private List<TornaDocParamDTO> headerParamsRaw = Collections.emptyList();
|
||||
|
||||
|
||||
private List<TornaDocParamDTO> queryParams = Collections.emptyList();
|
||||
|
||||
|
||||
private List<TornaDocParamDTO> requestParams = Collections.emptyList();
|
||||
|
||||
|
||||
private List<TornaDocParamDTO> responseParams = Collections.emptyList();
|
||||
|
||||
private List<TornaDocParamDTO> errorCodeParams = Collections.emptyList();
|
||||
|
||||
private List<TornaDocParamDTO> globalHeaders = Collections.emptyList();
|
||||
private List<TornaDocParamDTO> globalParams = Collections.emptyList();
|
||||
private List<TornaDocParamDTO> globalReturns = Collections.emptyList();
|
||||
|
||||
private String errorCodeInfo;
|
||||
|
||||
private List<TornaDocInfoViewVO> children = Collections.emptyList();
|
||||
|
||||
public String getDocName() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public String getDocTitle() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user