@@ -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
|
||||
|
||||
Reference in New Issue
Block a user