v1_test.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package tests
  4. import (
  5. "context"
  6. "testing"
  7. v1 "adm-data/pb/v1"
  8. jsoniter "github.com/json-iterator/go"
  9. )
  10. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  11. func TestQuery(t *testing.T) {
  12. req := v1.QueryRequest{
  13. Code: "U01",
  14. // Params: `{"vin": "MS1SEJSB15T1C15","model_no": "","long":0,"brand_name":""}`,
  15. // Params: `{
  16. // "list": [{"third_style_id": "AF0C1H3420T8A25", "source": "1"}, {"third_style_id": "AF0C1H3420T8A15", "source": "1"}, {"third_style_id": "AF0C1H3420T8A45", "source": "1"}]
  17. // }`,
  18. /*Params: `{
  19. "vin": "",
  20. "model_no": "JX1033TSE4",
  21. "displacement": 0,
  22. "displacement_l": "1.6",
  23. "vehicle_body_color":"",
  24. "vehicle_body_color_detail":"欧曼蓝金属漆",
  25. "vehicle_type":"K33",
  26. "initial_registration_date":"",
  27. "insurance_first_date":"2010-12-22",
  28. "use_property":"A",
  29. "approved_number":5,
  30. "state":"A",
  31. "compulsory_scrap_to":"",
  32. "plate_type":"02",
  33. "long":"4999",
  34. "approved_number":"1",
  35. "grossMass":"400",
  36. "inspection_result_effective_to":""
  37. }`,*/
  38. Params: `{
  39. "vin": "LVVDG17BXJD627878",
  40. "plate_type": "02",
  41. "emission_standard":"GB18352.3-2005(国V阶段)",
  42. "last_compulsory_insurance_date":"2021-02"
  43. }`,
  44. // "vehicle_type": "K33",
  45. // "vehicle_type_detail": "",
  46. // "fuel_type": "A",
  47. // "fuel_type_detail": "",
  48. // "plate_type": "",
  49. // "plate_type_detail":"小型汽车"
  50. }
  51. reply, err := client.Query(context.Background(), &req)
  52. if err != nil {
  53. t.Fatal(err)
  54. } else {
  55. s, _ := json.MarshalToString(reply)
  56. t.Log(s)
  57. }
  58. }