用户接口远程调用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
3.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. package userrpc
  2. import (
  3. "testing"
  4. )
  5. func Test_GetUserScore(t *testing.T) {
  6. dbname := "shop_v2_org"
  7. id := "2"
  8. ret, err := GetUserScore(dbname, id)
  9. t.Log(ret)
  10. t.Log(err)
  11. }
  12. func Test_GetUserRedEnvelope(t *testing.T) {
  13. dbname := "shop_v2_org"
  14. id := "2"
  15. ret, err := GetUserRedEnvelope(dbname, id)
  16. t.Log(ret)
  17. t.Log(err)
  18. }
  19. func Test_AddUserScore(t *testing.T) {
  20. dbname := "shop_v2_org"
  21. userid := "2"
  22. score := "20"
  23. ret, err := AddUserScore(dbname, userid, score)
  24. t.Log(ret)
  25. t.Log(err)
  26. }
  27. func Test_UpdateUserScore(t *testing.T) {
  28. dbname := "shop_v2_org"
  29. userid := "2"
  30. score := "400"
  31. used_score := "300"
  32. ret, err := UpdateUserScore(dbname, userid, score, used_score)
  33. t.Log(ret)
  34. t.Log(err)
  35. }
  36. func Test_AddUserScoreLog(t *testing.T) {
  37. dbname := "shop_v2_org"
  38. userid := "2"
  39. score := "100"
  40. before := "500"
  41. after := "400"
  42. Source := "task"
  43. SourceId := ""
  44. OrderSn := ""
  45. Target := ""
  46. TargetId := ""
  47. ProductThumb := ""
  48. Memo := ""
  49. ret, err := AddUserScoreLog(dbname, userid, score, before, after, Source, SourceId, OrderSn, Target, TargetId, ProductThumb, Memo)
  50. t.Log(ret)
  51. t.Log(err)
  52. }
  53. func Test_AddUserUpgrade(t *testing.T) {
  54. dbname := "shop_v2_org"
  55. userid := "5"
  56. upgrade := "100"
  57. ret, err := AddUserUpgrade(dbname, userid, upgrade)
  58. t.Log(ret)
  59. t.Log(err)
  60. }
  61. func Test_UpdateUserUpgrade(t *testing.T) {
  62. dbname := "shop_v2_org"
  63. userid := "5"
  64. upgrade := "100"
  65. ret, err := UpdateUserUpgrade(dbname, userid, upgrade)
  66. t.Log(ret)
  67. t.Log(err)
  68. }
  69. func Test_AddUserUpgradeLog(t *testing.T) {
  70. dbname := "shop_v2_org"
  71. userid := "2"
  72. upgrade := "20"
  73. before := "11"
  74. after := "31"
  75. Source := "task"
  76. Memo := ""
  77. ret, err := AddUserUpgradeLog(dbname, userid, upgrade, before, after, Source, Memo)
  78. t.Log(ret)
  79. t.Log(err)
  80. }
  81. func Test_AddUserRedEnvelope(t *testing.T) {
  82. dbname := "shop_v2_org"
  83. userid := "5"
  84. money := "20"
  85. ret, err := AddUserRedEnvelope(dbname, userid, money)
  86. t.Log(ret)
  87. t.Log(err)
  88. }
  89. func Test_UpdateUserRedEnvelope(t *testing.T) {
  90. dbname := "shop_v2_org"
  91. userid := "2"
  92. money := "40"
  93. used_money := "1"
  94. ret, err := UpdateUserRedEnvelope(dbname, userid, money, used_money)
  95. t.Log(ret)
  96. t.Log(err)
  97. }
  98. func Test_AddUserRedEnvelopeLog(t *testing.T) {
  99. dbname := "shop_v2_org"
  100. userid := "2"
  101. money := "-1"
  102. before := "41"
  103. after := "40"
  104. Source := "task"
  105. SourceId := ""
  106. OrderSn := "216304042479173922"
  107. Target := ""
  108. TargetId := ""
  109. ProductThumb := ""
  110. Memo := ""
  111. ret, err := AddUserRedEnvelopeLog(dbname, userid, money, before, after, Source, SourceId, OrderSn, Target, TargetId, ProductThumb, Memo)
  112. t.Log(ret)
  113. t.Log(err)
  114. }
  115. func Test_AddUserCoupon(t *testing.T) {
  116. dbname := "shop_v2_org"
  117. userid := "2"
  118. couponId := "20"
  119. expired_time := ""
  120. order_sn := ""
  121. remark := ""
  122. ret, err := AddUserCoupon(dbname, userid, couponId, expired_time,order_sn,remark)
  123. t.Log(ret)
  124. t.Log(err)
  125. }
  126. func Test_UpdateUserCoupon(t *testing.T) {
  127. dbname := "shop_v2_org"
  128. userid := "2"
  129. couponId := "20"
  130. remark := ""
  131. orderSn := ""
  132. isUse := ""
  133. usetime := ""
  134. ret, err := UpdateUserCoupon(dbname, userid, couponId, remark, orderSn, isUse,usetime)
  135. t.Log(ret)
  136. t.Log(err)
  137. }