Add isjoined to event info and event list
All checks were successful
Client CMS Check Build (NixCN CMS) TeamCity build finished
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-02-05 17:43:20 +08:00
parent a7a6b7aa4e
commit 4f0b4262ed
9 changed files with 191 additions and 19 deletions

View File

@@ -32,7 +32,8 @@ type EventIndexDoc struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Thumbnail string `json:"thumbnail"`
RequireKyc bool `json:"require_kyc"`
EnableKYC bool `json:"enable_kyc"`
IsJoined bool `json:"is_joined"`
JoinCount int64 `json:"join_count"`
CheckinCount int64 `json:"checkin_count"`
}
@@ -98,7 +99,7 @@ func (self *Event) FastListEvents(ctx context.Context, limit, offset int64) (*[]
err := Database.WithContext(ctx).
Model(&Event{}).
Select("event_id", "name", "type", "description", "start_time", "end_time").
Select("event_id", "name", "type", "description", "start_time", "end_time", "enable_kyc").
Limit(int(limit)).
Offset(int(offset)).
Scan(&results).Error