| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace HH.WCS.Mobox3.DSZSH.Dtos.Response { |
| | | public class MoboxResponse : BaseResponse { |
| | | public class MoboxResponse { |
| | | /// <summary> |
| | | /// Mobox 接口返回 |
| | | /// Mobox 接口返回数据类 |
| | | /// </summary> |
| | | public class SimpleResult : Result { |
| | | public class SimpleResult { |
| | | |
| | | [JsonProperty("resultCode")] |
| | | public int Code { get; set; } |
| | | |
| | | [JsonProperty("resultMsg")] |
| | | public string Message { get; set; } |
| | | |
| | | [JsonProperty("result")] |
| | | public List<object> Results { get; set; } = new List<object>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 构建 <see cref="SimpleResult"/> 返回值,选择打印日志信息(默认打印) |
| | | /// </summary> |
| | | /// <param name="code"></param> |
| | | /// <param name="message"></param> |
| | | /// <param name="pringLog"></param> |
| | | /// <returns></returns> |
| | | public static SimpleResult BuildSimpleResult(int code, string message, bool pringLog = true) { |
| | | if (pringLog) { |
| | | LogHelper.Info(message); |
| | | } |
| | | return new SimpleResult { Code = code, Message = message }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 构建 <see cref="SimpleResult"/> 异常返回值,选择打印异常日志信息(默认打印) |
| | | /// </summary> |
| | | /// <param name="ex"></param> |
| | | /// <param name="exCode"></param> |
| | | /// <param name="pringLog"></param> |
| | | /// <returns></returns> |
| | | public static SimpleResult BuildSimpleEx(Exception ex, int exCode = 1, bool pringLog = true) { |
| | | if (pringLog) { |
| | | LogHelper.InfoEx(ex); |
| | | } |
| | | return new SimpleResult { Code = exCode, Message = ex.Message }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// mobox 取消任务、标记完成任务 |
| | | /// </summary> |
| | | public class MoboxTaskBase { |
| | | [JsonProperty("task_no")] |
| | | public string TaskNo { get; set; } |
| | | } |
| | | |
| | |
| | | /// 返回给GZ |
| | | /// </summary> |
| | | public class GzResult { |
| | | |
| | | public int resultCode { get; set; } |
| | | public string msg { get; set; } |
| | | public int orderID { get; set; } |