database

package
v0.0.0-...-6681e3d Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func CreateUser

func CreateUser(ctx context.Context, name string, token string) error

nameとtokenを受け取って保存する

func GetCharacter

func GetCharacter(ctx context.Context, characterId int) (model.Character, error)

func GetCharacters

func GetCharacters(ctx context.Context) ([]model.Character, error)

GetCharacters キャラクターの情報を取得する

func GetGachaConfigs

func GetGachaConfigs(ctx context.Context) ([]model.GachaConfig, error)

GetGachaConfigs ガチャの設定情報を取得する

func GetToken

func GetToken(ctx context.Context, id int, name string) (model.User, error)

idとnameを受け取って該当するuserのtokenを取り出す

func GetUser

func GetUser(ctx context.Context, token string) (model.User, error)

tokenを受け取って該当するuserのnameを取り出す

func GetUserCharactersByID

func GetUserCharactersByID(ctx context.Context, userId int) ([]model.UserCharacter, error)

func GetUserCountedCharactersByID

func GetUserCountedCharactersByID(ctx context.Context, userId int) ([]model.UserPossessionCharacter, error)

func PostUserCharacters

func PostUserCharacters(ctx context.Context, selectedCharacters []model.Character, userId int) error

ユーザーが引いたキャラクターをDBに保存する

func UpdateUser

func UpdateUser(ctx context.Context, token string, name string) error

tokenとnameを受け取ってtokenに該当するuserのnameを更新する

func VerifyToken

func VerifyToken(ctx context.Context, token string) bool

tokenが存在するかチェックする

Types

This section is empty.

Jump to

Keyboard shortcuts

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