Compare commits

..

2 Commits

Author SHA1 Message Date
junleea c772060fd2 Merge branch 'refs/heads/feature-im-gitea' 2024-08-07 18:09:44 +08:00
junleea c63d290273 修改获取消息 2024-08-07 18:09:36 +08:00
2 changed files with 9 additions and 8 deletions

View File

@ -179,7 +179,7 @@ func FindFriend(from_user_id, to_user_id int) []Friend {
type FriendRet struct { type FriendRet struct {
ID int `json:"id"` //用户id ID int `json:"id"` //用户id
Username string `json:"username"` //用户名 Name string `json:"name"` //用户名
Email string `json:"email"` //邮箱 Email string `json:"email"` //邮箱
} }

View File

@ -25,11 +25,11 @@ type SMessage struct {
} }
type Message struct { type Message struct {
ID int `json:"id"` ID int `json:"id" form:"id" `
To_user_id int `json:"to_user_id"` To_user_id int `json:"to_user_id" form:"to_user_id" `
From_user_id int `json:"from_user_id"` From_user_id int `json:"from_user_id" form:"from_user_id" `
Index int `json:"index"` Index int `json:"index" form:"index" `
Type int `json:"type"` Type int `json:"type" form:"type" `
} }
type CGroup struct { type CGroup struct {
@ -86,6 +86,7 @@ func GetMessage(c *gin.Context) {
var req Message var req Message
user_id, _ := c.Get("id") user_id, _ := c.Get("id")
id := int(user_id.(float64)) id := int(user_id.(float64))
//解析参数
if err := c.ShouldBind(&req); err == nil { if err := c.ShouldBind(&req); err == nil {
fmt.Println(req) fmt.Println(req)
msgs, err2 := service.GetMsgUserByIndexService(id, req.To_user_id, req.Index, req.Type, req.From_user_id) msgs, err2 := service.GetMsgUserByIndexService(id, req.To_user_id, req.Index, req.Type, req.From_user_id)