order_test.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package order
  2. import (
  3. "context"
  4. "gd_service/apis"
  5. "encoding/json"
  6. "testing"
  7. )
  8. func Test_ServiceGetOrderList(t *testing.T) {
  9. req := apis.ServiceGetOrderListReq{Uid: 26, AppKey: "123456"}
  10. reply := apis.ServiceGetOrderListReply{}
  11. if err := xcli.Call(context.Background(), "ServiceGetOrderList", req, &reply); err != nil {
  12. t.Error("failed to call: ", err)
  13. } else {
  14. d, _ := json.Marshal(reply)
  15. t.Log(string(d))
  16. }
  17. }
  18. func Test_ServiceGetAnnualInspectionOrderInfo(t *testing.T) {
  19. req := apis.ServiceGetAnnualInspectionOrderInfoReq{OrderNo: "123", AppKey: "123456"}
  20. //req := apis.ServiceGetAnnualInspectionOrderInfoReq{OrderNo: "081161907589", AppKey: "123456"}
  21. reply := apis.ServiceGetAnnualInspectionOrderInfoReply{}
  22. if err := xcli.Call(context.Background(), "ServiceGetAnnualInspectionOrderInfo", req, &reply); err != nil {
  23. t.Error("failed to call: ", err)
  24. } else {
  25. d, _ := json.Marshal(reply)
  26. t.Log(string(d))
  27. }
  28. }
  29. /*func Test_ServiceCreateOrderInfo(t *testing.T) {
  30. req := apis.ServiceGetAnnualInspectionOrderInfoReq{OrderNo:"123",AppKey:"123456"}
  31. req := apis.ServiceCreateOrderReq{
  32. AppKey: "123456",
  33. UserAddress: "地址地址",
  34. PlateNo: "川A12328",
  35. PhoneNumber: "13540735437",
  36. Name: "liu",
  37. Reservation: "2018-11-19 09:00:00",
  38. Longitude: 0,
  39. Latitude: 0,
  40. NotifyUrl: "xxx",
  41. Uid: 1,
  42. Service: "2",
  43. }
  44. reply := apis.ServiceCreateOrderReply{}
  45. if err := xcli.Call(context.Background(), "ServiceCreateOrder", req, &reply); err != nil {
  46. t.Error("failed to call: ", err)
  47. } else {
  48. d, _ := json.Marshal(reply)
  49. t.Log(string(d))
  50. }
  51. }
  52. */