repo

package
v0.0.0-...-570c91f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const AccountMaxRetries = 100
View Source
const (
	RejectRuleActiveStatus = 1
)

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(db *bun.DB) *Account

func (*Account) CreateAccountWithRandomPenguinId

func (r *Account) CreateAccountWithRandomPenguinId(ctx context.Context) (*model.Account, error)

func (*Account) GetAccountById

func (r *Account) GetAccountById(ctx context.Context, accountId string) (*model.Account, error)

func (*Account) GetAccountByPenguinId

func (r *Account) GetAccountByPenguinId(ctx context.Context, penguinId string) (*model.Account, error)

func (*Account) IsAccountExistWithId

func (r *Account) IsAccountExistWithId(ctx context.Context, accountId int) bool

type Activity

type Activity struct {
	// contains filtered or unexported fields
}

func NewActivity

func NewActivity(db *bun.DB) *Activity

func (*Activity) GetActivities

func (r *Activity) GetActivities(ctx context.Context) ([]*model.Activity, error)

func (*Activity) GetActivityById

func (r *Activity) GetActivityById(ctx context.Context, activityId int) (*model.Activity, error)

type Admin

type Admin struct {
	// contains filtered or unexported fields
}

func NewAdmin

func NewAdmin(db *bun.DB) *Admin

func (*Admin) SaveActivities

func (r *Admin) SaveActivities(ctx context.Context, tx bun.Tx, activities *[]*model.Activity) error

func (*Admin) SaveDropInfos

func (r *Admin) SaveDropInfos(ctx context.Context, tx bun.Tx, dropInfos *[]*model.DropInfo) error

func (*Admin) SaveStages

func (r *Admin) SaveStages(ctx context.Context, tx bun.Tx, stages *[]*model.Stage) error

func (*Admin) SaveTimeRanges

func (r *Admin) SaveTimeRanges(ctx context.Context, tx bun.Tx, timeRanges *[]*model.TimeRange) error

func (*Admin) SaveZones

func (r *Admin) SaveZones(ctx context.Context, tx bun.Tx, zones *[]*model.Zone) error

type DropInfo

type DropInfo struct {
	// contains filtered or unexported fields
}

func NewDropInfo

func NewDropInfo(db *bun.DB) *DropInfo

func (*DropInfo) CloneDropInfosFromCN

func (s *DropInfo) CloneDropInfosFromCN(ctx context.Context, originRangeId int, destRangeId int, server string) error

func (*DropInfo) GetDropInfo

func (r *DropInfo) GetDropInfo(ctx context.Context, id int) (*model.DropInfo, error)

func (*DropInfo) GetDropInfosByServer

func (r *DropInfo) GetDropInfosByServer(ctx context.Context, server string) ([]*model.DropInfo, error)

func (*DropInfo) GetDropInfosByServerAndRangeId

func (r *DropInfo) GetDropInfosByServerAndRangeId(ctx context.Context, server string, rangeId int) ([]*model.DropInfo, error)

func (*DropInfo) GetDropInfosByServerAndStageId

func (r *DropInfo) GetDropInfosByServerAndStageId(ctx context.Context, server string, stageId int) ([]*model.DropInfo, error)

func (*DropInfo) GetDropInfosWithFilters

func (r *DropInfo) GetDropInfosWithFilters(ctx context.Context, server string, timeRanges []*model.TimeRange, stageIdFilter []int, itemIdFilter []int) ([]*model.DropInfo, error)

func (*DropInfo) GetForCurrentTimeRange

func (r *DropInfo) GetForCurrentTimeRange(ctx context.Context, query *DropInfoQuery) ([]*model.DropInfo, error)

GetDropInfoByArkId returns a drop info by its ark id.

func (*DropInfo) GetForCurrentTimeRangeWithDropTypes

func (r *DropInfo) GetForCurrentTimeRangeWithDropTypes(ctx context.Context, query *DropInfoQuery) (itemDropInfos, typeDropInfos []*model.DropInfo, err error)

func (*DropInfo) GetItemDropSetByStageIdAndRangeId

func (r *DropInfo) GetItemDropSetByStageIdAndRangeId(ctx context.Context, server string, stageId int, rangeId int) ([]int, error)

type DropInfoQuery

type DropInfoQuery struct {
	Server     string
	ArkStageId string
}

type DropMatrixElement

type DropMatrixElement struct {
	// contains filtered or unexported fields
}

func NewDropMatrixElement

