package com.cyksj.model.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/*
 *项目名: netflix
 *文件名: Task
 *创建者: JavaZou
 *创建时间:2022/12/27 13:36
 */
@Getter
@Setter
@SearchBean(tables = "task")
public class Task extends BaseEntity{
	@NotEmpty(message = "任务名称不能为空")
	private String name;

	@TableField(updateStrategy = FieldStrategy.IGNORED)
	private String icon;

	/**
	 * 类型id
	 */
	@NotNull(message = "类型不能为空")
	private Long typeId;

	private String description;

	/**
	 * 任务时限 time,day,week
	 */
	@NotEmpty(message = "任务时限不能为空")
	private String taskLimit;

	private Long couponId;

	/**
	 * 邀请人数
	 */
	private Integer inviteNum;

	/**
	 * 积分
	 */
	@NotNull(message = "积分不能为空")
	@Min(value = 1, message = "积分不小于0")
	private Integer points;

	private Boolean status;

	private String link;

	@TableField(updateStrategy = FieldStrategy.IGNORED)
	private String picture;

	private BigDecimal balance;

	private Boolean deleted;

	private Integer sorted;
}
