diff --git a/src/dao/advertising_basic_dao.go b/src/dao/advertising_basic_dao.go new file mode 100644 index 0000000..d5a3c92 --- /dev/null +++ b/src/dao/advertising_basic_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type AdvertisingBasicDao interface { + GetAdvertisingBasicDb() (m *model.AdvertisingBasic, err error) +} diff --git a/src/dao/advertising_function_dao.go b/src/dao/advertising_function_dao.go new file mode 100644 index 0000000..a46ea0c --- /dev/null +++ b/src/dao/advertising_function_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type AdvertisingFunctionDao interface { + AdvertisingFunctionAll() (*[]model.AdvertisingFunction, error) +} diff --git a/src/dao/advertising_limit_dao.go b/src/dao/advertising_limit_dao.go new file mode 100644 index 0000000..2fcc2dc --- /dev/null +++ b/src/dao/advertising_limit_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type AdvertisingLimitDao interface { + GetAdvertisingLimit() (m *model.AdvertisingLimit, err error) +} diff --git a/src/dao/advertising_space_dao.go b/src/dao/advertising_space_dao.go new file mode 100644 index 0000000..2683cdd --- /dev/null +++ b/src/dao/advertising_space_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type AdvertisingSpaceDao interface { + AdvertisingSpaceAll() (*[]model.AdvertisingSpace, error) +} diff --git a/src/implement/advertising_basic_implement.go b/src/implement/advertising_basic_implement.go new file mode 100644 index 0000000..c2c516a --- /dev/null +++ b/src/implement/advertising_basic_implement.go @@ -0,0 +1,28 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "xorm.io/xorm" +) + +func NewAdvertisingBasicDb(engine *xorm.Engine) dao.AdvertisingBasicDao { + return &AdvertisingBasicDb{Db: engine} +} + +type AdvertisingBasicDb struct { + Db *xorm.Engine +} + +func (a AdvertisingBasicDb) GetAdvertisingBasicDb() (m *model.AdvertisingBasic, err error) { + m = new(model.AdvertisingBasic) + has, err := a.Db.Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/advertising_function_implement.go b/src/implement/advertising_function_implement.go new file mode 100644 index 0000000..c343483 --- /dev/null +++ b/src/implement/advertising_function_implement.go @@ -0,0 +1,24 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "xorm.io/xorm" +) + +func NewAdvertisingFunctionDb(engine *xorm.Engine) dao.AdvertisingFunctionDao { + return &AdvertisingFunctionDb{Db: engine} +} + +type AdvertisingFunctionDb struct { + Db *xorm.Engine +} + +func (a AdvertisingFunctionDb) AdvertisingFunctionAll() (*[]model.AdvertisingFunction, error) { + var m []model.AdvertisingFunction + if err := a.Db.Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/advertising_limit_implement.go b/src/implement/advertising_limit_implement.go new file mode 100644 index 0000000..20d8c90 --- /dev/null +++ b/src/implement/advertising_limit_implement.go @@ -0,0 +1,28 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "xorm.io/xorm" +) + +func NewAdvertisingLimitDb(engine *xorm.Engine) dao.AdvertisingLimitDao { + return &AdvertisingLimitDb{Db: engine} +} + +type AdvertisingLimitDb struct { + Db *xorm.Engine +} + +func (a AdvertisingLimitDb) GetAdvertisingLimit() (m *model.AdvertisingLimit, err error) { + m = new(model.AdvertisingLimit) + has, err := a.Db.Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/advertising_space_implement.go b/src/implement/advertising_space_implement.go new file mode 100644 index 0000000..a6dfe32 --- /dev/null +++ b/src/implement/advertising_space_implement.go @@ -0,0 +1,24 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "xorm.io/xorm" +) + +func NewAdvertisingSpaceDb(engine *xorm.Engine) dao.AdvertisingSpaceDao { + return &AdvertisingSpaceDb{Db: engine} +} + +type AdvertisingSpaceDb struct { + Db *xorm.Engine +} + +func (a AdvertisingSpaceDb) AdvertisingSpaceAll() (*[]model.AdvertisingSpace, error) { + var m []model.AdvertisingSpace + if err := a.Db.Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/model/advertising_basic.go b/src/model/advertising_basic.go new file mode 100644 index 0000000..a45005d --- /dev/null +++ b/src/model/advertising_basic.go @@ -0,0 +1,11 @@ +package model + +type AdvertisingBasic struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Info string `json:"info" xorm:"comment('json') TEXT"` + AndroidAdIsOpen int `json:"android_ad_is_open" xorm:"not null default 0 comment('安卓广告是否开启(1:开启 0:不开启)') TINYINT(1)"` + IosAdIsOpen int `json:"ios_ad_is_open" xorm:"not null default 0 comment('ios广告是否开启(1:开启 0:不开启)') TINYINT(1)"` + AndroidOpenAdIsOpen int `json:"android_open_ad_is_open" xorm:"not null default 0 comment('安卓广告是否开启(1:开启 0:不开启)') TINYINT(1)"` + IosOpenAdIsOpen int `json:"ios_open_ad_is_open" xorm:"not null default 0 comment('ios广告是否开启(1:开启 0:不开启)') TINYINT(1)"` + Voice string `json:"voice" xorm:"VARCHAR(255)"` +} diff --git a/src/model/advertising_function.go b/src/model/advertising_function.go new file mode 100644 index 0000000..2537830 --- /dev/null +++ b/src/model/advertising_function.go @@ -0,0 +1,8 @@ +package model + +type AdvertisingFunction struct { + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"` + Type string `json:"type" xorm:"not null default '' VARCHAR(255)"` + AdId int `json:"ad_id" xorm:"not null default 0 comment('广告位id') INT(11)"` +} diff --git a/src/model/advertising_limit.go b/src/model/advertising_limit.go new file mode 100644 index 0000000..08b3e55 --- /dev/null +++ b/src/model/advertising_limit.go @@ -0,0 +1,12 @@ +package model + +type AdvertisingLimit struct { + Id int `json:"id" xorm:"not null pk INT(11)"` + Minue int `json:"minue" xorm:"default 0 INT(11)"` + ImeiNum int `json:"imei_num" xorm:"default 0 INT(11)"` + Tip string `json:"tip" xorm:"VARCHAR(255)"` + PublicImg string `json:"public_img" xorm:"VARCHAR(255)"` + PublicStr string `json:"public_str" xorm:"VARCHAR(255)"` + WithdrawImg string `json:"withdraw_img" xorm:"VARCHAR(255)"` + WithdrawStr string `json:"withdraw_str" xorm:"VARCHAR(255)"` +} diff --git a/src/model/advertising_space.go b/src/model/advertising_space.go new file mode 100644 index 0000000..93dfbc6 --- /dev/null +++ b/src/model/advertising_space.go @@ -0,0 +1,9 @@ +package model + +type AdvertisingSpace struct { + Id int `json:"id" xorm:"not null pk INT(11)"` + Name string `json:"name" xorm:"VARCHAR(255)"` + Kind int `json:"kind" xorm:"not null default 1 comment('广告类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流广告)') TINYINT(1)"` + Info string `json:"info" xorm:"TEXT"` + CountingDown int `json:"counting_down" xorm:"default 0 comment('倒计时 单位秒') INT(11)"` +}