Skip to content

Commit

Permalink
fix: use constant tool to get platform name from id rather than unrel…
Browse files Browse the repository at this point in the history
…ated utils
  • Loading branch information
CNCSMonster committed Sep 18, 2023
1 parent cc1c5ff commit 0bce864
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/rpc/chat/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package chat
import (
"context"
"fmt"
"math/rand"
"time"

"github.com/OpenIMSDK/chat/pkg/common/constant"
table "github.com/OpenIMSDK/chat/pkg/common/db/table/chat"
"github.com/OpenIMSDK/chat/pkg/common/mctx"
"github.com/OpenIMSDK/chat/pkg/proto/chat"
constant2 "github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/mw/specialerror"
utils2 "github.com/OpenIMSDK/tools/utils"
"gorm.io/gorm/utils"
"math/rand"
"time"
)

func (o *chatSvr) genLogID() string {
Expand Down Expand Up @@ -44,7 +45,7 @@ func (o *chatSvr) UploadLogs(ctx context.Context, req *chat.UploadLogsReq) (*cha
log := table.Log{
Version: req.Version,
SystemType: req.SystemType,
Platform: utils.ToString(req.Platform),
Platform: constant2.PlatformIDToName(int(req.Platform)),
UserID: userID,
CreateTime: time.Now(),
Url: fileURL.URL,
Expand Down

0 comments on commit 0bce864

Please sign in to comment.