package im import ( "sportfitness/base/global" pb "sportfitness/base/repository/grpc/bsw/im/im" "testing" "git.beswell.com/gframe/application" "github.com/sirupsen/logrus" "google.golang.org/grpc" ) func init() { logrus.Info("test init") app := application.NewDefault() err := app.AddServiceGrpcClient("bsw/im") if err != nil { panic(err) } global.SysToken = "3374a2b5a483ed1263f3574666e1ab5e" } func TestSignUp(t *testing.T) { id := SignUpUserCode(&pb.SignUpRequest{ UserCode: "test123", Name: "测试123", Email: "", Phone: "", WxOpenId: "", Qq: "", Password: "123456", Question: "", Answer: "", Memo: "", }) println(id) _, err := getClient().SystemAddUser(ctx(), &pb.SystemAddUserRequest{ UserId: id, Memo: "测试", }) if err != nil { panic(err) } } func TestMD(t *testing.T) { conn, err := grpc.Dial("localhost:19090", grpc.WithInsecure()) if err != nil { panic(err) } client := pb.NewApiClient(conn) _, err = client.SignInUserCode(ctx(), &pb.SignInPasswordRequest{ Credential: "", Password: "", SysId: 0, ExpirationSec: 0, Ip: "123123", ClientInfo: "", }) _, err = client.SystemAddUser(ctx(), &pb.SystemAddUserRequest{ UserId: 167676470552965120, Memo: "测试", }) if err != nil { panic(err) } } //func TestSignInUserCodePassword(t *testing.T) { // token, userId := SignInUserCodePassword( // "test123", "123456", "192.168.0.100", "web") // // println(token, userId) //} func TestLicenseTypeMap(t *testing.T) { idList := []int64{165770159456260096} rs := LicenseTypeMap( idList) println(rs) }