Browse Source

update

master
dengbiao 4 months ago
parent
commit
c90404effb
6 changed files with 1 additions and 123 deletions
  1. +0
    -9
      src/super/dao/agent_app_domain_dao.go
  2. +0
    -9
      src/super/dao/medium_app_domain_dao.go
  3. +0
    -48
      src/super/implement/agent_app_domain_implement.go
  4. +0
    -48
      src/super/implement/medium_app_domain_implement.go
  5. +0
    -9
      src/super/model/agent_app_domain.go
  6. +1
    -0
      src/super/model/user_wx_applet_list.go

+ 0
- 9
src/super/dao/agent_app_domain_dao.go View File

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

import "code.fnuoos.com/zhimeng/model.git/src/super/model"

type AgentAppDomainDao interface {
GetAgentAppDomain(agentId int) (m *model.AgentAppDomain, err error)
GetAgentAppDomainByHost(host string) (m *model.AgentAppDomain, err error)
AgentAppDomainInsert(m *model.AgentAppDomain) (int64, error)
}

+ 0
- 9
src/super/dao/medium_app_domain_dao.go View File

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

import "code.fnuoos.com/zhimeng/model.git/src/super/model"

type MediumAppDomainDao interface {
GetMediumAppDomain(mediumId int) (m *model.MediumAppDomain, err error)
GetMediumAppDomainByHost(host string) (m *model.MediumAppDomain, err error)
MediumAppDomainInsert(m *model.MediumAppDomain) (int64, error)
}

+ 0
- 48
src/super/implement/agent_app_domain_implement.go View File

@@ -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 NewAgentAppDomainDb(engine *xorm.Engine) dao.AgentAppDomainDao {
return &AgentAppDomainDb{Db: engine}
}

type AgentAppDomainDb struct {
Db *xorm.Engine
}

func (a AgentAppDomainDb) GetAgentAppDomainByHost(host string) (m *model.AgentAppDomain, err error) {
m = new(model.AgentAppDomain)
has, err := a.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 (a AgentAppDomainDb) GetAgentAppDomain(agent int) (m *model.AgentAppDomain, err error) {
m = new(model.AgentAppDomain)
has, err := a.Db.Where("agent_id =?", agent).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (a AgentAppDomainDb) AgentAppDomainInsert(m *model.AgentAppDomain) (int64, error) {
insertAffected, err := a.Db.InsertOne(m)
if err != nil {
return 0, err
}
return insertAffected, nil
}

+ 0
- 48
src/super/implement/medium_app_domain_implement.go View File

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

+ 0
- 9
src/super/model/agent_app_domain.go View File

@@ -1,9 +0,0 @@
package model

type AgentAppDomain struct {
Domain string `json:"domain" xorm:"not null pk comment('绑定域名') VARCHAR(100)"`
AgentId int `json:"agent_id" xorm:"not null comment('代理id') index unique(IDX_UUID_TYPE) INT(10)"`
Uuid int `json:"uuid" xorm:"not null comment('对应APP ID编号') index unique(IDX_UUID_TYPE) INT(10)"`
Type string `json:"type" xorm:"not null comment('api接口域名,wap.h5域名,admin管理后台') unique(IDX_UUID_TYPE) ENUM('admin','api','wap')"`
IsSsl int `json:"is_ssl" xorm:"not null default 0 comment('是否开启ssl:0否;1是') TINYINT(255)"`
}

+ 1
- 0
src/super/model/user_wx_applet_list.go View File

@@ -5,6 +5,7 @@ type UserWxAppletList struct {
Name string `json:"name" xorm:"not null default '' comment('小程序名称') VARCHAR(255)"`
Logo string `json:"logo" xorm:"not null default '' comment('小程序logo') VARCHAR(255)"`
Appid string `json:"appid" xorm:"not null default '' comment('授权小程序appid') VARCHAR(255)"`
OriginalId string `json:"original_id" xorm:"not null default '' comment('授权小程序原始id') VARCHAR(255)"`
AuthorizerRefreshToken string `json:"authorizer_refresh_token" xorm:"not null default '' comment('授权更新token') VARCHAR(255)"`
IsAuth int `json:"is_auth" xorm:"not null default 0 comment('是否已授权 1已授权 0未授权') TINYINT(1)"`
Uuid string `json:"uuid" xorm:"not null default '' comment('站长id') unique VARCHAR(255)"`


Loading…
Cancel
Save