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

namespace YBDevice.NApi.Application.ThirdClient
{
    /// <summary>
    /// 基础请求参数
    /// </summary>
    public class TouTiaoBaseRequest
    {
        /// <summary>
        /// 账户appid
        /// </summary>
        public string Appid { get; set; } = "tte74991f478708b7401";
        /// <summary>
        /// 账户密钥
        /// </summary>
        public string Secret { get; set; } = "de8c3a4813130eaf455b3fd84d13d8fa84e2a00e";

    }
    /// <summary>
    /// code2session接口参数
    /// </summary>
    public class TouTiaoCode2SessionRequest: TouTiaoBaseRequest
    {
        /// <summary>
        /// login 接口返回的登录凭证
        /// </summary>
        public string code { get; set; }
        /// <summary>
        /// login 接口返回的匿名登录凭证
        /// </summary>
        public string anonymous_code { get; set; }
    }
    /// <summary>
    /// 头条响应数据
    /// </summary>
    public class TouTiaoResponseInfo
    {
        /// <summary>
        /// 错误代码,0-正确,其他均为异常
        /// </summary>
        public int err_no { get; set; }
        /// <summary>
        /// 错误描述
        /// </summary>
        public string err_tips { get; set; }
    }
    /// <summary>
    /// 头条响应数据
    /// </summary>
    public class TouTiaoResponseData<T>: TouTiaoResponseInfo
    {
        /// <summary>
        /// 数据体
        /// </summary>
        public T data { get; set; }
    }

    /// <summary>
    /// 头条登录响应数据
    /// </summary>
    public class TuTiaoLoginResponse
    {
        /// <summary>
        /// 会话密钥，如果请求时有 code 参数才会返回
        /// </summary>
        public string session_key { get; set; }
        /// <summary>
        /// 用户在当前小程序的 ID，如果请求时有 code 参数才会返回
        /// </summary>
        public string openid { get; set; }
        /// <summary>
        /// 匿名用户在当前小程序的 ID，如果请求时有 anonymous_code 参数才会返回
        /// </summary>
        public string anonymous_openid { get; set; }
        /// <summary>
        /// 用户在小程序平台的唯一标识符，请求时有 code 参数才会返回。如果开发者拥有多个小程序，可通过 unionid 来区分用户的唯一性。
        /// </summary>
        public string unionid { get; set; }
    }
}
