init.go 782 Bytes
package service

import (
	"apigame/service-common/svconst"
	"apigame/service-common/svmysql"
	"apigame/service/cardholder"
	"apigame/service/roomrank"
)

func Init() {

	// create table
	// 卡牌卡包
	for _, gameId := range svconst.GameListCardHolder {
		svmysql.InitTable(new(cardholder.Player), gameId, true)
		svmysql.InitTable(new(cardholder.RecordOpen), gameId, true)
		svmysql.InitTable(new(cardholder.RecordRewardAlbum), gameId, true)
		svmysql.InitTable(new(cardholder.RecordRewardRound), gameId, true)
	}
	// 房间排行
	for _, gameId := range svconst.GameListRoomRank {
		svmysql.InitTable(new(roomrank.Player), gameId, true)
		svmysql.InitTable(new(roomrank.RecordGetSettleAward), gameId, true)
		svmysql.InitTable(new(roomrank.RecordAddScore), gameId, true)
	}

}