AdvertisementOrderPost.java 2.5 KB

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