From 45c9120ed142b1d0acc4b54ff22bdcb7eca64fa6 Mon Sep 17 00:00:00 2001 From: tommy <3405129587@qq.com> Date: Wed, 20 May 2020 14:57:28 +0800 Subject: [PATCH] fix --- models/base.go | 78 ++++++++++++++++++++++++++++++++++++++++++++++ models/init_models.go | 85 --------------------------------------------------- 2 files changed, 78 insertions(+), 85 deletions(-) delete mode 100644 models/init_models.go diff --git a/models/base.go b/models/base.go index eb6df4c..1a05cfd 100644 --- a/models/base.go +++ b/models/base.go @@ -8,6 +8,84 @@ import ( "strings" ) +const TableNamePrefix = "ox_" + +func init() { + err := core.GetXormAuto().Sync2( + new(Activity), + new(ActivityModuleService), + new(AreaStore), + new(AuctionHistory), + new(AuctionResultRecord), + new(BaheTeam), + new(BaheTeamMember), + new(BarrageHistory), + new(BullyScreenHistory), + new(BullyScreenServer), + new(BullyScreenWalletHistory), + new(Customer), + new(CustomerGoods), + new(CustomerOperation), + new(CustomerOrder), + new(DanMuServer), + new(Invitation), + new(InvitationLetter), + new(LotteryDrawActivity), + new(LotteryDrawEnvelopeWallet), + new(LotteryDrawRecord), + new(LotteryDrawRule), + new(LotteryDrawRuleLadder), + new(LotteryDrawWalletHistory), + new(ModuleService), + new(ModuleServiceHistory), + new(ModuleStyle), + new(NewAuctionActivity), + new(NewVoteActivity), + new(NewVoteActivityHistory), + new(NewVoteActivityLadder), + new(OrderDrawActivity), + new(OrderDrawRecord), + new(OrderDrawRule), + new(OrderDrawRuleLadder), + new(OrderDrawStyle), + new(RewardHistory), + new(RewardServer), + new(RewardWallet), + new(RewardWalletHistory), + new(Sensitive), + new(ShakeRedEnvelopeActivity), + new(ShakeRedEnvelopeRecord), + new(ShakeRedEnvelopeRule), + new(ShakeRedEnvelopeRuleLadder), + new(SignHistory), + new(SignUp), + new(TugOfWar), + new(UpperWall), + new(User), + new(UserWalletHistory), + new(NewVoteActivity), + new(NewVoteActivityHistory), + new(OrderEntryPerson), + new(Rehearsal), + new(MsgWallServer), + new(ShakeRedEnvelopeUser), + new(OrderGift), + new(UserPrize), + new(Calorie), + new(CalorieUser), + new(UserOrder), + new(UserRedPack), + new(RealSignList), + new(RealSignHistory), + new(LiveViewer), + new(LiveConfig), + new(LiveRedEnvelopeRule), + new(UserTransfer), + new(CustomerOrderSub), + ) + fmt.Printf("error=======>%v\n\n", err) +} + func Condition(condition map[string]interface{}) *xorm.Session { session := core.GetXormAuto().NewSession() for k, v := range condition { diff --git a/models/init_models.go b/models/init_models.go deleted file mode 100644 index b448075..0000000 --- a/models/init_models.go +++ /dev/null @@ -1,85 +0,0 @@ -package models - -import ( - "fmt" - - "github.com/ouxuanserver/osmanthuswine/src/core" -) - -const TableNamePrefix = "ox_" - -func init() { - err := core.GetXormAuto().Sync2( - new(Activity), - new(ActivityModuleService), - new(AreaStore), - new(AuctionHistory), - new(AuctionResultRecord), - new(BaheTeam), - new(BaheTeamMember), - new(BarrageHistory), - new(BullyScreenHistory), - new(BullyScreenServer), - new(BullyScreenWalletHistory), - new(Customer), - new(CustomerGoods), - new(CustomerOperation), - new(CustomerOrder), - new(DanMuServer), - new(Invitation), - new(InvitationLetter), - new(LotteryDrawActivity), - new(LotteryDrawEnvelopeWallet), - new(LotteryDrawRecord), - new(LotteryDrawRule), - new(LotteryDrawRuleLadder), - new(LotteryDrawWalletHistory), - new(ModuleService), - new(ModuleServiceHistory), - new(ModuleStyle), - new(NewAuctionActivity), - new(NewVoteActivity), - new(NewVoteActivityHistory), - new(NewVoteActivityLadder), - new(OrderDrawActivity), - new(OrderDrawRecord), - new(OrderDrawRule), - new(OrderDrawRuleLadder), - new(OrderDrawStyle), - new(RewardHistory), - new(RewardServer), - new(RewardWallet), - new(RewardWalletHistory), - new(Sensitive), - new(ShakeRedEnvelopeActivity), - new(ShakeRedEnvelopeRecord), - new(ShakeRedEnvelopeRule), - new(ShakeRedEnvelopeRuleLadder), - new(SignHistory), - new(SignUp), - new(TugOfWar), - new(UpperWall), - new(User), - new(UserWalletHistory), - new(NewVoteActivity), - new(NewVoteActivityHistory), - new(OrderEntryPerson), - new(Rehearsal), - new(MsgWallServer), - new(ShakeRedEnvelopeUser), - new(OrderGift), - new(UserPrize), - new(Calorie), - new(CalorieUser), - new(UserOrder), - new(UserRedPack), - new(RealSignList), - new(RealSignHistory), - new(LiveViewer), - new(LiveConfig), - new(LiveRedEnvelopeRule), - new(UserTransfer), - new(CustomerOrderSub), - ) - fmt.Printf("error=======>%v\n\n", err) -}