From 77c1b63622265ef740aa8b5c1fa00b06c2548077 Mon Sep 17 00:00:00 2001 From: Pasha Date: Mon, 19 May 2025 14:18:41 +0300 Subject: [PATCH] update gen file url for minio --- repository/answer/dal_minio.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/repository/answer/dal_minio.go b/repository/answer/dal_minio.go index b54cb47..e6cde83 100644 --- a/repository/answer/dal_minio.go +++ b/repository/answer/dal_minio.go @@ -4,12 +4,10 @@ import ( "context" "fmt" "github.com/minio/minio-go/v7" - "net/url" - "time" ) const ( - bucket = "3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b" + bucket = "3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b" bucketAnswers = "squizanswer" ) @@ -26,12 +24,7 @@ func NewAnswerMinio(ctx context.Context, minioClient *minio.Client) (*StorerAnsw func (s *StorerAnswer) GetAnswerURL(ctx context.Context, quizID string, questionID int64, filename string) (string, error) { objectName := fmt.Sprintf("%s/%d/%s", quizID, questionID, filename) - reqParams := make(url.Values) - reqParams.Set("response-content-disposition", "attachment") - url, err := s.client.PresignedGetObject(ctx, bucket, bucketAnswers + "/" + objectName, time.Hour*1, reqParams) - if err != nil { - return "", err - } + url := fmt.Sprintf("https://%s/%s/%s", s.client.EndpointURL().Host, bucket, bucketAnswers+"/"+objectName) - return url.String(), nil + return url, nil }