GoodsPush.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WdtSdk;
  7. namespace GoodsPush
  8. {
  9. class GoodsPush
  10. {
  11. static void Main(string[] args)
  12. {
  13. WdtClient client = new WdtClient();
  14. client.sid = "";
  15. client.appkey = "";
  16. client.appsecret = "";
  17. client.gatewayUrl = "http://121.41.177.115/openapi2/goods_push.php";
  18. var goods_list = new[]
  19. {
  20. new
  21. {
  22. goods_no="llxxtest",
  23. goods_type=1,
  24. goods_name="测试测试ceshi",
  25. spec_list=new[]
  26. {
  27. new
  28. {
  29. spec_no="myxx",
  30. spec_code = "myxx",
  31. spec_name = "满夜雪啸"
  32. },
  33. new
  34. {
  35. spec_no="dshg",
  36. spec_code = "dshg",
  37. spec_name = "凋松鹤骨"
  38. },
  39. new
  40. {
  41. spec_no="mhgs",
  42. spec_code = "mhgs",
  43. spec_name = "梦回姑苏"
  44. }
  45. }
  46. }
  47. };
  48. string json = goods_list.ToJsonString();
  49. client.putParams("goods_list", json);
  50. string result = client.wdtOpenapi();
  51. Console.WriteLine(result);
  52. Console.ReadKey();
  53. }
  54. }
  55. }