|
|
@@ -1,48 +0,0 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/dao" |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/model" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewMediumAppDomainDb(engine *xorm.Engine) dao.MediumAppDomainDao { |
|
|
|
return &MediumAppDomainDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type MediumAppDomainDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (m2 MediumAppDomainDb) GetMediumAppDomainByHost(host string) (m *model.MediumAppDomain, err error) { |
|
|
|
m = new(model.MediumAppDomain) |
|
|
|
has, err := m2.Db.Where("domain =?", host).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (m2 MediumAppDomainDb) GetMediumAppDomain(mediumId int) (m *model.MediumAppDomain, err error) { |
|
|
|
m = new(model.MediumAppDomain) |
|
|
|
has, err := m2.Db.Where("medium_id =?", mediumId).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (m2 MediumAppDomainDb) MediumAppDomainInsert(m *model.MediumAppDomain) (int64, error) { |
|
|
|
insertAffected, err := m2.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
return insertAffected, nil |
|
|
|
} |