@@ -0,0 +1,7 @@ | |||||
package dao | |||||
import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
type MicroApplicationsListDao interface { | |||||
GetMicroApplicationsLis(appKey string) (m *models.MicroApplicationsList, err error) | |||||
} |
@@ -0,0 +1,28 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | |||||
"xorm.io/xorm" | |||||
) | |||||
func NewMicroApplicationsListDb(engine *xorm.Engine) dao.MicroApplicationsListDao { | |||||
return &MicroApplicationsListDb{Db: engine} | |||||
} | |||||
type MicroApplicationsListDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func (m2 MicroApplicationsListDb) GetMicroApplicationsLis(appKey string) (m *models.MicroApplicationsList, err error) { | |||||
m = new(models.MicroApplicationsList) | |||||
has, err := m2.Db.Where("app_key =?", appKey).Get(m) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return m, nil | |||||
} |
@@ -0,0 +1,18 @@ | |||||
package models | |||||
import ( | |||||
"time" | |||||
) | |||||
type MicroApplicationsList struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr comment('自增id') INT(11)"` | |||||
AppKey string `json:"app_key" xorm:"not null default '' comment('应用标识') CHAR(100)"` | |||||
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"` | |||||
Icon string `json:"icon" xorm:"not null default '' comment('应用icon') VARCHAR(255)"` | |||||
Desc string `json:"desc" xorm:"not null default '' comment('应用描述') VARCHAR(255)"` | |||||
NowVersion string `json:"now_version" xorm:"not null default '' comment('当前版本号') CHAR(50)"` | |||||
Md5 string `json:"md5" xorm:"not null default '' comment('MD5校验值') VARCHAR(255)"` | |||||
AddressUrl string `json:"address_url" xorm:"not null default '' comment('文件地址url') VARCHAR(255)"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` | |||||
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` | |||||
} |