ByteDanceVideoInfo.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. package cn.com.ctop.toutiao.entity;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.baomidou.mybatisplus.annotation.TableId;
  4. import com.baomidou.mybatisplus.annotation.TableName;
  5. import io.swagger.annotations.ApiModel;
  6. import io.swagger.annotations.ApiModelProperty;
  7. import lombok.Data;
  8. import lombok.EqualsAndHashCode;
  9. import lombok.experimental.Accessors;
  10. import cn.com.ctop.common.module.entity.CtopOauthToken;
  11. import org.jeecgframework.poi.excel.annotation.Excel;
  12. import java.util.Date;
  13. /**
  14. * @Description: 今日头条视频素材信息
  15. * @Author: jeecg-boot
  16. * @Date: 2019-07-29
  17. * @Version: V1.0
  18. */
  19. @Data
  20. @TableName("ctop_bytedance_video_info")
  21. @EqualsAndHashCode(callSuper = false)
  22. @Accessors(chain = true)
  23. @ApiModel(value = "ctop_bytedance_video_info对象", description = "今日头条视频素材信息")
  24. public class ByteDanceVideoInfo {
  25. /**
  26. * id
  27. */
  28. @TableId()
  29. @ApiModelProperty(value = "id")
  30. private String id;
  31. /**
  32. * 对应本文件id
  33. */
  34. @Excel(name = "对应本文件id", width = 15)
  35. @ApiModelProperty(value = "对应本文件id")
  36. private String fileId;
  37. /**
  38. * 平台账号id
  39. */
  40. @Excel(name = "平台账号id", width = 15)
  41. @ApiModelProperty(value = "平台账号id")
  42. private String advertiserId;
  43. /**
  44. * 对应本文件id
  45. */
  46. @Excel(name = "头条账号id", width = 15)
  47. @ApiModelProperty(value = "头条账号id")
  48. private Long accountId;
  49. /**
  50. * 视频宽度
  51. */
  52. @Excel(name = "视频宽度", width = 15)
  53. @ApiModelProperty(value = "视频宽度")
  54. private Integer width;
  55. /**
  56. * 视频高度
  57. */
  58. @Excel(name = "视频高度", width = 15)
  59. @ApiModelProperty(value = "视频高度")
  60. private Integer height;
  61. /**
  62. * 视频时长
  63. */
  64. @Excel(name = "视频时长", width = 15)
  65. @ApiModelProperty(value = "视频时长")
  66. private Double duration;
  67. /**
  68. * 视频大小
  69. */
  70. @Excel(name = "视频大小", width = 15)
  71. @ApiModelProperty(value = "视频大小")
  72. private Long size;
  73. /**
  74. * 视频地址
  75. */
  76. @Excel(name = "视频地址", width = 15)
  77. @ApiModelProperty(value = "视频地址")
  78. private String videoUrl;
  79. @Excel(name = "md5码", width = 64)
  80. @ApiModelProperty(value = "md5码")
  81. private String signature;
  82. /**
  83. * status
  84. */
  85. @Excel(name = "status", width = 15)
  86. @ApiModelProperty(value = "status")
  87. private Integer status;
  88. /**
  89. * createTime
  90. */
  91. @ApiModelProperty(value = "createTime")
  92. private Date createTime;
  93. /**
  94. * updateTime
  95. */
  96. @ApiModelProperty(value = "updateTime")
  97. private Date updateTime;
  98. public ByteDanceVideoInfo(JSONObject data, CtopOauthToken token) {
  99. this.id = data.getString("video_id");
  100. this.fileId = id;
  101. this.accountId = token.getAccountId();
  102. this.advertiserId = token.getAdvertiserId();
  103. this.width = data.getInteger("width");
  104. this.height = data.getInteger("width");
  105. this.size = data.getLong("size");
  106. this.duration = data.getDouble("duration");
  107. this.videoUrl = data.getString("video_url");
  108. this.signature = data.getString("signature");
  109. this.status = 1;
  110. Date now = new Date();
  111. this.createTime = now;
  112. this.updateTime = now;
  113. }
  114. public ByteDanceVideoInfo() {
  115. }
  116. }