|
@@ -0,0 +1,83 @@
|
|
|
|
+package test
|
|
|
|
+
|
|
|
|
+import (
|
|
|
|
+ "context"
|
|
|
|
+ "github.com/zeromicro/go-zero/zrpc"
|
|
|
|
+ "log"
|
|
|
|
+ "testing"
|
|
|
|
+ "time"
|
|
|
|
+ "userCenter/rpc/pb"
|
|
|
|
+ usercenterclient "userCenter/rpc/usercenter"
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+var (
|
|
|
|
+ ctx, _ = context.WithTimeout(context.Background(), 2*time.Second)
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+// 菜单模式选择
|
|
|
|
+// go test -v -run Test_MenuMode
|
|
|
|
+func Test_MenuMode(t *testing.T) {
|
|
|
|
+ FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
|
|
|
|
+ req := &pb.WorkDesktopComprehensiveReq{
|
|
|
|
+ UserId: "61e7820581197c2e50af18df",
|
|
|
|
+ AppId: "10000",
|
|
|
|
+ Platform: "PC",
|
|
|
|
+ Phone: "",
|
|
|
|
+ ActionMode: "menuMode",
|
|
|
|
+ MenuMode: "all",
|
|
|
|
+ MenuIds: "",
|
|
|
|
+ }
|
|
|
|
+ res, err := FileSystem.WorkDesktopComprehensive(ctx, req)
|
|
|
|
+ log.Println("err ", err)
|
|
|
|
+ log.Println("res:", res)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 常用功能更新
|
|
|
|
+// go test -v -run Test_CommonlyRenew
|
|
|
|
+func Test_CommonlyRenew(t *testing.T) {
|
|
|
|
+ FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
|
|
|
|
+ req := &pb.WorkDesktopComprehensiveReq{
|
|
|
|
+ UserId: "61e7820581197c2e50af18df",
|
|
|
|
+ AppId: "10000",
|
|
|
|
+ Platform: "PC",
|
|
|
|
+ Phone: "",
|
|
|
|
+ ActionMode: "commonlyRenew",
|
|
|
|
+ MenuMode: "",
|
|
|
|
+ MenuIds: "Q1o=,TF4=,TFw=,TFg=,Q1g=,RV9F,RV9J,RV5B,RV5H,RV5J",
|
|
|
|
+ }
|
|
|
|
+ res, err := FileSystem.WorkDesktopComprehensive(ctx, req)
|
|
|
|
+ log.Println("err ", err)
|
|
|
|
+ log.Println("res:", res)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 常用功能列表
|
|
|
|
+// go test -v -run Test_CommonlyList
|
|
|
|
+func Test_CommonlyList(t *testing.T) {
|
|
|
|
+ FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
|
|
|
|
+ req := &pb.WorkDesktopComprehensiveReq{
|
|
|
|
+ UserId: "61e7820581197c2e50af18df",
|
|
|
|
+ AppId: "10000",
|
|
|
|
+ Platform: "PC",
|
|
|
|
+ Phone: "",
|
|
|
|
+ ActionMode: "commonlyList",
|
|
|
|
+ MenuMode: "",
|
|
|
|
+ MenuIds: "",
|
|
|
|
+ }
|
|
|
|
+ res, err := FileSystem.WorkDesktopComprehensive(ctx, req)
|
|
|
|
+ log.Println("err ", err)
|
|
|
|
+ log.Println("res:", res)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//工作桌面菜单树
|
|
|
|
+//go test -run=Test_WorkDesktopMenuTree
|
|
|
|
+func Test_WorkDesktopMenuTree(t *testing.T) {
|
|
|
|
+ FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
|
|
|
|
+ req := &pb.WorkDesktopMenuInfoReq{
|
|
|
|
+ UserId: "61e7820581197c2e50af18df",
|
|
|
|
+ AppId: "10000",
|
|
|
|
+ Platform: "PC",
|
|
|
|
+ Phone: "",
|
|
|
|
+ }
|
|
|
|
+ res, err := FileSystem.WorkDesktopMenuInfo(ctx, req)
|
|
|
|
+ log.Println("err:", err, "---res:", res)
|
|
|
|
+}
|