public void TestAddProjectComment() { string url = apiHost + @"api/k2callback/AddProjectComment"; IList <WebApiQueryParam> _queryParams = new List <WebApiQueryParam>(); _queryParams.Add(new WebApiQueryParam("procInstID", "884")); _queryParams.Add(new WebApiQueryParam("k2SN", "884_35")); _queryParams.Add(new WebApiQueryParam("operatorID", "E5016672")); _queryParams.Add(new WebApiQueryParam("action", "Approve")); _queryParams.Add(new WebApiQueryParam("comment", ConvertHelper.Base64Encode("Test Approve Comment"))); var _isExecuted = CallAMAPI(url, _queryParams, "POST"); Console.WriteLine("Call API Result: {0}", _isExecuted); }
public void TestPrepareTask() { string url = Formatter.CombinePath(apiHost, @"api/k2callback/preparetask"); IList <WebApiQueryParam> _queryParams = new List <WebApiQueryParam>(); _queryParams.Add(new WebApiQueryParam("procInstID", "1104")); _queryParams.Add(new WebApiQueryParam("taskID", "CAAFA419-0EDD-4CAA-BD9C-2FDD2E66E016")); _queryParams.Add(new WebApiQueryParam("taskURL", ConvertHelper.Base64Encode("/MajorLease/Main#/MajorLease/ConsInvtChecking/Process/View?ProcInstID=1104"))); _queryParams.Add(new WebApiQueryParam("receiverID", "E5006154")); _queryParams.Add(new WebApiQueryParam("creater", "bpm.service")); _queryParams.Add(new WebApiQueryParam("k2SN", "1104_24")); _queryParams.Add(new WebApiQueryParam("activity", ConvertHelper.Base64Encode("Supervisor Approval"))); MCDAMReturnObject _returnAMObject = WebApiProxy.Call <MCDAMReturnObject>(url, _queryParams, "POST"); Console.WriteLine("Result: {0}", JsonConvert.SerializeObject(_returnAMObject, Formatting.Indented)); }
/// <summary> /// string变base64 /// </summary> /// <param name="s"></param> /// <returns></returns> public static string StringToBase64(this string s) => ConvertHelper.Base64Encode(s);