namespace DataSharing.Share.Dtos.YiBin.ConvergenceMedia
{

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

        public static List<ReturnData> ReturnDataInfo(string msg)
        {
            return new List<ReturnData> { new ReturnData() { msg = msg } };
        }
    }

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

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

        /// <summary>
        /// 数据
        /// </summary>
        public TData data { get; set; }

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

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