Fix service_event nil kycid
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-08 17:07:33 +08:00
parent e7df62e673
commit 79ccd0036e
2 changed files with 58 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ type CheckinResult struct {
func (self *EventServiceImpl) Checkin(payload *CheckinPayload) (result *CheckinResult) {
attendandeData, err := new(data.Attendance).
GetAttendance(payload.Context, payload.Data.EventId, payload.UserId)
GetAttendance(payload.Context, payload.UserId, payload.Data.EventId)
if err != nil {
result = &CheckinResult{
Common: shared.CommonResult{
@@ -49,9 +49,46 @@ func (self *EventServiceImpl) Checkin(payload *CheckinPayload) (result *CheckinR
return
}
if attendandeData == nil {
result = &CheckinResult{
Common: shared.CommonResult{
HttpCode: 403,
Exception: new(exception.Builder).
SetStatus(exception.StatusUser).
SetService(exception.ServiceEvent).
SetEndpoint(exception.EndpointEventServiceCheckin).
SetType(exception.TypeCommon).
SetOriginal(exception.CommonErrorInvalidInput).
Throw(payload.Context),
},
}
return
}
eventData, err := new(data.Event).
GetEventById(payload.Context, payload.Data.EventId)
if err != nil || eventData == nil {
code := 500
if eventData == nil {
code = 404
}
result = &CheckinResult{
Common: shared.CommonResult{
HttpCode: code,
Exception: new(exception.Builder).
SetStatus(exception.StatusUser).
SetService(exception.ServiceEvent).
SetEndpoint(exception.EndpointEventServiceCheckin).
SetType(exception.TypeCommon).
SetOriginal(exception.CommonErrorInvalidInput).
SetError(err).
Throw(payload.Context),
},
}
return
}
if attendandeData.KycId == uuid.Nil && eventData.EnableKYC == true {
result = &CheckinResult{
Common: shared.CommonResult{