refactor(di): migrate from setter to constructor injection for logService
- Remove SetLogService methods from user, post, comment, and admin post services - Add logService as constructor parameter to all dependent services - Centralize call-related and message error definitions in app_errors.go - Add ConversationID field to WSEventResponse for improved message tracking - Simplify wire provider functions by removing manual setter calls
This commit is contained in:
@@ -363,13 +363,14 @@ func (h *MessageHandler) HandleSendMessage(c *gin.Context) {
|
||||
|
||||
// 构建 WSEventResponse 格式响应
|
||||
wsResponse := dto.WSEventResponse{
|
||||
ID: msg.ID,
|
||||
Time: msg.CreatedAt.UnixMilli(),
|
||||
Type: "message",
|
||||
DetailType: params.DetailType,
|
||||
Seq: strconv.FormatInt(msg.Seq, 10),
|
||||
Segments: params.Segments,
|
||||
SenderID: userID,
|
||||
ID: msg.ID,
|
||||
Time: msg.CreatedAt.UnixMilli(),
|
||||
Type: "message",
|
||||
DetailType: params.DetailType,
|
||||
ConversationID: conversationID,
|
||||
Seq: strconv.FormatInt(msg.Seq, 10),
|
||||
Segments: params.Segments,
|
||||
SenderID: userID,
|
||||
}
|
||||
|
||||
response.Success(c, wsResponse)
|
||||
|
||||
Reference in New Issue
Block a user