func NewDropMatrixElement(db *bun.DB) *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 (s *DropMatrixElement) CalcTotalSanityCostForShimSiteStats(ctx context.Context, server string) (sanity int, err error)

func (*DropMatrixElement) CalcTotalStageQuantityForShimSiteStats

func (s *DropMatrixElement) CalcTotalStageQuantityForShimSiteStats(ctx context.Context, server string) ([]*modelv2.TotalStageTime, error)

func (*DropMatrixElement) DeleteByServerAndDayNum

func (s *DropMatrixElement) DeleteByServerAndDayNum(ctx context.Context, server string, dayNum int) error

func (*DropMatrixElement) GetAllQuantitiesForGlobalDropMatrix

func (s *DropMatrixElement) GetAllQuantitiesForGlobalDropMatrix(
	ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, sourceCategory string,
) ([]*model.AllQuantitiesResultForGlobalDropMatrix, error)

func (*DropMatrixElement) GetAllQuantityBucketsForGlobalDropMatrix

func (s *DropMatrixElement) GetAllQuantityBucketsForGlobalDropMatrix(
	ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, sourceCategory string,
) ([]*model.AllQuantityBucketsResultForGlobalDropMatrix, error)

func (*DropMatrixElement) GetAllTimesForGlobalDropMatrix

func (s *DropMatrixElement) GetAllTimesForGlobalDropMatrix(
	ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, sourceCategory string,
) ([]*model.AllTimesResultForGlobalDropMatrix, error)

func (*DropMatrixElement) GetElementsByServerAndSourceCategoryAndDayNumRange

func (s *DropMatrixElement) GetElementsByServerAndSourceCategoryAndDayNumRange(
	ctx context.Context, server string, sourceCategory string, startDayNum int, endDayNum int,
) ([]*model.DropMatrixElement, error)

*

  • startDayNum inclusive
  • endDayNum inclusive

func (*DropMatrixElement) IsExistByServerAndDayNum

func (s *DropMatrixElement) IsExistByServerAndDayNum(ctx context.Context, server string, dayNum int) (bool, error)

type DropPattern

type DropPattern struct {
	// contains filtered or unexported fields
}

func NewDropPattern

func NewDropPattern(db *bun.DB) *DropPattern

func (*DropPattern) GetDropPatternByHash

func (r *DropPattern) GetDropPatternByHash(ctx context.Context, hash string) (*model.DropPattern, error)

func (*DropPattern) GetDropPatternById

func (r *DropPattern) GetDropPatternById(ctx context.Context, id int) (*model.DropPattern, error)

func (*DropPattern) GetDropPatterns

func (r *DropPattern) GetDropPatterns(ctx context.Context) ([]*model.DropPattern, error)

func (*DropPattern) GetOrCreateDropPatternFromDrops

func (r *DropPattern) GetOrCreateDropPatternFromDrops(ctx context.Context, tx bun.Tx, drops []*types.Drop) (*model.DropPattern, bool, error)

type DropPatternElement

type DropPatternElement struct {
	// contains filtered or unexported fields
}

func NewDropPatternElement

func NewDropPatternElement(db *bun.DB) *DropPatternElement

func (*DropPatternElement) CreateDropPatternElements

func (r *DropPatternElement) CreateDropPatternElements(ctx context.Context, tx bun.Tx, patternId int, drops []*types.Drop) ([]*model.DropPatternElement, error)

func (*DropPatternElement) GetDropPatternElementByHash

func (r *DropPatternElement) GetDropPatternElementByHash(ctx context.Context, hash string) (*model.DropPatternElement, error)

func (*DropPatternElement) GetDropPatternElementById

func (r *DropPatternElement) GetDropPatternElementById(ctx context.Context, id int) (*model.DropPatternElement, error)

func (*DropPatternElement) GetDropPatternElements

func (r *DropPatternElement) GetDropPatternElements(ctx context.Context) ([]*model.DropPatternElement, error)

func (*DropPatternElement) GetDropPatternElementsByPatternId

func (r *DropPatternElement) GetDropPatternElementsByPatternId(ctx context.Context, patternId int) ([]*model.DropPatternElement, error)

func (*DropPatternElement) GetDropPatternElementsByPatternIds

func (r *DropPatternElement) GetDropPatternElementsByPatternIds(ctx context.Context, patternIds []int) ([]*model.DropPatternElement, error)

type DropReport

type DropReport struct {
	// contains filtered or unexported fields
}

func NewDropReport

func NewDropReport(db *bun.DB) *DropReport

func (*DropReport) CalcQuantityUniqCount

