|
|
@@ -85,19 +85,28 @@ func TestLogicExtServer_SendMessage(t *testing.T) { |
|
|
|
func TestLogicExtServer_protoUnmarshal(t *testing.T) { |
|
|
|
db.InitMysql(config.MySQL) |
|
|
|
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 { |
|
|
|
fmt.Println(err) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var temp pb.RED_PACKAGE |
|
|
|
var temp pb.Command |
|
|
|
var temp1 pb.AddGroupMembersPush |
|
|
|
err := proto.Unmarshal(msg.Content, &temp) |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
err = proto.Unmarshal(temp.Data, &temp1) |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
fmt.Println(temp) |
|
|
|
fmt.Printf("!!!!") |
|
|
|
} |
|
|
|
|
|
|
|