api

package
v1.5.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Id       int64     `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
	UUID     string    `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
	Name     string    `gorm:"type:varchar(100);not null;column:name;comment:name"`
	Driver   string    `gorm:"size:36;not null;column:driver;comment:驱动;index:driver"`                      // 驱动
	Service  string    `gorm:"size:36;not null;column:service;comment:服务;index:service"`                    // 服务
	Team     string    `gorm:"size:36;not null;column:team;comment:团队;index:team"`                          // 团队id
	Upstream string    `gorm:"size:36;not null;column:upstream;comment:上游;index:upstream"`                  // 上游ID
	Creator  string    `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人
	CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
	IsDelete int       `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除 0:未删除 1:已删除"`
	Method   []string  `gorm:"size:255;not null;column:method;comment:请求方法;serializer:json"`
	Protocol []string  `gorm:"type:text;not null;column:protocol;comment:协议;serializer:json"`
	Path     string    `gorm:"size:255;not null;column:path;comment:请求路径"`
}

func (*API) IdValue

func (a *API) IdValue() int64

func (*API) TableName

func (a *API) TableName() string

type AiAPIInfo

type AiAPIInfo struct {
	Id               int64     `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
	Uuid             string    `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID"`
	Name             string    `gorm:"type:varchar(100);not null;column:name;comment:name"`
	Service          string    `gorm:"size:36;not null;column:service;comment:服务;index:service"`
	Path             string    `gorm:"size:255;not null;column:path;comment:请求路径"`
	Description      string    `gorm:"size:255;not null;column:description;comment:description"`
	Timeout          int       `gorm:"type:int(11);not null;column:timeout;comment:超时时间"`
	Retry            int       `gorm:"type:int(11);not null;column:retry;comment:重试次数"`
	Model            string    `gorm:"size:255;not null;column:model;comment:模型"`
	Provider         string    `gorm:"size:36;not null;column:provider;comment:提供者;index:provider"`
	Creator          string    `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"`
	CreateAt         time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
	Updater          string    `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"`
	UpdateAt         time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
	AdditionalConfig string    `gorm:"type:text;null;column:additional_config;comment:额外配置"`
	UseToken         int       `gorm:"type:int(11);not null;column:use_token;comment:使用token"`
	Type             int       `gorm:"type:tinyint(1);not null;column:type;comment:类型 0:online api 1:local api"`
	Disable          bool      `gorm:"type:tinyint(1);not null;column:disable;comment:是否禁用 0:否 1:是"`
	IsDelete         bool      `gorm:"type:tinyint(1);not null;column:is_delete;comment:是否删除 0:否 1:是"`
}

func (*AiAPIInfo) IdValue

func (a *AiAPIInfo) IdValue() int64

func (*AiAPIInfo) TableName

func (a *AiAPIInfo) TableName() string

type AiAPIUse

type AiAPIUse struct {
	Id          int64  `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
	API         string `gorm:"size:36;not null;column:api;comment:API;index:api"`
	Service     string `gorm:"size:36;not null;column:service;comment:服务;index:service"`
	Provider    string `gorm:"size:36;not null;column:provider;comment:提供者;index:provider"`
	Model       string `gorm:"size:255;not null;column:model;comment:模型"`
	Day         int64  `gorm:"type:int(11);not null;column:day;comment:当前日期"`
	Hour        int64  `gorm:"type:int(11);not null;column:hour;comment:当前小时"`
	Minute      int64  `gorm:"type:int(11);not null;column:minute;comment:当前分钟"`
	InputToken  int    `gorm:"type:int(11);not null;column:input_token;comment:输入token"`
	OutputToken int    `gorm:"type:int(11);not null;column:output_token;comment:输出token"`
	TotalToken  int    `gorm:"type:int(11);not null;column:total_token;comment:总token"`
}

func (*AiAPIUse) IdValue

func (a *AiAPIUse) IdValue() int64

func (*AiAPIUse) TableName

func (a *AiAPIUse) TableName() string

type Doc

type Doc struct {
	Id       int64     `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
	UUID     string    `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
	Service  string    `gorm:"size:36;not null;column:service;comment:服务;index:service"`
	Content  string    `gorm:"type:longtext;null;column:content;comment:文档内容"`
	Updater  string    `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"`
	UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
	APICount int64     `gorm:"type:int(11);not null;column:api_count;comment:接口数量"`
}

func (*Doc) IdValue

func (i *Doc) IdValue() int64

func (*Doc) TableName

func (i *Doc) TableName() string

type IAPIDocStore

type IAPIDocStore interface {
	store.IBaseStore[Doc]
}

type IAPIInfoStore

type IAPIInfoStore store.IBaseStore[Info]

type IAiAPIInfoStore

type IAiAPIInfoStore interface {
	store.ISearchStore[AiAPIInfo]
}

type IAiAPIUseStore

type IAiAPIUseStore interface {
	store.IStatisticsStore[AiAPIUse]
}

type IApiBaseStore

type IApiBaseStore interface {
	store.ISearchStore[API]
}

type Info

type Info struct {
	Id          int64     `gorm:"column:id;type:BIGINT(20);NOT NULL;comment:id;primary_key;comment:主键ID;"`
	UUID        string    `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"`
	Name        string    `gorm:"type:varchar(100);not null;column:name;comment:name"`
	Description string    `gorm:"size:255;not null;column:description;comment:description"`
	Service     string    `gorm:"size:36;not null;column:service;comment:服务;index:service"`
	Team        string    `gorm:"size:36;not null;column:team;comment:团队;index:team"` // 团队id
	Upstream    string    `gorm:"size:36;not null;column:upstream;comment:上游;index:upstream"`
	Method      []string  `gorm:"size:255;not null;column:method;comment:请求方法;serializer:json" `
	Path        string    `gorm:"size:255;not null;column:path;comment:请求路径"`
	Protocol    []string  `gorm:"type:text;null;column:protocol;comment:协议;serializer:json"`
	Match       string    `gorm:"type:text;null;column:match;comment:匹配规则"`
	Creator     string    `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人
	CreateAt    time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"`
	Updater     string    `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人
	UpdateAt    time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"`
	Disable     bool      `gorm:"type:tinyint(1);not null;column:disable;comment:是否禁用 0:否 1:是"`
}

func (*Info) IdValue

func (i *Info) IdValue() int64

func (*Info) TableName

func (i *Info) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL