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

namespace DataSharing.Share.Dtos.YiBin.Enterprise
{
    /// <summary>
    /// 接口返回
    /// </summary>
    public class EnterpriseResponse
    {
        /// <summary>
        /// 响应码
        /// </summary>
        public int code { get; set; }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool success { get; set; }

        /// <summary>
        /// 返回消息
        /// </summary>
        public string msg { get; set; }

        /// <summary>
        /// 操作结果
        /// </summary>
        public object data { get; set; }
    }

    public class EnterpriseDeResponse
    {
        /// <summary>
        /// 状态
        /// </summary>
        public string code { get; set; }

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

        /// <summary>
        /// 成功
        /// </summary>
        /// <param name="description"></param>
        /// <returns></returns>
        public static EnterpriseDeResponse Success(string? description = "")
        {
            return new EnterpriseDeResponse
            {
                code = "1",
                msg = description ?? "您已成功提交数据！"
            };
        }

        /// <summary>
        /// 失败
        /// </summary>
        /// <param name="code"></param>
        /// <param name="description"></param>
        /// <returns></returns>
        public static EnterpriseDeResponse Failed(string? code = "0", string? description = "")
        {
            return new EnterpriseDeResponse
            {
                code = code,
                msg = description ?? "接口调用失败！"
            };
        }

    }
}
