models

package
v0.0.0-...-d31d92c Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Db *sqlx.DB
)
View Source
var UserPresentAllMasters []UserPresentAllMaster

Functions

func GetCardLevelAndAmountPerSec

func GetCardLevelAndAmountPerSec(card CardMaster, totalExp int64) (int, int)

func InitAllGachaItemMaster

func InitAllGachaItemMaster()

func InitCardMaster

func InitCardMaster()

func InitUserPresentAllMaster

func InitUserPresentAllMaster()

func PresentBulkCreate

func PresentBulkCreate(userPresents *[]UserPresent) error

func PresentReceivedBulkCreate

func PresentReceivedBulkCreate(userPresents *[]UserPresent) error

func UserCardBulkCreate

func UserCardBulkCreate(userCards *[]UserCard) error

func UserItemBulkCreate

func UserItemBulkCreate(userItems *[]UserItem) error

func UserPresentAllReceivedHistoryBulkCreate

func UserPresentAllReceivedHistoryBulkCreate(UserPresentAllReceivedHistories *[]UserPresentAllReceivedHistory) error

Types

type CardMaster

type CardMaster struct {
	CardID           int `json:"id" db:"id"`
	BaseExpPerLevel  int `json:"baseExpPerLevel" db:"base_exp_per_level"`
	MaxAmountPerSec  int `json:"maxAmountPerSec" db:"max_amount_per_sec"`
	BaseAmountPerSec int `json:"amountPerSec" db:"amount_per_sec"`
	MaxLevel         int `json:"maxLevel" db:"max_level"`
}

func GetCardMaster

func GetCardMaster(cardID int) CardMaster

type CardMasters

type CardMasters []CardMaster

func GetCardMasters

func GetCardMasters() CardMasters

func (CardMasters) Commit

func (cm CardMasters) Commit(outdir string) error

func (CardMasters) Rename

func (cm CardMasters) Rename(fileName string) error

type ExpItemMaster

type ExpItemMaster struct {
	ID        int64 `json:"id" db:"id"`
	GainedExp int   `json:"gainedExp" db:"gained_exp"`
}

type ExpItemMasters

type ExpItemMasters []ExpItemMaster

func GetExpItemMaster

func GetExpItemMaster() ExpItemMasters

func (ExpItemMasters) Commit

func (eim ExpItemMasters) Commit(outdir string) error

func (ExpItemMasters) Rename

func (eim ExpItemMasters) Rename(fileName string) error

type GachaAllItemMasters

type GachaAllItemMasters []GachaData

func GetGachaAllItemMasters

func GetGachaAllItemMasters() GachaAllItemMasters

func (GachaAllItemMasters) Commit

func (gaim GachaAllItemMasters) Commit(outdir string) error

func (GachaAllItemMasters) Rename

func (gaim GachaAllItemMasters) Rename(fileName string) error

type GachaData

type GachaData struct {
	Gacha     GachaMaster       `json:"gacha"`
	GachaItem []GachaItemMaster `json:"gachaItemList"`
}

type GachaItemMaster

type GachaItemMaster struct {
	ID        int64 `json:"id" db:"id"`
	GachaID   int64 `json:"gachaId" db:"gacha_id"`
	ItemType  int   `json:"itemType" db:"item_type"`
	ItemID    int   `json:"itemId" db:"item_id"`
	Amount    int   `json:"amount" db:"amount"`
	Weight    int   `json:"weight" db:"weight"`
	CreatedAt int64 `json:"createdAt" db:"created_at"`
}

func DrawGacha

func DrawGacha(gachaID int) GachaItemMaster

func DrawManyGacha

func DrawManyGacha(gachaID int, drawCount int) []GachaItemMaster

type GachaMaster

type GachaMaster struct {
	ID           int64  `json:"id" db:"id"`
	Name         string `json:"name" db:"name"`
	StartAt      int64  `json:"startAt" db:"start_at"`
	EndAt        int64  `json:"endAt" db:"end_at"`
	DisplayOrder int    `json:"displayOrder" db:"display_order"`
	CreatedAt    int64  `json:"createdAt" db:"created_at"`
}

type GachaMasters

type GachaMasters []GachaMaster

type Json

type Json struct {
	UserType string `json:"user_type"`
	UserID   int64  `json:"user_id"`
	ViewerID string `json:"viewer_id"`
}

type JsonArray

type JsonArray []*Json

func (*JsonArray) Commit

func (j *JsonArray) Commit(outdir string) error

func (*JsonArray) Rename

func (j *JsonArray) Rename(fileName string) error

type JsonPlatform

type JsonPlatform []*Platform

func (*JsonPlatform) Commit

func (j *JsonPlatform) Commit(outdir string) error

func (*JsonPlatform) Rename

func (j *JsonPlatform) Rename(fileName string) error

type JsonValidate

