aa
This commit is contained in:
@@ -52,6 +52,7 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
|||||||
"vendorTypeName": model.VendorTypeName,
|
"vendorTypeName": model.VendorTypeName,
|
||||||
"vendorName": model.VendorChineseNames,
|
"vendorName": model.VendorChineseNames,
|
||||||
"vendorImg": model.VendorImg,
|
"vendorImg": model.VendorImg,
|
||||||
|
"vendorColors": model.VendorColors,
|
||||||
"orderStatus": model.OrderStatusName,
|
"orderStatus": model.OrderStatusName,
|
||||||
"waybillStatus": model.WaybillStatusName,
|
"waybillStatus": model.WaybillStatusName,
|
||||||
"orderTypeName": model.OrderTypeName,
|
"orderTypeName": model.OrderTypeName,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package event
|
package event
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -169,12 +168,18 @@ func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName strin
|
|||||||
}
|
}
|
||||||
dao.WrapAddIDCULDEntity(messageGroup, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(messageGroup, ctx.GetUserName())
|
||||||
dao.WrapAddIDCULDEntity(messageGroupMember, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(messageGroupMember, ctx.GetUserName())
|
||||||
dao.CreateEntity(db, messageGroup)
|
err = dao.CreateEntity(db, messageGroup)
|
||||||
dao.CreateEntity(db, messageGroupMember)
|
err = dao.CreateEntity(db, messageGroupMember)
|
||||||
if data, err := json.Marshal(messageGroup); err == nil {
|
if err == nil {
|
||||||
json.Unmarshal(data, &messageGroupResult)
|
messageGroupRead := &model.MessageGroupRead{
|
||||||
messageGroupResult.Name = user.Name
|
GroupID: groupID,
|
||||||
// messageGroupResult.MessageGroupMembers = append(messageGroupResult.MessageGroupMembers, messageGroupMember)
|
UserID: userID,
|
||||||
|
}
|
||||||
|
dao.WrapAddIDCULEntity(messageGroupRead, ctx.GetUserName())
|
||||||
|
messageGroupRead2 := messageGroupRead
|
||||||
|
messageGroupRead2.UserID = userID2
|
||||||
|
dao.CreateEntity(db, messageGroupRead)
|
||||||
|
dao.CreateEntity(db, messageGroupRead2)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
userMembers, err := dao.GetUserMember(db, userID, model.MemberTypeNormal)
|
userMembers, err := dao.GetUserMember(db, userID, model.MemberTypeNormal)
|
||||||
@@ -202,8 +207,14 @@ func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName strin
|
|||||||
messageGroup.Name = user.Name + "的集团"
|
messageGroup.Name = user.Name + "的集团"
|
||||||
}
|
}
|
||||||
dao.WrapAddIDCULDEntity(messageGroup, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(messageGroup, ctx.GetUserName())
|
||||||
dao.CreateEntity(db, messageGroup)
|
if err = dao.CreateEntity(db, messageGroup); err == nil {
|
||||||
// messageGroupResult.MessageGroup = *messageGroup
|
messageGroupRead := &model.MessageGroupRead{
|
||||||
|
GroupID: groupID,
|
||||||
|
UserID: userID,
|
||||||
|
}
|
||||||
|
dao.WrapAddIDCULEntity(messageGroupRead, ctx.GetUserName())
|
||||||
|
dao.CreateEntity(db, messageGroupRead)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return messageGroupResult, err
|
return messageGroupResult, err
|
||||||
}
|
}
|
||||||
@@ -289,7 +300,14 @@ func AddMessageGroup(ctx *jxcontext.Context, groupID int, userID string) (err er
|
|||||||
Type: model.GroupMemberTypeNormal,
|
Type: model.GroupMemberTypeNormal,
|
||||||
}
|
}
|
||||||
dao.WrapAddIDCULDEntity(messageGroupMember, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(messageGroupMember, ctx.GetUserName())
|
||||||
dao.CreateEntity(db, messageGroupMember)
|
if err = dao.CreateEntity(db, messageGroupMember); err == nil {
|
||||||
|
messageGroupRead := &model.MessageGroupRead{
|
||||||
|
GroupID: groupID,
|
||||||
|
UserID: userID,
|
||||||
|
}
|
||||||
|
dao.WrapAddIDCULEntity(messageGroupRead, ctx.GetUserName())
|
||||||
|
dao.CreateEntity(db, messageGroupRead)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,13 @@ var (
|
|||||||
VendorIDJDShop: "http://image.jxc4.com/image/7c43ebbcbdbc0ef31fe028f680c0a7e3.tem.png",
|
VendorIDJDShop: "http://image.jxc4.com/image/7c43ebbcbdbc0ef31fe028f680c0a7e3.tem.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VendorColors = map[int]string{
|
||||||
|
VendorIDJD: "#3CC518",
|
||||||
|
VendorIDMTWM: "#FFB14A",
|
||||||
|
VendorIDEBAI: "#E43428",
|
||||||
|
VendorIDJDShop: "#51A7FC",
|
||||||
|
}
|
||||||
|
|
||||||
VendorInfoMap = map[int]*VendorInfo{
|
VendorInfoMap = map[int]*VendorInfo{
|
||||||
VendorIDJD: &VendorInfo{
|
VendorIDJD: &VendorInfo{
|
||||||
Name: "京东到家",
|
Name: "京东到家",
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ type ImMessageRecord struct {
|
|||||||
Seq int `json:"seq"`
|
Seq int `json:"seq"`
|
||||||
Weight int `json:"weight"`
|
Weight int `json:"weight"`
|
||||||
Height int `json:"height"`
|
Height int `json:"height"`
|
||||||
|
// UnReadFlag int `json:"unReadFlag"` //未读标志,为1则此条消息未读
|
||||||
|
|
||||||
UserInfo *GetUserResult `orm:"-" json:"userInfo"`
|
UserInfo *GetUserResult `orm:"-" json:"userInfo"`
|
||||||
}
|
}
|
||||||
@@ -110,3 +111,17 @@ func (*MessageGroupMember) TableIndex() [][]string {
|
|||||||
[]string{"MemberUserID"},
|
[]string{"MemberUserID"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MessageGroupRead struct {
|
||||||
|
ModelIDCUL
|
||||||
|
|
||||||
|
GroupID int `orm:"column(group_id)" json:"groupID"` //组ID
|
||||||
|
UserID string `orm:"size(48);column(user_id)" json:"userID"` //创建组的userID
|
||||||
|
UnReadCount int `json:"unReadCount"` //未读数
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MessageGroupRead) TableIndex() [][]string {
|
||||||
|
return [][]string{
|
||||||
|
[]string{"UserID", "GroupID"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user