Browse Source

update

master
dengbiao 4 weeks ago
parent
commit
0129770e24
3 changed files with 16 additions and 3 deletions
  1. +1
    -1
      src/model/applet_application_ad_space_list.go
  2. +2
    -1
      src/super/dao/user_app_domain_dao.go
  3. +13
    -1
      src/super/implement/user_app_domain_implement.go

+ 1
- 1
src/model/applet_application_ad_space_list.go View File

@@ -8,7 +8,7 @@ type AppletApplicationAdSpaceList struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"default '' comment('广告位名称') VARCHAR(255)"`
AppId string `json:"app_id" xorm:"not null default '' comment('小程序appid') VARCHAR(255)"`
Kind int `json:"kind" xorm:"not null default 1 comment('广告位类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流 5:Banner)') TINYINT(1)"`
Kind int `json:"kind" xorm:"not null default 1 comment('广告位类型(1:banner 2:激励视频 3:插屏广告 4:视频广告 5:视频贴片广告)') TINYINT(1)"`
State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝 3:封禁中)') TINYINT(1)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Update time.Time `json:"update" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`


+ 2
- 1
src/super/dao/user_app_domain_dao.go View File

@@ -4,6 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model"

type UserAppDomainDao interface {
GetUserAppDomain(masterId int) (m *model.UserAppDomain, err error)
GetMediumAppDomainByHost(host string) (m *model.UserAppDomain, err error)
GetAppDomainByHost(host string) (m *model.UserAppDomain, err error)
GetAppDomainByType(kind, masterId string) (m *model.UserAppDomain, err error)
UserAppDomainInsert(m *model.UserAppDomain) (int64, error)
}

+ 13
- 1
src/super/implement/user_app_domain_implement.go View File

@@ -15,7 +15,7 @@ type UserAppDomainDb struct {
Db *xorm.Engine
}

func (u UserAppDomainDb) GetMediumAppDomainByHost(host string) (m *model.UserAppDomain, err error) {
func (u UserAppDomainDb) GetAppDomainByHost(host string) (m *model.UserAppDomain, err error) {
m = new(model.UserAppDomain)
has, err := u.Db.Where("domain =?", host).Get(m)
if err != nil {
@@ -27,6 +27,18 @@ func (u UserAppDomainDb) GetMediumAppDomainByHost(host string) (m *model.UserApp
return m, nil
}

func (u UserAppDomainDb) GetAppDomainByType(masterId, kind string) (m *model.UserAppDomain, err error) {
m = new(model.UserAppDomain)
has, err := u.Db.Where("type =?", kind).And("uuid =?", masterId).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (u UserAppDomainDb) GetUserAppDomain(masterId int) (m *model.UserAppDomain, err error) {
m = new(model.UserAppDomain)
has, err := u.Db.Where("uuid =?", masterId).Get(m)


Loading…
Cancel
Save