Browse Source

update

master
DengBiao 1 year ago
parent
commit
41d8365783
2 changed files with 20 additions and 3 deletions
  1. +11
    -2
      internal/logic/api/logic_ext_test.go
  2. +9
    -1
      internal/logic/app/group_app.go

+ 11
- 2
internal/logic/api/logic_ext_test.go View File

@@ -85,19 +85,28 @@ 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` = 4145").First(&msg).Error; err != nil {
if err := db.DB.Table("message_000").Where("`id` = 192914").First(&msg).Error; err != nil {
if err == gorm.ErrRecordNotFound { if err == gorm.ErrRecordNotFound {
fmt.Println(err) fmt.Println(err)
return return
} }
} }


var temp pb.RED_PACKAGE
var temp pb.Command
var temp1 pb.AddGroupMembersPush
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
}

fmt.Println(temp)
fmt.Printf("!!!!") fmt.Printf("!!!!")
} }




+ 9
- 1
internal/logic/app/group_app.go View File

@@ -38,7 +38,15 @@ func (*groupApp) GetGroup(ctx context.Context, groupId int64) (*pb.Group, error)
if err != nil { if err != nil {
return nil, err return nil, err
} }

userId, _, err := grpclib.GetCtxData(ctx)
if err != nil {
return nil, err
}
for _, member := range group.Members {
if member.UserId == userId && member.MemberType != int(pb.MemberType_GMT_ADMIN) {
group.Name = "我的推荐人群"
}
}
return group.ToProto(), nil return group.ToProto(), nil
} }




Loading…
Cancel
Save