func (r *DropReport) CalcQuantityUniqCount(
	ctx context.Context, queryCtx *model.DropReportQueryContext,
) ([]*model.QuantityUniqCountResultForDropMatrix, error)

only filtered by stage_id, not item_id, needs post-filtering

func (*DropReport) CalcRecentUniqueUserCountBySource

func (r *DropReport) CalcRecentUniqueUserCountBySource(ctx context.Context, duration time.Duration) ([]*modelv2.UniqueUserCountBySource, error)

func (*DropReport) CalcTotalQuantityForPatternMatrix

func (r *DropReport) CalcTotalQuantityForPatternMatrix(
	ctx context.Context, queryCtx *model.DropReportQueryContext,
) ([]*model.TotalQuantityResultForPatternMatrix, error)

func (*DropReport) CalcTotalQuantityForTrend

func (r *DropReport) CalcTotalQuantityForTrend(
	ctx context.Context, server string, startTime *time.Time, intervalLength time.Duration, intervalNum int, stageIdItemIdMap map[int][]int, accountId null.Int, sourceCategory string,
) ([]*model.TotalQuantityResultForTrend, error)

func (*DropReport) CalcTotalStageQuantityForShimSiteStats

func (r *DropReport) CalcTotalStageQuantityForShimSiteStats(ctx context.Context, server string, isRecent24h bool) ([]*modelv2.TotalStageTime, error)

func (*DropReport) CalcTotalTimes

func (r *DropReport) CalcTotalTimes(
	ctx context.Context, queryCtx *model.DropReportQueryContext,
) ([]*model.TotalTimesResult, error)

func (*DropReport) CalcTotalTimesForTrend

func (r *DropReport) CalcTotalTimesForTrend(
	ctx context.Context, server string, startTime *time.Time, intervalLength time.Duration, intervalNum int, stageIds []int, accountId null.Int, sourceCategory string,
) ([]*model.TotalTimesResultForTrend, error)

func (*DropReport) CreateDropReport

func (r *DropReport) CreateDropReport(ctx context.Context, tx bun.Tx, dropReport *model.DropReport) error

func (*DropReport) DeleteDropReport

func (r *DropReport) DeleteDropReport(ctx context.Context, reportId int) error

func (*DropReport) DeleteDropReportsForArchive

func (r *DropReport) DeleteDropReportsForArchive(ctx context.Context, tx bun.Tx, date time.Time) (int64, error)

DeleteDropReportsForArchive deletes drop reports for archive. returns number of rows affected and error

func (*DropReport) GetDropReports

func (r *DropReport) GetDropReports(ctx context.Context, queryCtx *model.DropReportQueryContext) ([]*model.DropReport, error)

*

  • Only return drop reports under one stage.

func (*DropReport) GetDropReportsForArchive

func (r *DropReport) GetDropReportsForArchive(ctx context.Context, cursor *model.Cursor, date time.Time, limit int) ([]*model.DropReport, model.Cursor, error)

func (*DropReport) UpdateDropReportReliability

func (r *DropReport) UpdateDropReportReliability(ctx context.Context, tx bun.Tx, reportId int, reliability int) error

type DropReportExtra

type DropReportExtra struct {
	// contains filtered or unexported fields
}

func NewDropReportExtra

func NewDropReportExtra(db *bun.DB) *DropReportExtra

func (*DropReportExtra) CreateDropReportExtra

func (r *DropReportExtra) CreateDropReportExtra(ctx context.Context, tx bun.Tx, report *model.DropReportExtra) error

func (*DropReportExtra) DeleteDropReportExtrasForArchive

func (c *DropReportExtra) DeleteDropReportExtrasForArchive(ctx context.Context, tx bun.Tx, idInclusiveStart int, idInclusiveEnd int) (int64, error)

DeleteDropReportExtrasForArchive deletes all drop report extras with report_id between idInclusiveStart and idInclusiveEnd. Returns the number of rows affected and an error if any.

func (*DropReportExtra) GetDropReportExtraById

func (r *DropReportExtra) GetDropReportExtraById(ctx context.Context, id int) (*model.DropReportExtra, error)

func (*DropReportExtra) GetDropReportExtraForArchive

func (c *DropReportExtra) GetDropReportExtraForArchive(ctx context.Context, cursor *model.Cursor, idInclusiveStart int, idInclusiveEnd int, limit int) ([]*model.DropReportExtra, model.Cursor, error)

func (*DropReportExtra) IsDropReportExtraMD5Exist

