workDesktop_test.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package service
  2. import (
  3. "context"
  4. "log"
  5. "testing"
  6. "time"
  7. "userCenter/rpc/pb"
  8. )
  9. var (
  10. ctx, _ = context.WithTimeout(context.Background(), 2*time.Second)
  11. )
  12. // 菜单模式选择
  13. // go test -v -run Test_MenuMode
  14. func Test_MenuMode(t *testing.T) {
  15. FileSystem := AutoInit()
  16. AutoInit()
  17. req := &pb.WorkDesktopComprehensiveReq{
  18. UserId: "61e7820581197c2e50af18df",
  19. AppId: "10000",
  20. Platform: "PC",
  21. Phone: "",
  22. ActionMode: "menuMode",
  23. MenuMode: "usable",
  24. MenuIds: "",
  25. }
  26. res, err := FileSystem.WorkDesktopComprehensive(ctx, req)
  27. log.Println("err ", err)
  28. log.Println("res:", res)
  29. }
  30. // 常用功能更新
  31. // go test -v -run Test_CommonlyRenew
  32. func Test_CommonlyRenew(t *testing.T) {
  33. FileSystem := AutoInit()
  34. req := &pb.WorkDesktopComprehensiveReq{
  35. UserId: "61e7820581197c2e50af18df",
  36. AppId: "10000",
  37. Platform: "PC",
  38. Phone: "",
  39. ActionMode: "commonlyRenew",
  40. MenuMode: "",
  41. MenuIds: "Q1o=,TF4=,TFw=,TFg=,Q1g=,RV9F,RV9J,RV5B,RV5H,RV5J",
  42. }
  43. res, err := FileSystem.WorkDesktopComprehensive(ctx, req)
  44. log.Println("err ", err)
  45. log.Println("res:", res)
  46. }
  47. // 常用功能列表
  48. // go test -v -run Test_CommonlyList
  49. func Test_CommonlyList(t *testing.T) {
  50. FileSystem := AutoInit()
  51. req := &pb.WorkDesktopComprehensiveReq{
  52. UserId: "61e7820581197c2e50af18df",
  53. AppId: "10000",
  54. Platform: "PC",
  55. Phone: "",
  56. ActionMode: "commonlyList",
  57. MenuMode: "",
  58. MenuIds: "",
  59. }
  60. res, err := FileSystem.WorkDesktopComprehensive(ctx, req)
  61. log.Println("err ", err)
  62. log.Println("res:", res)
  63. }
  64. //工作桌面菜单树
  65. //go test -run=Test_WorkDesktopMenuTree
  66. func Test_WorkDesktopMenuTree(t *testing.T) {
  67. FileSystem := AutoInit()
  68. req := &pb.WorkDesktopMenuInfoReq{
  69. UserId: "61e7820581197c2e50af18df",
  70. AppId: "10000",
  71. Platform: "PC",
  72. Phone: "",
  73. }
  74. res, err := FileSystem.WorkDesktopMenuInfo(ctx, req)
  75. log.Println("err:", err, "---res:", res)
  76. }