| | |
| | | package com.oying.rest; |
| | | |
| | | import com.oying.service.EmailService; |
| | | import com.oying.utils.R; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | |
| | | /** |
| | | * 发送邮件 |
| | | * |
| | | * @author Z |
| | | * @date 2018/09/28 6:55:53 |
| | | */ |
| | |
| | | private final EmailService emailService; |
| | | |
| | | @GetMapping |
| | | public ResponseEntity<EmailConfig> queryEmailConfig(){ |
| | | return new ResponseEntity<>(emailService.find(),HttpStatus.OK); |
| | | public ResponseEntity<Object> queryEmailConfig() { |
| | | return new ResponseEntity<>(R.success(emailService.find()), HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("配置邮件") |
| | |
| | | @ApiOperation("配置邮件") |
| | | public ResponseEntity<Object> updateEmailConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception { |
| | | emailService.config(emailConfig, emailService.find()); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("发送邮件") |
| | |
| | | @ApiOperation("发送邮件") |
| | | public ResponseEntity<Object> sendEmail(@Validated @RequestBody EmailDto emailDto){ |
| | | emailService.send(emailDto,emailService.find()); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | } |