| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 任务手动完成 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public async Task<WebResponseContent> ManualTaskCompleted(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | string url = "http://localhost:9290"; |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error($"未找到WCSApi地址,请检查配置文件")); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/Task/TaskCompleted?taskNum=" + taskNum,taskNum.ToString()); |
| | | |
| | | return await Task.FromResult(JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("返回错误")); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message)); |
| | | } |
| | | } |
| | | } |
| | | } |