Merge branch 'chat' into dev

This commit is contained in:
徐俊杰 2025-06-14 15:05:00 +08:00
commit 13fc02b8ba

View File

@ -373,6 +373,7 @@ func (cr ChatHandler) Upload(c *gin.Context) {
service.ErrWithCode(c, code)
return
}
fmt.Printf("chatUser is %#v\n", chatUser)
//获取文件对象
file, err := c.FormFile("file")
if err != nil {
@ -427,7 +428,7 @@ func (cr ChatHandler) Upload(c *gin.Context) {
defer tmp.Close()
fileBuffer := bytes.NewBuffer(fileContent)
var bosUrl string
bosUrl, err = upload.UploadWithBuffer(fileBuffer, fmt.Sprintf("%d/%v%v", chatUser.ID, filename, fileExt))
bosUrl, err = upload.UploadWithBuffer(fileBuffer, fmt.Sprintf("fiee/%d/%v%v", chatUser.ID, filename, fileExt))
if err != nil {
service.Error(c, err)
return