修复通道提取接口权限与数据映射问题
This commit is contained in:
@@ -37,6 +37,7 @@ func newProxy(db *gorm.DB, opts ...gen.DOOption) proxy {
|
||||
_proxy.Secret = field.NewString(tableName, "secret")
|
||||
_proxy.Type = field.NewInt(tableName, "type")
|
||||
_proxy.Status = field.NewInt(tableName, "status")
|
||||
_proxy.Meta = field.NewField(tableName, "meta")
|
||||
_proxy.Channels = proxyHasManyChannels{
|
||||
db: db.Session(&gorm.Session{}),
|
||||
|
||||
@@ -122,6 +123,7 @@ type proxy struct {
|
||||
Secret field.String
|
||||
Type field.Int
|
||||
Status field.Int
|
||||
Meta field.Field
|
||||
Channels proxyHasManyChannels
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
@@ -149,6 +151,7 @@ func (p *proxy) updateTableName(table string) *proxy {
|
||||
p.Secret = field.NewString(table, "secret")
|
||||
p.Type = field.NewInt(table, "type")
|
||||
p.Status = field.NewInt(table, "status")
|
||||
p.Meta = field.NewField(table, "meta")
|
||||
|
||||
p.fillFieldMap()
|
||||
|
||||
@@ -165,7 +168,7 @@ func (p *proxy) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
}
|
||||
|
||||
func (p *proxy) fillFieldMap() {
|
||||
p.fieldMap = make(map[string]field.Expr, 11)
|
||||
p.fieldMap = make(map[string]field.Expr, 12)
|
||||
p.fieldMap["id"] = p.ID
|
||||
p.fieldMap["created_at"] = p.CreatedAt
|
||||
p.fieldMap["updated_at"] = p.UpdatedAt
|
||||
@@ -176,6 +179,7 @@ func (p *proxy) fillFieldMap() {
|
||||
p.fieldMap["secret"] = p.Secret
|
||||
p.fieldMap["type"] = p.Type
|
||||
p.fieldMap["status"] = p.Status
|
||||
p.fieldMap["meta"] = p.Meta
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user