123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- package test
- import (
- "context"
- // "flag"
- "log"
- "testing"
- "time"
- "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
- usercenterclient "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
- "github.com/zeromicro/go-zero/core/conf"
- "github.com/zeromicro/go-zero/zrpc"
- )
- type Config struct {
- zrpc.RpcServerConf
- Node int // 节点
- CalleeId string // 服务名字
- FileSystemConf zrpc.RpcClientConf
- }
- var c Config
- func init() {
- conf.MustLoad("usercenter.yaml", &c)
- }
- // go test -v -run Test_CheckEnt
- func Test_CheckEnt(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
- FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
- req := &pb.CheckEntReq{
- EntId: 1,
- }
- res, err := FileSystem.CheckEnt(ctx, req)
- log.Println("err ", err)
- log.Println("res:", res)
- }
- //
- func Test_EntAuth(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
- FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
- req := &pb.EntAuthReq{
- Name: "张鑫磊企业2",
- AuthPhone: "15538267985",
- CreditCode: "asdqweqweasd",
- RegPhone: "15538267985",
- ComPanyType: "1",
- AreaNumber: "1c00100010001",
- Business: "https://www.baidu.com",
- OfficialLetter: "https://www.jianyu360.cn",
- AuthName: "郭靖2",
- OrganizationType: "2",
- EntId: "21",
- }
- res, err := FileSystem.EntAuth(ctx, req)
- log.Println("err ", err)
- log.Println("req ", res)
- }
- // go test -v -run Test_EntExamine
- func Test_EntExamine(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
- FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
- req := &pb.ExamineReq{
- EntId: "14823",
- AuthType: "2",
- Reason: "",
- AuditUser: "少爷",
- ExamineId: "18",
- }
- res, err := FileSystem.EntExamine(ctx, req)
- log.Println("err ", err)
- log.Println("req ", res)
- }
- // go test -v -run Test_EntList
- func Test_EntList(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
- FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
- req := &pb.EntListReq{
- Name: "企业",
- AuthStatus: "1",
- PageNum: "1",
- PageSize: "10",
- // CreditCode: data.CreditCode,
- // CreateStartTime: data.CreateStartTime,
- // CreateEndTime: data.CreateEndTime,
- // ValidStartTime: data.ValidStartTime,
- // ValidEndTime: data.ValidEndTime,
- // FrozenStatus: data.FrozenStatus,
- // RegPhone: data.RegPhone,
- // AuthPhone: data.AuthPhone,
- }
- res, err := FileSystem.EntList(ctx, req)
- log.Println("err ", err)
- log.Println("res:", res)
- }
- // go test -v -run Test_ExamineList
- func Test_ExamineList(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
- FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
- req := &pb.ExamineListReq{
- Name: "中凯",
- AuthPhone: "",
- RegPhone: "",
- AuthType: "",
- AuthStartTime: "1650075550",
- AuthEndTime: "1681611550",
- PageNum: "",
- PageSize: "",
- }
- res, err := FileSystem.ExamineList(ctx, req)
- log.Println("err ", err)
- log.Println("res:", res)
- }
|