func (c *DropReportExtra) IsDropReportExtraMD5Exist(ctx context.Context, md5 string) bool

type Item

type Item struct {
	// contains filtered or unexported fields
}

func NewItem

func NewItem(db *bun.DB) *Item

func (*Item) GetItemByArkId

func (r *Item) GetItemByArkId(ctx context.Context, arkItemId string) (*model.Item, error)

func (*Item) GetItemById

func (r *Item) GetItemById(ctx context.Context, itemId int) (*model.Item, error)

func (*Item) GetItems

func (r *Item) GetItems(ctx context.Context) ([]*model.Item, error)

func (*Item) GetRecruitTagItems

func (r *Item) GetRecruitTagItems(ctx context.Context) ([]*model.Item, error)

func (*Item) GetShimItemByArkId

func (r *Item) GetShimItemByArkId(ctx context.Context, itemId string) (*modelv2.Item, error)

func (*Item) GetShimItems

func (r *Item) GetShimItems(ctx context.Context) ([]*modelv2.Item, error)

func (*Item) SearchItemByName

func (r *Item) SearchItemByName(ctx context.Context, name string) (*model.Item, error)

type Notice

type Notice struct {
	// contains filtered or unexported fields
}

func NewNotice

func NewNotice(db *bun.DB) *Notice

func (*Notice) GetNotices

func (r *Notice) GetNotices(ctx context.Context) ([]*model.Notice, error)

type PatternMatrixElement

type PatternMatrixElement struct {
	// contains filtered or unexported fields
}

func NewPatternMatrixElement

func NewPatternMatrixElement(db *bun.DB) *PatternMatrixElement

func (*PatternMatrixElement) BatchSaveElements

func (s *PatternMatrixElement) BatchSaveElements(ctx context.Context, elements []*model.PatternMatrixElement, server string) error

func (*PatternMatrixElement) DeleteByServerAndDayNum

func (s *PatternMatrixElement) DeleteByServerAndDayNum(ctx context.Context, server string, dayNum int) error

func (*PatternMatrixElement) GetAllQuantitiesForGlobalPatternMatrix

func (s *PatternMatrixElement) GetAllQuantitiesForGlobalPatternMatrix(
	ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, sourceCategory string,
) ([]*model.AllQuantitiesResultForGlobalPatternMatrix, error)

func (*PatternMatrixElement) GetAllTimesForGlobalPatternMatrix

func (s *PatternMatrixElement) GetAllTimesForGlobalPatternMatrix(
	ctx context.Context, server string, timeRange *model.TimeRange, stageIds []int, sourceCategory string,
) ([]*model.AllTimesResultForGlobalPatternMatrix, error)

func (*PatternMatrixElement) IsExistByServerAndDayNum

func (s *PatternMatrixElement) IsExistByServerAndDayNum(ctx context.Context, server string, dayNum int) (bool, error)

type Property

type Property struct {
	// contains filtered or unexported fields
}

func NewProperty

func NewProperty(db *bun.DB) *Property

func (*Property) GetProperties

func (r *Property) GetProperties(ctx context.Context) ([]*model.Property, error)

func (*Property) GetPropertyByKey

func (r *Property) GetPropertyByKey(ctx context.Context, key string) (*model.Property, error)

func (*Property) UpdatePropertyByKey

func (r *Property) UpdatePropertyByKey(ctx context.Context, key string, value string) (*model.Property, error)

type RecognitionDefect

type RecognitionDefect struct {
	// contains filtered or unexported fields
}

func NewRecognitionDefect

func NewRecognitionDefect(db *bun.DB) *RecognitionDefect

func (*RecognitionDefect) CreateDefectReportDraft

func (r *RecognitionDefect) CreateDefectReportDraft(ctx context.Context, defectReport *model.RecognitionDefect) error

func (*RecognitionDefect) FinalizeDefectReport

func (r *RecognitionDefect) FinalizeDefectReport(ctx context.Context, defectId, imageUri string) error

func (*RecognitionDefect) GetDefectReport

func (r *RecognitionDefect) GetDefectReport(ctx context.Context, defectId string) (*model.RecognitionDefect, error)

func (*RecognitionDefect) GetDefectReports

func (r *RecognitionDefect) GetDefectReports(ctx context.Context, limit int, page int) ([]*model.RecognitionDefect, error)

type RejectRule

type RejectRule struct {
	// contains filtered or unexported fields
}

func NewRejectRule

func NewRejectRule(db *bun.DB) *RejectRule

