namespace DataSharing.Share.Dtos.ZiGong.TianQue
{
    public class TianQueResponse
    {
        /// <summary>
        /// 状态
        /// </summary>
        public int code { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string msg { get; set; }

        /// <summary>
        /// 成功
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public static TianQueResponse Success(string? message = "")
        {
            return new TianQueResponse
            {
                code = 1,
                msg = message ?? "请求成功！"
            };
        }

        /// <summary>
        /// 失败
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public static TianQueResponse Failed(string? message = "")
        {
            return new TianQueResponse
            {
                code =  0,
                msg = message ?? "请求失败！"
            };
        }
    }
}
