Fix swagger data struct error
Some checks failed
Backend Check Build (NixCN CMS) TeamCity build failed
Client CMS Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-29 01:25:12 +08:00
parent f7bde8ef2e
commit 654b196bfd
15 changed files with 136 additions and 316 deletions

View File

@@ -19,13 +19,15 @@ type InfoPayload struct {
Data *InfoData
}
type InfoResponse struct {
Name string `json:"name"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
type InfoResult struct {
Common shared.CommonResult
Data *struct {
Name string `json:"name"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
Data *InfoResponse
}
func (self *EventServiceImpl) Info(payload *InfoPayload) (result *InfoResult) {
@@ -50,16 +52,6 @@ func (self *EventServiceImpl) Info(payload *InfoPayload) (result *InfoResult) {
return
}
resultData := struct {
Name string `json:"name"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}{
Name: event.Name,
StartTime: event.StartTime,
EndTime: event.EndTime,
}
result = &InfoResult{
Common: shared.CommonResult{
HttpCode: 200,
@@ -71,7 +63,11 @@ func (self *EventServiceImpl) Info(payload *InfoPayload) (result *InfoResult) {
SetOriginal(exception.CommonSuccess).
Throw(payload.Context),
},
Data: &resultData,
Data: &InfoResponse{
Name: event.Name,
StartTime: event.StartTime,
EndTime: event.EndTime,
},
}
return