first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// Package model 定义领域模型。
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// MiniProgram 是被后台纳管的微信小程序配置。
|
||||
// 一个租户/运营方可在此登记多个小程序,AppID 全局唯一。
|
||||
type MiniProgram struct {
|
||||
ID uint64 `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
Name string `gorm:"type:varchar(128);not null" json:"name"`
|
||||
Description string `gorm:"type:varchar(512)" json:"description"`
|
||||
AppID string `gorm:"column:app_id;type:varchar(64);uniqueIndex;not null" json:"app_id"`
|
||||
AppSecret string `gorm:"column:app_secret;type:varchar(128);not null" json:"-"`
|
||||
Status int8 `gorm:"type:tinyint;not null;default:1" json:"status"`
|
||||
Ext string `gorm:"type:text" json:"ext"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (MiniProgram) TableName() string { return "mini_programs" }
|
||||
|
||||
// 小程序状态。
|
||||
const (
|
||||
MiniProgramStatusDisabled int8 = 0 // 停用
|
||||
MiniProgramStatusEnabled int8 = 1 // 启用
|
||||
)
|
||||
Reference in New Issue
Block a user