package com.red.circle.other.inner.model.cmd.sys;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.red.circle.framework.core.dto.CommonCommand;
import com.red.circle.tool.core.text.StringUtils;
import java.io.Serial;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 定时推送消息.
 *
 * @author pengshigang
 * @since 2022-10-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysPushTaskCmd extends CommonCommand {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 主键标识.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  /**
   * 标题.
   */
  private String title;

  /**
   * 系统.
   */
  private String sysOrigin;

  /**
   * 消息内容.
   */
  private String content;

  /**
   * 平台.
   */
  private String platform;

  /**
   * 业务场景
   */
  private String businessScene;

  /**
   * 定投用户id.
   */
  private String fixedUserIds;

  /**
   * 来源.
   */
  private String origin;

  /**
   * 语言.
   */
  private String language;

  /**
   * 设备平台(UMENG,GOOGLE).
   */
  private String deviceType;

  /**
   * 备注.
   */
  private String remarks;

  /**
   * 0.下架 1.上架.
   */
  private Boolean shelfStatus;

  /**
   * 触发任务(几号).
   */
  private Integer days;

  /**
   * 触发任务(几时).
   */
  private Integer hours;

  /**
   * 触发任务(几分).
   */
  private Integer minutes;

  private Long createUser;

  @JsonIgnore
  public boolean isFixedUserIdSend() {
    return StringUtils.isNotBlank(fixedUserIds);
  }
}
