Skip to content

Commit 13fa480

Browse files
committed
update alvax model
1 parent 1e707a5 commit 13fa480

File tree

4 files changed

+236
-57
lines changed

4 files changed

+236
-57
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
APP_NAME=swis-api
66
APP_ROOT=/opt/${APP_NAME}
7-
APP_VERSION=5.18.4
7+
APP_VERSION=5.18.5
88

99

1010
#

api/swagger.json

Lines changed: 146 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"name": "MIT",
1414
"url": "https://github.com/vxn-dev/swis-api/blob/master/LICENSE"
1515
},
16-
"version": "5.18.4"
16+
"version": "5.18.5"
1717
},
1818
"host": "swis-api-run-prod:8050",
1919
"basePath": "/",
@@ -3901,7 +3901,35 @@
39013901
}
39023902
},
39033903
"definitions": {
3904-
"pkg_alvax.Channel": {
3904+
"pkg_alvax.ChannelSpecific": {
3905+
"type": "object",
3906+
"properties": {
3907+
"memeMode": {
3908+
"type": "boolean"
3909+
},
3910+
"sendErrors": {
3911+
"type": "boolean"
3912+
}
3913+
}
3914+
},
3915+
"pkg_alvax.Channels": {
3916+
"type": "object",
3917+
"properties": {
3918+
"Discord": {
3919+
"$ref": "#/definitions/pkg_alvax.ChannelsDiscord"
3920+
},
3921+
"Kanban": {
3922+
"$ref": "#/definitions/pkg_alvax.ChannelsKanban"
3923+
},
3924+
"Redmine": {
3925+
"$ref": "#/definitions/pkg_alvax.ChannelsRedmine"
3926+
},
3927+
"Telegram": {
3928+
"$ref": "#/definitions/pkg_alvax.ChannelsTelegram"
3929+
}
3930+
}
3931+
},
3932+
"pkg_alvax.ChannelsDiscord": {
39053933
"type": "object",
39063934
"properties": {
39073935
"baseUrl": {
@@ -3910,29 +3938,111 @@
39103938
"botToken": {
39113939
"type": "string"
39123940
},
3941+
"commands": {
3942+
"type": "array",
3943+
"items": {}
3944+
},
3945+
"integrate": {
3946+
"type": "boolean"
3947+
},
3948+
"methods": {
3949+
"$ref": "#/definitions/pkg_alvax.ChannelsDiscordMethods"
3950+
},
3951+
"name": {
3952+
"type": "string"
3953+
},
3954+
"prodWebhook": {
3955+
"type": "string"
3956+
},
3957+
"token": {
3958+
"type": "string"
3959+
},
3960+
"webhookEndpoint": {
3961+
"type": "string"
3962+
}
3963+
}
3964+
},
3965+
"pkg_alvax.ChannelsDiscordMethods": {
3966+
"type": "object"
3967+
},
3968+
"pkg_alvax.ChannelsKanban": {
3969+
"type": "object",
3970+
"properties": {
3971+
"baseUrl": {
3972+
"type": "string"
3973+
},
3974+
"integrate": {
3975+
"type": "boolean"
3976+
},
3977+
"methods": {
3978+
"$ref": "#/definitions/pkg_alvax.ChannelsKanbanMethods"
3979+
},
3980+
"name": {
3981+
"type": "string"
3982+
},
3983+
"token": {
3984+
"type": "string"
3985+
},
3986+
"username": {
3987+
"type": "string"
3988+
}
3989+
}
3990+
},
3991+
"pkg_alvax.ChannelsKanbanMethods": {
3992+
"type": "object"
3993+
},
3994+
"pkg_alvax.ChannelsRedmine": {
3995+
"type": "object",
3996+
"properties": {
3997+
"baseUrl": {
3998+
"type": "string"
3999+
},
4000+
"integrate": {
4001+
"type": "boolean"
4002+
},
4003+
"methods": {
4004+
"$ref": "#/definitions/pkg_alvax.ChannelsRedmineMethods"
4005+
},
4006+
"name": {
4007+
"type": "string"
4008+
},
4009+
"token": {
4010+
"type": "string"
4011+
}
4012+
}
4013+
},
4014+
"pkg_alvax.ChannelsRedmineMethods": {
4015+
"type": "object"
4016+
},
4017+
"pkg_alvax.ChannelsTelegram": {
4018+
"type": "object",
4019+
"properties": {
4020+
"baseUrl": {
4021+
"type": "string"
4022+
},
4023+
"channelSpecific": {
4024+
"$ref": "#/definitions/pkg_alvax.ChannelsTelegramChannelSpecific"
4025+
},
39134026
"commands": {
39144027
"type": "array",
39154028
"items": {
3916-
"$ref": "#/definitions/pkg_alvax.Command"
4029+
"$ref": "#/definitions/pkg_alvax.ChannelsTelegramCommandsItem"
39174030
}
39184031
},
39194032
"defaultGroupId": {
39204033
"type": "integer"
39214034
},
3922-
"githubGroupId": {
4035+
"dishGroupId": {
39234036
"type": "integer"
39244037
},
3925-
"integrate": {
3926-
"type": "boolean"
4038+
"gitHubGroupId": {
4039+
"type": "integer"
39274040
},
3928-
"memeMode": {
4041+
"integrate": {
39294042
"type": "boolean"
39304043
},
39314044
"methods": {
3932-
"type": "object",
3933-
"additionalProperties": {
3934-
"type": "string"
3935-
}
4045+
"$ref": "#/definitions/pkg_alvax.ChannelsTelegramMethods"
39364046
},
39374047
"name": {
39384048
"type": "string"
@@ -3943,18 +4053,21 @@
39434053
"token": {
39444054
"type": "string"
39454055
},
3946-
"username": {
4056+
"webhookEndpoint": {
39474057
"type": "string"
39484058
},
3949-
"wehbookEndpoint": {
3950-
"type": "string"
3951-
},
3952-
"wehbookUrl": {
4059+
"webhookUrl": {
39534060
"type": "string"
39544061
}
39554062
}
39564063
},
3957-
"pkg_alvax.Command": {
4064+
"pkg_alvax.ChannelsTelegramChannelSpecific": {
4065+
"type": "object",
4066+
"additionalProperties": {
4067+
"$ref": "#/definitions/pkg_alvax.ChannelSpecific"
4068+
}
4069+
},
4070+
"pkg_alvax.ChannelsTelegramCommandsItem": {
39584071
"type": "object",
39594072
"properties": {
39604073
"description": {
@@ -3968,20 +4081,26 @@
39684081
},
39694082
"parameters": {
39704083
"type": "array",
3971-
"items": {
3972-
"type": "string"
3973-
}
4084+
"items": {}
4085+
}
4086+
}
4087+
},
4088+
"pkg_alvax.ChannelsTelegramMethods": {
4089+
"type": "object",
4090+
"properties": {
4091+
"sendMessage": {
4092+
"type": "string"
4093+
},
4094+
"sendPhoto": {
4095+
"type": "string"
39744096
}
39754097
}
39764098
},
39774099
"pkg_alvax.ConfigRoot": {
39784100
"type": "object",
39794101
"properties": {
39804102
"channels": {
3981-
"type": "object",
3982-
"additionalProperties": {
3983-
"$ref": "#/definitions/pkg_alvax.Channel"
3984-
}
4103+
"$ref": "#/definitions/pkg_alvax.Channels"
39854104
},
39864105
"docker": {
39874106
"$ref": "#/definitions/pkg_alvax.Docker"
@@ -3996,6 +4115,9 @@
39964115
"ngrok": {
39974116
"$ref": "#/definitions/pkg_alvax.Ngrok"
39984117
},
4118+
"remoteConfigSourceUrl": {
4119+
"type": "string"
4120+
},
39994121
"server": {
40004122
"$ref": "#/definitions/pkg_alvax.Server"
40014123
}

cmd/swis-api/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @title swis-api (swapi) v5
2-
// @version 5.18.4
2+
// @version 5.18.5
33
// @description sakalWeb Information System v5 RESTful API documentation
44
// @termsOfService http://swagger.io/terms/
55

pkg/alvax/models.go

Lines changed: 88 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,103 @@ type ConfigRootMap struct {
55
}
66

77
type ConfigRoot struct {
8-
ID string `json:"id" required:"true" readonly:"true"`
9-
Key string `json:"key" required:"true"`
10-
Server Server `json:"server"`
11-
Ngrok Ngrok `json:"ngrok"`
12-
Docker Docker `json:"docker"`
13-
Channels map[string]Channel `json:"channels"`
8+
ID string `json:"id" required:"true" readonly:"true"`
9+
Key string `json:"key" required:"true"`
10+
RemoteConfigSourceUrl string `json:"remoteConfigSourceUrl"`
11+
Server Server `json:"server"`
12+
Channels Channels `json:"channels"`
13+
Ngrok Ngrok `json:"ngrok"`
14+
Docker Docker `json:"docker"`
1415
}
1516

1617
type Server struct {
1718
Port int `json:"port"`
1819
}
1920

21+
type ChannelSpecific struct {
22+
MemeMode bool `json:"memeMode"`
23+
SendErrors bool `json:"sendErrors"`
24+
}
25+
26+
type ChannelsTelegramChannelSpecific map[string]ChannelSpecific
27+
28+
type ChannelsTelegramMethods struct {
29+
SendMessage string `json:"sendMessage"`
30+
SendPhoto string `json:"sendPhoto"`
31+
}
32+
33+
type ChannelsTelegramCommandsItem struct {
34+
Name string `json:"name"`
35+
FullName string `json:"fullName"`
36+
Parameters []interface{} `json:"parameters"`
37+
Description string `json:"description"`
38+
}
39+
40+
type ChannelsTelegram struct {
41+
Name string `json:"name"`
42+
Integrate bool `json:"integrate"`
43+
BaseUrl string `json:"baseUrl"`
44+
Token string `json:"token"`
45+
WebhookEndpoint string `json:"webhookEndpoint"`
46+
WebhookUrl string `json:"webhookUrl"`
47+
ChannelSpecific ChannelsTelegramChannelSpecific `json:"channelSpecific"`
48+
ProdWebhook string `json:"prodWebhook"`
49+
Methods ChannelsTelegramMethods `json:"methods"`
50+
Commands []ChannelsTelegramCommandsItem `json:"commands"`
51+
DefaultGroupId int `json:"defaultGroupId"`
52+
GitHubGroupId int `json:"gitHubGroupId"`
53+
DishGroupId int `json:"dishGroupId"`
54+
}
55+
56+
type ChannelsDiscordMethods struct {
57+
}
58+
59+
type ChannelsDiscord struct {
60+
Name string `json:"name"`
61+
Integrate bool `json:"integrate"`
62+
BaseUrl string `json:"baseUrl"`
63+
BotToken string `json:"botToken"`
64+
WebhookEndpoint string `json:"webhookEndpoint"`
65+
ProdWebhook string `json:"prodWebhook"`
66+
Methods ChannelsDiscordMethods `json:"methods"`
67+
Token string `json:"token"`
68+
Commands []interface{} `json:"commands"`
69+
}
70+
71+
type ChannelsKanbanMethods struct {
72+
}
73+
74+
type ChannelsKanban struct {
75+
Name string `json:"name"`
76+
Integrate bool `json:"integrate"`
77+
BaseUrl string `json:"baseUrl"`
78+
Methods ChannelsKanbanMethods `json:"methods"`
79+
Username string `json:"username"`
80+
Token string `json:"token"`
81+
}
82+
83+
type ChannelsRedmineMethods struct {
84+
}
85+
86+
type ChannelsRedmine struct {
87+
Name string `json:"name"`
88+
Integrate bool `json:"integrate"`
89+
BaseUrl string `json:"baseUrl"`
90+
Methods ChannelsRedmineMethods `json:"methods"`
91+
Token string `json:"token"`
92+
}
93+
94+
type Channels struct {
95+
Telegram ChannelsTelegram `json:"Telegram"`
96+
Discord ChannelsDiscord `json:"Discord"`
97+
Kanban ChannelsKanban `json:"Kanban"`
98+
Redmine ChannelsRedmine `json:"Redmine"`
99+
}
100+
20101
type Ngrok struct {
21-
TunnelsURL string `json:"tunnelsUrl"`
102+
TunnelsUrl string `json:"tunnelsUrl"`
22103
}
23104

24105
type Docker struct {
25106
Host string `json:"host"`
26107
}
27-
28-
type Channel struct {
29-
Name string `json:"name"`
30-
Integrate bool `json:"integrate"`
31-
BaseURL string `json:"baseUrl"`
32-
Token string `json:"token"`
33-
BotToken string `json:"botToken"`
34-
WebhookEndpoint string `json:"wehbookEndpoint"`
35-
WebhookURL string `json:"wehbookUrl"`
36-
MemeMode bool `json:"memeMode"`
37-
ProdWebhook string `json:"prodWebhook"`
38-
Methods map[string]string `json:"methods"`
39-
Commands []Command `json:"commands"`
40-
DefaultGroupID int64 `json:"defaultGroupId"`
41-
GithubGroupID int64 `json:"githubGroupId"`
42-
UserName string `json:"username"`
43-
}
44-
45-
type Command struct {
46-
Name string `json:"name"`
47-
FullName string `json:"fullName"`
48-
Parameters []string `json:"parameters"`
49-
Description string `json:"description"`
50-
}

0 commit comments

Comments
 (0)