feat: Add Swagger documentation for admin and master API endpoints

- Added Swagger documentation for the following admin endpoints:
  - Create a new master tenant
  - Create a new provider
  - Register a new model
  - List all models
  - Update a model
  - Force sync snapshot
  - Ingest logs

- Added Swagger documentation for the master endpoint:
  - Issue a child key

- Updated go.mod and go.sum to include necessary dependencies for Swagger.
This commit is contained in:
2025-12-05 15:01:35 +08:00
parent 25e5e105b3
commit 770a9fef2b
10 changed files with 2017 additions and 26 deletions

View File

@@ -23,6 +23,18 @@ type CreateMasterRequest struct {
GlobalQPS int `json:"global_qps"`
}
// CreateMaster godoc
// @Summary Create a new master tenant
// @Description Create a new master account (tenant)
// @Tags admin
// @Accept json
// @Produce json
// @Security AdminAuth
// @Param master body CreateMasterRequest true "Master Info"
// @Success 201 {object} gin.H
// @Failure 400 {object} gin.H
// @Failure 500 {object} gin.H
// @Router /admin/masters [post]
func (h *AdminHandler) CreateMaster(c *gin.Context) {
var req CreateMasterRequest
if err := c.ShouldBindJSON(&req); err != nil {