Skip to content

Commit 92a3abe

Browse files
authored
Merge pull request #1 from Dot-Liu/main
APIPark-1.0-beta完成
2 parents 7190c32 + 2e3bfff commit 92a3abe

File tree

111 files changed

+1255
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1255
-833
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: "Bug Report"
2+
description: Report a bug to help improve the project.
3+
title: "bug: "
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to report this bug!
9+
10+
_The more information you share, the faster we can identify and fix the bug._
11+
12+
Prior to opening the issue, please make sure that you:
13+
14+
- Use English to communicate.
15+
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
16+
17+
- type: textarea
18+
id: current-behavior
19+
attributes:
20+
label: Current Behavior
21+
description: Describe the issue you are facing.
22+
placeholder: |
23+
What is the issue with the current behavior?
24+
validations:
25+
required: true
26+
- type: textarea
27+
id: expected-behavior
28+
attributes:
29+
label: Expected Behavior
30+
description: Describe what you expected to happen.
31+
placeholder: |
32+
What did you expect to happen instead?
33+
validations:
34+
required: false
35+
- type: textarea
36+
id: error
37+
attributes:
38+
label: Error Logs
39+
description: Paste the error logs if any.
40+
validations:
41+
required: false
42+
- type: textarea
43+
id: steps
44+
attributes:
45+
label: Steps to Reproduce
46+
description: Share the steps you took so that we can reproduce the issue. Reports without proper steps details will likely be closed.
47+
placeholder: |
48+
1. Run apinto via the Docker image.
49+
2. Create a Route with the Admin API.
50+
3. Try configuring ...
51+
4. ...
52+
validations:
53+
required: true
54+
- type: textarea
55+
id: environment
56+
attributes:
57+
label: Environment
58+
description: Share your environment details. Reports without proper environment details will likely be closed.
59+
value: |
60+
- APINTO Dashboard version (run `apinto dashboard version`):
61+
- Operating system (run `uname -a`):
62+
validations:
63+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: APIPark Discussion Forum
4+
url: https://github.com/APIParkLab/APIPark/discussions
5+
about: Please ask and answer questions here.

