Done ticket GEPAFINBE-92

This commit is contained in:
nisha
2024-11-15 19:55:24 +05:30
parent 526a831357
commit 7485cead14
26 changed files with 257 additions and 164 deletions

View File

@@ -1,24 +1,40 @@
package net.gepafin.tendermanagement.service.feignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@FeignClient(name = "mailgunClient", url = "${mailGun_base_url}")
//@FeignClient(name = "mailgunClient", url = "${mailGun_base_url}")
public interface MailgunFeignClient {
@PostMapping("/v3/{domain}/messages")
ResponseEntity<Void> sendEmail(
@PathVariable("domain") String domain,
@RequestParam("from") String from,
@RequestParam("to") List<String> to,
@RequestParam("subject") String subject,
@RequestParam("html") String htmlBody,
@RequestHeader("Authorization") String authorizationHeader);
// @PostMapping(value = "/v3/{domain}/messages", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
// ResponseEntity<Void> sendEmail( @RequestPart("from") String from,
// @RequestPart("to") List<String> to,
// @RequestPart("subject") String subject,
// @RequestPart("text") String htmlBody,
// @PathVariable("domain") String domain,
//// @RequestBody PayloadDTO dto,
// //RequestParam
//
// @RequestHeader HttpHeaders headers);
//
// public class PayloadDTO {
// public String from;
// public List<String> to;
// public String subject;
// public String htmlBody;
//
// public PayloadDTO(String from, List<String> to, String subject, String htmlBody) {
// this.from = from;
// this.to = to;
// this.subject = subject;
// this.htmlBody = htmlBody;
// }
//
// }
}

View File

@@ -3,15 +3,16 @@ package net.gepafin.tendermanagement.service.feignClient;
import feign.Headers;
import net.gepafin.tendermanagement.model.request.PecEmailRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
@FeignClient(name = "pecClient", url = "${api.pecUrl}")
//@FeignClient(name = "pecClient", url = "${api.pecUrl}")
public interface PecFeignClient {
@PostMapping("/send")
ResponseEntity<Void> sendEmail(@RequestHeader("Authorization") String token,
@RequestBody PecEmailRequest emailRequest);
// @PostMapping("/send")
// ResponseEntity<Void> sendEmail(@RequestHeader HttpHeaders headers,
// @RequestBody PecEmailRequest emailRequest);
}