개정판 0b75c341
PEMSS의 정합성 코멘트는 제외하고 Export 되도록 수정
Change-Id: I289cc872cf12b9d43fb415d0381271acca61f00a
PemssAPI/PemssApi.cs | ||
---|---|---|
7 | 7 |
using System.Collections.Specialized; |
8 | 8 |
using System.Net.Http; |
9 | 9 |
using System.Net.Http.Headers; |
10 |
using System.Net; |
|
11 |
using Newtonsoft.Json; |
|
10 | 12 |
|
11 | 13 |
namespace KCOM_API |
12 | 14 |
{ |
... | ... | |
142 | 144 |
/// </summary> |
143 | 145 |
/// <param name="pId">프로젝트 ID</param> |
144 | 146 |
/// <param name="dId">Document ID</param> |
145 |
/// <param name="mdId">MR 상세 아이템 ID</param>
|
|
147 |
/// <param name="mrId">MR 상세 아이템 ID</param>
|
|
146 | 148 |
/// <param name="commentId"></param> |
147 | 149 |
/// <param name="uId"></param> |
148 | 150 |
/// <returns></returns> |
... | ... | |
155 | 157 |
//http://pemss.i-on.net/rest/ext/comment/requirement?dId=116&mdId=MD0000000352&commentId=1&uId=유저아이디 |
156 | 158 |
|
157 | 159 |
var values = new NameValueCollection(){ |
160 |
{ "pId",pId}, |
|
158 | 161 |
{ "dId",dId}, |
159 | 162 |
{ "mdId", mdId}, |
160 | 163 |
{ "commentId" , commentId}, |
161 | 164 |
{ "uId", uId} |
162 | 165 |
}; |
163 | 166 |
|
164 |
var jsonObj = DeleteWebClientString($"{gPemssUri}","/rest/ext/comment/requirement", values); |
|
165 |
//+ $"dId={dId}&mdId={mdId}&commentId={commentId}&uId={uId}"); |
|
167 |
//var jsonObj = DeleteWebClientString($"{gPemssUri}/rest/ext/comment/requirement",values); |
|
168 |
var jsonObj = DeleteWebClientString($"{gPemssUri}/rest/ext/comment/requirement?dId={dId}&mdId={mdId}&commentId={commentId}&uId={uId}", values); |
|
169 |
// + $"dId={dId}&mdId={mdId}&commentId={commentId}&uId={uId}", values); |
|
166 | 170 |
|
167 | 171 |
// var jsonObj = DeleteWebClientString($"{gPemssUri}/rest/ext/comment/requirement", values); |
168 | 172 |
|
... | ... | |
311 | 315 |
} |
312 | 316 |
} |
313 | 317 |
|
314 |
private string DeleteWebClientString(string baseUri, string RestApi, NameValueCollection data)
|
|
318 |
private string DeleteWebClientString(string RestApi, NameValueCollection valus)
|
|
315 | 319 |
{ |
316 | 320 |
try |
317 | 321 |
{ |
318 |
using (var client = new HttpClient()) |
|
322 |
|
|
323 |
using (System.Net.WebClient client = new System.Net.WebClient { Encoding = System.Text.Encoding.UTF8 }) |
|
319 | 324 |
{ |
320 |
client.BaseAddress = new Uri(baseUri); |
|
321 |
client.DefaultRequestHeaders.Accept.Clear(); |
|
322 |
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); |
|
325 |
var response = client.UploadValues(RestApi, "DELETE", valus); |
|
326 |
var result = System.Text.Encoding.UTF8.GetString(response); |
|
323 | 327 |
|
324 |
var response = client.SendAsync(new HttpRequestMessage(HttpMethod.Delete, RestApi)
|
|
328 |
if (string.IsNullOrWhiteSpace(result.Replace("{", "").Replace("}", "")))
|
|
325 | 329 |
{ |
326 |
Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data), System.Text.Encoding.UTF8, "application/json")
|
|
327 |
});
|
|
328 |
|
|
329 |
var result = response.Result;
|
|
330 |
|
|
331 |
return result.IsSuccessStatusCode.ToString();
|
|
330 |
return null;
|
|
331 |
} |
|
332 |
else |
|
333 |
{
|
|
334 |
return result; |
|
335 |
}
|
|
332 | 336 |
} |
333 | 337 |
} |
334 | 338 |
catch (Exception ex) |
내보내기 Unified diff