码迷,mamicode.com
首页 > 其他好文 > 详细

数据接口返回类餐参考

时间:2015-04-05 23:17:24      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

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

namespace TheBiz.Common
{
    public interface IResult
    {
        /// <summary>
        /// 返回值
        /// </summary>
        EResult Code { set; get; }
        /// <summary>
        /// 错误原因
        /// </summary>
        string Msg { set; get; }
    }

    public class SingleResult<T> : IResult
    {
        public T Data { set; get; }
        public EResult Code { set; get; }
        public string Msg { set; get; }
    }
    public class BatchResult<T> : IResult
    {
        public List<T> Data { set; get; }
        public EResult Code { set; get; }
        public string Msg { set; get; }
    }

    public enum EResult
    {
        /// <summary>
        /// 10000	SUCCESS	操作成功
        /// </summary>
        SUCCESS = 10000,
        /// <summary>
        /// 10001	URL_REQUEST_ERROR	异常接口调用
        /// </summary>
        URL_REQUEST_ERROR = 10001,
        /// <summary>
        /// 10002	PROCESS_FAIL	服务器处理失败
        /// </summary>
        PROCESS_FAIL = 10002,
        /// <summary>
        /// 10003	TOO_MANY_REQUEST	访问过于频繁
        /// </summary>
        TOO_MANY_REQUEST = 10003,
        /// <summary>
        /// 10004	PERMISSION_DENY	用户服务无权限
        /// </summary>
        PERMISSION_DENY = 10004,
        /// <summary>
        /// 10005	AUTHENTICATION_EXPIRED	身份认证过期,请重新登录
        /// </summary>
        AUTHENTICATION_EXPIRED = 10005,
    }

    public class ResultValue<T>
    {
        public T Value { set; get; }
    }
}

  

数据接口返回类餐参考

标签:

原文地址:http://www.cnblogs.com/niaowo/p/4394858.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!