using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.KitChen.GroupMeal.Application.BaseDto
{
    /// <summary>
    /// 通用输入扩展参数（带权限）
    /// </summary>
    public class XnInputBase : PageInputBase
    {
        /// <summary>
        /// 授权菜单
        /// </summary>
        public List<string> GrantMenuIdList { get; set; } = new List<string>();

        /// <summary>
        /// 授权角色
        /// </summary>
        public List<string> GrantRoleIdList { get; set; } = new List<string>();

        /// <summary>
        /// 授权数据
        /// </summary>
        public List<string> GrantOrgIdList { get; set; } = new List<string>();

        /// <summary>
        /// 搜索值
        /// </summary>
        public virtual string SearchValue { get; set; }

        /// <summary>
        /// 搜索开始时间
        /// </summary>
        public virtual string SearchBeginTime { get; set; }

        /// <summary>
        /// 搜索结束时间
        /// </summary>
        public virtual string SearchEndTime { get; set; }

        /// <summary>
        /// 排序字段
        /// </summary>
        public virtual string SortField { get; set; }

        /// <summary>
        /// 排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend)
        /// </summary>
        public virtual string SortOrder { get; set; }

        /// <summary>
        /// 降序排序(不要问我为什么是descend不是desc，前端约定参数就是这样)
        /// </summary>
        public virtual string DescStr { get; set; } = "descend";

        /// <summary>
        /// 复杂查询条件
        /// </summary>
      //  public virtual List<Condition> SearchParameters { get; set; } = new();
    }

    /// <summary>
    /// 通用分页输入参数
    /// </summary>
    public class PageInputBase
    {
        public string bomId { get; set; }
        public string chnologyId { get; set; }
        /// <summary>
        /// 当前页码
        /// </summary>
        private int current;
        public virtual int Current
        {
            get
            {
                return current;
            }
            set
            {

                current = value;
                if (current <= 0)
                {
                    current = 1;
                }
            }
        }
        //public int? Status { get; set; }
        /// <summary>
        /// 页码容量
        /// </summary>

        private int pagesize;
        public virtual int PageSize
        {
            get
            {
                return pagesize;
            }
            set
            {

                pagesize = value;
                if (pagesize <= 0)
                {
                    pagesize = 20;
                }
            }
        }
    }
}