feat: server thumbnail (#818)

* feat: add get_group_member_user_id api

* feat: add SendBusinessNotification api

* feat: add GetFriendIDs api

* update pkg

* feat: cos oss thumbnail

* feat: cos video snapshot

* feat: oss video snapshot

* feat: minio video snapshot

* feat: minio video snapshot

* feat: minio

* feat: minio

* feat: minio

* feat: s3 AccessURL

* feat: s3 AccessURL

* fix: Minio AccessURL

* fix: Minio AccessURL

* fix: optimize thumbnails

* fix: optimize thumbnails

* fix: cos option

* fix: cos option

* fix: cos option

* docs: config

* docs: config

* minio: preview image cache

* minio: preview image cache

* minio: preview image cache

* go mod tidy

* cicd: robot automated Change

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: withchao <withchao@users.noreply.github.com>
This commit is contained in:
withchao
2023-08-08 16:40:07 +08:00
committed by GitHub
parent bd518365ea
commit e706620f12
18 changed files with 500 additions and 225 deletions
+18 -1
View File
@@ -16,8 +16,11 @@ package third
import (
"context"
"strconv"
"time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3"
"github.com/OpenIMSDK/protocol/third"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/log"
@@ -152,7 +155,21 @@ func (t *thirdServer) CompleteMultipartUpload(ctx context.Context, req *third.Co
}
func (t *thirdServer) AccessURL(ctx context.Context, req *third.AccessURLReq) (*third.AccessURLResp, error) {
expireTime, rawURL, err := t.s3dataBase.AccessURL(ctx, req.Name, t.defaultExpire)
opt := &s3.AccessURLOption{}
if len(req.Query) > 0 {
switch req.Query["type"] {
case "":
case "image":
opt.Image = &s3.Image{}
opt.Image.Format = req.Query["format"]
opt.Image.Width, _ = strconv.Atoi(req.Query["width"])
opt.Image.Height, _ = strconv.Atoi(req.Query["height"])
log.ZDebug(ctx, "AccessURL image", "name", req.Name, "option", opt.Image)
default:
return nil, errs.ErrArgs.Wrap("invalid query type")
}
}
expireTime, rawURL, err := t.s3dataBase.AccessURL(ctx, req.Name, t.defaultExpire, opt)
if err != nil {
return nil, err
}