type JsonValidate struct {
	UserType                       string                          `json:"user_type"`
	UserID                         int64                           `json:"user_id"`
	ViewerID                       string                          `json:"viewer_id"`
	UserLoginBonuses               []UserLoginBonus                `json:"userLoginBonuses,omitempty"`
	UserLoginAppendPresents        []UserPresent                   `json:"userLoginAppendPresents,omitempty"`
	JsonUser                       User                            `json:"user,omitempty"`
	UserDeck                       UserDeck                        `json:"userDeck,omitempty"`
	UserDevices                    []UserDevice                    `json:"userDevices,omitempty"`
	TotalAmountPerSec              int64                           `json:"totalAmountPerSec,omitempty"`
	GetItemList                    []UserItem                      `json:"userItem,omitempty"`
	UserCards                      []UserCard                      `json:"userCard,omitempty"`
	UserPresents                   []UserPresent                   `json:"userPresent,omitempty"`
	UserAllPresents                []UserPresent                   `json:"userAllPresents,omitempty"`
	UserPresentAllReceiveHistories []UserPresentAllReceivedHistory `json:"userPresentAllReceivedHistory,omitempty"`
}

type JsonValidates

type JsonValidates []*JsonValidate

func (*JsonValidates) Commit

func (j *JsonValidates) Commit(outdir string) error

func (*JsonValidates) Rename

func (j *JsonValidates) Rename(fileName string) error

type LoginBonusMaster

type LoginBonusMaster struct {
	ID             int64 `db:"id"`
	LoginBonusType int   `db:"login_bonus_type"`
	StartAt        int64 `db:"start_at"`
	EndAt          int64 `db:"end_at"`
	ColumnCount    int   `db:"column_count"`
	Looped         int   `db:"looped"`
	CreatedAt      int64 `db:"created_at"`
}

func GetLoginBonusMasters

func GetLoginBonusMasters() []LoginBonusMaster

type LoginBonusRewardMaster

type LoginBonusRewardMaster struct {
	ID             int64 `json:"id" db:"id"`
	LoginBonusID   int64 `json:"loginBonusId" db:"login_bonus_id"`
	RewardSequence int   `json:"rewardSequence" db:"reward_sequence"`
	ItemType       int   `json:"itemType" db:"item_type"`
	ItemID         int64 `json:"itemId" db:"item_id"`
	Amount         int64 `json:"amount" db:"amount"`
}

type LoginBonusRewardMasters

type LoginBonusRewardMasters []LoginBonusRewardMaster

func GetLoginBonusRewardMaster

func GetLoginBonusRewardMaster() LoginBonusRewardMasters

func (LoginBonusRewardMasters) Commit

func (lbrm LoginBonusRewardMasters) Commit(outdir string) error

func (LoginBonusRewardMasters) Rename

func (lbrm LoginBonusRewardMasters) Rename(fileName string) error

type Platform

type Platform struct {
	ID   int64 `json:"platform_id"`
	Type int   `json:"platform_type"`
}

type PresentAllMaster

type PresentAllMaster struct {
	ID                int64  `json:"id" db:"id"`
	RegisteredStartAt int64  `json:"registeredStartAt" db:"registered_start_at"`
	RegisteredEndAt   int64  `json:"registeredEndAt" db:"registered_end_at"`
	ItemType          int    `json:"itemType" db:"item_type"`
	ItemID            int64  `json:"itemId" db:"item_id"`
	Amount            int64  `json:"amount" db:"amount"`
	PresentMessage    string `json:"presentMessage" db:"present_message"`
	CreatedAt         int64  `json:"createdAt" db:"created_at"`
}

type PresentAllMasters

type PresentAllMasters []PresentAllMaster

func GetPresentAllMasters

func GetPresentAllMasters() PresentAllMasters

func (PresentAllMasters) Commit

func (pam PresentAllMasters) Commit(outdir string) error

func (PresentAllMasters) Rename

func (pam PresentAllMasters) Rename(fileName string) error

type User

type User struct {
	ID              int64
	IsuCoin         int64
	LastGetRewardAt int64
	LastActivatedAt int64
	RegisteredAt    int64
	CreatedAt       int64
	UpdatedAt       int64
}

func NewUser

func NewUser(i int64, isuCoin int64, registeredAt int64, activeAt int64) User

func (User) Create

func (u User) Create() error

type UserBan

type UserBan struct {
	ID        int64 `json:"id" db:"id"`
	UserID    int64 `json:"userId" db:"user_id"`
	CreatedAt int64 `json:"createdAt" db:"created_at"`
	UpdatedAt int64 `json:"updatedAt" db:"updated_at"`
}

func NewUserBan

func NewUserBan(i int64, userID int64, createdAt int64) UserBan

func (UserBan) Create

func (u UserBan) Create() error

type UserCard

type UserCard struct {
	ID           int64 `db:"id"`
	UserID       int64 `db:"user_id"`
	CardID       int   `db:"card_id"`
	AmountPerSec int   `db:"amount_per_sec"`
	Level        int   `db:"level"`
	TotalExp     int64 `db:"total_exp"`
	CreatedAt    int64 `db:"created_at"`
	UpdatedAt    int64 `db:"updated_at"`
}

func NewUserCard

func NewUserCard(i int64, user User, cardID int, amountPerSec int, level int, totalExp int64) UserCard

func (UserCard) Create

