schangxiang@126.com
2025-09-04 6b5de286683ac86026b2e9109166ced0332cfdad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace yunneiWCS.SystemInteraction.mes2.dto
{
    /// <summary>
    /// 通用泛型接口响应模型
    /// </summary>
    /// <typeparam name="T">Data 字段的类型,可以是任意类型,如 string、int、自定义类等</typeparam>
    public class ApiResponse<T>
    {
        /// <summary>
        /// 状态码,例如 200 表示成功
        /// </summary>
        public int Code { get; set; }
 
        /// <summary>
        /// 是否成功,true 表示成功,false 表示失败
        /// </summary>
        public bool Success { get; set; }
 
        /// <summary>
        /// 返回消息,例如:"成功" 或错误信息
        /// </summary>
        public string Message { get; set; }
 
        /// <summary>
        /// 返回的数据内容,类型为泛型 T
        /// </summary>
        public T Data { get; set; }
    }
}