1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace DllEapEntity.Dtos
- {
- public class LayuiModel<T>
- {
- public LayuiModel()
- {
- }
- public LayuiModel(int count, IEnumerable<T> datas)
- {
- this.count = count;
- this.data = datas;
- }
- public int code { get; set; } = 1;
- public string msg { get; set; }
- public int count { get; set; }
- public int extra { get; set; }
- public IEnumerable<T> data { get; set; }
- public object extraObject { get; set; }
- /// <summary>
- /// 创建空列表
- /// </summary>
- /// <param name="error"></param>
- /// <returns></returns>
- public static LayuiModel<T> CreateEmptyList(string error = null)
- {
- var temp = new LayuiModel<T> { code = 1, data = null, count = 0 };
- if (!string.IsNullOrEmpty(error))
- {
- temp.code = -1;
- temp.msg = error;
- }
- return temp;
- }
- }
- }
|