Compare commits
No commits in common. "4c3a2e87d0272a111d0f091a6c350de6ce477604" and "4b37f707a32c5e3d31bc8e8a7363a37dc7c959c3" have entirely different histories.
4c3a2e87d0
...
4b37f707a3
|
@ -20,10 +20,6 @@ public class EmailTemplateAddDto {
|
||||||
@NotNull(message = "模板名称不能为空")
|
@NotNull(message = "模板名称不能为空")
|
||||||
private String templateName;
|
private String templateName;
|
||||||
|
|
||||||
@Schema(name = "emailUser", title = "配置邮件用户")
|
|
||||||
@NotNull(message = "配置邮件用户不能为空")
|
|
||||||
private Long emailUser;
|
|
||||||
|
|
||||||
@Schema(name = "subject", title = "主题")
|
@Schema(name = "subject", title = "主题")
|
||||||
@NotBlank(message = "主题不能为空")
|
@NotBlank(message = "主题不能为空")
|
||||||
@NotNull(message = "主题不能为空")
|
@NotNull(message = "主题不能为空")
|
||||||
|
|
|
@ -18,16 +18,12 @@ public class EmailTemplateUpdateDto {
|
||||||
@Schema(name = "id", title = "主键")
|
@Schema(name = "id", title = "主键")
|
||||||
@NotNull(message = "id不能为空")
|
@NotNull(message = "id不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(name = "templateName", title = "模板名称")
|
@Schema(name = "templateName", title = "模板名称")
|
||||||
@NotBlank(message = "模板名称不能为空")
|
@NotBlank(message = "模板名称不能为空")
|
||||||
@NotNull(message = "模板名称不能为空")
|
@NotNull(message = "模板名称不能为空")
|
||||||
private String templateName;
|
private String templateName;
|
||||||
|
|
||||||
@Schema(name = "emailUser", title = "配置邮件用户")
|
|
||||||
@NotNull(message = "配置邮件用户不能为空")
|
|
||||||
private Long emailUser;
|
|
||||||
|
|
||||||
@Schema(name = "subject", title = "主题")
|
@Schema(name = "subject", title = "主题")
|
||||||
@NotBlank(message = "主题不能为空")
|
@NotBlank(message = "主题不能为空")
|
||||||
@NotNull(message = "主题不能为空")
|
@NotNull(message = "主题不能为空")
|
||||||
|
|
|
@ -20,6 +20,9 @@ public class EmailUsersAddDto {
|
||||||
@NotNull(message = "邮箱不能为空")
|
@NotNull(message = "邮箱不能为空")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
@Schema(name = "emailTemplate", title = "邮件模板")
|
||||||
|
private Long emailTemplate;
|
||||||
|
|
||||||
@Schema(name = "password", title = "密码")
|
@Schema(name = "password", title = "密码")
|
||||||
@NotBlank(message = "密码不能为空")
|
@NotBlank(message = "密码不能为空")
|
||||||
@NotNull(message = "密码不能为空")
|
@NotNull(message = "密码不能为空")
|
||||||
|
|
|
@ -24,6 +24,9 @@ public class EmailUsersUpdateDto {
|
||||||
@NotNull(message = "邮箱不能为空")
|
@NotNull(message = "邮箱不能为空")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
@Schema(name = "emailTemplate", title = "邮件模板")
|
||||||
|
private Long emailTemplate;
|
||||||
|
|
||||||
@Schema(name = "password", title = "密码")
|
@Schema(name = "password", title = "密码")
|
||||||
@NotBlank(message = "密码不能为空")
|
@NotBlank(message = "密码不能为空")
|
||||||
@NotNull(message = "密码不能为空")
|
@NotNull(message = "密码不能为空")
|
||||||
|
|
|
@ -25,9 +25,6 @@ public class EmailTemplate extends BaseEntity {
|
||||||
@Schema(name = "templateName", title = "模板名称")
|
@Schema(name = "templateName", title = "模板名称")
|
||||||
private String templateName;
|
private String templateName;
|
||||||
|
|
||||||
@Schema(name = "emailUser", title = "模板名称")
|
|
||||||
private Long emailUser;
|
|
||||||
|
|
||||||
@Schema(name = "subject", title = "主题")
|
@Schema(name = "subject", title = "主题")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,9 @@ public class EmailUsers extends BaseEntity {
|
||||||
@Schema(name = "email", title = "邮箱")
|
@Schema(name = "email", title = "邮箱")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
@Schema(name = "emailTemplate", title = "使用邮件模板")
|
||||||
|
private Long emailTemplate;
|
||||||
|
|
||||||
@Schema(name = "password", title = "密码")
|
@Schema(name = "password", title = "密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package cn.bunny.dao.vo.system.email;
|
package cn.bunny.dao.vo.system.email;
|
||||||
|
|
||||||
import cn.bunny.dao.vo.BaseVo;
|
import cn.bunny.dao.vo.BaseVo;
|
||||||
import com.alibaba.fastjson2.annotation.JSONField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
@ -18,14 +15,6 @@ public class EmailTemplateVo extends BaseVo {
|
||||||
@Schema(name = "templateName", title = "模板名称")
|
@Schema(name = "templateName", title = "模板名称")
|
||||||
private String templateName;
|
private String templateName;
|
||||||
|
|
||||||
@Schema(name = "emailUser", title = "配置邮件用户")
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
|
||||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
|
||||||
private Long emailUser;
|
|
||||||
|
|
||||||
@Schema(name = "emailUsername", title = "邮箱账户")
|
|
||||||
private String emailUsername;
|
|
||||||
|
|
||||||
@Schema(name = "subject", title = "主题")
|
@Schema(name = "subject", title = "主题")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package cn.bunny.dao.vo.system.email;
|
package cn.bunny.dao.vo.system.email;
|
||||||
|
|
||||||
import cn.bunny.dao.vo.BaseVo;
|
import cn.bunny.dao.vo.BaseVo;
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
@ -15,6 +18,11 @@ public class EmailUsersVo extends BaseVo {
|
||||||
@Schema(name = "email", title = "邮箱")
|
@Schema(name = "email", title = "邮箱")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
@Schema(name = "emailTemplate", title = "使用邮件模板")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||||
|
private Long emailTemplate;
|
||||||
|
|
||||||
@Schema(name = "password", title = "密码")
|
@Schema(name = "password", title = "密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,13 @@ public class EmailTemplateController {
|
||||||
return Mono.just(Result.success(pageResult));
|
return Mono.just(Result.success(pageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询所有邮件模板", description = "查询所有邮件模板")
|
||||||
|
@GetMapping("getAllEmailTemplates")
|
||||||
|
public Mono<Result<List<EmailTemplateVo>>> getAllEmailTemplates() {
|
||||||
|
List<EmailTemplateVo> voList = emailTemplateService.getAllEmailTemplates();
|
||||||
|
return Mono.just(Result.success(voList));
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "添加邮件模板表", description = "添加邮件模板表")
|
@Operation(summary = "添加邮件模板表", description = "添加邮件模板表")
|
||||||
@PostMapping("addEmailTemplate")
|
@PostMapping("addEmailTemplate")
|
||||||
public Mono<Result<String>> addEmailTemplate(@Valid @RequestBody EmailTemplateAddDto dto) {
|
public Mono<Result<String>> addEmailTemplate(@Valid @RequestBody EmailTemplateAddDto dto) {
|
||||||
|
|
|
@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -51,13 +50,6 @@ public class EmailUsersController {
|
||||||
return Mono.just(Result.success(pageResult));
|
return Mono.just(Result.success(pageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取所有邮箱配置用户", description = "获取所有邮箱配置用户")
|
|
||||||
@GetMapping("getAllMailboxConfigurationUsers")
|
|
||||||
public Mono<Result<List<Map<String, String>>>> getAllMailboxConfigurationUsers() {
|
|
||||||
List<Map<String, String>> list = emailUsersService.getAllMailboxConfigurationUsers();
|
|
||||||
return Mono.just(Result.success(list));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加邮箱用户发送配置", description = "添加邮箱用户发送配置")
|
@Operation(summary = "添加邮箱用户发送配置", description = "添加邮箱用户发送配置")
|
||||||
@PostMapping("addEmailUsers")
|
@PostMapping("addEmailUsers")
|
||||||
public Mono<Result<String>> addEmailUsers(@Valid @RequestBody EmailUsersAddDto dto) {
|
public Mono<Result<String>> addEmailUsers(@Valid @RequestBody EmailUsersAddDto dto) {
|
||||||
|
|
|
@ -49,4 +49,11 @@ public interface EmailTemplateService extends IService<EmailTemplate> {
|
||||||
* @param ids 删除id列表
|
* @param ids 删除id列表
|
||||||
*/
|
*/
|
||||||
void deleteEmailTemplate(List<Long> ids);
|
void deleteEmailTemplate(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 查询所有邮件模板
|
||||||
|
*
|
||||||
|
* @return 邮箱模板返回内容列表
|
||||||
|
*/
|
||||||
|
List<EmailTemplateVo> getAllEmailTemplates();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -58,12 +57,4 @@ public interface EmailUsersService extends IService<EmailUsers> {
|
||||||
* @param dto 邮箱用户更新状态表单
|
* @param dto 邮箱用户更新状态表单
|
||||||
*/
|
*/
|
||||||
void updateEmailUserStatus(EmailUserUpdateStatusDto dto);
|
void updateEmailUserStatus(EmailUserUpdateStatusDto dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* * 获取所有邮箱配置用户
|
|
||||||
*
|
|
||||||
* @return 邮件用户列表
|
|
||||||
*/
|
|
||||||
List<Map<String, String>> getAllMailboxConfigurationUsers();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,21 @@ public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, E
|
||||||
public void deleteEmailTemplate(List<Long> ids) {
|
public void deleteEmailTemplate(List<Long> ids) {
|
||||||
// 判断数据请求是否为空
|
// 判断数据请求是否为空
|
||||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||||
|
|
||||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 查询所有邮件模板
|
||||||
|
*
|
||||||
|
* @return 邮箱模板返回内容列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmailTemplateVo> getAllEmailTemplates() {
|
||||||
|
return list().stream().map(emailTemplate -> {
|
||||||
|
EmailTemplateVo emailTemplateVo = new EmailTemplateVo();
|
||||||
|
BeanUtils.copyProperties(emailTemplate, emailTemplateVo);
|
||||||
|
return emailTemplateVo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -73,8 +71,9 @@ public class EmailUsersServiceImpl extends ServiceImpl<EmailUsersMapper, EmailUs
|
||||||
* @param dto 邮箱用户发送配置添加
|
* @param dto 邮箱用户发送配置添加
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addEmailUsers(EmailUsersAddDto dto) {
|
public void addEmailUsers(@Valid EmailUsersAddDto dto) {
|
||||||
// 判断邮箱是否添加
|
// 判断邮箱是否添加
|
||||||
|
String email = dto.getEmail();
|
||||||
List<EmailUsers> emailUsersList = list(Wrappers.<EmailUsers>lambdaQuery().eq(EmailUsers::getEmail, dto.getEmail()));
|
List<EmailUsers> emailUsersList = list(Wrappers.<EmailUsers>lambdaQuery().eq(EmailUsers::getEmail, dto.getEmail()));
|
||||||
if (!emailUsersList.isEmpty()) throw new BunnyException(ResultCodeEnum.EMAIL_EXIST);
|
if (!emailUsersList.isEmpty()) throw new BunnyException(ResultCodeEnum.EMAIL_EXIST);
|
||||||
|
|
||||||
|
@ -113,7 +112,7 @@ public class EmailUsersServiceImpl extends ServiceImpl<EmailUsersMapper, EmailUs
|
||||||
public void deleteEmailUsers(List<Long> ids) {
|
public void deleteEmailUsers(List<Long> ids) {
|
||||||
// 判断数据请求是否为空
|
// 判断数据请求是否为空
|
||||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||||
|
|
||||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,19 +130,4 @@ public class EmailUsersServiceImpl extends ServiceImpl<EmailUsersMapper, EmailUs
|
||||||
BeanUtils.copyProperties(dto, emailUsers);
|
BeanUtils.copyProperties(dto, emailUsers);
|
||||||
updateById(emailUsers);
|
updateById(emailUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* * 获取所有邮箱配置用户
|
|
||||||
*
|
|
||||||
* @return 邮件用户列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Map<String, String>> getAllMailboxConfigurationUsers() {
|
|
||||||
return list().stream().map(emailUsers -> {
|
|
||||||
Map<String, String> map = new HashMap<>();
|
|
||||||
map.put("key", emailUsers.getEmail());
|
|
||||||
map.put("value", emailUsers.getId().toString());
|
|
||||||
return map;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ spring:
|
||||||
quartz:
|
quartz:
|
||||||
job-store-type: jdbc
|
job-store-type: jdbc
|
||||||
jdbc:
|
jdbc:
|
||||||
initialize-schema: embedded
|
initialize-schema: always
|
||||||
auto-startup: true
|
auto-startup: true
|
||||||
wait-for-jobs-to-complete-on-shutdown: true
|
wait-for-jobs-to-complete-on-shutdown: true
|
||||||
overwrite-existing-jobs: false
|
overwrite-existing-jobs: false
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
<id column="update_user" property="updateUser"/>
|
<id column="update_user" property="updateUser"/>
|
||||||
<id column="is_deleted" property="isDeleted"/>
|
<id column="is_deleted" property="isDeleted"/>
|
||||||
<id column="template_name" property="templateName"/>
|
<id column="template_name" property="templateName"/>
|
||||||
<id column="email_user" property="emailUser"/>
|
|
||||||
<id column="subject" property="subject"/>
|
<id column="subject" property="subject"/>
|
||||||
<id column="body" property="body"/>
|
<id column="body" property="body"/>
|
||||||
<id column="type" property="type"/>
|
<id column="type" property="type"/>
|
||||||
|
@ -20,7 +19,7 @@
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, create_time, update_time, create_user, update_user, is_deleted, template_name, email_user, subject, body, type, is_default
|
id, create_time, update_time, create_user, update_user, is_deleted, template_name, subject, body, type, is_default
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询邮件模板表内容 -->
|
<!-- 分页查询邮件模板表内容 -->
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<id column="update_user" property="updateUser"/>
|
<id column="update_user" property="updateUser"/>
|
||||||
<id column="is_deleted" property="isDeleted"/>
|
<id column="is_deleted" property="isDeleted"/>
|
||||||
<id column="email" property="email"/>
|
<id column="email" property="email"/>
|
||||||
|
<id column="email_template" property="emailTemplate"/>
|
||||||
<id column="password" property="password"/>
|
<id column="password" property="password"/>
|
||||||
<id column="host" property="host"/>
|
<id column="host" property="host"/>
|
||||||
<id column="port" property="port"/>
|
<id column="port" property="port"/>
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, create_time, update_time, create_user, update_user, is_deleted, email, password, host, port, smtp_agreement, is_default
|
id, create_time, update_time, create_user, update_user, is_deleted, email, email_template, password, host, port, smtp_agreement, is_default
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询邮箱用户发送配置内容 -->
|
<!-- 分页查询邮箱用户发送配置内容 -->
|
||||||
|
|
Loading…
Reference in New Issue