|
@@ -3,14 +3,13 @@ package cn.iocoder.yudao.module.system.controller.admin.mail;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*;
|
|
|
-import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateSendReqVO;
|
|
|
import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO;
|
|
|
import cn.iocoder.yudao.module.system.service.mail.MailSendService;
|
|
|
import cn.iocoder.yudao.module.system.service.mail.MailTemplateService;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -20,7 +19,7 @@ import java.util.List;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
-@Api(tags = "管理后台 - 邮件模版")
|
|
|
+@Tag(name = "管理后台 - 邮件模版")
|
|
|
@RestController
|
|
|
@RequestMapping("/system/mail-template")
|
|
|
public class MailTemplateController {
|
|
@@ -31,14 +30,14 @@ public class MailTemplateController {
|
|
|
private MailSendService mailSendService;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
- @ApiOperation("创建邮件模版")
|
|
|
+ @Operation(summary = "创建邮件模版")
|
|
|
@PreAuthorize("@ss.hasPermission('system:mail-template:create')")
|
|
|
public CommonResult<Long> createMailTemplate(@Valid @RequestBody MailTemplateCreateReqVO createReqVO){
|
|
|
return success(mailTempleService.createMailTemplate(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
- @ApiOperation("修改邮件模版")
|
|
|
+ @Operation(summary = "修改邮件模版")
|
|
|
@PreAuthorize("@ss.hasPermission('system:mail-template:update')")
|
|
|
public CommonResult<Boolean> updateMailTemplate(@Valid @RequestBody MailTemplateUpdateReqVO updateReqVO){
|
|
|
mailTempleService.updateMailTemplate(updateReqVO);
|
|
@@ -46,8 +45,8 @@ public class MailTemplateController {
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
- @ApiOperation("删除邮件模版")
|
|
|
- @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
|
|
+ @Operation(summary = "删除邮件模版")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('system:mail-template:delete')")
|
|
|
public CommonResult<Boolean> deleteMailTemplate(@RequestParam("id") Long id) {
|
|
|
mailTempleService.deleteMailTemplate(id);
|
|
@@ -55,8 +54,8 @@ public class MailTemplateController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
- @ApiOperation("获得邮件模版")
|
|
|
- @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
|
|
+ @Operation(summary = "获得邮件模版")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('system:mail-template:get')")
|
|
|
public CommonResult<MailTemplateRespVO> getMailTemplate(@RequestParam("id") Long id) {
|
|
|
MailTemplateDO mailTemplateDO = mailTempleService.getMailTemplate(id);
|
|
@@ -64,7 +63,7 @@ public class MailTemplateController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
- @ApiOperation("获得邮件模版分页")
|
|
|
+ @Operation(summary = "获得邮件模版分页")
|
|
|
@PreAuthorize("@ss.hasPermission('system:mail-template:query')")
|
|
|
public CommonResult<PageResult<MailTemplateRespVO>> getMailTemplatePage(@Valid MailTemplatePageReqVO pageReqVO) {
|
|
|
PageResult<MailTemplateDO> pageResult = mailTempleService.getMailTemplatePage(pageReqVO);
|
|
@@ -72,14 +71,14 @@ public class MailTemplateController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/list-all-simple")
|
|
|
- @ApiOperation(value = "获得邮件模版精简列表")
|
|
|
+ @Operation(summary = "获得邮件模版精简列表")
|
|
|
public CommonResult<List<MailTemplateSimpleRespVO>> getSimpleTemplateList() {
|
|
|
List<MailTemplateDO> list = mailTempleService.getMailTemplateList();
|
|
|
return success(MailTemplateConvert.INSTANCE.convertList02(list));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/send-mail")
|
|
|
- @ApiOperation("发送短信")
|
|
|
+ @Operation(summary = "发送短信")
|
|
|
@PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')")
|
|
|
public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) {
|
|
|
return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null,
|