develop #42
@@ -13,6 +13,7 @@ import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
|
||||
@@ -132,6 +133,13 @@ public class NotiHubApiClient {
|
||||
return sendBulk("/send-kko/bulk", request);
|
||||
}
|
||||
|
||||
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
|
||||
HttpServletRequest request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return relay(request, null, new ParameterizedTypeReference<>() {}, ctx);
|
||||
}
|
||||
|
||||
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
|
||||
NotiHubKkoTemplateListRequestDto body,
|
||||
HttpServletRequest request,
|
||||
|
||||
11
src/main/java/com/kri/contact/server/common/external/notihub/dto/NotiHubKkoSenderProfileDto.java
vendored
Normal file
11
src/main/java/com/kri/contact/server/common/external/notihub/dto/NotiHubKkoSenderProfileDto.java
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.kri.contact.server.common.external.notihub.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "Kakao sender profile")
|
||||
public record NotiHubKkoSenderProfileDto(
|
||||
String senderKey,
|
||||
String name,
|
||||
String uuid
|
||||
) {
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.kri.contact.server.common.external.notihub.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
public record NotiHubKkoTemplateDetailRequestDto(
|
||||
|
||||
@Schema(description = "Selected sender profile key; validated by NotiHub", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
String senderKey,
|
||||
@NotBlank
|
||||
@Size(max = 30)
|
||||
@Pattern(regexp = "[A-Za-z0-9_-]+")
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.kri.contact.server.common.external.notihub.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
public record NotiHubKkoTemplateListRequestDto(
|
||||
|
||||
@Schema(description = "Selected sender profile key; validated by NotiHub", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
String senderKey,
|
||||
@Size(min = 2, max = 50)
|
||||
String keyword
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
|
||||
@@ -37,6 +38,14 @@ public class MessageTemplateController {
|
||||
|
||||
private final MessageTemplateService messageTemplateService;
|
||||
|
||||
@GetMapping("/kko/profiles")
|
||||
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
|
||||
HttpServletRequest request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return messageTemplateService.getKkoSenderProfiles(request, ctx);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/kko/list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
|
||||
@Valid @RequestBody NotiHubKkoTemplateListRequestDto body,
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.kri.contact.server.service;
|
||||
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
|
||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
|
||||
@@ -25,6 +26,13 @@ public class MessageTemplateService {
|
||||
private final NotiHubApiClient notiHubApiClient;
|
||||
private final ProjectMainTemplateRepository projectMainTemplateRepository;
|
||||
|
||||
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
|
||||
HttpServletRequest request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return notiHubApiClient.getKkoSenderProfiles(request, ctx);
|
||||
}
|
||||
|
||||
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
|
||||
NotiHubKkoTemplateListRequestDto body,
|
||||
HttpServletRequest request,
|
||||
|
||||
Reference in New Issue
Block a user