@@ -85,26 +85,26 @@ func TestLogicExtServer_SendMessage(t *testing.T) { | |||||
func TestLogicExtServer_protoUnmarshal(t *testing.T) { | func TestLogicExtServer_protoUnmarshal(t *testing.T) { | ||||
db.InitMysql(config.MySQL) | db.InitMysql(config.MySQL) | ||||
var msg model.Message | var msg model.Message | ||||
if err := db.DB.Table("message_000").Where("`id` = 10912").First(&msg).Error; err != nil { | |||||
if err := db.DB.Table("message_000").Where("`id` = 11414").First(&msg).Error; err != nil { | |||||
if err == gorm.ErrRecordNotFound { | if err == gorm.ErrRecordNotFound { | ||||
fmt.Println(err) | fmt.Println(err) | ||||
return | return | ||||
} | } | ||||
} | } | ||||
var temp pb.Command | |||||
var temp1 pb.UpdateGroupPush | |||||
var temp pb.RED_PACKAGE | |||||
//var temp1 pb.RED_PACKAGE | |||||
err := proto.Unmarshal(msg.Content, &temp) | err := proto.Unmarshal(msg.Content, &temp) | ||||
if err != nil { | if err != nil { | ||||
fmt.Println(err) | fmt.Println(err) | ||||
return | return | ||||
} | } | ||||
err = proto.Unmarshal(temp.Data, &temp1) | |||||
if err != nil { | |||||
fmt.Println(err) | |||||
return | |||||
} | |||||
//err = proto.Unmarshal(temp.Data, &temp1) | |||||
//if err != nil { | |||||
// fmt.Println(err) | |||||
// return | |||||
//} | |||||
fmt.Println(temp) | fmt.Println(temp) | ||||
fmt.Printf("!!!!") | fmt.Printf("!!!!") | ||||
@@ -117,7 +117,7 @@ func (*groupApp) AddMembers(ctx context.Context, userId, groupId int64, userIds | |||||
return nil, err | return nil, err | ||||
} | } | ||||
err = group.PushAddMember(ctx, userId, addedIds, true) | |||||
err = group.PushAddMember(ctx, userId, addedIds, false) | |||||
if err != nil { | if err != nil { | ||||
return nil, err | return nil, err | ||||
} | } | ||||
@@ -258,10 +258,11 @@ func (g *Group) RecallSendMessage(ctx context.Context, sender *pb.Sender, req *p | |||||
// SendRedPackage 发送红包消息发送至群组 | // SendRedPackage 发送红包消息发送至群组 | ||||
func (g *Group) SendRedPackage(ctx context.Context, sender *pb.Sender, req *pb.SendRedPacketReq) (int64, error) { | func (g *Group) SendRedPackage(ctx context.Context, sender *pb.Sender, req *pb.SendRedPacketReq) (int64, error) { | ||||
if sender.SenderType == pb.SenderType_ST_USER && !g.IsMember(sender.SenderId) { | |||||
logger.Sugar.Error(ctx, sender.SenderId, req.ReceiverId, "不在群组内") | |||||
return 0, gerrors.ErrNotInGroup | |||||
} | |||||
//TODO::发送红包,暂不过滤群组用户 | |||||
//if sender.SenderType == pb.SenderType_ST_USER && !g.IsMember(sender.SenderId) { | |||||
// logger.Sugar.Error(ctx, sender.SenderId, req.ReceiverId, "不在群组内") | |||||
// return 0, gerrors.ErrNotInGroup | |||||
//} | |||||
// 如果发送者是用户,将消息发送给发送者,获取用户seq | // 如果发送者是用户,将消息发送给发送者,获取用户seq | ||||
var userSeq int64 | var userSeq int64 | ||||