新增代理服务的离线接口,优化认证逻辑,代理服务表添加状态字段
This commit is contained in:
@@ -36,6 +36,7 @@ func newProxy(db *gorm.DB, opts ...gen.DOOption) proxy {
|
||||
_proxy.CreatedAt = field.NewField(tableName, "created_at")
|
||||
_proxy.UpdatedAt = field.NewField(tableName, "updated_at")
|
||||
_proxy.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
_proxy.Status = field.NewInt32(tableName, "status")
|
||||
_proxy.Edges = proxyHasManyEdges{
|
||||
db: db.Session(&gorm.Session{}),
|
||||
|
||||
@@ -60,6 +61,7 @@ type proxy struct {
|
||||
CreatedAt field.Field // 创建时间
|
||||
UpdatedAt field.Field // 更新时间
|
||||
DeletedAt field.Field // 删除时间
|
||||
Status field.Int32 // 代理服务状态:0-离线,1-在线
|
||||
Edges proxyHasManyEdges
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
@@ -86,6 +88,7 @@ func (p *proxy) updateTableName(table string) *proxy {
|
||||
p.CreatedAt = field.NewField(table, "created_at")
|
||||
p.UpdatedAt = field.NewField(table, "updated_at")
|
||||
p.DeletedAt = field.NewField(table, "deleted_at")
|
||||
p.Status = field.NewInt32(table, "status")
|
||||
|
||||
p.fillFieldMap()
|
||||
|
||||
@@ -102,7 +105,7 @@ func (p *proxy) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
}
|
||||
|
||||
func (p *proxy) fillFieldMap() {
|
||||
p.fieldMap = make(map[string]field.Expr, 10)
|
||||
p.fieldMap = make(map[string]field.Expr, 11)
|
||||
p.fieldMap["id"] = p.ID
|
||||
p.fieldMap["version"] = p.Version
|
||||
p.fieldMap["name"] = p.Name
|
||||
@@ -112,6 +115,7 @@ func (p *proxy) fillFieldMap() {
|
||||
p.fieldMap["created_at"] = p.CreatedAt
|
||||
p.fieldMap["updated_at"] = p.UpdatedAt
|
||||
p.fieldMap["deleted_at"] = p.DeletedAt
|
||||
p.fieldMap["status"] = p.Status
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user