package org.dromara.member.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.time.LocalDateTime;

/**
 * App端消息业务对象 app_message
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = org.dromara.member.domain.AppMessage.class, reverseConvertGenerate = false)
public class AppMessageBo extends BaseEntity {

    /**
     * 消息ID
     */
    @NotNull(message = "消息ID不能为空", groups = {EditGroup.class})
    private Long messageId;

    /**
     * 消息标题
     */
    @NotBlank(message = "消息标题不能为空", groups = {AddGroup.class, EditGroup.class})
    private String title;

    /**
     * 消息内容
     */
    @NotBlank(message = "消息内容不能为空", groups = {AddGroup.class, EditGroup.class})
    private String content;

    /**
     * 消息类型（system:系统消息 notice:通知 activity:活动）
     */
    private String messageType;

    /**
     * 推送目标（all:全部用户 user:指定用户 role:指定角色）
     */
    private String targetType;

    /**
     * 目标ID列表（用户ID或角色ID，逗号分隔）
     */
    private String targetIds;

    /**
     * 发送时间
     */
    private LocalDateTime sendTime;

    /**
     * 状态（0待发送 1已发送 2发送失败）
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 接收者ID（用于查询当前用户的消息）
     */
    private Long receiverId;

    /**
     * 发送者ID
     */
    private Long senderId;

}