v1_test.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package tests
  4. import (
  5. "context"
  6. "testing"
  7. v1 "smart-supplier-management/pb/v1"
  8. jsoniter "github.com/json-iterator/go"
  9. )
  10. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  11. /*
  12. func Test_GenerateFetchVcodeV1(t *testing.T) {
  13. r, err := client.GenerateFetchVcode(context.Background(), &v1.GenerateFetchVcodeRequest{OrderNo: "123456", Phone: "13882234456", Sid: 26})
  14. if err == nil {
  15. s, _ := json.MarshalToString(r)
  16. t.Log(s)
  17. } else {
  18. t.Error("failed to call: ", err)
  19. }
  20. }*/
  21. // 用户生成存件码
  22. /*func Test_GenerateSaveVcodeV1(t *testing.T) {
  23. r, err := client.GenerateSaveVcode(context.Background(), &v1.GenerateSaveVcodeRequest{OrderNo: "123456", Phone: "13882234456", Sid: 26})
  24. if err == nil {
  25. s, _ := json.MarshalToString(r)
  26. t.Log(s)
  27. } else {
  28. t.Error("failed to call: ", err)
  29. }
  30. }
  31. // 验证存件码
  32. func Test_VerifySaveVcodeV1(t *testing.T) {
  33. r, err := client.VerifySaveVcode(context.Background(), &v1.VerifySaveVcodeRequest{SaNo: "CC-00001", Vcode: "853048", Sid: 26})
  34. if err == nil {
  35. s, _ := json.MarshalToString(r)
  36. t.Log(s)
  37. } else {
  38. t.Error("failed to call: ", err)
  39. }
  40. }
  41. // 小程序存件
  42. func Test_OpenBoxBySaveKeyV1(t *testing.T) {
  43. r, err := client.OpenBoxBySaveKey(context.Background(), &v1.OpenBoxBySaveKeyRequest{SaNo: "CC-00001", OrderNo: "123456", Sid: 26})
  44. if err == nil {
  45. s, _ := json.MarshalToString(r)
  46. t.Log(s)
  47. } else {
  48. t.Error("failed to call: ", err)
  49. }
  50. }
  51. */
  52. /*
  53. // 用户关门通知
  54. func Test_UserNotifyCloseBoxV1(t *testing.T) {
  55. r, err := client.NotifyCloseBox(context.Background(), &v1.NotifyCloseBoxRequest{SaNo: "CC-00001", KeyNo: 2, Sid: 26})
  56. if err == nil {
  57. s, _ := json.MarshalToString(r)
  58. t.Log(s)
  59. } else {
  60. t.Error("failed to call: ", err)
  61. }
  62. }*/
  63. /*
  64. // 门店接单生成存取件码,生成存取件码有问题
  65. func Test_GenerateSaveAndFetchVcodeV1(t *testing.T) {
  66. r, err := client.GenerateSaveAndFetchVcode(context.Background(), &v1.GenerateSaveAndFetchVcodeRequest{OrderNo: "123456", Phone: "12334445555", Sid: 26})
  67. if err == nil {
  68. s, _ := json.MarshalToString(r)
  69. t.Log(s)
  70. } else {
  71. t.Error("failed to call: ", err)
  72. }
  73. }*/
  74. /*
  75. //门店取件
  76. func Test_ShopVerifyFetchVcodeV1(t *testing.T) {
  77. r, err := client.VerifyFetchVcode(context.Background(), &v1.VerifyFetchVcodeRequest{Vcode: "387019", SaNo: "CC-00001", Sid: 26})
  78. if err == nil {
  79. s, _ := json.MarshalToString(r)
  80. t.Log(s)
  81. } else {
  82. t.Error("failed to call: ", err)
  83. }
  84. }
  85. */
  86. /*
  87. // 门店取件关门通知
  88. func Test_ShopFetchNotifyCloseBoxV1(t *testing.T) {
  89. r, err := client.NotifyCloseBox(context.Background(), &v1.NotifyCloseBoxRequest{SaNo: "CC-00001", KeyNo: 2, Sid: 26})
  90. if err == nil {
  91. s, _ := json.MarshalToString(r)
  92. t.Log(s)
  93. } else {
  94. t.Error("failed to call: ", err)
  95. }
  96. }*/
  97. /*
  98. // 门店存件
  99. func Test_ShopVerifySaveVcodeV1(t *testing.T) {
  100. r, err := client.VerifySaveVcode(context.Background(), &v1.VerifySaveVcodeRequest{SaNo: "CC-00001", Vcode: "736472", Sid: 26})
  101. if err == nil {
  102. s, _ := json.MarshalToString(r)
  103. t.Log(s)
  104. } else {
  105. t.Error("failed to call: ", err)
  106. }
  107. }
  108. */
  109. /*
  110. // 门店存件关门通知
  111. func Test_ShopSaveNotifyCloseBoxV1(t *testing.T) {
  112. r, err := client.NotifyCloseBox(context.Background(), &v1.NotifyCloseBoxRequest{SaNo: "CC-00001", KeyNo: 3, Sid: 26})
  113. if err == nil {
  114. s, _ := json.MarshalToString(r)
  115. t.Log(s)
  116. } else {
  117. t.Error("failed to call: ", err)
  118. }
  119. }
  120. */
  121. /*
  122. // 用户取
  123. func Test_UserFetchVerifyFetchVcodeV1(t *testing.T) {
  124. r, err := client.VerifyFetchVcode(context.Background(), &v1.VerifyFetchVcodeRequest{Vcode: "735814", SaNo: "CC-00001", Sid: 26})
  125. if err == nil {
  126. s, _ := json.MarshalToString(r)
  127. t.Log(s)
  128. } else {
  129. t.Error("failed to call: ", err)
  130. }
  131. }
  132. */
  133. // 用户取关门通知
  134. func Test_UserFetchNotifyCloseBoxV1(t *testing.T) {
  135. r, err := client.NotifyCloseBox(context.Background(), &v1.NotifyCloseBoxRequest{SaNo: "CC-00001", KeyNo: 3, Sid: 26})
  136. if err == nil {
  137. s, _ := json.MarshalToString(r)
  138. t.Log(s)
  139. } else {
  140. t.Error("failed to call: ", err)
  141. }
  142. }