Documentation ¶
Index ¶
- Variables
- func Module() fx.Option
- func RegisterAccount(v2 *svr.V2, c Account)
- func RegisterEventPeriod(v2 *svr.V2, c EventPeriod)
- func RegisterFormula(v2 *svr.V2, c Formula)
- func RegisterFrontendConfig(v2 *svr.V2, c FrontendConfig)
- func RegisterItem(v2 *svr.V2, c Item)
- func RegisterNotice(v2 *svr.V2, c Notice)
- func RegisterPrivate(v2 *svr.V2, c Private)
- func RegisterReport(v2 *svr.V2, c Report)
- func RegisterResult(v2 *svr.V2, c Result)
- func RegisterShortURL(v2 *svr.V2, c ShortURL)
- func RegisterSiteStats(v2 *svr.V2, c SiteStats)
- func RegisterStage(v2 *svr.V2, c Stage)
- func RegisterUpyun(v2 *svr.V2, c Recognition)
- func RegisterZone(v2 *svr.V2, c Zone)
- type Account
- type EventPeriod
- type Formula
- type FrontendConfig
- type InitDefectReportRequest
- type InitDefectReportRequestEnvironment
- type InitDefectReportResponse
- type InitDefectReportResponseUploadParams
- type Item
- type Notice
- type Private
- type Recognition
- type Report
- type Result
- type ShortURL
- type SiteStats
- type Stage
- type Zone
Constants ¶
This section is empty.
Variables ¶
var ErrIntervalLengthTooSmall = pgerr.ErrInvalidReq.Msg("interval length must be greater than 1 hour")
ErrIntervalLengthTooSmall is returned when the interval length is invalid
Functions ¶
func RegisterAccount ¶
func RegisterEventPeriod ¶
func RegisterEventPeriod(v2 *svr.V2, c EventPeriod)
func RegisterFormula ¶
func RegisterFrontendConfig ¶
func RegisterFrontendConfig(v2 *svr.V2, c FrontendConfig)
func RegisterItem ¶
func RegisterNotice ¶
func RegisterPrivate ¶
func RegisterReport ¶
func RegisterResult ¶
func RegisterShortURL ¶
func RegisterSiteStats ¶
func RegisterStage ¶
func RegisterUpyun ¶
func RegisterUpyun(v2 *svr.V2, c Recognition)
func RegisterZone ¶
Types ¶
type Account ¶
func (*Account) Login ¶
@Summary Login with PenguinID @Tags Account @Accept plain @Produce plain @Param userId body int true "User ID" @Success 200 {object} modelv2.LoginResponse "User ID. In the deprecated backend this is, for some reason, been implemented to return a JSON in the response body but with a `Content-Type: text/plain` in the response header instead of the correct `Content-Type: application/json`. So the v2 API has replicated this behavior to ensure compatibility." @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Security PenguinIDAuth @Router /PenguinStats/api/v2/users [POST]
type EventPeriod ¶
func (*EventPeriod) GetEventPeriods ¶
func (c *EventPeriod) GetEventPeriods(ctx *fiber.Ctx) (err error)
@Summary Get All Event Periods @Tags EventPeriod @Produce json @Success 200 {array} modelv2.Activity{label_i18n=model.I18nString,existence=model.Existence} @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/period [GET]
type Formula ¶
func (*Formula) GetFormula ¶
@Summary Get Formula @Tags Formula @Produce json @Success 200 @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/formula [GET]
type FrontendConfig ¶
type FrontendConfig struct { fx.In FrontendConfigService *service.FrontendConfig }
func (*FrontendConfig) GetFrontendConfig ¶
func (c *FrontendConfig) GetFrontendConfig(ctx *fiber.Ctx) error
@Summary Get FrontendConfig @Tags FrontendConfig @Produce json @Success 200 @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/config [GET]
type InitDefectReportRequest ¶
type InitDefectReportRequest struct { RecognitionResult json.RawMessage `json:"recognitionResult" validate:"dive"` Environment InitDefectReportRequestEnvironment `json:"environment" validate:"required,dive"` }
type InitDefectReportRequestEnvironment ¶
type InitDefectReportRequestEnvironment struct { FrontendVersion string `json:"frontendVersion" validate:"required,max=32,printascii"` FrontendCommit string `json:"frontendCommit" validate:"required,max=32,printascii"` RecognizerVersion string `json:"recognizerVersion" validate:"required,max=32,printascii"` RecognizerOpenCVVersion string `json:"recognizerOpenCVVersion" validate:"required,max=32,printascii"` RecognizerAssetsVersion string `json:"recognizerAssetsVersion" validate:"required,max=32,printascii"` Server string `json:"server" validate:"required,arkserver"` SessionID string `json:"sessionId" validate:"required,len=8,alphanum"` }
type InitDefectReportResponse ¶
type InitDefectReportResponse struct { UploadParams InitDefectReportResponseUploadParams `json:"uploadParams"` DefectID string `json:"defectId"` }
type Item ¶
func (*Item) GetItemByArkId ¶
@Summary Get an Item with ID @Tags Item @Produce json @Param itemId path string true "Item ID" @Success 200 {object} modelv2.Item{name_i18n=model.I18nString,existence=model.Existence} @Failure 400 {object} pgerr.PenguinError "Invalid or missing itemId. Notice that this shall be the **string ID** of the item, instead of the internally used numerical ID of the item." @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/items/{itemId} [GET]
type Notice ¶
func (*Notice) GetNotices ¶
@Summary Get All Notices @Tags Notice @Produce json @Success 200 {array} model.Notice @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/notice [GET]
type Private ¶
type Private struct { fx.In DropMatrixService *service.DropMatrix PatternMatrixService *service.PatternMatrix TrendService *service.Trend AccountService *service.Account ItemService *service.Item StageService *service.Stage }
func (*Private) GetDropMatrix ¶
func (*Private) GetPatternMatrix ¶
type Recognition ¶
type Recognition struct { fx.In RecognitionDefectRepo *repo.RecognitionDefect AccountService *service.Account UpyunService *service.Upyun }
func (*Recognition) InitDefectReport ¶
func (c *Recognition) InitDefectReport(ctx *fiber.Ctx) error
func (*Recognition) RetrieveDefectReportImageCallback ¶
func (c *Recognition) RetrieveDefectReportImageCallback(ctx *fiber.Ctx) error
type Report ¶
type Report struct { fx.In Redis *redis.Client RedSync *redsync.Redsync Crypto *crypto.Crypto ReportService *service.Report AccountService *service.Account }
func (*Report) MiddlewareGetOrCreateAccount ¶
func (*Report) RecallSingularReport ¶
@Summary Recall a Drop Report @Description Recall a Drop Report by its `reportHash`. The farest report you can recall is limited to 24 hours. Recalling a report after it has been already recalled will result in an error. @Tags Report @Accept json @Produce json @Param report body types.SingularReportRecallRequest true "Report Recall request" @Success 204 "Report has been successfully recalled" @Failure 400 {object} pgerr.PenguinError "`reportHash` is missing, invalid, or already been recalled." @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/report/recall [POST]
func (*Report) RecognitionReport ¶
@Summary Bulk Submit with Frontend Recognition @Description Submit an Item Drop Report with Frontend Recognition. Notice that this is a **private API** and is not designed for external use. @Tags Report @Produce json @Param report body string true "Recognition Report Request" @Success 200 {object} modelv2.RecognitionReportResponse "Report has been successfully submitted for queue processing" @Failure 400 {object} pgerr.PenguinError "Invalid request" @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Security PenguinIDAuth @Router /PenguinStats/api/v2/report/recognition [POST]
func (*Report) SingularReport ¶
@Summary Submit a Drop Report @Description Submit a Drop Report. You can use the `reportHash` in the response to recall the report in 24 hours after it has been submitted. @Tags Report @Accept json @Produce json @Param report body types.SingularReportRequest true "Report request" @Success 200 {object} modelv2.ReportResponse "Report has been successfully submitted" @Failure 400 {object} pgerr.PenguinError "Invalid request" @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Security PenguinIDAuth @Router /PenguinStats/api/v2/report [POST]
type Result ¶
type Result struct { fx.In DropMatrixService *service.DropMatrix PatternMatrixService *service.PatternMatrix TrendService *service.Trend AccountService *service.Account ItemService *service.Item StageService *service.Stage }
func (*Result) AdvancedQuery ¶
@Summary Execute Advanced Query @Tags Result @Produce json @Param query body types.AdvancedQueryRequest true "Query" @Success 200 {object} modelv2.AdvancedQueryResult{advanced_results=[]modelv2.DropMatrixQueryResult} "Drop Matrix Response: when `interval` has been left undefined." @Success 202 {object} modelv2.AdvancedQueryResult{advanced_results=[]modelv2.TrendQueryResult} "Trend Response: when `interval` has been defined a value greater than `0`. Notice that this response still responds with a status code of `200`, but due to swagger limitations, to denote a different response with the same status code is not possible. Therefore, a status code of `202` is used, only for the purpose of workaround." @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/result/advanced [POST]
func (*Result) GetDropMatrix ¶
@Summary Get Drop Matrix @Tags Result @Produce json @Param server query string true "Server; default to CN" Enums(CN, US, JP, KR) @Param is_personal query bool false "Whether to query for personal drop matrix or not. If `is_personal` equals to `true`, a valid PenguinID would be required to be provided (PenguinIDAuth)" @Param show_closed_zones query bool false "Whether to show closed stages or not" @Param category query string false "Category; default to all" Enums(all, automated, manual) @Param stageFilter query []string false "Comma separated list of stage IDs to filter" collectionFormat(csv) @Param itemFilter query []string false "Comma separated list of item IDs to filter" collectionFormat(csv) @Success 200 {object} modelv2.DropMatrixQueryResult "Drop Matrix response" @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Security PenguinIDAuth @Router /PenguinStats/api/v2/result/matrix [GET]
func (*Result) GetPatternMatrix ¶
@Summary Get Pattern Matrix @Tags Result @Produce json @Param server query string true "Server; default to CN" Enums(CN, US, JP, KR) @Param is_personal query bool false "Whether to query for personal drop matrix or not. If `is_personal` equals to `true`, a valid PenguinID would be required to be provided (PenguinIDAuth)" @Param showAllPatterns query bool false "Show all patterns; default to false" @Success 200 {object} modelv2.PatternMatrixQueryResult @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Security PenguinIDAuth @Router /PenguinStats/api/v2/result/pattern [GET]
func (*Result) GetTrends ¶
@Summary Get Trends @Tags Result @Produce json @Param server query string true "Server; default to CN" Enums(CN, US, JP, KR) @Success 200 {object} modelv2.TrendQueryResult @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/result/trends [GET]
type SiteStats ¶
func (*SiteStats) GetSiteStats ¶
@Summary Get Site Stats @Tags SiteStats @Produce json @Param server query string true "Server; default to CN" Enums(CN, US, JP, KR) @Success 200 {array} modelv2.SiteStats @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/stats [GET]
type Stage ¶
func (*Stage) GetStageByArkId ¶
@Summary Get a Stage with ID @Tags Stage @Produce json @Param stageId path int true "Stage ID" @Success 200 {object} modelv2.Stage{existence=model.Existence,code_i18n=model.I18nString} @Failure 400 {object} pgerr.PenguinError "Invalid or missing stageId. Notice that this shall be the **string ID** of the stage, instead of the internally used numerical ID of the stage." @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/stages/{stageId} [GET]
type Zone ¶
func (*Zone) GetZoneByArkId ¶
@Summary Get a Zone with ID @Tags Zone @Produce json @Param zoneId path int true "Zone ID" @Success 200 {object} modelv2.Zone{existence=model.Existence,zoneName_i18n=model.I18nString} @Failure 400 {object} pgerr.PenguinError "Invalid or missing zoneId. Notice that this shall be the **string ID** of the zone, instead of the v3 API internally used numerical ID of the zone." @Failure 500 {object} pgerr.PenguinError "An unexpected error occurred" @Router /PenguinStats/api/v2/zones/{zoneId} [GET]