feat: mail springdoc

This commit is contained in:
xingyu 2023-01-29 16:24:24 +08:00
parent ffb0358ce2
commit edbbb1a50a
19 changed files with 120 additions and 144 deletions

View File

@ -7,20 +7,19 @@ import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.*;
import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO;
import cn.iocoder.yudao.module.system.service.mail.MailAccountService; import cn.iocoder.yudao.module.system.service.mail.MailAccountService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Comparator;
import java.util.List; import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 邮箱账号") @Tag(name = "管理后台 - 邮箱账号")
@RestController @RestController
@RequestMapping("/system/mail-account") @RequestMapping("/system/mail-account")
public class MailAccountController { public class MailAccountController {
@ -29,14 +28,14 @@ public class MailAccountController {
private MailAccountService mailAccountService; private MailAccountService mailAccountService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建邮箱账号") @Operation(summary = "创建邮箱账号")
@PreAuthorize("@ss.hasPermission('system:mail-account:create')") @PreAuthorize("@ss.hasPermission('system:mail-account:create')")
public CommonResult<Long> createMailAccount(@Valid @RequestBody MailAccountCreateReqVO createReqVO) { public CommonResult<Long> createMailAccount(@Valid @RequestBody MailAccountCreateReqVO createReqVO) {
return success(mailAccountService.createMailAccount(createReqVO)); return success(mailAccountService.createMailAccount(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("修改邮箱账号") @Operation(summary = "修改邮箱账号")
@PreAuthorize("@ss.hasPermission('system:mail-account:update')") @PreAuthorize("@ss.hasPermission('system:mail-account:update')")
public CommonResult<Boolean> updateMailAccount(@Valid @RequestBody MailAccountUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateMailAccount(@Valid @RequestBody MailAccountUpdateReqVO updateReqVO) {
mailAccountService.updateMailAccount(updateReqVO); mailAccountService.updateMailAccount(updateReqVO);
@ -44,8 +43,8 @@ public class MailAccountController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除邮箱账号") @Operation(summary = "删除邮箱账号")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:mail-account:delete')") @PreAuthorize("@ss.hasPermission('system:mail-account:delete')")
public CommonResult<Boolean> deleteMailAccount(@RequestParam Long id) { public CommonResult<Boolean> deleteMailAccount(@RequestParam Long id) {
mailAccountService.deleteMailAccount(id); mailAccountService.deleteMailAccount(id);
@ -53,8 +52,8 @@ public class MailAccountController {
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得邮箱账号") @Operation(summary = "获得邮箱账号")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:mail-account:get')") @PreAuthorize("@ss.hasPermission('system:mail-account:get')")
public CommonResult<MailAccountRespVO> getMailAccount(@RequestParam("id") Long id) { public CommonResult<MailAccountRespVO> getMailAccount(@RequestParam("id") Long id) {
MailAccountDO mailAccountDO = mailAccountService.getMailAccount(id); MailAccountDO mailAccountDO = mailAccountService.getMailAccount(id);
@ -62,7 +61,7 @@ public class MailAccountController {
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得邮箱账号分页") @Operation(summary = "获得邮箱账号分页")
@PreAuthorize("@ss.hasPermission('system:mail-account:query')") @PreAuthorize("@ss.hasPermission('system:mail-account:query')")
public CommonResult<PageResult<MailAccountBaseVO>> getMailAccountPage(@Valid MailAccountPageReqVO pageReqVO) { public CommonResult<PageResult<MailAccountBaseVO>> getMailAccountPage(@Valid MailAccountPageReqVO pageReqVO) {
PageResult<MailAccountDO> pageResult = mailAccountService.getMailAccountPage(pageReqVO); PageResult<MailAccountDO> pageResult = mailAccountService.getMailAccountPage(pageReqVO);
@ -70,7 +69,7 @@ public class MailAccountController {
} }
@GetMapping("/list-all-simple") @GetMapping("/list-all-simple")
@ApiOperation(value = "获得邮箱账号精简列表") @Operation(summary = "获得邮箱账号精简列表")
public CommonResult<List<MailAccountSimpleRespVO>> getSimpleMailAccountList() { public CommonResult<List<MailAccountSimpleRespVO>> getSimpleMailAccountList() {
List<MailAccountDO> list = mailAccountService.getMailAccountList(); List<MailAccountDO> list = mailAccountService.getMailAccountList();
return success(MailAccountConvert.INSTANCE.convertList02(list)); return success(MailAccountConvert.INSTANCE.convertList02(list));

View File

@ -1,19 +1,15 @@
package cn.iocoder.yudao.module.system.controller.admin.mail; package cn.iocoder.yudao.module.system.controller.admin.mail;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogRespVO; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogRespVO;
import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateRespVO;
import cn.iocoder.yudao.module.system.convert.mail.MailLogConvert; import cn.iocoder.yudao.module.system.convert.mail.MailLogConvert;
import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO;
import cn.iocoder.yudao.module.system.service.mail.MailLogService; import cn.iocoder.yudao.module.system.service.mail.MailLogService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -25,8 +21,7 @@ import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 邮件日志")
@Api(tags = "管理后台 - 邮件日志")
@RestController @RestController
@RequestMapping("/system/mail-log") @RequestMapping("/system/mail-log")
public class MailLogController { public class MailLogController {
@ -35,7 +30,7 @@ public class MailLogController {
private MailLogService mailLogService; private MailLogService mailLogService;
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得邮箱日志分页") @Operation(summary = "获得邮箱日志分页")
@PreAuthorize("@ss.hasPermission('system:mail-log:query')") @PreAuthorize("@ss.hasPermission('system:mail-log:query')")
public CommonResult<PageResult<MailLogRespVO>> getMailLogPage(@Valid MailLogPageReqVO pageVO) { public CommonResult<PageResult<MailLogRespVO>> getMailLogPage(@Valid MailLogPageReqVO pageVO) {
PageResult<MailLogDO> pageResult = mailLogService.getMailLogPage(pageVO); PageResult<MailLogDO> pageResult = mailLogService.getMailLogPage(pageVO);
@ -43,8 +38,8 @@ public class MailLogController {
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得邮箱日志") @Operation(summary = "获得邮箱日志")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:mail-log:query')") @PreAuthorize("@ss.hasPermission('system:mail-log:query')")
public CommonResult<MailLogRespVO> getMailTemplate(@RequestParam("id") Long id) { public CommonResult<MailLogRespVO> getMailTemplate(@RequestParam("id") Long id) {
MailLogDO mailLogDO = mailLogService.getMailLog(id); MailLogDO mailLogDO = mailLogService.getMailLog(id);

View File

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

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Email; import javax.validation.constraints.Email;
@ -13,28 +13,28 @@ import javax.validation.constraints.NotNull;
@Data @Data
public class MailAccountBaseVO { public class MailAccountBaseVO {
@ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com") @Schema(description = "邮箱", required = true, example = "yudaoyuanma@123.com")
@NotNull(message = "邮箱不能为空") @NotNull(message = "邮箱不能为空")
@Email(message = "必须是 Email 格式") @Email(message = "必须是 Email 格式")
private String mail; private String mail;
@ApiModelProperty(value = "用户名", required = true, example = "yudao") @Schema(description = "用户名", required = true, example = "yudao")
@NotNull(message = "用户名不能为空") @NotNull(message = "用户名不能为空")
private String username; private String username;
@ApiModelProperty(value = "密码", required = true, example = "123456") @Schema(description = "密码", required = true, example = "123456")
@NotNull(message = "密码必填") @NotNull(message = "密码必填")
private String password; private String password;
@ApiModelProperty(value = "SMTP 服务器域名", required = true, example = "www.iocoder.cn") @Schema(description = "SMTP 服务器域名", required = true, example = "www.iocoder.cn")
@NotNull(message = "SMTP 服务器域名不能为空") @NotNull(message = "SMTP 服务器域名不能为空")
private String host; private String host;
@ApiModelProperty(value = "SMTP 服务器端口", required = true, example = "80") @Schema(description = "SMTP 服务器端口", required = true, example = "80")
@NotNull(message = "SMTP 服务器端口不能为空") @NotNull(message = "SMTP 服务器端口不能为空")
private Integer port; private Integer port;
@ApiModelProperty(value = "是否开启 ssl", required = true, example = "true") @Schema(description = "是否开启 ssl", required = true, example = "true")
@NotNull(message = "是否开启 ssl 必填") @NotNull(message = "是否开启 ssl 必填")
private Boolean sslEnable; private Boolean sslEnable;

View File

@ -1,14 +1,11 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; @Schema(description = "管理后台 - 邮箱账号创建 Request VO")
@ApiModel("管理后台 - 邮箱账号创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -1,22 +1,21 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 邮箱账号分页 Request VO") @Schema(description = "管理后台 - 邮箱账号分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailAccountPageReqVO extends PageParam { public class MailAccountPageReqVO extends PageParam {
@ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com") @Schema(description = "邮箱", required = true, example = "yudaoyuanma@123.com")
private String mail; private String mail;
@ApiModelProperty(value = "用户名" , required = true , example = "yudao") @Schema(description = "用户名" , required = true , example = "yudao")
private String username; private String username;
} }

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -9,17 +8,17 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 邮箱账号 Response VO") @Schema(description ="管理后台 - 邮箱账号 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailAccountRespVO extends MailAccountBaseVO { public class MailAccountRespVO extends MailAccountBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,17 +1,16 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ApiModel("管理后台 - 邮箱账号的精简 Response VO") @Schema(description = "管理后台 - 邮箱账号的精简 Response VO")
@Data @Data
public class MailAccountSimpleRespVO { public class MailAccountSimpleRespVO {
@ApiModelProperty(value = "邮箱编号", required = true, example = "1024") @Schema(description = "邮箱编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "邮箱", required = true, example = "768541388@qq.com") @Schema(description = "邮箱", required = true, example = "768541388@qq.com")
private String mail; private String mail;
} }

View File

@ -1,20 +1,19 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 邮箱账号修改 Request VO") @Schema(description = "管理后台 - 邮箱账号修改 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailAccountUpdateReqVO extends MailAccountBaseVO { public class MailAccountUpdateReqVO extends MailAccountBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private Long id; private Long id;

View File

@ -1,11 +1,9 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import io.swagger.annotations.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -18,59 +16,59 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Data @Data
public class MailLogBaseVO { public class MailLogBaseVO {
@ApiModelProperty(value = "用户编号", example = "30883") @Schema(description = "用户编号", example = "30883")
private Long userId; private Long userId;
@ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举") @Schema(description = "用户类型 - 参见 UserTypeEnum 枚举", example = "2")
private Byte userType; private Byte userType;
@ApiModelProperty(value = "接收邮箱地址", required = true, example = "76854@qq.com") @Schema(description = "接收邮箱地址", required = true, example = "76854@qq.com")
@NotNull(message = "接收邮箱地址不能为空") @NotNull(message = "接收邮箱地址不能为空")
private String toMail; private String toMail;
@ApiModelProperty(value = "邮箱账号编号", required = true, example = "18107") @Schema(description = "邮箱账号编号", required = true, example = "18107")
@NotNull(message = "邮箱账号编号不能为空") @NotNull(message = "邮箱账号编号不能为空")
private Long accountId; private Long accountId;
@ApiModelProperty(value = "发送邮箱地址", required = true, example = "85757@qq.com") @Schema(description = "发送邮箱地址", required = true, example = "85757@qq.com")
@NotNull(message = "发送邮箱地址不能为空") @NotNull(message = "发送邮箱地址不能为空")
private String fromMail; private String fromMail;
@ApiModelProperty(value = "模板编号", required = true, example = "5678") @Schema(description = "模板编号", required = true, example = "5678")
@NotNull(message = "模板编号不能为空") @NotNull(message = "模板编号不能为空")
private Long templateId; private Long templateId;
@ApiModelProperty(value = "模板编码", required = true, example = "test_01") @Schema(description = "模板编码", required = true, example = "test_01")
@NotNull(message = "模板编码不能为空") @NotNull(message = "模板编码不能为空")
private String templateCode; private String templateCode;
@ApiModelProperty(value = "模版发送人名称", example = "李四") @Schema(description = "模版发送人名称", example = "李四")
private String templateNickname; private String templateNickname;
@ApiModelProperty(value = "邮件标题", required = true, example = "测试标题") @Schema(description = "邮件标题", required = true, example = "测试标题")
@NotNull(message = "邮件标题不能为空") @NotNull(message = "邮件标题不能为空")
private String templateTitle; private String templateTitle;
@ApiModelProperty(value = "邮件内容", required = true, example = "测试内容") @Schema(description = "邮件内容", required = true, example = "测试内容")
@NotNull(message = "邮件内容不能为空") @NotNull(message = "邮件内容不能为空")
private String templateContent; private String templateContent;
@ApiModelProperty(value = "邮件参数", required = true) @Schema(description = "邮件参数", required = true)
@NotNull(message = "邮件参数不能为空") @NotNull(message = "邮件参数不能为空")
private Map<String, Object> templateParams; private Map<String, Object> templateParams;
@ApiModelProperty(value = "发送状态", required = true, example = "1", notes = "参见 MailSendStatusEnum 枚举") @Schema(description = "发送状态 - 参见 MailSendStatusEnum 枚举", required = true, example = "1")
@NotNull(message = "发送状态不能为空") @NotNull(message = "发送状态不能为空")
private Byte sendStatus; private Byte sendStatus;
@ApiModelProperty(value = "发送时间") @Schema(description = "发送时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime sendTime; private LocalDateTime sendTime;
@ApiModelProperty(value = "发送返回的消息 ID", example = "28568") @Schema(description = "发送返回的消息 ID", example = "28568")
private String sendMessageId; private String sendMessageId;
@ApiModelProperty(value = "发送异常") @Schema(description = "发送异常")
private String sendException; private String sendException;
} }

View File

@ -1,43 +1,41 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.sql.Timestamp;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 邮箱日志分页 Request VO") @Schema(description = "管理后台 - 邮箱日志分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailLogPageReqVO extends PageParam { public class MailLogPageReqVO extends PageParam {
@ApiModelProperty(value = "用户编号", example = "30883") @Schema(description = "用户编号", example = "30883")
private Long userId; private Long userId;
@ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举") @Schema(description = "用户类型 - 参见 UserTypeEnum 枚举", example = "2")
private Integer userType; private Integer userType;
@ApiModelProperty(value = "接收邮箱地址", example = "76854@qq.com", notes = "模糊匹配") @Schema(description = "接收邮箱地址 模糊匹配", example = "76854@qq.com")
private String toMail; private String toMail;
@ApiModelProperty(value = "邮箱账号编号", example = "18107") @Schema(description = "邮箱账号编号", example = "18107")
private Long accountId; private Long accountId;
@ApiModelProperty(value = "模板编号", example = "5678") @Schema(description = "模板编号", example = "5678")
private Long templateId; private Long templateId;
@ApiModelProperty(value = "发送状态", example = "1", notes = "参见 MailSendStatusEnum 枚举") @Schema(description = "发送状态 - 参见 MailSendStatusEnum 枚举", example = "1")
private Integer sendStatus; private Integer sendStatus;
@ApiModelProperty(value = "发送时间") @Schema(description = "发送时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] sendTime; private LocalDateTime[] sendTime;

View File

@ -1,19 +1,19 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 邮件日志 Response VO") @Schema(description = "管理后台 - 邮件日志 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailLogRespVO extends MailLogBaseVO { public class MailLogRespVO extends MailLogBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "31020") @Schema(description = "编号", required = true, example = "31020")
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ -14,34 +13,34 @@ import javax.validation.constraints.NotNull;
@Data @Data
public class MailTemplateBaseVO { public class MailTemplateBaseVO {
@ApiModelProperty(value = "模版名称", required = true, example = "测试名字") @Schema(description = "模版名称", required = true, example = "测试名字")
@NotNull(message = "名称不能为空") @NotNull(message = "名称不能为空")
private String name; private String name;
@ApiModelProperty(value = "模版编号", required = true, example = "test") @Schema(description = "模版编号", required = true, example = "test")
@NotNull(message = "模版编号不能为空") @NotNull(message = "模版编号不能为空")
private String code; private String code;
@ApiModelProperty(value = "发送的邮箱账号编号", required = true, example = "1") @Schema(description = "发送的邮箱账号编号", required = true, example = "1")
@NotNull(message = "发送的邮箱账号编号不能为空") @NotNull(message = "发送的邮箱账号编号不能为空")
private Long accountId; private Long accountId;
@ApiModelProperty(value = "发送人名称", example = "芋头") @Schema(description = "发送人名称", example = "芋头")
private String nickname; private String nickname;
@ApiModelProperty(value = "标题", required = true, example = "注册成功") @Schema(description = "标题", required = true, example = "注册成功")
@NotEmpty(message = "标题不能为空") @NotEmpty(message = "标题不能为空")
private String title; private String title;
@ApiModelProperty(value = "内容", required = true, example = "你好,注册成功啦") @Schema(description = "内容", required = true, example = "你好,注册成功啦")
@NotEmpty(message = "内容不能为空") @NotEmpty(message = "内容不能为空")
private String content; private String content;
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") @Schema(description = "状态 - 参见 CommonStatusEnum 枚举", required = true, example = "1")
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer status; private Integer status;
@ApiModelProperty(value = "备注", example = "奥特曼") @Schema(description = "备注", example = "奥特曼")
private String remark; private String remark;
} }

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 邮件模版创建 Request VO") @Schema(description = "管理后台 - 邮件模版创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -1,8 +1,7 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -12,25 +11,25 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 邮件模版分页 Request VO") @Schema(description = "管理后台 - 邮件模版分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailTemplatePageReqVO extends PageParam { public class MailTemplatePageReqVO extends PageParam {
@ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举") @Schema(description = "状态 - 参见 CommonStatusEnum 枚举", example = "1")
private Integer status; private Integer status;
@ApiModelProperty(value = "标识", example = "code_1024", notes = "模糊匹配") @Schema(description = "标识 - 模糊匹配", example = "code_1024")
private String code; private String code;
@ApiModelProperty(value = "名称", example = "芋头", notes = "模糊匹配") @Schema(description = "名称 - 模糊匹配", example = "芋头")
private String name; private String name;
@ApiModelProperty(value = "账号编号", example = "2048") @Schema(description = "账号编号", example = "2048")
private Long accountId; private Long accountId;
@ApiModelProperty(value = "创建时间") @Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -9,19 +8,19 @@ import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 邮件末班 Response VO") @Schema(description = "管理后台 - 邮件末班 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailTemplateRespVO extends MailTemplateBaseVO { public class MailTemplateRespVO extends MailTemplateBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "参数数组", example = "name,code") @Schema(description = "参数数组", example = "name,code")
private List<String> params; private List<String> params;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,26 +1,25 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Map; import java.util.Map;
@ApiModel("管理后台 - 邮件发送 Req VO") @Schema(description = "管理后台 - 邮件发送 Req VO")
@Data @Data
public class MailTemplateSendReqVO { public class MailTemplateSendReqVO {
@ApiModelProperty(value = "接收邮箱", required = true, example = "7685413@qq.com") @Schema(description = "接收邮箱", required = true, example = "7685413@qq.com")
@NotEmpty(message = "接收邮箱不能为空") @NotEmpty(message = "接收邮箱不能为空")
private String mail; private String mail;
@ApiModelProperty(value = "模板编码", required = true, example = "test_01") @Schema(description = "模板编码", required = true, example = "test_01")
@NotNull(message = "模板编码不能为空") @NotNull(message = "模板编码不能为空")
private String templateCode; private String templateCode;
@ApiModelProperty(value = "模板参数") @Schema(description = "模板参数")
private Map<String, Object> templateParams; private Map<String, Object> templateParams;
} }

View File

@ -1,17 +1,16 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ApiModel("管理后台 - 邮件模版的精简 Response VO") @Schema(description = "管理后台 - 邮件模版的精简 Response VO")
@Data @Data
public class MailTemplateSimpleRespVO { public class MailTemplateSimpleRespVO {
@ApiModelProperty(value = "模版编号", required = true, example = "1024") @Schema(description = "模版编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "模版名字", required = true, example = "哒哒哒") @Schema(description = "模版名字", required = true, example = "哒哒哒")
private String name; private String name;
} }

View File

@ -1,20 +1,19 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 邮件模版修改 Request VO") @Schema(description = "管理后台 - 邮件模版修改 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class MailTemplateUpdateReqVO extends MailTemplateBaseVO { public class MailTemplateUpdateReqVO extends MailTemplateBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private Long id; private Long id;