refactor: reorganize modules and add Linux build tooling
This commit is contained in:
109
module/ec/delivery/test/rpc/team_test.go
Normal file
109
module/ec/delivery/test/rpc/team_test.go
Normal file
@@ -0,0 +1,109 @@
|
||||
//go:build integration
|
||||
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
pb "bsm/full/module/ec/delivery/external/pb/delivery"
|
||||
)
|
||||
|
||||
func TestTeamAdd(t *testing.T) {
|
||||
conn, ctx := GetCoon()
|
||||
client := pb.NewTeamClient(conn)
|
||||
|
||||
defer conn.Close()
|
||||
data := pb.TeamItem{
|
||||
Title: "XX专送团队",
|
||||
Owner: "B9355263-4983-5BAA-631A-046B453480C8",
|
||||
Contacts: "老王",
|
||||
Phone: "13402984328",
|
||||
Logo: "http://www.baidu.com/sad.jpg",
|
||||
}
|
||||
re, _ := json.Marshal(&data)
|
||||
fmt.Printf("发送的测试消息: %s\n", re)
|
||||
res, err := client.TeamAdd(ctx, &data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s, err := json.Marshal(res)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("返回的测试消息: %s", s)
|
||||
}
|
||||
func TestTeamSet(t *testing.T) {
|
||||
conn, ctx := GetCoon()
|
||||
client := pb.NewTeamClient(conn)
|
||||
|
||||
defer conn.Close()
|
||||
data := pb.TeamItem{
|
||||
Title: "XX专送团队",
|
||||
Owner: "B9355263-4983-5BAA-631A-046B453480C8",
|
||||
Contacts: "老李",
|
||||
Phone: "13402984328",
|
||||
Logo: "http://www.baidu.com/sad.jpg",
|
||||
Identity: "f3b9bf81-c721-4d1e-9261-2b96d0fe0cc5",
|
||||
Status: 1,
|
||||
}
|
||||
re, _ := json.Marshal(&data)
|
||||
fmt.Printf("发送的测试消息: %s\n", re)
|
||||
res, err := client.TeamSet(ctx, &data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s, err := json.Marshal(res)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("返回的测试消息: %s", s)
|
||||
}
|
||||
func TestTeamGet(t *testing.T) {
|
||||
conn, ctx := GetCoon()
|
||||
client := pb.NewTeamClient(conn)
|
||||
|
||||
defer conn.Close()
|
||||
data := pb.IdentRequest{
|
||||
Identity: "f3b9bf81-c721-4d1e-9261-2b96d0fe0cc5",
|
||||
}
|
||||
re, _ := json.Marshal(&data)
|
||||
fmt.Printf("发送的测试消息: %s\n", re)
|
||||
res, err := client.TeamGet(ctx, &data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s, err := json.Marshal(res)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("返回的测试消息: %s", s)
|
||||
}
|
||||
func TestTeamList(t *testing.T) {
|
||||
conn, ctx := GetCoon()
|
||||
client := pb.NewTeamClient(conn)
|
||||
|
||||
defer conn.Close()
|
||||
data := pb.FetchRequest{
|
||||
PageNo: 1,
|
||||
PageSize: 10,
|
||||
Params: map[string]string{
|
||||
"identity": "",
|
||||
"title": "",
|
||||
"owner": "",
|
||||
"status": "",
|
||||
},
|
||||
}
|
||||
re, _ := json.Marshal(&data)
|
||||
fmt.Printf("发送的测试消息: %s\n", re)
|
||||
res, err := client.TeamList(ctx, &data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s, err := json.Marshal(res)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("返回的测试消息: %s", s)
|
||||
}
|
||||
Reference in New Issue
Block a user