BroadcastItemVO.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.welampiot.vo;
  2. import com.welampiot.dto.BroadcastItemDTO;
  3. import lombok.Data;
  4. import org.jetbrains.annotations.Contract;
  5. import org.jetbrains.annotations.NotNull;
  6. import java.io.Serializable;
  7. import java.util.List;
  8. /**
  9. * ClassName: BroadcastItemVO
  10. * Package: com.welampiot.vo
  11. * Description:
  12. *
  13. * @Author: zhj_Start
  14. * @Create: 2023/4/17 - 15:50
  15. * @Version: v1.0
  16. */
  17. @Data
  18. public class BroadcastItemVO implements Serializable {
  19. private Integer page;
  20. private Integer count;
  21. private String keyword;
  22. private Integer version;
  23. private String username;
  24. private Integer userId;
  25. private Integer total;
  26. private List<BroadcastItemDTO> list;
  27. private static final long serialVersionUID = 1L;
  28. @NotNull
  29. @Contract("_ -> param1")
  30. public static BroadcastItemVO getBroadcastItemVO(@NotNull BroadcastItemVO vo) {
  31. if (vo.getVersion() == null) {
  32. vo.setVersion(0);
  33. }
  34. if (vo.getUsername() == null) {
  35. vo.setUsername("");
  36. }
  37. if (vo.getPage() == null) {
  38. vo.setPage(1);
  39. }
  40. if (vo.getCount() == null) {
  41. vo.setCount(16);
  42. }
  43. if (vo.getKeyword() == null) {
  44. vo.setKeyword("");
  45. }
  46. return vo;
  47. }
  48. }