Skip to content

Commit 21682d3

Browse files
committed
add API Docs
1 parent 91d66db commit 21682d3

File tree

4 files changed

+118
-0
lines changed

4 files changed

+118
-0
lines changed

docs/qaworkspace/project/README.md

Whitespace-only changes.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package io.fluentqa.pm.project.model;
2+
3+
4+
import io.fluentqa.erupts.base.model.ModelWithValidFlagVo;
5+
import io.fluentqa.pm.product.model.Product;
6+
import lombok.Data;
7+
import xyz.erupt.annotation.Erupt;
8+
import xyz.erupt.annotation.EruptField;
9+
import xyz.erupt.annotation.sub_erupt.Power;
10+
import xyz.erupt.annotation.sub_erupt.Tree;
11+
import xyz.erupt.annotation.sub_field.Edit;
12+
import xyz.erupt.annotation.sub_field.EditType;
13+
import xyz.erupt.annotation.sub_field.View;
14+
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
15+
import xyz.erupt.annotation.sub_field.sub_edit.InputType;
16+
import xyz.erupt.annotation.sub_field.sub_edit.ReferenceTreeType;
17+
import xyz.erupt.annotation.sub_field.sub_edit.Search;
18+
import xyz.erupt.toolkit.handler.SqlChoiceFetchHandler;
19+
20+
import javax.persistence.*;
21+
import java.util.UUID;
22+
23+
@Erupt(name = "项目配置",
24+
power = @Power(importable = true, export = true),
25+
tree = @Tree(pid = "parent.id"))
26+
@Entity
27+
@Table(name = "projects")
28+
@Data
29+
public class Project extends ModelWithValidFlagVo {
30+
31+
@EruptField(
32+
views = @View(
33+
title = "名称"
34+
),
35+
edit = @Edit(
36+
title = "名称",
37+
type = EditType.INPUT, search = @Search,
38+
notNull = true,
39+
inputType = @InputType
40+
)
41+
)
42+
private String name;
43+
44+
@EruptField(
45+
views = @View(
46+
title = "代号"
47+
),
48+
edit = @Edit(
49+
title = "代号",
50+
type = EditType.INPUT, search = @Search,
51+
notNull = true,
52+
inputType = @InputType
53+
)
54+
)
55+
private String code;
56+
57+
@EruptField(
58+
views = @View(
59+
title = "详细描述"
60+
),
61+
edit = @Edit(
62+
title = "详细描述",
63+
type = EditType.INPUT, search = @Search, notNull = true,
64+
inputType = @InputType
65+
)
66+
)
67+
private String details;
68+
69+
@ManyToOne
70+
@EruptField(
71+
edit = @Edit(
72+
title = "产品清单",
73+
type = EditType.REFERENCE_TREE,
74+
referenceTreeType = @ReferenceTreeType(pid = "parent.id")
75+
)
76+
)
77+
private Product productId;
78+
79+
@Column(length = 36, nullable = false, updatable = false)
80+
private String uuid = UUID.randomUUID().toString();
81+
}

server/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
<artifactId>fluent-pm</artifactId>
5252
<version>${fluent.version}</version>
5353
</dependency>
54+
<dependency>
55+
<groupId>com.github.xiaoymin</groupId>
56+
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
57+
<version>4.3.0</version>
58+
</dependency>
5459

5560
</dependencies>
5661
<build>

server/src/main/resources/application-dev.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,38 @@ spring:
3939
max-file-size: 100MB
4040
max-request-size: 100MB
4141

42+
# springdoc-openapi项目配置
43+
springdoc:
44+
swagger-ui:
45+
path: /swagger-ui.html
46+
tags-sorter: alpha
47+
operations-sorter: alpha
48+
api-docs:
49+
path: /v3/api-docs
50+
group-configs:
51+
- group: 'default'
52+
paths-to-match: '/**'
53+
packages-to-scan: com.xiaominfo.knife4j.demo.web
54+
# knife4j的增强配置,不需要增强可以不配
55+
knife4j:
56+
enable: true
57+
openapi:
58+
title: Knife4j官方文档
59+
description: "`我是测试`,**你知道吗**
60+
# aaa"
61+
62+
concat: 八一菜刀
63+
url: https://docs.xiaominfo.com
64+
version: v4.0
65+
license: Apache 2.0
66+
license-url: https://stackoverflow.com/
67+
terms-of-service-url: https://stackoverflow.com/
68+
group:
69+
test1:
70+
group-name: 分组名称
71+
api-rule: package
72+
# api-rule-resources:
73+
# - com.knife4j.demo.new3
4274

4375
server:
4476
# 启用 gzip 压缩

0 commit comments

Comments
 (0)