| | |
| | | } |
| | | |
| | | /// <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 { |