using Hotline.Share.Enums.KnowledgeBase;
using Hotline.Share.Enums.Snapshot;
using Hotline.Share.Enums.ThirdAccount;
using Hotline.Share.Enums.User;
using System.ComponentModel.DataAnnotations;

namespace Hotline.Share.Dtos.Snapshot;

public class ThirdOpenIdInDto
{
    /// <summary>
    /// OpenId
    /// </summary>
    public string OpenId { get; set; }

    /// <summary>
    /// UnionId
    /// </summary>
    public string UnionId { get; set; }

    /// <summary>
    /// 第三方平台类型(不传默认微信)
    /// 0: 微信
    /// </summary>
    public EThirdType ThirdType { get; set; } = EThirdType.WeChat;

    /// <summary>
    /// 登录app(不传默认随手拍)
    /// 1: 随手拍
    /// 2: 部门办件app
    /// 3: 市民办件app
    /// </summary>
    public EAppType AppType { get; set; } = EAppType.Snapshot;

    /// <summary>
    /// 接口地址前缀
    /// </summary>
    public string? WebApiHost { get; set; }

    /// <summary>
    /// 电话号码
    /// </summary>
    public string? PhoneNumber { get; set; }
}

public class ThirdTokenInDto
{
    /// <summary>
    /// 微信小程序登录Code
    /// </summary>
    public string LoginCode { get; set; }

    /// <summary>
    /// 微信小程序手机号Code
    /// </summary>
    public string TelCode { get; set; }

    /// <summary>
    /// 第三方平台类型(不传默认微信)
    /// 0: 微信
    /// </summary>
    public EThirdType ThirdType { get; set; } = EThirdType.WeChat;

    /// <summary>
    /// 登录app(不传默认随手拍)
    /// 1: 随手拍
    /// 2: 部门办件app
    /// 3: 市民办件app
    /// </summary>
    public EAppType AppType { get; set; } = EAppType.Snapshot;

    /// <summary>
    /// 接口地址前缀
    /// </summary>
    public string? WebApiHost { get; set; }
}

public class ThirdPhoneInDto : ThirdTokenInDto { }

public class ThirdPhoneOutDto
{
    /// <summary>
    /// 电话号码
    /// </summary>
    public string PhoneNumber { get; set; }

    /// <summary>
    /// 是否异常
    /// </summary>
    public bool IsError { get; set; }

    /// <summary>
    /// 微信返回异常信息
    /// </summary>
    public string ErrorMessage { get; set; }

    /// <summary>
    /// 微信返回异常Code
    /// </summary>
    public int ErrorCode { get; set; }
}

public class ThirdTokenOutDto
{
    public string SessionKey { get; set; }
    public string OpenId { get; set; }
    /// <summary>
    /// UnIconId
    /// </summary>
    public string? UnIonId { get; set; }
}

public class GuiderSystemOutDto
{
    /// <summary>
    /// 网格员系统Id
    /// </summary>
    public string GuiderSystemId { get; set; }

    /// <summary>
    /// 附加数据
    /// </summary>
    public string JsonData { get; set; }
}

public class ThirdTokenDto : ThirdTokenInDto
{
    /// <summary>
    /// 微信AppId
    /// </summary>
    public string AppId { get; set; }

    /// <summary>
    /// 微信AppSecret
    /// </summary>
    public string Secret { get; set; }
}

public class SaveInvitationCodeInDto
{
    /// <summary>
    /// 邀请码
    /// </summary>
    [Required]
    public string InvitationCode { get; set; }
}

