Browse Source

广告位

master
huangjiajun 1 month ago
parent
commit
0eac76d1a5
12 changed files with 172 additions and 0 deletions
  1. +7
    -0
      src/dao/advertising_basic_dao.go
  2. +7
    -0
      src/dao/advertising_function_dao.go
  3. +7
    -0
      src/dao/advertising_limit_dao.go
  4. +7
    -0
      src/dao/advertising_space_dao.go
  5. +28
    -0
      src/implement/advertising_basic_implement.go
  6. +24
    -0
      src/implement/advertising_function_implement.go
  7. +28
    -0
      src/implement/advertising_limit_implement.go
  8. +24
    -0
      src/implement/advertising_space_implement.go
  9. +11
    -0
      src/model/advertising_basic.go
  10. +8
    -0
      src/model/advertising_function.go
  11. +12
    -0
      src/model/advertising_limit.go
  12. +9
    -0
      src/model/advertising_space.go

+ 7
- 0
src/dao/advertising_basic_dao.go View File

@@ -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)
}

+ 7
- 0
src/dao/advertising_function_dao.go View File

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type AdvertisingFunctionDao interface {
AdvertisingFunctionAll() (*[]model.AdvertisingFunction, error)
}

+ 7
- 0
src/dao/advertising_limit_dao.go View File

@@ -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)
}

+ 7
- 0
src/dao/advertising_space_dao.go View File

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type AdvertisingSpaceDao interface {
AdvertisingSpaceAll() (*[]model.AdvertisingSpace, error)
}

+ 28
- 0
src/implement/advertising_basic_implement.go View File

@@ -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
}

+ 24
- 0
src/implement/advertising_function_implement.go View File

@@ -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
}

+ 28
- 0
src/implement/advertising_limit_implement.go View File

@@ -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
}

+ 24
- 0
src/implement/advertising_space_implement.go View File

@@ -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
}

+ 11
- 0
src/model/advertising_basic.go View File

@@ -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)"`
}

+ 8
- 0
src/model/advertising_function.go View File

@@ -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)"`
}

+ 12
- 0
src/model/advertising_limit.go View File

@@ -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)"`
}

+ 9
- 0
src/model/advertising_space.go View File

@@ -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)"`
}

Loading…
Cancel
Save