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

namespace LQKJ.K3.FileSystem.WebApi
{
  public static class ApiResultHelper
    {
        //成功返回结果
        public static ApiResult Success(dynamic data,string msg)
        {
            ApiResult result = new ApiResult
            {
                code = 200,
                data = data,
                msg = msg,
                success = true
            };
            return result;
        }
        //失败返回结果
        public static ApiResult Error(string msg)
        {
            ApiResult result = new ApiResult
            {
                code = 500,
                msg = msg,
                success = false
            };
            return result;
        }
        public static ApiResult Error400(string msg)
        {
            ApiResult result = new ApiResult
            {
                code = 400,
                msg = msg,
                success = false
            };
            return result;
        }
        public static ApiResult Error402(string msg)
        {
            ApiResult result = new ApiResult
            {
                code = 402,
                msg = msg,
                success = false
            };
            return result;
        }
    }
}
