using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace HH.WCS.Mobox3.DSZSH.Dtos.Response {
public class WmsResponse {
///
/// MES API 响应结果类
///
public class WmsResult {
///
/// 接口调用结果 1-成功 0-失败
///
[JsonProperty("result")]
public int Result { get; set; }
///
/// 是否成功 True-成功,False:失败
///
[JsonProperty("success")]
public bool Success { get; set; }
///
/// 这里是string类型,对结果的描述
///
[JsonProperty("data")]
public string Data { get; set; }
}
public static WmsResult MesResultBuilder(int code, string message = "", bool printLog = true) {
if (printLog && string.IsNullOrEmpty(message)) {
LogHelper.Info(message);
}
return new WmsResult {
Result = code,
Success = code == 0, // 仅当code=0时,success=true
Data = message,
};
}
}
}