|
@@ -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("!!!!") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|