v1

package
v0.0.0-...-8ec472f Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelHandler

type ModelHandler struct {
	// contains filtered or unexported fields
}

func NewModelHandler

func NewModelHandler(
	w *web.Web,
	usecase domain.ModelUsecase,
	auth *middleware.AuthMiddleware,
	active *middleware.ActiveMiddleware,
	readonly *middleware.ReadOnlyMiddleware,
	logger *slog.Logger,
) *ModelHandler

func (*ModelHandler) Check

func (h *ModelHandler) Check(c *web.Context, req domain.CheckModelReq) error

Check 检查模型

@Tags			Model
@Summary		检查模型
@Description	检查模型
@ID				check-model
@Accept			json
@Produce		json
@Param			model	body		domain.CheckModelReq	true	"模型"
@Success		200		{object}	web.Resp{data=domain.CheckModelResp}
@Router			/api/v1/model/check [post]

func (*ModelHandler) Create

func (h *ModelHandler) Create(c *web.Context, req domain.CreateModelReq) error

Create 创建模型

@Tags			Model
@Summary		创建模型
@Description	创建模型
@ID				create-model
@Accept			json
@Produce		json
@Param			model	body		domain.CreateModelReq	true	"模型"
@Success		200		{object}	web.Resp{data=domain.Model}
@Router			/api/v1/model [post]

func (*ModelHandler) Delete

func (h *ModelHandler) Delete(c *web.Context) error

Delete 删除模型

@Tags			Model
@Summary		删除模型
@Description	删除模型
@ID				delete-model
@Accept			json
@Produce		json
@Param			id	query		string	true	"模型ID"
@Success		200	{object}	web.Resp{}
@Router			/api/v1/model [delete]

func (*ModelHandler) GetProviderModelList

func (h *ModelHandler) GetProviderModelList(c *web.Context, req domain.GetProviderModelListReq) error

GetProviderModelList 获取供应商支持的模型列表

@Tags			Model
@Summary		获取供应商支持的模型列表
@Description	获取供应商支持的模型列表
@ID				get-provider-model-list
@Accept			json
@Produce		json
@Param			param	query		domain.GetProviderModelListReq	true	"模型类型"
@Success		200		{object}	web.Resp{data=domain.GetProviderModelListResp}
@Router			/api/v1/model/provider/supported [get]

func (*ModelHandler) GetTokenUsage

func (h *ModelHandler) GetTokenUsage(c *web.Context, req domain.GetTokenUsageReq) error

GetTokenUsage 获取模型token使用情况

@Tags			Model
@Summary		获取模型token使用情况
@Description	获取模型token使用情况
@ID				get-token-usage
@Accept			json
@Produce		json
@Param			param	query		domain.GetTokenUsageReq	true	"模型类型"
@Success		200		{object}	web.Resp{data=domain.ModelTokenUsageResp}
@Router			/api/v1/model/token-usage [get]

func (*ModelHandler) InitModel

func (h *ModelHandler) InitModel() error

func (*ModelHandler) List

func (h *ModelHandler) List(c *web.Context) error

List 获取模型列表

@Tags			Model
@Summary		获取模型列表
@Description	获取模型列表
@ID				list-model
@Accept			json
@Produce		json
@Success		200	{object}	web.Resp{data=domain.AllModelResp}
@Router			/api/v1/model [get]

func (*ModelHandler) MyModelList

func (h *ModelHandler) MyModelList(c *web.Context, req domain.MyModelListReq) error

MyModelList 获取我的模型列表

@Tags			Model
@Summary		获取我的模型列表
@Description	获取我的模型列表
@ID				my-model-list
@Accept			json
@Produce		json
@Param			model_type	query		domain.MyModelListReq	true	"模型类型"
@Success		200			{object}	web.Resp{data=[]domain.Model}
@Router			/api/v1/model/my [get]

func (*ModelHandler) Update

func (h *ModelHandler) Update(c *web.Context, req domain.UpdateModelReq) error

Update 更新模型

@Tags			Model
@Summary		更新模型
@Description	更新模型
@ID				update-model
@Accept			json
@Produce		json
@Param			model	body		domain.UpdateModelReq	true	"模型"
@Success		200		{object}	web.Resp{data=domain.Model}
@Router			/api/v1/model [put]

Jump to

Keyboard shortcuts

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