feat: 添加租户列表接口,优化租户相关功能;更新前端租户列表和收藏功能

This commit is contained in:
2026-01-07 16:10:03 +08:00
parent 1298192157
commit 5b45f7d5c4
10 changed files with 252 additions and 77 deletions

View File

@@ -17,19 +17,18 @@ type Storage struct {
// Upload file
//
// @Router /v1/storage/:key [put]
// @Router /v1/storage/* [put]
// @Summary Upload file
// @Tags Storage
// @Accept octet-stream
// @Produce json
// @Param key path string true "Object Key"
// @Param expires query string true "Expiry"
// @Param sign query string true "Signature"
// @Success 200 {string} string "success"
// @Bind key path key(key)
// @Bind expires query
// @Bind sign query
func (s *Storage) Upload(ctx fiber.Ctx, key, expires, sign string) (string, error) {
func (s *Storage) Upload(ctx fiber.Ctx, expires, sign string) (string, error) {
key := ctx.Params("*")
if err := s.storage.Verify("PUT", key, expires, sign); err != nil {
return "", fiber.NewError(fiber.StatusForbidden, err.Error())
}
@@ -59,19 +58,18 @@ func (s *Storage) Upload(ctx fiber.Ctx, key, expires, sign string) (string, erro
// Download file
//
// @Router /v1/storage/:key [get]
// @Router /v1/storage/* [get]
// @Summary Download file
// @Tags Storage
// @Accept json
// @Produce octet-stream
// @Param key path string true "Object Key"
// @Param expires query string true "Expiry"
// @Param sign query string true "Signature"
// @Success 200 {file} file
// @Bind key path key(key)
// @Bind expires query
// @Bind sign query
func (s *Storage) Download(ctx fiber.Ctx, key, expires, sign string) error {
func (s *Storage) Download(ctx fiber.Ctx, expires, sign string) error {
key := ctx.Params("*")
if err := s.storage.Verify("GET", key, expires, sign); err != nil {
return fiber.NewError(fiber.StatusForbidden, err.Error())
}