Documentation
¶
Index ¶
- type Account
- type Activity
- type Bounds
- type CombinedResultForDropMatrix
- type CombinedResultForDropPattern
- type CombinedResultForTrend
- type DropInfo
- type DropMatrixElement
- type DropMatrixQueryResult
- type DropPattern
- type DropPatternElement
- type DropPatternElementForExport
- type DropPatternForExport
- type DropReport
- type DropReportExtra
- type DropReportForExport
- type DropReportQueryContext
- type Existence
- type ExportDropReportsAndPatternsResult
- type GlobalDropMatrixAggregate
- type GlobalDropMatrixKey
- type GlobalDropMatrixTarget
- type GlobalPatternMatrixAggregates
- type GlobalPatternMatrixTarget
- type I18nOptionalString
- type I18nString
- type Item
- type ItemTrend
- type Keywords
- type Notice
- type OneDropMatrixElement
- type OnePatternMatrixElement
- type PatternMatrixElement
- type PatternMatrixQueryResult
- type Property
- type QuantityUniqCountResultForDropMatrix
- type RecognitionDefect
- type RejectRule
- type ServerExistence
- type SiteStatsAggregate
- type SiteStatsBase
- type Snapshot
- type Stage
- type StageExtended
- type StageTrend
- type TimeRange
- type TotalQuantityResultForDropMatrix
- type TotalQuantityResultForPatternMatrix
- type TotalQuantityResultForTrend
- type TotalTimesResult
- type TotalTimesResultForTrend
- type TrendElement
- type TrendQueryResult
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
type CombinedResultForTrend ¶
type DropInfo ¶
type DropInfo struct {
bun.BaseModel `bun:"drop_infos,alias:di"`
DropID int `bun:",pk,autoincrement" json:"id"`
Server string `json:"server"`
StageID int `json:"stageId"`
ItemID null.Int `json:"itemId" swaggertype:"integer"`
DropType string `json:"dropType"`
RangeID int `json:"rangeId"`
Accumulable bool `json:"accumulable"`
Bounds *Bounds `json:"bounds"`
Extras json.RawMessage `json:"extras,omitempty"`
}
DropInfo describes the drops of a stage during a time range: of one item, or, without an item, of the stage.
Accumulable tells whether the drops of the item in this time range are carried into the later time ranges of the stage and item. Consecutive accumulable time ranges are counted together; a time range that is not accumulable is counted on its own, without the time ranges before or after it. With A false, B and C true (in chronological order) the latest window is B~C; when the latest time range is not accumulable, it is the latest window by itself. The global and the personal drop matrices use the same rule (see #794 and service.accumulableSegments).
type DropMatrixElement ¶
type DropMatrixElement struct {
bun.BaseModel `bun:"drop_matrix_elements,alias:dme"`
ElementID int `bun:",pk,autoincrement" json:"id"`
StageID int `json:"stageId"`
ItemID int `json:"itemId"`
StartTime *time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime"`
DayNum int `json:"dayNum"`
Quantity int `json:"quantity"`
Times int `json:"times"`
QuantityBuckets map[int]int `bun:"type:jsonb" json:"quantityBuckets"`
Server string `json:"server"`
SourceCategory string `json:"sourceCategory"` // sourceCategory can be: "automated", "manual", "all"
RangeID int `bun:"-" json:"-"`
// TimeRange field is for those elements whose time range is not saved in DB, but a customized one
TimeRange *TimeRange `bun:"-" json:"-"`
}
type DropMatrixQueryResult ¶
type DropMatrixQueryResult struct {
Matrix []*OneDropMatrixElement `json:"matrix"`
}
type DropPattern ¶
type DropPatternElement ¶
type DropPatternForExport ¶
type DropPatternForExport struct {
PatternID int `json:"pattern_id"`
DropPatternElements []*DropPatternElementForExport `json:"drop_pattern_elements"`
}
type DropReport ¶
type DropReport struct {
bun.BaseModel `bun:"drop_reports,alias:dr"`
ReportID int `bun:",pk,autoincrement" json:"id"`
StageID int `json:"stageId"`
PatternID int `json:"patternId"`
Times int `json:"times"`
CreatedAt *time.Time `json:"createdAt"`
Reliability int `json:"reliability"`
Server string `json:"server"`
AccountID int `json:"accountId"`
SourceName string `json:"sourceName"`
Version string `json:"version"`
}
type DropReportExtra ¶
type DropReportExtra struct {
bun.BaseModel `bun:"drop_report_extras,alias:dre"`
ReportID int `bun:",pk,autoincrement" json:"id"`
IP string `json:"ip"`
Metadata *types.ReportRequestMetadata `json:"metadata"`
MD5 null.String `json:"md5" swaggertype:"string"`
// CreatedAt is the created_at of the report, the partition key of drop_report_extras on the new database of #752
// (scripts/newdb). Today's database has no such column, so bun neither selects nor inserts it: CreateDropReportExtra
// writes it when it is set, which the report worker does only with appconfig.ConfigSpec.ReportSchemaV2Enabled.
// Reads leave it nil.
CreatedAt *time.Time `bun:"-" json:"-"`
}
type DropReportForExport ¶
type DropReportQueryContext ¶
type DropReportQueryContext struct {
Server string `json:"server"`
StartTime *time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime"`
AccountID null.Int `json:"accountId"`
StageItemFilter *map[int][]int `json:"stageItemFilter"`
SourceCategory string `json:"sourceCategory"`
ExcludeNonOneTimes bool `json:"excludeNonOneTimes"`
Times null.Int `json:"times"`
}
func (*DropReportQueryContext) GetItemIdsSet ¶
func (queryCtx *DropReportQueryContext) GetItemIdsSet(stageId int) map[int]struct{}
func (*DropReportQueryContext) GetStageIds ¶
func (queryCtx *DropReportQueryContext) GetStageIds() []int
func (*DropReportQueryContext) HasItemIds ¶
func (queryCtx *DropReportQueryContext) HasItemIds() bool
type Existence ¶
type Existence struct {
// CN: 国服 Mainland China Server (maintained by Hypergryph Network Technology Co., Ltd.)
CN ServerExistence `json:"CN" validate:"required"`
// US: 美服/国际服 Global Server (maintained by Yostar Limited)
US ServerExistence `json:"US" validate:"required"`
// JP: 日服 Japan Server (maintained by Yostar Inc,.)
JP ServerExistence `json:"JP" validate:"required"`
// KR: 韩服 Korea Server (maintained by Yostar Limited)
KR ServerExistence `json:"KR" validate:"required"`
}
type ExportDropReportsAndPatternsResult ¶
type ExportDropReportsAndPatternsResult struct {
DropReports []*DropReportForExport `json:"drop_reports"`
DropPatterns []*DropPatternForExport `json:"drop_patterns"`
}
type GlobalDropMatrixAggregate ¶
type GlobalDropMatrixAggregate struct {
Times null.Int
Quantity null.Int
QuantityBuckets map[int]int
}
GlobalDropMatrixAggregate aggregates the elements of a target in a source category. Times sums times over the distinct (times, day_num) of the elements with times > 0; Quantity and QuantityBuckets sum those with quantity > 0. A part no element counts for is invalid (empty for the buckets).
type GlobalDropMatrixKey ¶
type GlobalDropMatrixTarget ¶
GlobalDropMatrixTarget is a stage and item of a global drop matrix, with the time range its elements are aggregated over (the elements within it).
type GlobalPatternMatrixAggregates ¶
type GlobalPatternMatrixAggregates struct {
TimesByStageID map[int]int
QuantitiesByStageID map[int]map[int]int
}
GlobalPatternMatrixAggregates aggregates the elements of the targets of a source category: per stage, the times summed over days of the smallest times > 0 of a day, and per stage and pattern, the quantity > 0 summed.
type GlobalPatternMatrixTarget ¶
GlobalPatternMatrixTarget is a stage of a global pattern matrix, with the time range its elements are aggregated over (the elements within it).
type I18nOptionalString ¶
type I18nString ¶
type Item ¶
type Item struct {
bun.BaseModel `bun:"items,alias:it" swaggerignore:"true"`
// ItemID (penguinItemId) is the numerical ID of the item.
ItemID int `bun:",pk,autoincrement" json:"penguinItemId"`
// ArkItemID (itemId) is the previously used, string form ID of the item; in JSON-representation `itemId` is used as key.
ArkItemID string `json:"itemId"`
Type string `json:"type"`
// Name is a map with language code as key and the name of the item in that language as value.
Name json.RawMessage `json:"name" swaggertype:"object"`
// Existence is a map with server code as key and the existence of the item in that server as value.
Existence json.RawMessage `json:"existence" swaggertype:"object"`
// SortID is the sort position of the item.
SortID int `json:"sortId"`
Rarity int `json:"rarity"`
// Group is an identifier of what the item actually is. For example, both orirock and orirock cube would have the same group, `orirock`.
Group null.String `json:"group,omitempty" swaggertype:"string"`
// Sprite describes the location of the item's sprite on the sprite image, in a form of Y:X.
Sprite null.String `json:"sprite,omitempty" swaggertype:"string"`
// Keywords is an arbitrary JSON object containing the keywords of the item, for optimizing the results of the frontend built-in search engine.
Keywords json.RawMessage `json:"keywords,omitempty" swaggertype:"object"`
}
type Keywords ¶
type Keywords struct {
// Alias of the item
Alias I18nOptionalString `json:"alias"`
// Pronunciation hints of the item
Pron I18nOptionalString `json:"pron"`
}
type Notice ¶
type Notice struct {
bun.BaseModel `bun:"notices"`
NoticeID int `bun:",pk,autoincrement" json:"id"`
Existence json.RawMessage `json:"existence" swaggertype:"object"`
Severity null.Int `json:"severity" swaggertype:"integer"`
Content json.RawMessage `json:"content_i18n"`
}
type OneDropMatrixElement ¶
type OnePatternMatrixElement ¶
type PatternMatrixElement ¶
type PatternMatrixElement struct {
bun.BaseModel `bun:"pattern_matrix_elements,alias:pme"`
ElementID int `bun:",pk,autoincrement" json:"id"`
StageID int `json:"stageId"`
PatternID int `json:"patternId"`
StartTime *time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime"`
DayNum int `json:"dayNum"`
Quantity int `json:"quantity"`
Times int `json:"times"`
Server string `json:"server"`
SourceCategory string `json:"sourceCategory"` // sourceCategory can be: "automated", "manual", "all"
RangeID int `bun:"-" json:"-"`
}
type PatternMatrixQueryResult ¶
type PatternMatrixQueryResult struct {
PatternMatrix []*OnePatternMatrixElement `json:"dropPatterns"`
}
type RecognitionDefect ¶
type RecognitionDefect struct {
bun.BaseModel `bun:"recognition_defects"`
// DefectID is the primary key for this table; it is generated by client
DefectID string `bun:"defect_id,pk" json:"defectId"`
CreatedAt *time.Time `bun:"created_at,nullzero,default:current_timestamp" json:"createdAt"`
UpdatedAt *time.Time `bun:"updated_at,nullzero" json:"updatedAt"`
SessionID string `bun:"session_id,notnull" json:"sessionId"`
AccountID int `bun:"account_id,nullzero" json:"accountId"`
ImageURI string `bun:"image_uri" json:"imageUrl"`
RecognitionResult json.RawMessage `bun:"recognition_result,notnull" json:"recognitionResult"`
Environment json.RawMessage `bun:"environment,notnull" json:"environment"`
}
type RejectRule ¶
type RejectRule struct {
bun.BaseModel `bun:"reject_rules"`
RuleID int `bun:",pk,autoincrement" json:"id"`
CreatedAt *time.Time `bun:"created_at" json:"created_at"`
UpdatedAt *time.Time `bun:"updated_at" json:"updated_at"`
Status int `bun:"status" json:"status"`
Expr string `bun:"expr" json:"expr"`
WithReliability int `bun:"with_reliability" json:"with_reliability"`
}
type ServerExistence ¶
type SiteStatsAggregate ¶
type SiteStatsAggregate struct {
StageID int `bun:"stage_id"`
ItemID int `bun:"item_id"`
// Times sums times over the distinct (times, day_num) pairs with times > 0; NULL if there is no such pair.
Times null.Int `bun:"times"`
Quantity int `bun:"quantity"`
}
SiteStatsAggregate is the per stage and item aggregation of drop matrix elements behind the site stats. Aggregates of disjoint day ranges add up (see Add).
func (*SiteStatsAggregate) Add ¶
func (a *SiteStatsAggregate) Add(other *SiteStatsAggregate)
Add accumulates an aggregate of the same stage and item over a disjoint range of days.
type SiteStatsBase ¶
type SiteStatsBase struct {
BeforeDayNum int
Generation int64
Aggregates []*SiteStatsAggregate
}
SiteStatsBase holds the site stats aggregates of every day before BeforeDayNum, as of invalidation Generation.
type Stage ¶
type Stage struct {
bun.BaseModel `bun:"stages,alias:st"`
// StageID (penguinStageId) is the numerical ID of the stage.
StageID int `bun:",pk,autoincrement" json:"penguinStageId"`
// ArkStageID (stageId) is the previously used, string form ID of the stage; in JSON-representation `stageId` is used as key.
ArkStageID string `json:"stageId"`
// ZoneID is the numerical ID of the zone the stage is in.
ZoneID int `json:"zoneId"`
// StageType is the type of the stage, e.g. "MAIN", "SUB", "ACTIVITY" and "DAILY".
StageType string `json:"stageType"`
// ExtraProcessType is the type of extra process that is used in the stage, e.g. "GACHABOX".
ExtraProcessType null.String `json:"extraProcessType" swaggertype:"string"`
// Code is a map with language code as key and the code of the stage in that language as value.
Code json.RawMessage `json:"code"`
// Sanity is the sanity requirement for a full clear of the stage.
Sanity null.Int `json:"sanity" swaggertype:"integer"`
// Existence is a map with server code as key and the existence of the item in that server as value.
Existence json.RawMessage `json:"existence" swaggertype:"object"`
// MinClearTime is the minimum time (in milliseconds as a duration) it takes to clear the stage, referencing from prts.wiki
MinClearTime null.Int `json:"minClearTime" swaggertype:"integer"`
}
type StageExtended ¶
type StageTrend ¶
type TimeRange ¶
type TimeRange struct {
bun.BaseModel `bun:"time_ranges,alias:tr"`
RangeID int `bun:",pk,autoincrement" json:"id"`
Name null.String `json:"name,omitempty" swaggertype:"string"`
StartTime *time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime"`
Comment null.String `json:"comment" swaggertype:"string"`
Server string `json:"server"`
}
func TimeRangeFromString ¶
func (*TimeRange) HumanReadableString ¶
type TotalQuantityResultForDropMatrix ¶
type TotalQuantityResultForDropMatrix struct {
StageID int `json:"stageId" bun:"stage_id"`
ItemID int `json:"itemId" bun:"item_id"`
TotalQuantity int `json:"totalQuantity" bun:"total_quantity"`
}
DropMatrix
type TotalQuantityResultForPatternMatrix ¶
type TotalQuantityResultForPatternMatrix struct {
StageID int `json:"stageId" bun:"stage_id"`
PatternID int `json:"patternId" bun:"pattern_id"`
TotalQuantity int `json:"totalQuantity" bun:"total_quantity"`
}
DropPattern
type TotalQuantityResultForTrend ¶
type TotalQuantityResultForTrend struct {
GroupID int `json:"groupId" bun:"group_id"`
IntervalStart *time.Time `json:"intervalStart" bun:"interval_start"`
IntervalEnd *time.Time `json:"intervalEnd" bun:"interval_end"`
StageID int `json:"stageId" bun:"stage_id"`
ItemID int `json:"itemId" bun:"item_id"`
TotalQuantity int `json:"totalQuantity" bun:"total_quantity"`
}
Trend
type TotalTimesResult ¶
type TotalTimesResultForTrend ¶
type TotalTimesResultForTrend struct {
GroupID int `json:"groupId" bun:"group_id"`
IntervalStart *time.Time `json:"intervalStart" bun:"interval_start"`
IntervalEnd *time.Time `json:"intervalEnd" bun:"interval_end"`
StageID int `json:"stageId" bun:"stage_id"`
TotalTimes int `json:"totalTimes" bun:"total_times"`
}
type TrendElement ¶
type TrendElement struct {
ElementID int `json:"id"`
StageID int `json:"stageId"`
ItemID int `json:"itemId"`
GroupID int `json:"groupId"`
StartTime *time.Time `json:"startTime"`
EndTime *time.Time `json:"endTime"`
Quantity int `json:"quantity"`
Times int `json:"times"`
Server string `json:"server"`
SourceCategory string `json:"sourceCategory"` // sourceCategory can be: "automated", "manual", "all"
}
type TrendQueryResult ¶
type TrendQueryResult struct {
Trends []*StageTrend `json:"trends"`
}
type Zone ¶
type Zone struct {
bun.BaseModel `bun:"zones,alias:zo"`
// ZoneID is the numerical ID of the zone.
ZoneID int `bun:",pk,autoincrement" json:"penguinZoneId"`
ArkZoneID string `json:"zoneId"`
Index int `json:"index"`
// Category of the zone.
Category string `json:"category" example:"MAINLINE"`
// Type of the zone, e.g. "AWAKENING_HOUR" or "VISION_SHATTER". Optional and only occurs when `category` is "MAINLINE".
Type null.String `json:"type,omitempty" swaggertype:"string" example:"AWAKENING_HOUR"`
// Name is a map with language code as key and the name of the item in that language as value.
Name json.RawMessage `json:"name"`
// Existence is a map with server code as key and the existence of the item in that server as value.
Existence json.RawMessage `json:"existence" swaggertype:"object"`
// Background is the path of the background image of the zone, relative to the CDN endpoint.
Background null.String `json:"background,omitempty" swaggertype:"string"`
}
Source Files
¶
- account.go
- activity.go
- drop_info.go
- drop_matrix_element.go
- drop_matrix_element_query_result.go
- drop_pattern.go
- drop_pattern_element.go
- drop_report.go
- drop_report_extra.go
- drop_report_query_context.go
- drop_report_query_result.go
- export.go
- item.go
- notice.go
- pattern_matrix_element.go
- pattern_matrix_element_query_result.go
- property.go
- recognition_defect.go
- reject_rule.go
- snapshot.go
- stage.go
- swagger.go
- time_range.go
- trend_element.go
- zone.go