Documentation ¶
Index ¶
- Constants
- Variables
- func AssociationRelationship(db *gorm.DB, conditions *gorm.DB, mdl interface{}, relationship string, ...) *gorm.Association
- func ClearAssociation(db *gorm.DB, object Model, foreignKey string, pivot Model) error
- func GetFirst(db *gorm.DB, conditions *gorm.DB, model interface{}, preloads []string) (err error)
- func GetList(db *gorm.DB, conditions *gorm.DB, models interface{}, preloads []string, ...) (paginator *database.Pagination, err error)
- func GetModelFields(model interface{}) (fields []string)
- func Paginate(page int, pageSize int) func(db *gorm.DB) *gorm.DB
- func WhereUUID(uuid string) func(db *gorm.DB) *gorm.DB
- type App
- type Merchant
- type MerchantToAppConfig
- type Model
- type MyModel
- type MyRelationship
- type Platform
- type User
Constants ¶
View Source
const APPROVAL_STATUS_APPROVED int8 = 3
View Source
const APPROVAL_STATUS_DRAFT int8 = 0
View Source
const APPROVAL_STATUS_PENDING int8 = 1
View Source
const APPROVAL_STATUS_REJECTED int8 = 4
View Source
const MODEL_STATUS_ACTIVE int8 = 1
View Source
const MODEL_STATUS_CANCELED int8 = 2
View Source
const MODEL_STATUS_DRAFT int8 = 0
View Source
const MODEL_STATUS_INACTIVE int8 = 4
View Source
const MODEL_STATUS_PENDING int8 = 3
View Source
const PLATFORM_ALIPAY = "AliPay"
View Source
const PLATFORM_WECHAT = "WeChat"
View Source
const TABLE_NAME_Merchant_To_App_Config = "merchant_to_app_config"
View Source
const UNIQUE_ID = "uuid"
Variables ¶
View Source
var ArrayModelFields *object.HashMap = &object.HashMap{}
Functions ¶
func AssociationRelationship ¶
func AssociationRelationship(db *gorm.DB, conditions *gorm.DB, mdl interface{}, relationship string, withClauseAssociations bool) *gorm.Association
*
- Association Relationship
func ClearAssociation ¶
func GetModelFields ¶
func GetModelFields(model interface{}) (fields []string)
Types ¶
type Merchant ¶
type Merchant struct { Model Name string `gorm:"column:name" json:"name"` MchID string `gorm:"column:mch_id" json:"mchID"` Secret string `gorm:"column:secret" json:"secret"` SecretV3 string `gorm:"column:secret_v3" json:"secretV3"` CertPath string `gorm:"column:cert_path" json:"certPath"` KeyPath string `gorm:"column:key_path" json:"keyPath"` SerialNo string `gorm:"column:serial_no" json:"serialNO"` }
type MerchantToAppConfig ¶
type MerchantToAppConfig struct { *MyRelationship Merchant *Merchant `gorm:"foreignKey:AwardableObjectUUID;references:UUID"` App *App `gorm:"foreignKey:AwardableObjectUUID;references:UUID"` //common fields Status int8 `gorm:"column:status" json:"status"` ConfigType int8 `gorm:"column:config_type" json:"ConfigType"` MerchantUUID object.NullString `gorm:"column:merchant_uuid;not null;index:index_merchant_uuid" json:"merchantUUID"` AppUUID object.NullString `gorm:"column:app_uuid;not null;index:index_app_uuid" json:"appUUID"` }
merchant_to_app_config 数据表结构
type MyModel ¶
type MyModel struct { ID int `gorm:"autoIncrement:true;unique; column:id; ->;<-:create" json:"-"` UUID string `gorm:"primaryKey;autoIncrement:false;unique; column:uuid; ->;<-:create " json:"uuid" sql:"index"` CreatedAt time.Time `gorm:"column:created_at; ->;<-:create " json:"createdAt"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"` }
func NewMyModel ¶
func NewMyModel() *MyModel
func (*MyModel) GetForeignKey ¶
func (*MyModel) GetPrimaryKey ¶
type MyRelationship ¶
type MyRelationship struct { ID int `gorm:"autoIncrement:true;unique; column:id; ->;<-:create" json:"-"` CreatedAt time.Time `gorm:"column:created_at; ->;<-:create " json:"createdAt"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"` }
func NewMyRelationship ¶
func NewMyRelationship() *MyRelationship
func (*MyRelationship) GetForeignKey ¶
func (mdl *MyRelationship) GetForeignKey() string
func (*MyRelationship) GetID ¶
func (mdl *MyRelationship) GetID() interface{}
func (*MyRelationship) GetPrimaryKey ¶
func (mdl *MyRelationship) GetPrimaryKey() string
type User ¶
type User struct { Id int `gorm:"json:id column:id"` Password string `gorm:"column:password json:password"` Locale string `gorm:"column:locale json:locale"` UUID string `gorm:"column:uuid" json:"uuid" primaryKey;autoIncrement:"false" sql:"index"` }
Click to show internal directories.
Click to hide internal directories.