Skip to content

Commit

Permalink
[refactoring] #48
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Mar 17, 2021
1 parent fb64131 commit 800da59
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pkg/api/core/controller/v0/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ func SendChatAdmin(data controller.Chat) {
client := &http.Client{}
client.Timeout = time.Second * 5

body, _ := json.Marshal(controller.Chat{Err: data.Err, CreatedAt: data.CreatedAt, UserID: data.UserID,
GroupID: data.GroupID, Admin: data.Admin, Message: data.Message})
body, _ := json.Marshal(controller.Chat{
Err: data.Err,
CreatedAt: data.CreatedAt,
UserID: data.UserID,
GroupID: data.GroupID,
Admin: data.Admin,
Message: data.Message,
})

//Header部分
header := http.Header{}
Expand Down Expand Up @@ -64,6 +70,11 @@ func ReceiveChatAdmin(c *gin.Context) {
var input controller.Chat
log.Println(c.BindJSON(&input))

support.Broadcast <- support.WebSocketResult{CreatedAt: time.Now(),
UserID: input.UserID, GroupID: input.GroupID, Admin: input.Admin, Message: input.Message}
support.Broadcast <- support.WebSocketResult{
CreatedAt: time.Now(),
UserID: input.UserID,
GroupID: input.GroupID,
Admin: input.Admin,
Message: input.Message,
}
}

0 comments on commit 800da59

Please sign in to comment.