using Furion.DataValidation;
using Nirvana.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace YBDevice.NApi.Application.BusinessClient.AccountInfo
{
    /// <summary>
    /// 商户登录
    /// </summary>
    public class BusinessLoginDto
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "请先输入手机号")]
        [DataValidation(ValidationTypes.PhoneNumber, ErrorMessage = "手机号格式不正确")]
        public string Phone { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "请先输入密码")]
        [MinLength(6, ErrorMessage = "密码长度最少为6位")]
        public string Password { get; set; }
        /// <summary>
        /// 用户sessionid,可不传输
        /// </summary>
        public string sessionId { get; set; } = "";
    }
    /// <summary>
    /// 手机号快捷登录
    /// </summary>
    public class BusinessQLoginDto
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "请先输入手机号")]
        [DataValidation(ValidationTypes.PhoneNumber, ErrorMessage = "手机号格式不正确")]
        public string Phone { get; set; }

        /// <summary>
        /// 用户sessionid,可不传输
        /// </summary>
        public string sessionId { get; set; } = "";

        /// <summary>
        /// 验证码
        /// </summary>
        public string code { get; set; } = "";
        /// <summary>
        /// 是否校检验证码
        /// </summary>
        public bool isvrcode { get; set; } = true;
    }

    /// <summary>
    /// 商户注册
    /// </summary>
    public class BusinessRegDto
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "请先输入手机号")]
        [DataValidation(ValidationTypes.PhoneNumber, ErrorMessage = "手机号格式不正确")]
        public string Phone { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "请先输入密码")]
        [MinLength(6, ErrorMessage = "密码长度最少为6位")]
        public string Password { get; set; }

        /// <summary>
        /// 确定密码
        /// </summary>
        [Required(ErrorMessage = "请再次输入密码")]
        [MinLength(6, ErrorMessage = "密码长度最少为6位")]
        public string RePassword { get; set; }
        /// <summary>
        /// 用户sessionid,可不传输
        /// </summary>
        public string sessionId { get; set; } = "";
        /// <summary>
        /// 商户昵称
        /// </summary>
        [Required(ErrorMessage = "请先输入昵称")]
        [MaxLength(20, ErrorMessage = "昵称长度最多为20位")]
        public string NickName { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string code { get; set; } = "";
        /// <summary>
        /// 是否校检验证码
        /// </summary>
        public bool isvrcode { get; set; } = true;
    }

    /// <summary>
    /// 微信小程序数据解密信息
    /// </summary>
    public class BusinessDecryptSubmitModel
    {
        /// <summary>
        /// 唯一id,作为换取登录信息的凭据
        /// </summary>
        [Required(ErrorMessage = "请先授权微信信息")]
        public string sessionId { get; set; }
        /// <summary>
        /// 加密数据
        /// </summary>
        [Required(ErrorMessage = "加密数据不可为空")]
        public string encryptedData { get; set; }
        /// <summary>
        /// 向量
        /// </summary>
        [Required(ErrorMessage = "向量不可为空")]
        public string iv { get; set; }
    }
    /// <summary>
    /// 商户资料
    /// </summary>
    public class BusinessInfoDto
    {
        /// <summary>
        /// 头像
        /// </summary>
        public string HeadImgUrl { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string NickName { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 设备数量
        /// </summary>
        public int DevCnt { get; set; }
        /// <summary>
        /// 今日测量数
        /// </summary>
        public int TodayCnt { get; set; }
        /// <summary>
        /// 用户数
        /// </summary>
        public int UserCnt { get; set; }
    }

    /// <summary>
    /// 资料修改
    /// </summary>
    public class BusinessChanageInfoDto
    {
        /// <summary>
        /// 头像地址
        /// </summary>
        public string HeadImg { get; set; } = "";
        /// <summary>
        /// 昵称
        /// </summary>
        public string NickName { get; set; } = "";
    }

    /// <summary>
    /// 修改密码
    /// </summary>
    public class BusinessChangePwdDto
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "请先输入手机号")]
        [DataValidation(ValidationTypes.PhoneNumber, ErrorMessage = "手机号格式不正确")]
        public string Phone { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "请先输入密码")]
        [MinLength(6, ErrorMessage = "密码长度最少为6位")]
        public string Password { get; set; }

        /// <summary>
        /// 确定密码
        /// </summary>
        [Required(ErrorMessage = "请再次输入密码")]
        [MinLength(6, ErrorMessage = "密码长度最少为6位")]
        public string RePassword { get; set; }
        /// <summary>
        /// 验证码
        /// </summary>
        public string code { get; set; } = "";
        /// <summary>
        /// 是否校检验证码
        /// </summary>
        public bool isvrcode { get; set; } = true;
    }
    /// <summary>
    /// 商户测量记录查询参数
    /// </summary>
    public class BusinessResultC2SDto
    {
        /// <summary>
        /// 排序方式,asc-正序,desc-倒序
        /// </summary>
        public string order { get; set; } = "desc";
        /// <summary>
        /// 排序字段
        /// </summary>
        public string sort { get; set; } = "createtime";
        /// <summary>
        /// 当前页
        /// </summary>
        public int offset { get; set; }
        /// <summary>
        /// 每页显示的数量
        /// </summary>
        public int limit { get; set; }
        /// <summary>
        /// 设备类型
        /// </summary>
        public int DevType { get; set; } = 0;
        /// <summary>
        /// 用户手机号
        /// </summary>
        [DataValidation(ValidationTypes.PhoneNumber, ErrorMessage = "手机号格式不正确",AllowEmptyStrings =true)]
        public string Phone { get; set; } = "";
    }
}
