package event import ( "nixcn-cms/internal/exception" "nixcn-cms/service/service_event" "nixcn-cms/utils" "github.com/gin-gonic/gin" "github.com/google/uuid" ) // AttendanceList handles the retrieval of the attendance list for a specific event. // // @Summary Get Attendance List // @Description Retrieves the list of attendees, including user info and decrypted KYC data for a specified event. // @Tags Event // @Produce json // @Param event_id query string true "Event UUID" // @Param X-Api-Version header string true "latest" // @Success 200 {object} utils.RespStatus{data=[]service_event.AttendanceListResponse} "Successful retrieval" // @Failure 400 {object} utils.RespStatus{data=nil} "Invalid Input" // @Failure 401 {object} utils.RespStatus{data=nil} "Unauthorized" // @Failure 500 {object} utils.RespStatus{data=nil} "Internal Server Error" // @Router /event/attendance [get] func (self *EventHandler) AttendanceList(c *gin.Context) { eventIdStr := c.Query("event_id") eventId, err := uuid.Parse(eventIdStr) if err != nil { errorCode := new(exception.Builder). SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceAttendanceList). SetType(exception.TypeCommon). SetOriginal(exception.CommonErrorInvalidInput). // 或者 CommonErrorUuidParseFailed SetError(err). Throw(c). String() utils.HttpResponse(c, 400, errorCode) return } listData := service_event.AttendanceListData{ EventId: eventId, } result := self.svc.AttendanceList(&service_event.AttendanceListPayload{ Context: c, Data: &listData, }) if result.Common.Exception.Original != exception.CommonSuccess { utils.HttpResponse(c, result.Common.HttpCode, result.Common.Exception.String()) return } utils.HttpResponse(c, 200, result.Common.Exception.String(), result.Data) }