func (*RejectRule) GetAllActiveRejectRules

func (r *RejectRule) GetAllActiveRejectRules(ctx context.Context) ([]*model.RejectRule, error)

func (*RejectRule) GetRejectRule

func (r *RejectRule) GetRejectRule(ctx context.Context, id int) (*model.RejectRule, error)

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

func NewSnapshot

func NewSnapshot(db *bun.DB) *Snapshot

func (*Snapshot) GetLatestSnapshotByKey

func (r *Snapshot) GetLatestSnapshotByKey(ctx context.Context, key string) (*model.Snapshot, error)

func (*Snapshot) GetSnapshotById

func (r *Snapshot) GetSnapshotById(ctx context.Context, id int) (*model.Snapshot, error)

func (*Snapshot) GetSnapshotsByIds

func (r *Snapshot) GetSnapshotsByIds(ctx context.Context, ids []int) ([]*model.Snapshot, error)

func (*Snapshot) GetSnapshotsByVersions

func (r *Snapshot) GetSnapshotsByVersions(ctx context.Context, key string, versions []string) ([]*model.Snapshot, error)

func (*Snapshot) SaveSnapshot

func (r *Snapshot) SaveSnapshot(ctx context.Context, snapshot *model.Snapshot) (*model.Snapshot, error)

type Stage

type Stage struct {
	// contains filtered or unexported fields
}

func NewStage

func NewStage(db *bun.DB) *Stage

func (*Stage) GetGachaBoxStages

func (r *Stage) GetGachaBoxStages(ctx context.Context) ([]*model.Stage, error)

func (*Stage) GetShimStageByArkId

func (r *Stage) GetShimStageByArkId(ctx context.Context, arkStageId string, server string) (*modelv2.Stage, error)

func (*Stage) GetShimStages

func (r *Stage) GetShimStages(ctx context.Context, server string) ([]*modelv2.Stage, error)

func (*Stage) GetShimStagesForFakeTime

func (r *Stage) GetShimStagesForFakeTime(ctx context.Context, server string, fakeTime time.Time) ([]*modelv2.Stage, error)

func (*Stage) GetStageByArkId

func (r *Stage) GetStageByArkId(ctx context.Context, arkStageId string) (*model.Stage, error)

func (*Stage) GetStageById

func (r *Stage) GetStageById(ctx context.Context, stageId int) (*model.Stage, error)

func (*Stage) GetStageExtraProcessTypeByArkId

func (r *Stage) GetStageExtraProcessTypeByArkId(ctx context.Context, arkStageId string) (null.String, error)

func (*Stage) GetStages

func (r *Stage) GetStages(ctx context.Context) ([]*model.Stage, error)

func (*Stage) GetStagesByZoneId

func (c *Stage) GetStagesByZoneId(ctx context.Context, zoneId int) ([]*model.Stage, error)

func (*Stage) SearchStageByCode

func (r *Stage) SearchStageByCode(ctx context.Context, code string) (*model.Stage, error)

type TimeRange

type TimeRange struct {
	// contains filtered or unexported fields
}

func NewTimeRange

func NewTimeRange(db *bun.DB) *TimeRange

func (*TimeRange) GetTimeRangeById

func (r *TimeRange) GetTimeRangeById(ctx context.Context, rangeId int) (*model.TimeRange, error)

func (*TimeRange) GetTimeRangeByServerAndName

func (c *TimeRange) GetTimeRangeByServerAndName(ctx context.Context, server string, name string) (*model.TimeRange, error)

func (*TimeRange) GetTimeRangesByServer

func (r *TimeRange) GetTimeRangesByServer(ctx context.Context, server string) ([]*model.TimeRange, error)

type Zone

type Zone struct {
	// contains filtered or unexported fields
}

func NewZone

func NewZone(db *bun.DB) *Zone

func (*Zone) GetShimZoneByArkId

func (r *Zone) GetShimZoneByArkId(ctx context.Context, arkZoneId string) (*modelv2.Zone, error)

func (*Zone) GetShimZones

func (r *Zone) GetShimZones(ctx context.Context) ([]*modelv2.Zone, error)

func (*Zone) GetZoneByArkId

func (c *Zone) GetZoneByArkId(ctx context.Context, arkZoneId string) (*model.Zone, error)

func (*Zone) GetZoneById

func (r *Zone) GetZoneById(ctx context.Context, id int) (*model.Zone, error)

func (*Zone) GetZones

func (r *Zone) GetZones(ctx context.Context) ([]*model.Zone, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL