Skip to content

Commit

Permalink
[fix] #55 (名前表示機能の追加)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Mar 17, 2021
1 parent 34fc00d commit 1f8e8aa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/api/core/support/ticket/v0/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,18 @@ func GetWebSocket(c *gin.Context) {
controller.SendChatUser(controllerInterface.Chat{CreatedAt: msg.CreatedAt,
UserID: result.User.ID, GroupID: resultGroup.Group.ID, Admin: msg.Admin, Message: msg.Message})

userName := "不明"

for _, tmp := range resultGroup.Group.Users {
if tmp.GroupID == result.User.ID {
userName = tmp.Name
}
}

//Slackに送信
attachment := slack.Attachment{}
attachment.AddField(slack.Field{Title: "Title", Value: "Support(新規メッセージ)"}).
AddField(slack.Field{Title: "発行者", Value: strconv.Itoa(int(result.User.ID))}).
AddField(slack.Field{Title: "発行者", Value: strconv.Itoa(int(result.User.ID)) + "-" + userName}).
AddField(slack.Field{Title: "Group", Value: strconv.Itoa(int(result.Group.ID)) + "-" + result.Group.Org}).
AddField(slack.Field{Title: "Title", Value: ticketResult.Ticket[0].Title}).
AddField(slack.Field{Title: "Message", Value: msg.Message})
Expand Down

0 comments on commit 1f8e8aa

Please sign in to comment.