Documentation ¶
Index ¶
- Constants
- Variables
- func Module() fx.Option
- type Account
- func (s *Account) CreateAccountWithRandomPenguinId(ctx context.Context) (*model.Account, error)
- func (s *Account) GetAccountById(ctx context.Context, accountId string) (*model.Account, error)
- func (s *Account) GetAccountByPenguinId(ctx context.Context, penguinId string) (*model.Account, error)
- func (s *Account) GetAccountFromRequest(ctx *fiber.Ctx) (*model.Account, error)
- func (s *Account) IsAccountExistWithId(ctx context.Context, accountId int) bool
- type Activity
- type Admin
- func (s *Admin) CloneFromCN(ctx context.Context, req types.CloneFromCNRequest) error
- func (s *Admin) EvaluateRejectRules(ctx context.Context, ...) (RejectRulesReevaluationEvaluationResultSet, error)
- func (s *Admin) GetRejectRulesReportContext(ctx context.Context, req types.RejectRulesReevaluationPreviewRequest) ([]RejectRulesReevaluationEvaluationContext, error)
- func (s *Admin) SaveRenderedObjects(ctx context.Context, objects *gamedata.RenderedObjects) error
- type Analytics
- type Archive
- type DropInfo
- func (s *DropInfo) CloneDropInfosFromCN(ctx context.Context, originRangeId int, destRangeId int, server string) error
- func (s *DropInfo) GetAppearStageIdsByServer(ctx context.Context, server string) ([]int, error)
- func (s *DropInfo) GetCurrentDropInfosByServer(ctx context.Context, server string) ([]*model.DropInfo, error)
- func (s *DropInfo) GetDropInfosByServer(ctx context.Context, server string) ([]*model.DropInfo, error)
- func (s *DropInfo) GetDropInfosWithFilters(ctx context.Context, server string, timeRanges []*model.TimeRange, ...) ([]*model.DropInfo, error)
- func (s *DropInfo) GetItemDropSetByStageIdAndRangeId(ctx context.Context, server string, stageId int, rangeId int) ([]int, error)
- func (s *DropInfo) GetItemDropSetByStageIdAndTimeRange(ctx context.Context, server string, stageId int, startTime *time.Time, ...) ([]int, error)
- type DropMatrix
- func (s *DropMatrix) GetShimCustomizedDropMatrixResults(ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, ...) (*modelv2.DropMatrixQueryResult, error)
- func (s *DropMatrix) GetShimDropMatrix(ctx context.Context, server string, showClosedZones bool, ...) (*modelv2.DropMatrixQueryResult, error)
- func (s *DropMatrix) RunCalcDropMatrixJob(ctx context.Context, server string) error
- func (s *DropMatrix) UpdateDropMatrixByGivenDate(ctx context.Context, server string, date *time.Time) error
- type DropMatrixElement
- func (s *DropMatrixElement) BatchSaveElements(ctx context.Context, elements []*model.DropMatrixElement, server string) error
- func (s *DropMatrixElement) CalcTotalItemQuantityForShimSiteStats(ctx context.Context, server string) ([]*modelv2.TotalItemQuantity, error)
- func (s *DropMatrixElement) CalcTotalSanityCostForShimSiteStats(ctx context.Context, server string) (sanity int, err error)
- func (s *DropMatrixElement) CalcTotalStageQuantityForShimSiteStats(ctx context.Context, server string) ([]*modelv2.TotalStageTime, error)
- func (s *DropMatrixElement) DeleteByServerAndDayNum(ctx context.Context, server string, dayNum int) error
- func (s *DropMatrixElement) GetAllQuantitiesForGlobalDropMatrixMapByStageIdAndItemId(ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, ...) (map[int]map[int]*model.AllQuantitiesResultForGlobalDropMatrix, error)
- func (s *DropMatrixElement) GetAllQuantityBucketsForGlobalDropMatrixMapByStageIdAndItemId(ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, ...) (map[int]map[int]*model.AllQuantityBucketsResultForGlobalDropMatrix, error)
- func (s *DropMatrixElement) GetAllTimesForGlobalDropMatrixMapByStageIdAndItemId(ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, ...) (map[int]map[int]*model.AllTimesResultForGlobalDropMatrix, error)
- func (s *DropMatrixElement) GetElementsByServerAndSourceCategoryAndDayNumRange(ctx context.Context, server string, sourceCategory string, startDayNum int, ...) ([]*model.DropMatrixElement, error)
- func (s *DropMatrixElement) IsExistByServerAndDayNum(ctx context.Context, server string, dayNum int) (bool, error)
- type DropPatternElement
- type DropReport
- func (s *DropReport) CalcQuantityUniqCount(ctx context.Context, queryCtx *model.DropReportQueryContext) ([]*model.QuantityUniqCountResultForDropMatrix, error)
- func (s *DropReport) CalcRecentUniqueUserCountBySource(ctx context.Context, duration time.Duration) ([]*modelv2.UniqueUserCountBySource, error)
- func (s *DropReport) CalcTotalQuantityForPatternMatrix(ctx context.Context, queryCtx *model.DropReportQueryContext) ([]*model.TotalQuantityResultForPatternMatrix, error)
- func (s *DropReport) CalcTotalQuantityForTrend(ctx context.Context, server string, startTime *time.Time, ...) ([]*model.TotalQuantityResultForTrend, error)
- func (s *DropReport) CalcTotalStageQuantityForShimSiteStats(ctx context.Context, server string, isRecent24h bool) ([]*modelv2.TotalStageTime, error)
- func (s *DropReport) CalcTotalTimesForDropMatrix(ctx context.Context, queryCtx *model.DropReportQueryContext) ([]*model.TotalTimesResult, error)
- func (s *DropReport) CalcTotalTimesForPatternMatrix(ctx context.Context, queryCtx *model.DropReportQueryContext) ([]*model.TotalTimesResult, error)
- func (s *DropReport) CalcTotalTimesForTrend(ctx context.Context, server string, startTime *time.Time, ...) ([]*model.TotalTimesResultForTrend, error)
- func (s *DropReport) DeleteDropReportsForArchive(ctx context.Context, tx bun.Tx, date time.Time) (int64, error)
- func (s *DropReport) GetDropReports(ctx context.Context, queryCtx *model.DropReportQueryContext) ([]*model.DropReport, error)
- func (s *DropReport) GetDropReportsForArchive(ctx context.Context, cursor *model.Cursor, date time.Time, limit int) ([]*model.DropReport, model.Cursor, error)
- type DropReportExtra
- func (c *DropReportExtra) DeleteDropReportExtrasForArchive(ctx context.Context, tx bun.Tx, idInclusiveStart int, idInclusiveEnd int) (int64, error)
- func (s *DropReportExtra) GetDropReportExtraForArchive(ctx context.Context, cursor *model.Cursor, idInclusiveStart int, ...) ([]*model.DropReportExtra, model.Cursor, error)
- type Export
- type Formula
- type FrontendConfig
- type GeoIP
- type Health
- type Init
- type Item
- func (s *Item) GetItemByArkId(ctx context.Context, arkItemId string) (*model.Item, error)
- func (s *Item) GetItemById(ctx context.Context, itemId int) (*model.Item, error)
- func (s *Item) GetItems(ctx context.Context) ([]*model.Item, error)
- func (s *Item) GetItemsMapByArkId(ctx context.Context) (map[string]*model.Item, error)
- func (s *Item) GetItemsMapById(ctx context.Context) (map[int]*model.Item, error)
- func (s *Item) GetRecruitTagItemsByBilingualName(ctx context.Context) (map[string]string, error)
- func (s *Item) GetShimItemByArkId(ctx context.Context, arkItemId string) (*modelv2.Item, error)
- func (s *Item) GetShimItems(ctx context.Context) ([]*modelv2.Item, error)
- func (s *Item) SearchItemByName(ctx context.Context, name string) (*model.Item, error)
- type Notice
- type PatternMatrix
- func (s *PatternMatrix) GetShimPatternMatrix(ctx context.Context, server string, accountId null.Int, sourceCategory string, ...) (*modelv2.PatternMatrixQueryResult, error)
- func (s *PatternMatrix) RunCalcPatternMatrixJob(ctx context.Context, server string) error
- func (s *PatternMatrix) UpdatePatternMatrixByGivenDate(ctx context.Context, server string, date *time.Time) error
- type PatternMatrixElement
- func (s *PatternMatrixElement) BatchSaveElements(ctx context.Context, elements []*model.PatternMatrixElement, server string) error
- func (s *PatternMatrixElement) DeleteByServerAndDayNum(ctx context.Context, server string, dayNum int) error
- func (s *PatternMatrixElement) GetAllQuantitiesForGlobalPatternMatrixMapByStageIdAndPatternId(ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, ...) (map[int]map[int]*model.AllQuantitiesResultForGlobalPatternMatrix, error)
- func (s *PatternMatrixElement) GetAllTimesForGlobalPatternMatrixMapByStageId(ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, ...) (map[int]*model.AllTimesResultForGlobalPatternMatrix, error)
- func (s *PatternMatrixElement) IsExistByServerAndDayNum(ctx context.Context, server string, dayNum int) (bool, error)
- type RejectRulesReevaluationEvaluationContext
- type RejectRulesReevaluationEvaluationResult
- type RejectRulesReevaluationEvaluationResultSet
- type RejectRulesReevaluationEvaluationResultSetChangeSet
- type RejectRulesReevaluationEvaluationResultSetDiff
- type RejectRulesReevaluationEvaluationResultSetSummary
- type RejectRulesReevaluationEvaluationResultSetSummaryReliabilityChanges
- type RejectRulesReevaluationEvaluationResultSetSummarySampledEvaluations
- type Report
- func (s *Report) PipelineAccount(ctx *fiber.Ctx) (accountId int, err error)
- func (s *Report) PipelineAggregateGachaboxDrops(ctx context.Context, singleReport *types.ReportTaskSingleReport) error
- func (s *Report) PipelineMergeDropsAndMapDropTypes(ctx context.Context, drops []types.ArkDrop) ([]*types.Drop, error)
- func (s *Report) PipelinePreprocessRecruitmentTags(ctx context.Context, req *types.SingularReportRequest) error
- func (s *Report) PipelinePreprocessRerunStageIdForMaa(ctx context.Context, req *types.SingularReportRequest) error
- func (s *Report) PipelineTaskId(ctx *fiber.Ctx) string
- func (s *Report) PreprocessAndQueueBatchReport(ctx *fiber.Ctx, req *types.BatchReportRequest) (taskId string, err error)
- func (s *Report) PreprocessAndQueueSingularReport(ctx *fiber.Ctx, req *types.SingularReportRequest) (taskId string, err error)
- func (s *Report) RecallSingularReport(ctx context.Context, req *types.SingularReportRecallRequest) error
- type ShortURL
- type SiteStats
- type Snapshot
- type Stage
- func (s *Stage) GetGachaBoxStages(ctx context.Context) ([]*model.Stage, error)
- func (s *Stage) GetShimStageByArkId(ctx context.Context, arkStageId string, server string) (*modelv2.Stage, error)
- func (s *Stage) GetShimStages(ctx context.Context, server string) ([]*modelv2.Stage, error)
- func (s *Stage) GetShimStagesForFakeTime(ctx context.Context, server string, t time.Time) ([]*modelv2.Stage, error)
- func (s *Stage) GetStageByArkId(ctx context.Context, arkStageId string) (*model.Stage, error)
- func (s *Stage) GetStageById(ctx context.Context, stageId int) (*model.Stage, error)
- func (s *Stage) GetStageExtraProcessTypeByArkId(ctx context.Context, arkStageId string) (null.String, error)
- func (s *Stage) GetStages(ctx context.Context) ([]*model.Stage, error)
- func (s *Stage) GetStagesByZoneId(ctx context.Context, zoneId int) ([]*model.Stage, error)
- func (s *Stage) GetStagesMapByArkId(ctx context.Context) (map[string]*model.Stage, error)
- func (s *Stage) GetStagesMapById(ctx context.Context) (map[int]*model.Stage, error)
- func (s *Stage) SearchStageByCode(ctx context.Context, code string) (*model.Stage, error)
- type TimeRange
- func (s *TimeRange) GetAllMaxAccumulableTimeRangesByServer(ctx context.Context, server string) (map[int]map[int][]*model.TimeRange, error)
- func (s *TimeRange) GetCurrentTimeRangesByServer(ctx context.Context, server string) ([]*model.TimeRange, error)
- func (s *TimeRange) GetLatestTimeRangesByServer(ctx context.Context, server string) (map[int]*model.TimeRange, error)
- func (s *TimeRange) GetMaxAccumulableTimeRangesByServer(ctx context.Context, server string) (map[int]map[int][]*model.TimeRange, error)
- func (s *TimeRange) GetTimeRangeById(ctx context.Context, rangeId int) (*model.TimeRange, error)
- func (s *TimeRange) GetTimeRangeByServerAndName(ctx context.Context, server string, name string) (*model.TimeRange, error)
- func (s *TimeRange) GetTimeRangesByServer(ctx context.Context, server string) ([]*model.TimeRange, error)
- func (s *TimeRange) GetTimeRangesMap(ctx context.Context, server string) (map[int]*model.TimeRange, error)
- type Trend
- type Upyun
- func (c *Upyun) ImageURIToSignedURL(uri, style string) (path string, err error)
- func (c *Upyun) InitImageUpload(prefix string, uploadId string) (types.UpyunInitResponse, error)
- func (c *Upyun) MarshalImageURI(path string) string
- func (c *Upyun) VerifyImageUploadCallback(ctx *fiber.Ctx) (path string, err error)
- type Zone
- func (s *Zone) GetShimZoneByArkId(ctx context.Context, arkZoneId string) (*modelv2.Zone, error)
- func (s *Zone) GetShimZones(ctx context.Context) ([]*modelv2.Zone, error)
- func (s *Zone) GetZoneByArkId(ctx context.Context, arkZoneId string) (*model.Zone, error)
- func (s *Zone) GetZoneById(ctx context.Context, id int) (*model.Zone, error)
- func (s *Zone) GetZones(ctx context.Context) ([]*model.Zone, error)
Constants ¶
const ( RealmDropReports = "drop_reports" RealmDropReportExtras = "drop_report_extras" ArchiveS3Prefix = "v1/" )
const (
UpyunAuthorizationHeaderRealm = "UPYUN"
)
Variables ¶
var ( ErrDatabaseNotReachable = errors.New("database not reachable") ErrRedisNotReachable = errors.New("redis not reachable") ErrNATSNotReachable = errors.New("nats not reachable") )
var ( ErrReportNotFound = pgerr.ErrInvalidReq.Msg("report not existed or has already been recalled") ErrAccountMissing = pgerr.ErrInvalidReq.Msg("account missing") ErrNatsTimeout = errors.New("timeout waiting for NATS response") )
var ( ErrSnapshotNotFound = errors.New("snapshot not found") ErrSnapshotNonNullable = errors.New("snapshot content cannot be empty") ErrSnapshotFromVersionNotFound = pgerr.ErrInvalidReq.Msg("snapshot matching `from` version not found") ErrSnapshotToVersionNotFound = pgerr.ErrInvalidReq.Msg("snapshot matching `to` version not found") )
Functions ¶
Types ¶
type Account ¶
func NewAccount ¶
func (*Account) CreateAccountWithRandomPenguinId ¶
func (*Account) GetAccountById ¶
Cache: account#accountId:{accountId}, 1 hr
func (*Account) GetAccountByPenguinId ¶
func (s *Account) GetAccountByPenguinId(ctx context.Context, penguinId string) (*model.Account, error)
Cache: account#penguinId:{penguinId}, 1 hr
func (*Account) GetAccountFromRequest ¶
type Activity ¶
func NewActivity ¶
func (*Activity) GetActivities ¶
Cache: (singular) activities, 1 hr; records last modified time
func (*Activity) GetActivityById ¶
type Admin ¶
type Admin struct { DB *bun.DB AdminRepo *repo.Admin DropReportService *DropReport RejectRuleRepo *repo.RejectRule ZoneService *Zone StageService *Stage ActivityService *Activity TimeRangeService *TimeRange DropInfoService *DropInfo }
func (*Admin) CloneFromCN ¶
func (*Admin) EvaluateRejectRules ¶
func (s *Admin) EvaluateRejectRules(ctx context.Context, evaluationContexts []RejectRulesReevaluationEvaluationContext, ruleId int) (RejectRulesReevaluationEvaluationResultSet, error)
func (*Admin) GetRejectRulesReportContext ¶
func (s *Admin) GetRejectRulesReportContext(ctx context.Context, req types.RejectRulesReevaluationPreviewRequest) ([]RejectRulesReevaluationEvaluationContext, error)
func (*Admin) SaveRenderedObjects ¶
type Analytics ¶
type Analytics struct {
DropReportService *DropReport
}
func NewAnalytics ¶
func NewAnalytics(dropReportService *DropReport) *Analytics
type Archive ¶
type Archive struct { DropReportService *DropReport DropReportExtraService *DropReportExtra Config *appconfig.Config // contains filtered or unexported fields }
func NewArchive ¶
func NewArchive(dropReportService *DropReport, dropReportExtraService *DropReportExtra, conf *appconfig.Config, lock *redsync.Redsync, db *bun.DB) (*Archive, error)
func (*Archive) ArchiveByDate ¶
func (*Archive) ArchiveByGlobalConfig ¶
type DropInfo ¶
func NewDropInfo ¶
func (*DropInfo) CloneDropInfosFromCN ¶
func (*DropInfo) GetAppearStageIdsByServer ¶
func (*DropInfo) GetCurrentDropInfosByServer ¶
func (*DropInfo) GetDropInfosByServer ¶
func (*DropInfo) GetDropInfosWithFilters ¶
func (*DropInfo) GetItemDropSetByStageIdAndRangeId ¶
func (s *DropInfo) GetItemDropSetByStageIdAndRangeId(ctx context.Context, server string, stageId int, rangeId int) ([]int, error)
Cache: itemDropSet#server|stageId|rangeId:{server}|{stageId}|{rangeId}, 24 hrs
func (*DropInfo) GetItemDropSetByStageIdAndTimeRange ¶
func (s *DropInfo) GetItemDropSetByStageIdAndTimeRange(ctx context.Context, server string, stageId int, startTime *time.Time, endTime *time.Time) ([]int, error)
Cache: itemDropSet#server|stageId|startTime|endTime:{server}|{stageId}|{startTime}|{endTime}, 24 hrs
type DropMatrix ¶
type DropMatrix struct { Config *appconfig.Config TimeRangeService *TimeRange DropReportService *DropReport DropInfoService *DropInfo DropMatrixElementService *DropMatrixElement StageService *Stage ItemService *Item }
func NewDropMatrix ¶
func NewDropMatrix( config *appconfig.Config, timeRangeService *TimeRange, dropReportService *DropReport, dropInfoService *DropInfo, dropMatrixElementService *DropMatrixElement, stageService *Stage, itemService *Item, ) *DropMatrix
func (*DropMatrix) GetShimCustomizedDropMatrixResults ¶
func (*DropMatrix) GetShimDropMatrix ¶
func (s *DropMatrix) GetShimDropMatrix( ctx context.Context, server string, showClosedZones bool, stageFilterStr string, itemFilterStr string, accountId null.Int, sourceCategory string, ) (*modelv2.DropMatrixQueryResult, error)
Cache: shimGlobalDropMatrix#server|showClosedZones|sourceCategory:{server}|{showClosedZones}|{sourceCategory}, 24 hrs, records last modified time Called by frontend, used for both global and personal, only for max accumulable results
func (*DropMatrix) RunCalcDropMatrixJob ¶
func (s *DropMatrix) RunCalcDropMatrixJob(ctx context.Context, server string) error
Calc today's drop matrix elements and save to DB Called by worker
func (*DropMatrix) UpdateDropMatrixByGivenDate ¶
func (s *DropMatrix) UpdateDropMatrixByGivenDate(ctx context.Context, server string, date *time.Time) error
Update drop matrix elements for a given date (entire day) Called by admin api
type DropMatrixElement ¶
type DropMatrixElement struct {
DropMatrixElementRepo *repo.DropMatrixElement
}
func NewDropMatrixElement ¶
func NewDropMatrixElement(dropMatrixElementRepo *repo.DropMatrixElement) *DropMatrixElement
func (*DropMatrixElement) BatchSaveElements ¶
func (s *DropMatrixElement) BatchSaveElements(ctx context.Context, elements []*model.DropMatrixElement, server string) error
func (*DropMatrixElement) CalcTotalItemQuantityForShimSiteStats ¶
func (s *DropMatrixElement) CalcTotalItemQuantityForShimSiteStats(ctx context.Context, server string) ([]*modelv2.TotalItemQuantity, error)
func (*DropMatrixElement) CalcTotalSanityCostForShimSiteStats ¶
func (*DropMatrixElement) CalcTotalStageQuantityForShimSiteStats ¶
func (s *DropMatrixElement) CalcTotalStageQuantityForShimSiteStats(ctx context.Context, server string) ([]*modelv2.TotalStageTime, error)
func (*DropMatrixElement) DeleteByServerAndDayNum ¶
func (*DropMatrixElement) GetAllQuantitiesForGlobalDropMatrixMapByStageIdAndItemId ¶
func (*DropMatrixElement) GetAllQuantityBucketsForGlobalDropMatrixMapByStageIdAndItemId ¶
func (*DropMatrixElement) GetAllTimesForGlobalDropMatrixMapByStageIdAndItemId ¶
func (*DropMatrixElement) GetElementsByServerAndSourceCategoryAndDayNumRange ¶
func (s *DropMatrixElement) GetElementsByServerAndSourceCategoryAndDayNumRange( ctx context.Context, server string, sourceCategory string, startDayNum int, endDayNum int, ) ([]*model.DropMatrixElement, error)
func (*DropMatrixElement) IsExistByServerAndDayNum ¶
type DropPatternElement ¶
type DropPatternElement struct {
DropPatternElementRepo *repo.DropPatternElement
}
func NewDropPatternElement ¶
func NewDropPatternElement(dropPatternElementRepo *repo.DropPatternElement) *DropPatternElement
func (*DropPatternElement) GetDropPatternElementsByPatternId ¶
func (s *DropPatternElement) GetDropPatternElementsByPatternId(ctx context.Context, patternId int) ([]*model.DropPatternElement, error)
Cache: dropPatternElements#patternId:{patternId}, 24hrs
func (*DropPatternElement) GetDropPatternElementsMapByPatternIds ¶
func (s *DropPatternElement) GetDropPatternElementsMapByPatternIds(ctx context.Context, patternIds []int) (map[int][]*model.DropPatternElement, error)
type DropReport ¶
type DropReport struct {
DropReportRepo *repo.DropReport
}
func NewDropReport ¶
func NewDropReport(dropReportRepo *repo.DropReport) *DropReport
func (*DropReport) CalcQuantityUniqCount ¶
func (s *DropReport) CalcQuantityUniqCount( ctx context.Context, queryCtx *model.DropReportQueryContext, ) ([]*model.QuantityUniqCountResultForDropMatrix, error)
func (*DropReport) CalcRecentUniqueUserCountBySource ¶
func (s *DropReport) CalcRecentUniqueUserCountBySource(ctx context.Context, duration time.Duration) ([]*modelv2.UniqueUserCountBySource, error)
func (*DropReport) CalcTotalQuantityForPatternMatrix ¶
func (s *DropReport) CalcTotalQuantityForPatternMatrix( ctx context.Context, queryCtx *model.DropReportQueryContext, ) ([]*model.TotalQuantityResultForPatternMatrix, error)
func (*DropReport) CalcTotalQuantityForTrend ¶
func (*DropReport) CalcTotalStageQuantityForShimSiteStats ¶
func (s *DropReport) CalcTotalStageQuantityForShimSiteStats(ctx context.Context, server string, isRecent24h bool) ([]*modelv2.TotalStageTime, error)
func (*DropReport) CalcTotalTimesForDropMatrix ¶
func (s *DropReport) CalcTotalTimesForDropMatrix( ctx context.Context, queryCtx *model.DropReportQueryContext, ) ([]*model.TotalTimesResult, error)
func (*DropReport) CalcTotalTimesForPatternMatrix ¶
func (s *DropReport) CalcTotalTimesForPatternMatrix( ctx context.Context, queryCtx *model.DropReportQueryContext, ) ([]*model.TotalTimesResult, error)
func (*DropReport) CalcTotalTimesForTrend ¶
func (*DropReport) DeleteDropReportsForArchive ¶
func (*DropReport) GetDropReports ¶
func (s *DropReport) GetDropReports( ctx context.Context, queryCtx *model.DropReportQueryContext, ) ([]*model.DropReport, error)
func (*DropReport) GetDropReportsForArchive ¶
type DropReportExtra ¶
type DropReportExtra struct {
DropReportExtraRepo *repo.DropReportExtra
}
func NewDropReportExtra ¶
func NewDropReportExtra(dropReportExtraRepo *repo.DropReportExtra) *DropReportExtra
func (*DropReportExtra) DeleteDropReportExtrasForArchive ¶
func (*DropReportExtra) GetDropReportExtraForArchive ¶
type Export ¶
type Export struct { DropReportService *DropReport DropPatternElementService *DropPatternElement ItemService *Item }
func NewExport ¶
func NewExport( dropReportService *DropReport, dropPatternElementService *DropPatternElement, itemService *Item, ) *Export
func (*Export) ExportDropReportsAndPatterns ¶
type Formula ¶
func NewFormula ¶
type FrontendConfig ¶
func NewFrontendConfig ¶
func NewFrontendConfig(propertyRepo *repo.Property) *FrontendConfig
func (*FrontendConfig) GetFrontendConfig ¶
func (s *FrontendConfig) GetFrontendConfig(ctx context.Context) (json.RawMessage, error)
Cache: (singular) frontend_config, 1 hr
type GeoIP ¶
type GeoIP struct {
// contains filtered or unexported fields
}
func (*GeoIP) InChinaMainland ¶
type Item ¶
func (*Item) GetItemByArkId ¶
Cache: item#arkItemId:{arkItemId}, 1 hr
func (*Item) GetItemById ¶
func (*Item) GetItemsMapByArkId ¶
Cache: (singular) itemsMapByArkId, 1 hr
func (*Item) GetItemsMapById ¶
Cache: (singular) itemsMapById, 1 hr
func (*Item) GetRecruitTagItemsByBilingualName ¶
Cache: (singular) recruitTagMap, 1 hr
func (*Item) GetShimItemByArkId ¶
Cache: shimItem#arkItemId:{arkItemId}, 1 hr
func (*Item) GetShimItems ¶
Cache: (singular) shimItems, 1 hr; records last modified time
type PatternMatrix ¶
type PatternMatrix struct { Config *appconfig.Config TimeRangeService *TimeRange DropReportService *DropReport DropInfoService *DropInfo PatternMatrixElementService *PatternMatrixElement DropPatternElementService *DropPatternElement StageService *Stage ItemService *Item }
func NewPatternMatrix ¶
func NewPatternMatrix( config *appconfig.Config, timeRangeService *TimeRange, dropReportService *DropReport, dropInfoService *DropInfo, patternMatrixElementService *PatternMatrixElement, dropPatternElementService *DropPatternElement, stageService *Stage, itemService *Item, ) *PatternMatrix
func (*PatternMatrix) GetShimPatternMatrix ¶
func (s *PatternMatrix) GetShimPatternMatrix(ctx context.Context, server string, accountId null.Int, sourceCategory string, showAllPatterns bool, ) (*modelv2.PatternMatrixQueryResult, error)
Cache: shimGlobalPatternMatrix#server|sourceCategory|showAllPatterns:{server}|{sourceCategory}|{showAllPatterns}, 24hrs, records last modified time Called by frontend, used for both global and personal, only for latest timeranges
func (*PatternMatrix) RunCalcPatternMatrixJob ¶
func (s *PatternMatrix) RunCalcPatternMatrixJob(ctx context.Context, server string) error
Calc today's pattern matrix elements and save to DB Called by worker
func (*PatternMatrix) UpdatePatternMatrixByGivenDate ¶
func (s *PatternMatrix) UpdatePatternMatrixByGivenDate(ctx context.Context, server string, date *time.Time) error
Update pattern matrix elements for a given date (entire day) Called by admin api
type PatternMatrixElement ¶
type PatternMatrixElement struct {
PatternMatrixElementRepo *repo.PatternMatrixElement
}
func NewPatternMatrixElement ¶
func NewPatternMatrixElement(patternMatrixElementRepo *repo.PatternMatrixElement) *PatternMatrixElement
func (*PatternMatrixElement) BatchSaveElements ¶
func (s *PatternMatrixElement) BatchSaveElements(ctx context.Context, elements []*model.PatternMatrixElement, server string) error
func (*PatternMatrixElement) DeleteByServerAndDayNum ¶
func (*PatternMatrixElement) GetAllQuantitiesForGlobalPatternMatrixMapByStageIdAndPatternId ¶
func (*PatternMatrixElement) GetAllTimesForGlobalPatternMatrixMapByStageId ¶
func (*PatternMatrixElement) IsExistByServerAndDayNum ¶
type RejectRulesReevaluationEvaluationContext ¶
type RejectRulesReevaluationEvaluationContext struct { OriginalReport *model.DropReport `json:"originalReport"` EvaluateContext *reportverifs.ReportContext `json:"evaluateContext"` }
type RejectRulesReevaluationEvaluationResult ¶
type RejectRulesReevaluationEvaluationResult struct { RejectRulesReevaluationEvaluationContext EvaluationShouldRejectToReliability *int `json:"evaluationShouldRejectToReliability"` }
type RejectRulesReevaluationEvaluationResultSet ¶
type RejectRulesReevaluationEvaluationResultSet []*RejectRulesReevaluationEvaluationResult
type RejectRulesReevaluationEvaluationResultSetChangeSet ¶
type RejectRulesReevaluationEvaluationResultSetChangeSet []*RejectRulesReevaluationEvaluationResultSetDiff
type RejectRulesReevaluationEvaluationResultSetSummary ¶
type RejectRulesReevaluationEvaluationResultSetSummary struct { TotalCount int `json:"totalCount"` ChangeSetCount int `json:"changeSetCount"` ReliabilityChanges []RejectRulesReevaluationEvaluationResultSetSummaryReliabilityChanges `json:"reliabilityChanges"` SampledEvaluations RejectRulesReevaluationEvaluationResultSetSummarySampledEvaluations `json:"sampledEvaluations"` }
type RejectRulesReevaluationEvaluationResultSetSummarySampledEvaluations ¶
type RejectRulesReevaluationEvaluationResultSetSummarySampledEvaluations struct { ShouldReject []*RejectRulesReevaluationEvaluationResult `json:"shouldReject"` ShouldPass []*RejectRulesReevaluationEvaluationResult `json:"shouldPass"` }
type Report ¶
type Report struct { DB *bun.DB Redis *redis.Client NatsJS nats.JetStreamContext ItemService *Item StageService *Stage AccountService *Account TimeRangeService *TimeRange StageRepo *repo.Stage DropInfoRepo *repo.DropInfo DropReportRepo *repo.DropReport DropPatternRepo *repo.DropPattern DropReportExtraRepo *repo.DropReportExtra DropPatternElementRepo *repo.DropPatternElement ReportVerifier *reportverifs.ReportVerifiers }
func NewReport ¶
func NewReport(db *bun.DB, redisClient *redis.Client, natsJs nats.JetStreamContext, itemService *Item, stageService *Stage, stageRepo *repo.Stage, dropInfoRepo *repo.DropInfo, dropReportRepo *repo.DropReport, dropReportExtraRepo *repo.DropReportExtra, dropPatternRepo *repo.DropPattern, dropPatternElementRepo *repo.DropPatternElement, accountService *Account, timeRangeService *TimeRange, reportVerifier *reportverifs.ReportVerifiers) *Report
func (*Report) PipelineAccount ¶
func (*Report) PipelineAggregateGachaboxDrops ¶
func (*Report) PipelineMergeDropsAndMapDropTypes ¶
func (*Report) PipelinePreprocessRecruitmentTags ¶
func (*Report) PipelinePreprocessRerunStageIdForMaa ¶
func (*Report) PipelineTaskId ¶
func (*Report) PreprocessAndQueueBatchReport ¶
func (s *Report) PreprocessAndQueueBatchReport(ctx *fiber.Ctx, req *types.BatchReportRequest) (taskId string, err error)
func (*Report) PreprocessAndQueueSingularReport ¶
func (s *Report) PreprocessAndQueueSingularReport(ctx *fiber.Ctx, req *types.SingularReportRequest) (taskId string, err error)
returns taskID and error, if any
func (*Report) RecallSingularReport ¶
type ShortURL ¶
type ShortURL struct { ItemService *Item StageService *Stage ZoneService *Zone GeoIPService *GeoIP }
func NewShortURL ¶
type SiteStats ¶
type SiteStats struct { DropReportService *DropReport DropMatrixElementService *DropMatrixElement }
func NewSiteStats ¶
func NewSiteStats( dropReportService *DropReport, dropMatrixElementService *DropMatrixElement, ) *SiteStats
type Snapshot ¶
func NewSnapshot ¶
func (*Snapshot) CalculateVersion ¶
func (*Snapshot) GetDiffBetweenVersions ¶
type Stage ¶
func (*Stage) GetGachaBoxStages ¶
func (*Stage) GetShimStageByArkId ¶
func (s *Stage) GetShimStageByArkId(ctx context.Context, arkStageId string, server string) (*modelv2.Stage, error)
Cache: shimStage#server|arkStageId:{server}|{arkStageId}, 1 hr
func (*Stage) GetShimStages ¶
Cache: shimStages#server:{server}, 1 hr; records last modified time
func (*Stage) GetShimStagesForFakeTime ¶
func (s *Stage) GetShimStagesForFakeTime(ctx context.Context, server string, t time.Time) ([]*modelv2.Stage, error)
Not Cached
func (*Stage) GetStageByArkId ¶
Cache: stage#arkStageId:{arkStageId}, 1 hr
func (*Stage) GetStageById ¶
func (*Stage) GetStageExtraProcessTypeByArkId ¶
func (*Stage) GetStagesByZoneId ¶
func (*Stage) GetStagesMapByArkId ¶
Cache: (singular) stagesMapByArkId, 1 hr
func (*Stage) GetStagesMapById ¶
Cache: (singular) stagesMapById, 1 hr
type TimeRange ¶
func NewTimeRange ¶
func (*TimeRange) GetAllMaxAccumulableTimeRangesByServer ¶
func (s *TimeRange) GetAllMaxAccumulableTimeRangesByServer(ctx context.Context, server string) (map[int]map[int][]*model.TimeRange, error)
This function will combine time ranges together if they are adjacent Cache: allMaxAccumulableTimeRanges#server:{server}, 5 min
func (*TimeRange) GetCurrentTimeRangesByServer ¶
func (*TimeRange) GetLatestTimeRangesByServer ¶
func (s *TimeRange) GetLatestTimeRangesByServer(ctx context.Context, server string) (map[int]*model.TimeRange, error)
Cache: latestTimeRanges#server:{server}, 5 min
func (*TimeRange) GetMaxAccumulableTimeRangesByServer ¶
func (s *TimeRange) GetMaxAccumulableTimeRangesByServer(ctx context.Context, server string) (map[int]map[int][]*model.TimeRange, error)
Cache: maxAccumulableTimeRanges#server:{server}, 5 min
func (*TimeRange) GetTimeRangeById ¶
Cache: timeRange#rangeId:{rangeId}, 1 hr
func (*TimeRange) GetTimeRangeByServerAndName ¶
type Trend ¶
type Trend struct { DropReportService *DropReport DropInfoService *DropInfo StageService *Stage ItemService *Item DropMatrixElementService *DropMatrixElement }
func NewTrend ¶
func NewTrend( dropReportService *DropReport, dropInfoService *DropInfo, stageService *Stage, itemService *Item, dropMatrixElementService *DropMatrixElement, ) *Trend
func (*Trend) GetShimCustomizedTrendResults ¶
func (*Trend) GetShimTrend ¶
Cache: shimTrend#server:{server}, 24hrs, records last modified time Called by frontend, only for global
type Upyun ¶
type Upyun struct {
// contains filtered or unexported fields
}
func (*Upyun) ImageURIToSignedURL ¶
func (*Upyun) InitImageUpload ¶
func (*Upyun) MarshalImageURI ¶
func (*Upyun) VerifyImageUploadCallback ¶
type Zone ¶
func (*Zone) GetShimZoneByArkId ¶
Cache: shimZone#arkZoneId:{arkZoneId}, 1 hr
func (*Zone) GetShimZones ¶
Cache: (singular) shimZones, 1 hr; records last modified time
func (*Zone) GetZoneByArkId ¶
Cache: zone#arkZoneId:{arkZoneId}, 1 hr
func (*Zone) GetZoneById ¶
Source Files ¶
- 0module.go
- account.go
- activity.go
- admin.go
- analytics.go
- archive.go
- drop_info.go
- drop_matrix.go
- drop_matrix_element.go
- drop_pattern_element.go
- drop_report.go
- drop_report_extra.go
- export.go
- formula.go
- frontend_config.go
- geoip.go
- health.go
- init.go
- item.go
- notice.go
- pattern_matrix.go
- pattern_matrix_element.go
- report.go
- short_url.go
- site_stats.go
- snapshot.go
- stage.go
- time_range.go
- trend.go
- upyun.go
- zone.go