app_page.api
3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
syntax = "v1"
info(
title: "天联字库图表模板"
desc: "图表模板"
author: "小火箭"
email: "email"
version: "v1"
)
@server(
prefix: v1
group: page
jwt: JwtAuth
)
service Core {
@doc "保存应用页"
@handler saveAppPage
post /app-page (AppPageSaveRequest) returns (AppPageSaveResponse)
@doc "应用页另存为"
@handler saveAsAppPage
post /app-page/saveas (AppPageSaveAsRequest) returns (AppPageSaveAsResponse)
@doc "删除应用页"
@handler deleteAppPage
delete /app-page/:id (AppPageDeleteRequest) returns (AppPageDeleteResponse)
@doc "更新应用页"
@handler updateAppPage
put /app-page/:id (AppPageUpdateRequest) returns (AppPageUpdateResponse)
@doc "搜索"
@handler searchAppPage
post /app-page/search (AppPageSearchRequest) returns (AppPageSearchResponse)
@doc "创建应用页分享"
@handler createAppPageShareUrl
post /app-page/create-share (AppPageCreateShareRequest) returns (AppPageCreateShareResponse)
}
type (
AppPageGetRequest {
Id int64 `path:"id"`
}
AppPageGetResponse struct{
AppPage AppPageItem `json:"page"`
}
AppPageSaveRequest struct{
Name string `json:"name"` // 名称
Charts []int64 `json:"charts"`// 图表
Cover string `json:"cover,optional"` // 封面
}
AppPageSaveResponse struct{
Id int64 `json:"id"`
}
AppPageSaveAsRequest struct{
Id int64 `json:"id"` // 页面ID
Name string `json:"name"` // 名称
}
AppPageSaveAsResponse struct{
Id int64 `path:"id"`
Name string `json:"name"` // 名称
Charts []int64 `json:"charts"`// 图表
}
AppPageCreateShareRequest struct{
Id int64 `json:"id"` // 页面ID
}
AppPageCreateShareResponse struct{
Key string `json:"key,optional"` // 分享,预览时绑定映射到Id
}
AppPageDeleteRequest struct{
Id int64 `path:"id"` // 页面ID
}
AppPageDeleteResponse struct{}
AppPageUpdateRequest struct{
Id int64 `path:"id"`
Name string `json:"name,optional"` // 名称
Charts []int64 `json:"charts"`// 图表
Cover string `json:"cover,optional"` // 封面
}
AppPageUpdateResponse struct{}
AppPageSearchRequest struct{
Page int `json:"page"`
Size int `json:"size"`
}
AppPageSearchResponse{
List []AppPageItem `json:"list"`
Total int64 `json:"total"`
}
AppPageItem struct{
Id int64 `json:"id,optional"` // 唯一标识
Name string `json:"name,optional"` // 名称
Cover string `json:"cover,optional"` // 封面
Charts []AppPageChartItem `json:"charts,optional"`// 图表
UpdatedAt int64 `json:"updatedAt,optional"` //更新时间
}
AppPageChartItem struct{
ChartId int64 `json:"chartId"` // 图表ID
Name string `json:"name"` // 图表名称
Cover string `json:"cover"` // 图表封面
ChartType string `json:"chartType,optional"` // 图表类型
}
)
@server(
prefix: v1
group: page
)
service Core {
@doc "获取应用页详情"
@handler getAppPage
get /app-page/:id (AppPageGetRequest) returns (AppPageGetResponse)
@doc "开放接口-获取应用页详情通过KEY"
@handler getAppPageShareDetail
get /api/app-page/get-share-detail/:key (GetAppPageShareDetailRequest) returns (GetAppPageShareDetailResponse)
}
type (
GetAppPageShareDetailRequest struct{
Key string `path:"key"`
}
GetAppPageShareDetailResponse struct{
AppPage AppPageItem `json:"page"`
}
)