devrel-kr / nhn-toast-notification-service-custom-connector

This is to provide Microsoft Power Platform with a custom connector for NHN Toast Notification Services including SMS/MMS and KakaoTalk messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

각 API 별로 응답 개체 만들기

justinyoo opened this issue · comments

현재 모든 API 엔드포인트의 응답 개체 모양은 아래와 같습니다.

var payload = await result.Content.ReadAsAsync<object>().ConfigureAwait(false);
return new OkObjectResult(payload);

하지만 각각의 엔드포인트는 저마다 응답개체의 형식이 있습니다. 아래는 하나의 예시로서 GetMessage 엔드포인트의 응답개체 형식입니다.

{
   "header":{
      "resultCode":0,
      "resultMessage":"SUCCESS",
      "isSuccessful":true
   },
   "body":{
      "data":{
         "requestId":"20180810100630ReZQ6KZzAH0",
         "requestDate":"2018-08-10 10:06:30.0",
         "resultDate":"2018-08-10 10:06:42.0",
         "templateId":"TemplateId",
         "templateName":"템플릿명",
         "categoryId":0,
         "categoryName":"카테고리명",
         "body":"본문",
         "sendNo":"15446859",
         "countryCode":"82",
         "recipientNo":"01000000000",
         "msgStatus":"3",
         "msgStatusName":"성공",
         "resultCode":"1000",
         "resultCodeName":"성공",
         "telecomCode":10001,
         "telecomCodeName":"SKT",
         "recipientSeq":1,
         "sendType":"0",
         "messageType":"SMS",
         "userId":"tester",
         "adYn":"N",
         "resultMessage": "",
         "senderGroupingKey":"SenderGroupingKey",
         "recipientGroupingKey":"RecipientGroupingKey"
      }
   }
}
  1. @KIMTHE @wlals761 두 분이 서로 두개씩 엔드포인트를 나눠서 응답 개체를 만들고 적용시켜 보세요.
  2. 각 응답개체마다 headerbody 영역이 있는데, header 영역은 공통이고 body 영역만 다르게 생겼습니다.
  3. 제네릭을 적절히 활용하시면 해결할 수 있습니다.
  4. body 영역은 때로는 단일 개체 형식, 때로는 배열 형식이므로 이 역시도 제네릭을 적절히 활용하면 가능합니다.
  5. nt-common 프로젝트와 nt-sms 프로젝트를 적절히 활용하세요.

주의사항:

  • 이 이슈에 두 분은 각자 맡은 부분을 별도의 이슈로 만들고 연결시켜 주세요.
  • 브랜치는 항상 feature/xxx 형태로 만들어서 작업해 주세요.