team api
This commit is contained in:
@@ -1,26 +1,22 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lib/pq"
|
||||
)
|
||||
import "github.com/lib/pq" //pq.StringArray
|
||||
|
||||
type ApiKey_PG struct {
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement"`
|
||||
Name string `gorm:"column:name;not null;unique;index:idx_apikey_name"`
|
||||
ApiType string `gorm:"column:apitype;not null;unique;index:idx_apikey_apitype"`
|
||||
ApiKey string `gorm:"column:apikey;not null;unique;index:idx_apikey_apikey"`
|
||||
Status int `gorm:"type:int;default:0"` // enabled 0, disabled 1
|
||||
Endpoint string `gorm:"column:endpoint"`
|
||||
ResourceNmae string `gorm:"column:resource_name"`
|
||||
DeploymentName string `gorm:"column:deployment_name"`
|
||||
ApiKey string `gorm:"column:apikey;not null;unique;uniqueIndex:idx_apikey"`
|
||||
Status int `gorm:"type:int;default:1"` // enabled 1, disabled 0
|
||||
Endpoint string `gorm:"column:endpoint;comment:接入点"`
|
||||
ResourceNmae string `gorm:"column:resource_name;comment:azure资源名称"`
|
||||
DeploymentName string `gorm:"column:deployment_name;comment:azure部署名称"`
|
||||
ApiSecret string `gorm:"column:api_secret"`
|
||||
ModelPrefix string `gorm:"column:model_prefix"`
|
||||
ModelAlias string `gorm:"column:model_alias"`
|
||||
SupportModels pq.StringArray `gorm:"type:text[]"`
|
||||
UpdatedAt time.Time `json:"updatedAt,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt,omitempty"`
|
||||
ModelPrefix string `gorm:"column:model_prefix;comment:模型前缀"`
|
||||
ModelAlias string `gorm:"column:model_alias;comment:模型别名"`
|
||||
SupportModels pq.StringArray `gorm:"column:support_models;type:text[]"`
|
||||
CreatedAt int64 `gorm:"column:created_at;autoUpdateTime" json:"created_at,omitempty"`
|
||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime" json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
func (ApiKey_PG) TableName() string {
|
||||
@@ -28,20 +24,20 @@ func (ApiKey_PG) TableName() string {
|
||||
}
|
||||
|
||||
type ApiKey struct {
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement"`
|
||||
Name string `gorm:"column:name;not null;unique;index:idx_apikey_name"`
|
||||
ApiType string `gorm:"column:apitype;not null;unique;index:idx_apikey_apitype"`
|
||||
ApiKey string `gorm:"column:apikey;not null;unique;index:idx_apikey_apikey"`
|
||||
Status int `json:"status" gorm:"type:int;default:0"` // enabled 0, disabled 1
|
||||
Endpoint string `gorm:"column:endpoint"`
|
||||
ResourceNmae string `gorm:"column:resource_name"`
|
||||
DeploymentName string `gorm:"column:deployment_name"`
|
||||
ApiSecret string `gorm:"column:api_secret"`
|
||||
ModelPrefix string `gorm:"column:model_prefix"`
|
||||
ModelAlias string `gorm:"column:model_alias"`
|
||||
SupportModels []string `gorm:"type:json"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty" gorm:"autoUpdateTime"`
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"autoCreateTime"`
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement"`
|
||||
Name string `gorm:"column:name;not null;unique;index:idx_apikey_name"`
|
||||
ApiType string `gorm:"column:apitype;not null;unique;index:idx_apikey_apitype"`
|
||||
ApiKey string `gorm:"column:apikey;not null;unique;index:idx_apikey_apikey"`
|
||||
Status int `gorm:"type:int;default:1"` // enabled 1, disabled 0
|
||||
Endpoint string `gorm:"column:endpoint"`
|
||||
ResourceNmae string `gorm:"column:resource_name"`
|
||||
DeploymentName string `gorm:"column:deployment_name"`
|
||||
ApiSecret string `gorm:"column:api_secret"`
|
||||
ModelPrefix string `gorm:"column:model_prefix"`
|
||||
ModelAlias string `gorm:"column:model_alias"`
|
||||
SupportModels []string `gorm:"column:support_models;type:json"`
|
||||
CreatedAt int64 `gorm:"column:created_at;autoUpdateTime" json:"created_at,omitempty"`
|
||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime" json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
func (ApiKey) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user