feat: 添加租户列表接口,优化租户相关功能;更新前端租户列表和收藏功能
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user