File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
package itn.let.mail.web;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import itn.let.mail.service.EmailItnVO;
import itn.let.mail.service.MailTemplateService;
import itn.let.mail.service.StatusResponse;
/**
*
* @packageName : itn.let.mail.web
* @fileName : MailTemplateRestController.java
* @author : 이호영
* @date : 2022.07.05
* @description : iten 홈페이지에서 채용공고 메일 보내는 컨트롤러
* ===========================================================
* DATE AUTHOR NOTE
* ----------------------------------------------------------- *
* 2022.07.05 이호영 최초 생성
*
*
*
*/
@RestController
//@CrossOrigin(origins="*")
public class MailTemplateRestController {
private static final Logger log = LoggerFactory.getLogger(MailTemplateRestController.class);
@Resource(name = "MailTemplateService")
private MailTemplateService mailTemplateService;
/**
* @methodName : mailSendItnRecruitFile
* @author : 이호영
* @date : 2022.07.05
* @description: api 요청으로 첨부파일 서버 저장
* @param multi
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/web/itnApi/fileUpload.do", method = RequestMethod.POST)
public ResponseEntity<StatusResponse> mailSendItnRecruitFile(@RequestParam("file") MultipartFile multi) {
return ResponseEntity.ok().body(mailTemplateService.mailSendItnRecruitFile(multi));
}
/**
* @methodName : mailSendItnRecruit
* @author : 이호영
* @date : 2022.07.05
* @description :
* @param emailAttVO
* @return
* @throws Exception
*/
@RequestMapping(value = "/web/itnApi/rcrtSendMail.do", method = RequestMethod.GET)
public ResponseEntity<StatusResponse> mailSendItnRecruit(@RequestParam MultiValueMap<String, String> emailAttParams) throws Exception {
System.out.println("emailAttParams : "+ emailAttParams.toString());
EmailItnVO emailAttVO = new EmailItnVO(
emailAttParams.get("fileNm").toString()
,emailAttParams.get("oriFileNm").toString()
,emailAttParams.get("name").toString()
,emailAttParams.get("phone").toString()
,emailAttParams.get("email").toString()
,emailAttParams.get("portfolio").toString()
,emailAttParams.get("field").toString()
,emailAttParams.get("content").toString()
);
return ResponseEntity.ok().body(mailTemplateService.mailSendItnRecruit(emailAttVO));
}
/**
* @methodName : mailSendItnRecruit
* @author : hylee
* @date : 2022.07.08
* @description :
* @param emailAttVO
* @return
* @throws Exception
*/
@RequestMapping(value = "/web/itnApi/contactUsSendMail.do", method = RequestMethod.GET)
public ResponseEntity<StatusResponse> mailSendItnContactUs(@RequestParam MultiValueMap<String, String> emailAttParams) throws Exception {
System.out.println("emailItnVO.getOriFileNm() :: ["+emailAttParams+"]");
EmailItnVO emailAttVO = new EmailItnVO(
emailAttParams.get("fileNm").toString()
,emailAttParams.get("oriFileNm").toString()
,emailAttParams.get("title").toString()
,emailAttParams.get("name").toString()
,emailAttParams.get("email").toString()
,emailAttParams.get("content").toString()
);
return ResponseEntity.ok().body(mailTemplateService.mailSendItnContactUs(emailAttVO));
}
}