first commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.kri.notihub.server.controller;
|
||||
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
import com.kri.notihub.server.dto.send.*;
|
||||
import com.kri.notihub.server.service.SendSmsService;
|
||||
import com.kri.notihub.server.service.SmsSendCursorStore;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/send-sms")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Send SMS", description = "문자 발송 API")
|
||||
public class SendSmsController {
|
||||
|
||||
private final SendSmsService sendSmsService;
|
||||
private final SmsSendCursorStore cursorStore;
|
||||
|
||||
@Operation(summary = "SMS 결과 반영 커서(send_idx) 조회")
|
||||
@GetMapping("/cursor")
|
||||
public SmsCursorResponseDto getCursor() {
|
||||
return SmsCursorResponseDto.of(cursorStore.get());
|
||||
}
|
||||
|
||||
@Operation(summary = "벌크 발송키 생성")
|
||||
@PutMapping("/create/bulk")
|
||||
public String createBulkSendKey(@Valid @RequestBody BulkSendCreateRequestDto req) {
|
||||
return sendSmsService.issueBulkKey(req);
|
||||
}
|
||||
|
||||
@Operation(summary = "문자 단건 발송")
|
||||
@PostMapping("/single")
|
||||
public void sendSingle(
|
||||
@Valid @RequestBody SendRequestSingleDto req,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
sendSmsService.doSendSingle(req, ctx.getUserCmpn(), ctx.getUserId());
|
||||
}
|
||||
|
||||
@Operation(summary = "bulkSendKey 기반 문자 벌크 발송")
|
||||
@PostMapping("/bulk")
|
||||
public BulkSendResponseDto sendBulk(
|
||||
@Valid @RequestBody SendRequestBulkDto req
|
||||
) {
|
||||
return sendSmsService.doSendBulk(req);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user