12345678910111213141516171819202122232425 |
- package test
- import (
- "app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
- "context"
- "github.com/tal-tech/go-zero/core/discov"
- "github.com/tal-tech/go-zero/zrpc"
- "log"
- "testing"
- "time"
- )
- func Test_ChangeReadStatus(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
- std := messageclient.NewMessage(zrpc.MustNewClient(zrpc.RpcClientConf{Etcd: discov.EtcdConf{Hosts: []string{"127.0.0.1:2379"}, Key: "message.rpc"}}))
- //std := stdlibclient.NewStdlib(zrpc.MustNewClient(zrpc.RpcClientConf{Etcd: discov.EtcdConf{Hosts: []string{"127.0.0.1:2379"}, Key: "jydocs.stdlib.rpc"}}))
- req := &messageclient.ChangeReadStatusRequest{Id: 1}
- res, err := std.ChangeReadStatus(ctx, req)
- log.Println("err ", err,res)
- //if res.State == true {
- // log.Println("req true")
- //} else {
- // log.Println("req false", res)
- //}
- }
|