• C# 一些请求的基类(待补充)


    using System.Runtime.Serialization;
    
        /// <summary>
        /// 通用分页请求类
        /// </summary>
        [DataContract]
        public class PagedListModelReq : Request
        {
            /// <summary>
            /// <strong>Initializes a new instance of the <see cref="</strong>PagedListModelReq<strong>" /> class</strong>
            /// </summary>
            public PagedListModelReq()
            {
                this.PageIndex = 1;
                this.PageSize = 15;
            }
    
            /// <summary>
            /// 索引开始
            /// </summary>
            [DataMember]
            public int StartIndex
            {
                get
                {
                    int index = 0;
                    if (this.PageSize > 0 && this.PageIndex > 0)
                    {
                        index = ((this.PageIndex - 1) * this.PageSize) + 1;
                    }
    
                    return index;
                }
            }
    
            /// <summary>
            /// 索引结束
            /// </summary>
            [DataMember]
            public int EndIndex
            {
                get
                {
                    int index = 1;
                    if (this.PageSize > 0 && this.PageIndex > 0)
                    {
                        index = this.PageIndex * this.PageSize;
                    }
    
                    return index;
                }
            }
    
            /// <summary>
            /// 分页大小
            /// </summary>
            [DataMember]
            public int PageSize { get; set; }
    
            /// <summary>
            /// 第几页数
            /// </summary>
            [DataMember]
            public int PageIndex { get; set; }
    
            /// <summary>
            /// Called when [deserialized].
            /// </summary>
            /// <param name="context">StreamingContext</param>
            [OnDeserialized]
            private void OnDeserialized(StreamingContext context)
            {
                if (this.PageIndex <= 0)
                {
                    this.PageIndex = 1;
                }
    
                if (this.PageSize <= 0)
                {
                    this.PageSize = 15;
                }
            }
        }
        /// <summary>
        /// Model的基类
        /// </summary>
        [DataContract]
        public abstract class BaseModel
        {
            /// <summary>
            /// CreateUser
            /// </summary>
            [DataMember]
            public string Creator { get; set; }
    
            /// <summary>
            /// CreateUser
            /// </summary>
            [DataMember]
            public string Editor { get; set; }
    
            /// <summary>
            /// CreateUser
            /// </summary>
            [DataMember]
            public DateTime? CreateTime { get; set; }
    
            /// <summary>
            /// CreateUser
            /// </summary>
            [DataMember]
            public DateTime? EditTime { get; set; }
    
            /// <summary>
            /// CreateUser
            /// </summary>
            [DataMember]
            public bool IsDel { get; set; }
        }
  • 相关阅读:
    亚像素显示详解
    一文看懂显示关键材料之彩色滤光片(Color Filter)
    Android Camera2 Opengles2.0 实时滤镜(冷暖色/放大镜/模糊/美颜)
    Android Camera2 预览,拍照,人脸检测并实时展现
    Camera2点击对焦实现2
    关于Android Camera2 API 的自动对焦的坑
    Camera2点击对焦实现
    Android 新老两代 Camera API 大起底
    Android Camera2 参数调节关键字翻译集合,常用关键字解析
    MediaCodec在Android视频硬解码组件的应用
  • 原文地址:https://www.cnblogs.com/zhshlimi/p/8026249.html
Copyright © 2020-2023  润新知