func (u UserCard) Create() error

type UserDeck

type UserDeck struct {
	ID        int64 `json:"id" db:"id"`
	UserID    int64 `json:"userId" db:"user_id"`
	CardID1   int64 `json:"cardId1" db:"user_card_id_1"`
	CardID2   int64 `json:"cardId2" db:"user_card_id_2"`
	CardID3   int64 `json:"cardId3" db:"user_card_id_3"`
	CreatedAt int64 `json:"createdAt" db:"created_at"`
	UpdatedAt int64 `json:"updatedAt" db:"updated_at"`
}

func NewUserDeck

func NewUserDeck(i int64, user User, userCardID1 int64, userCardID2 int64, userCardID3 int64, createdAt int64) UserDeck

func (UserDeck) Create

func (u UserDeck) Create() error

type UserDevice

type UserDevice struct {
	ID           int64  `db:"id"`
	UserID       int64  `db:"user_id"`
	PlatformID   string `db:"platform_id"`
	PlatformType int    `db:"platform_type"`
	CreatedAt    int64  `db:"created_at"`
	UpdatedAt    int64  `db:"updated_at"`
}

func NewUserDevice

func NewUserDevice(i int64, user User, platformID string) UserDevice

func NewUserDeviceOther

func NewUserDeviceOther(i int64, user User, platformID string, platformType int) UserDevice

func (UserDevice) Create

func (u UserDevice) Create() error

type UserItem

type UserItem struct {
	ID        int64 `db:"id"`
	UserID    int64 `db:"user_id"`
	ItemType  int   `db:"item_type"`
	ItemID    int   `db:"item_id"`
	Amount    int   `db:"amount"`
	CreatedAt int64 `db:"created_at"`
	UpdatedAt int64 `db:"updated_at"`
}

func NewUserItem

func NewUserItem(i int64, user User, itemType int, itemID int, amount int, createdAt int64) UserItem

func (UserItem) Create

func (u UserItem) Create() error

type UserLoginBonus

type UserLoginBonus struct {
	ID                 int64 `json:"id" db:"id"`
	UserID             int64 `json:"userId" db:"user_id"`
	LoginBonusID       int   `json:"loginBonusId" db:"login_bonus_id"`
	LastRewardSequence int   `json:"lastRewardSequence" db:"last_reward_sequence"`
	LoopCount          int   `json:"loopCount" db:"loop_count"`
	CreatedAt          int64 `json:"createdAt" db:"created_at"`
	UpdatedAt          int64 `json:"updatedAt" db:"updated_at"`
}

func NewUserLoginBonus

func NewUserLoginBonus(i int64, user User, bonusID int, loopCount int, rewardSequence int) UserLoginBonus

func (UserLoginBonus) Create

func (u UserLoginBonus) Create() error

type UserPresent

type UserPresent struct {
	ID             int64  `db:"id"`
	UserID         int64  `db:"user_id"`
	SentAt         int64  `db:"sent_at"`
	ItemType       int    `db:"item_type"`
	ItemID         int    `db:"item_id"`
	Amount         int    `db:"amount"`
	PresentMessage string `db:"present_message"`
	CreatedAt      int64  `db:"created_at"`
	UpdatedAt      int64  `db:"updated_at"`
	DeletedAt      *int64 `db:"deleted_at"`
}

func NewUserPresent

func NewUserPresent(i int64, user User, sentAt int64, itemType int, itemID int, amount int, presentMessage string) UserPresent

func (UserPresent) Create

func (u UserPresent) Create() error

func (UserPresent) ReceivedCreate

func (u UserPresent) ReceivedCreate() error

type UserPresentAllMaster

type UserPresentAllMaster struct {
	ID                int    `db:"id"`
	RegisteredStartAt int64  `db:"registered_start_at"`
	RegisteredEndAt   int64  `db:"registered_end_at"`
	ItemType          int    `db:"item_type"`
	ItemID            int    `db:"item_id"`
	Amount            int    `db:"amount"`
	PresentMessage    string `db:"present_message"`
	CreatedAt         int64  `db:"created_at"`
}

type UserPresentAllReceivedHistory

type UserPresentAllReceivedHistory struct {
	ID           int64  `json:"id" db:"id"`
	UserID       int64  `json:"userId" db:"user_id"`
	PresentAllID int64  `json:"presentAllId" db:"present_all_id"`
	ReceivedAt   int64  `json:"receivedAt" db:"received_at"`
	CreatedAt    int64  `json:"createdAt" db:"created_at"`
	UpdatedAt    int64  `json:"updatedAt" db:"updated_at"`
	DeletedAt    *int64 `json:"deletedAt,omitempty" db:"deleted_at"`
}

func NewUserPresentAllReceivedHistory

func NewUserPresentAllReceivedHistory(i int64, user User, presentAllID int64, receivedAt int64, createdAt int64) UserPresentAllReceivedHistory

func (UserPresentAllReceivedHistory) Create

func (UserPresentAllReceivedHistory) CreateDeleted

func (u UserPresentAllReceivedHistory) CreateDeleted() error

Jump to

Keyboard shortcuts

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