VenR.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package com.malk.server.common;
  2. import com.malk.base.BaseDto;
  3. import com.malk.utils.UtilHttp;
  4. import lombok.Data;
  5. import lombok.SneakyThrows;
  6. import java.util.Map;
  7. /**
  8. * 定义第三方返回值结构信息
  9. */
  10. @Data
  11. public class VenR extends BaseDto {
  12. /**
  13. * 断言错误信息: 子类实现 [静态代理]
  14. */
  15. public void assertSuccess() {
  16. }
  17. ///-- 反射 [通过Class.forName(全类名)方式获取Class]
  18. public static final String RC_MC = "com.malk.server.common.MCR";
  19. public static final String RC_YD = "com.malk.server.aliwork.YDR";
  20. public static final String RC_ALY = "com.malk.server.aliyun.ALYR";
  21. public static final String RC_DD = "com.malk.server.dingtalk.DDR";
  22. public static final String RC_DD_New = "com.malk.server.dingtalk.DDR_New";
  23. public static final String RC_EKB = "com.malk.server.ekuaibao.EKBRR";
  24. public static final String RC_FXK = "com.malk.server.fxiaoke.FXKR ";
  25. public static final String RC_XBB = "com.malk.server.xbongbong.XBBR";
  26. public static final String RC_VK = "com.malk.server.vika.VKR";
  27. public static final String RC_TB = "com.malk.server.teambition.TBR";
  28. public static final String RC_INTP = "com.malk.server.integration.INTPR";
  29. /**
  30. * 通用post请求
  31. */
  32. @SneakyThrows
  33. public static VenR doPost(String url, Map header, Map param, Map body, String path) {
  34. Class rClass = Class.forName(path);
  35. VenR rsp = UtilHttp.doPost(url, header, param, body, rClass);
  36. return rsp;
  37. }
  38. /**
  39. * 通用get请求
  40. */
  41. @SneakyThrows
  42. public static VenR doGet(String url, Map header, Map param, String path) {
  43. Class rClass = Class.forName(path);
  44. VenR rsp = UtilHttp.doGet(url, header, param, rClass);
  45. return rsp;
  46. }
  47. }