OrderDonPost.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. package com.cyksj.model.entity;
  2. import com.baomidou.mybatisplus.annotation.TableField;
  3. import com.baomidou.mybatisplus.annotation.TableName;
  4. import lombok.Data;
  5. import lombok.Getter;
  6. import lombok.experimental.Accessors;
  7. import org.apache.commons.lang3.StringUtils;
  8. import java.io.Serializable;
  9. import java.util.stream.Stream;
  10. @TableName(value ="order_don_post")
  11. @Data
  12. @Accessors(chain = true)
  13. public class OrderDonPost extends BaseEntity implements Serializable {
  14. /**
  15. *
  16. */
  17. private Long orderId;
  18. /**
  19. * 回传参数
  20. */
  21. private String callback;
  22. /**
  23. * 状态 true 已回传 false 未回传
  24. */
  25. private Boolean status;
  26. /**
  27. * Ks 快手 Dy抖音
  28. */
  29. private Type type;
  30. /**
  31. * 回传类型
  32. */
  33. private String evenType;
  34. @TableField(exist = false)
  35. private static final long serialVersionUID = 1L;
  36. /**
  37. * 回传渠道类型
  38. */
  39. @Getter
  40. public enum Type {
  41. /**
  42. * 抖音
  43. */
  44. DY("抖音回传", "Dy", "2"),
  45. /**
  46. * 微信
  47. */
  48. WeChat("微信回传", "WeChat", "PURCHASE"),
  49. /**
  50. * adq
  51. */
  52. adq("腾讯回传", "adq", "PURCHASE"),
  53. /**
  54. * 360点睛
  55. */
  56. DJ("360点睛", "dj","ORDER"),
  57. /**
  58. * 百度
  59. */
  60. BaiDu("百度回传", "BaiDu", "90"),
  61. ;
  62. /**
  63. * 描述
  64. */
  65. private String desc;
  66. /**
  67. * 回传类型
  68. */
  69. private String type;
  70. /**
  71. * 类型 表单提交
  72. */
  73. private String evenType;
  74. Type(String desc, String type, String evenType) {
  75. this.desc = desc;
  76. this.type = type;
  77. this.evenType = evenType;
  78. }
  79. /**
  80. * 根据type 获取
  81. *
  82. * @param type
  83. * @return
  84. */
  85. @SuppressWarnings("rawtypes")
  86. public static Type getByType(String type) {
  87. return Stream.of(Type.values())
  88. .filter((enums) -> enums.getType().equals(type)).findFirst().get();
  89. }
  90. /**
  91. * 根据type
  92. *
  93. * @param type
  94. * @return
  95. */
  96. @SuppressWarnings("rawtypes")
  97. public static Boolean verify(String type) {
  98. if (StringUtils.isBlank(type)) {
  99. return Boolean.FALSE;
  100. }
  101. return Stream.of(Type.values())
  102. .anyMatch((enums) -> enums.getType().equals(type));
  103. }
  104. }
  105. }