.github/ISSUE_TEMPLATE/docs_issue.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Documentation Issue"
2+
description: Issues related to documentation.
3+
title: "docs: "
4+
labels: [doc]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
_The more information you share, the faster we can help you._
10+
11+
Prior to opening the issue, please make sure that you:
12+
13+
- Use English to communicate.
14+
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
15+
16+
- type: textarea
17+
id: current-state
18+
attributes:
19+
label: Current State
20+
description: Describe the current state of the documentation.
21+
placeholder: |
22+
The documentation for the API in this page (url) is missing ...
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: desired-state
27+
attributes:
28+
label: Desired State
29+
description: Describe the desired state the documentation should be in.
30+
placeholder: |
31+
There should be line mentioning how the API behaves when ...
32+
validations:
33+
required: true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Feature Request"
2+
description: Suggest an enhancement to APINTO.
3+
title: "feat: As a user, I want to ..., so that ..."
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
_The more information you share, the faster we can help you._
9+
10+
Prior to opening the issue, please make sure that you:
11+
12+
- Use English to communicate.
13+
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
14+
15+
- type: textarea
16+
id: description
17+
attributes:
18+
label: Description
19+
description: Describe the feature you would like to see.
20+
placeholder: |
21+
As a user, I want to ..., so that...
22+
validations:
23+
required: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Request Help"
2+
description: Stuck? Ask for help!
3+
title: "help request: "
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
_The more information you share, the faster we can help you._
9+
10+
Prior to opening the issue, please make sure that you:
11+
12+
- Use English to communicate.
13+
- Search the [open issues](https://github.com/APIParkLab/APIPark/issues) and [discussion forum](https://github.com/APIParkLab/APIPark/discussions) to avoid duplicating the issue.
14+
15+
- type: textarea
16+
id: description
17+
attributes:
18+
label: Description
19+
description: Describe the issue you are facing and what you need help with.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: environment
24+
attributes:
25+
label: Environment
26+
description: Share your environment details. Reports without proper environment details will likely be closed.
27+
value: |
28+
- APIPark version (run `apinto dashboard version`):
29+
- Operating system (run `uname -a`):
30+
validations:
31+
required: true

.github/workflows/release.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: release
2+
#触发机制,当创建tag时
3+
on:
4+
release:
5+
types:
6+
- published
7+
jobs:
8+
frontend-builder:
9+
name: frontend-builder
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: SetOutput
13+
id: vars
14+
run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
15+
- name: Checkout #Checkout代码
16+
uses: actions/checkout@v3
17+
- name: Set up Node
18+
uses: actions/setup-node@v3.0.0
19+
with:
20+
node-version: '18.12'
21+
- name: Pnpm install and build
22+
run: |
23+
npm install -g pnpm
24+
pnpm install --registry https://registry.npmmirror.com --dir ./frontend
25+
echo "Build frontend..."
26+
cd ./frontend && pnpm run build
27+
- name: upload frontend release
28+
uses: actions/upload-artifact@v2
29+
with:
30+
name: frontend-package
31+
path: frontend/dist
32+
release:
33+
needs: [frontend-builder]
34+
name: release
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: SetOutput #处理Tag字符串并存进outputs
38+
id: vars
39+
run: |
40+
echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
41+
- name: Checkout #Checkout代码
42+
uses: actions/checkout@v3
43+
- name: download frontend release
44+
uses: actions/download-artifact@v2
45+
with:
46+
name: frontend-package
47+
path: frontend/dist
48+
- name: Set up Go
49+
uses: actions/setup-go@v3
50+
with:
51+
go-version: '1.21.1'
52+
- name: Go tidy
53+
run: |
54+
go mod tidy
55+
echo "GOVERSION=$(go version)" >> $GITHUB_ENV
56+
- name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets
57+
uses: goreleaser/goreleaser-action@v3.1.0
58+
with:
59+
version: 1.9.2
60+
args: release --rm-dist
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
docker-push:
64+
needs: [frontend-builder]
65+
name: docker-push
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: SetOutput
69+
id: vars
70+
run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
71+
- uses: actions/checkout@v3
72+
73+
- name: download frontend release
74+
uses: actions/download-artifact@v2
75+
with:
76+
name: frontend-package
77+
path: frontend/dist
78+
- name: Login Docker #登录docker
79+
uses: docker/login-action@v1
80+
with:
81+
username: ${{ secrets.DOCKER_USERNAME }}
82+
password: ${{ secrets.DOCKER_TOKEN }}
83+
84+
- name: build
85+
run: cd scripts && ./docker_publish.sh ${{ secrets.DOCKER_USERNAME }} "backend"
86+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.DS_Store
22
/.idea/
33
/config.yml
4+
/build/
5+
/apipark

controller/dynamic-module/dynamic-module.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ type IDynamicModuleController interface {
1616
List(ctx *gin.Context, module string, keyword string, cluster string, page string, pageSize string) ([]map[string]interface{}, *dynamic_module_dto.PluginInfo, int64, error)
1717
Render(ctx *gin.Context, module string) (*dynamic_module_dto.PluginBasic, map[string]interface{}, error)
1818
ModuleDrivers(ctx *gin.Context, group string) ([]*dynamic_module_dto.ModuleDriver, error)
19-
Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error
20-
Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error
19+
Online(ctx *gin.Context, module string, id string) error
20+
Offline(ctx *gin.Context, module string, id string) error
2121
//PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error)
2222
//PartitionStatus(ctx *gin.Context, module string, id string) (*dynamic_module_dto.OnlineInfo, error)
2323
}

controller/dynamic-module/iml.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ type imlDynamicModuleController struct {
1515
module dynamic_module.IDynamicModuleModule `autowired:""`
1616
}
1717

18-
func (i *imlDynamicModuleController) Online(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error {
19-
return i.module.Online(ctx, module, id, partitionInput)
18+
func (i *imlDynamicModuleController) Online(ctx *gin.Context, module string, id string) error {
19+
return i.module.Online(ctx, module, id)
2020
}
2121

22-
func (i *imlDynamicModuleController) Offline(ctx *gin.Context, module string, id string, partitionInput *dynamic_module_dto.ClusterInput) error {
23-
return i.module.Offline(ctx, module, id, partitionInput)
22+
func (i *imlDynamicModuleController) Offline(ctx *gin.Context, module string, id string) error {
23+
return i.module.Offline(ctx, module, id)
2424
}
2525

2626
//func (i *imlDynamicModuleController) PartitionStatuses(ctx *gin.Context, module string, keyword string, page string, pageSize string) (map[string]map[string]string, error) {

controller/my_team/iml.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ type imlTeamController struct {
1414
module my_team.ITeamModule `autowired:""`
1515
}
1616

17+
func (c *imlTeamController) SimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error) {
18+
return c.module.SimpleTeams(ctx, keyword)
19+
}
20+
1721
func (c *imlTeamController) UpdateMemberRole(ctx *gin.Context, id string, input *team_dto.UpdateMemberRole) error {
1822
return c.module.UpdateMemberRole(ctx, id, input)
1923
}
@@ -23,16 +27,16 @@ func (c *imlTeamController) GetTeam(ctx *gin.Context, id string) (*team_dto.Team
2327
}
2428

2529
func (c *imlTeamController) Search(ctx *gin.Context, keyword string) ([]*team_dto.Item, error) {
26-
30+
2731
return c.module.Search(ctx, keyword)
2832
}
2933

3034
func (c *imlTeamController) EditTeam(ctx *gin.Context, id string, team *team_dto.EditTeam) (*team_dto.Team, error) {
3135
return c.module.Edit(ctx, id, team)
3236
}
3337

34-
func (c *imlTeamController) SimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error) {
35-
return c.module.SimpleTeams(ctx, keyword)
38+
func (c *imlTeamController) MySimpleTeams(ctx *gin.Context, keyword string) ([]*team_dto.SimpleTeam, error) {
39+
return c.module.MySimpleTeams(ctx, keyword)
3640
}
3741

3842
func (c *imlTeamController) AddMember(ctx *gin.Context, id string, users *team_dto.UserIDs) error {

0 commit comments

Comments
 (0)