package com.pig4cloud.pig.marketing.api.vo.config;


import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author: lwh
 * @date: 2025-07-25
 * @description: 全局配置信息
 */
@Data
@Schema(description = "全局配置信息")
public class GetMarketingGlobalConfigVO implements Serializable {

	@Serial
	private final static long serialVersionUID = 1L;

	/**
	 * 触发方式
	 */
	@Schema(description = "触发方式")
	@NotNull(message = "触发方式不能为空")
	Integer triggerMode;

	/**
	 * 触发规则
	 */
	@Schema(description = "触发规则")
	@NotNull(message = "触发规则不能为空")
	Integer triggerRule;

	/**
	 * 触发频率
	 */
	@Schema(description = "触发频率,小于1为百分比,大于1为周期")
	@NotBlank(message = "触发频率不能为空")
	String triggerNum;

	/**
	 * 提示信息
	 */
	@Schema(description = "提示信息")
	@NotBlank(message = "提示信息不能为空")
	@Size(max = 128, message = "提示信息长度不能超过128")
	String promptMsg;

	/**
	 * 跳转链接
	 */
	@Schema(description = "跳转链接")
	@NotBlank(message = "跳转链接不能为空")
	@Size(max = 128, message = "跳转链接长度不能超过128")
	@Pattern(
			regexp = "^(http|https|ftp)://([\\w-]+\\.)+[\\w-]+(:\\d+)?(/[\\w-./?%&=]*)?$",
			message = "跳转链接格式不正确，请输入有效的URL"
	)
	String url;
}
