更新sql和代码规范修改

This commit is contained in:
moxiangrong
2024-02-18 15:26:45 +08:00
parent 6f5e6e4662
commit c132b68745
1293 changed files with 43935 additions and 18456 deletions

View File

@ -38,7 +38,7 @@ public class SocialUserApiImpl implements SocialUserApi {
@Override
public Long getBindUserId(Integer userType, Integer type, String code, String state) {
return socialUserService.getBindUserId(userType, type, code, state);
return socialUserService.getBindUserId(userType, type, code, state);
}
}

View File

@ -148,7 +148,7 @@ public class AuthController {
@Parameter(name = "redirectUri", description = "回调路径")
})
public CommonResult<String> socialLogin(@RequestParam("type") Integer type,
@RequestParam("redirectUri") String redirectUri) {
@RequestParam("redirectUri") String redirectUri) {
return CommonResult.success(socialUserService.getAuthorizeUrl(type, redirectUri));
}

View File

@ -54,7 +54,8 @@ public class AuthLoginReqVO {
/**
* 开启验证码的 Group
*/
public interface CodeEnableGroup {}
public interface CodeEnableGroup {
}
@AssertTrue(message = "授权码不能为空")
public boolean isSocialCodeValid() {

View File

@ -42,7 +42,7 @@ public class BackupRecordController {
@Operation(summary = "备份信息")
@PreAuthorize("@ss.hasPermission('system:store-backup-record:backup')")
@PostMapping(value = "/backup")
public CommonResult<Boolean> backup(){
public CommonResult<Boolean> backup() {
backupRecordService.backup();
return success(true);
}
@ -50,7 +50,7 @@ public class BackupRecordController {
@Operation(summary = "还原备份")
@PreAuthorize("@ss.hasPermission('system:store-backup-record:revert')")
@PostMapping(value = "/revertBackup")
public CommonResult<Boolean> backupRecord(){
public CommonResult<Boolean> backupRecord() {
backupRecordService.revertBackup();
return success(true);
}

View File

@ -9,7 +9,7 @@ import java.time.LocalDateTime;
@Schema(description = "管理后台 - 备份记录 Response VO")
@Data
@ToString(callSuper = true)
public class BackupRecordRespVO {
public class BackupRecordRespVO {
@Schema(description = "记录编号", requiredMode = Schema.RequiredMode.REQUIRED)
private Long id;
@ -17,19 +17,19 @@ public class BackupRecordRespVO {
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
private String creator;
@Schema(description = "创建人名称", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "创建人名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String creatorName;
@Schema(description = "修改人", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "修改人", requiredMode = Schema.RequiredMode.REQUIRED)
private String updater;
@Schema(description = "修改人名称", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "修改人名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String updaterName;
@Schema(description = "修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime updateTime;
}

View File

@ -1,4 +1,5 @@
package co.yixiang.yshop.module.system.controller.admin.dept.vo.dept;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

View File

@ -1,4 +1,5 @@
package co.yixiang.yshop.module.system.controller.admin.dept.vo.dept;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,4 +1,5 @@
package co.yixiang.yshop.module.system.controller.admin.dept.vo.post;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

View File

@ -79,7 +79,7 @@ public class ErrorCodeController {
@PreAuthorize("@ss.hasPermission('system:error-code:export')")
@OperateLog(type = EXPORT)
public void exportErrorCodeExcel(@Valid ErrorCodeExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<ErrorCodeDO> list = errorCodeService.getErrorCodeList(exportReqVO);
// 导出 Excel
List<ErrorCodeExcelVO> datas = ErrorCodeConvert.INSTANCE.convertList02(list);

View File

@ -6,9 +6,9 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 错误码 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 错误码 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class ErrorCodeBaseVO {

View File

@ -32,14 +32,14 @@ public class MailTemplateController {
@PostMapping("/create")
@Operation(summary = "创建邮件模版")
@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));
}
@PutMapping("/update")
@Operation(summary = "修改邮件模版")
@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);
return success(true);
}

View File

@ -15,7 +15,7 @@ public class MailAccountPageReqVO extends PageParam {
@Schema(description = "邮箱", required = true, example = "yshopyuanma@123.com")
private String mail;
@Schema(description = "用户名" , required = true , example = "yshop")
@Schema(description = "用户名", required = true, example = "yshop")
private String username;
}

View File

@ -8,7 +8,7 @@ import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
@Schema(description ="管理后台 - 邮箱账号 Response VO")
@Schema(description = "管理后台 - 邮箱账号 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)

View File

@ -2,17 +2,19 @@ package co.yixiang.yshop.module.system.controller.admin.mail.vo.log;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 邮件日志 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 邮件日志 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class MailLogBaseVO {

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.mail.vo.log;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 邮件日志 Response VO")

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.notify.vo.message;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@Schema(description = "管理后台 - 站内信 Response VO")

View File

@ -9,9 +9,9 @@ import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* 站内信模版 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 站内信模版 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class NotifyTemplateBaseVO {

View File

@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import co.yixiang.yshop.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.notify.vo.template;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@Schema(description = "管理后台 - 站内信模版 Response VO")

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.notify.vo.template;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 站内信模版更新 Request VO")

View File

@ -45,11 +45,11 @@ import static co.yixiang.yshop.framework.security.core.util.SecurityFrameworkUti
/**
* 提供给外部应用调用为主
*
* <p>
* 一般来说,管理后台的 /system-api/* 是不直接提供给外部应用使用,主要是外部应用能够访问的数据与接口是有限的,而管理后台的 RBAC 无法很好的控制。
* 参考大量的开放平台,都是独立的一套 OpenAPI对应到【本系统】就是在 Controller 下新建 open 包,实现 /open-api/* 接口,然后通过 scope 进行控制。
* 另外,一个公司如果有多个管理后台,它们 client_id 产生的 access token 相互之间是无法互通的,即无法访问它们系统的 API 接口,直到两个 client_id 产生信任授权。
*
* <p>
* 考虑到【本系统】暂时不想做的过于复杂,默认只有获取到 access token 之后,可以访问【本系统】管理后台的 /system-api/* 所有接口,除非手动添加 scope 控制。
* scope 的使用示例,可见 {@link OAuth2UserController} 类
*
@ -73,13 +73,13 @@ public class OAuth2OpenController {
/**
* 对应 Spring Security OAuth 的 TokenEndpoint 类的 postAccessToken 方法
*
* <p>
* 授权码 authorization_code 模式时code + redirectUri + state 参数
* 密码 password 模式时username + password + scope 参数
* 刷新 refresh_token 模式时refreshToken 参数
* 客户端 client_credentials 模式scope 参数
* 简化 implicit 模式时:不支持
*
* <p>
* 注意,默认需要传递 client_id + client_secret 参数
*/
@PostMapping("/token")
@ -198,12 +198,12 @@ public class OAuth2OpenController {
/**
* 对应 Spring Security OAuth 的 AuthorizationEndpoint 类的 approveOrDeny 方法
*
* <p>
* 场景一:【自动授权 autoApprove = true】
* 刚进入 sso.vue 界面,调用该接口,用户历史已经给该应用做过对应的授权,或者 OAuth2Client 支持该 scope 的自动授权
* 刚进入 sso.vue 界面,调用该接口,用户历史已经给该应用做过对应的授权,或者 OAuth2Client 支持该 scope 的自动授权
* 场景二:【手动授权 autoApprove = false】
* 在 sso.vue 界面,用户选择好 scope 授权范围调用该接口进行授权。此时approved 为 true 或者 false
*
* 在 sso.vue 界面,用户选择好 scope 授权范围调用该接口进行授权。此时approved 为 true 或者 false
* <p>
* 因为前后端分离Axios 无法很好的处理 302 重定向,所以和 Spring Security OAuth 略有不同,返回结果是重定向的 URL剩余交给前端处理
*/
@PostMapping("/authorize")

View File

@ -27,7 +27,7 @@ import static co.yixiang.yshop.framework.security.core.util.SecurityFrameworkUti
/**
* 提供给外部应用调用为主
*
* <p>
* 1. 在 getUserInfo 方法上,添加 @PreAuthorize("@ss.hasScope('user.read')") 注解,声明需要满足 scope = user.read
* 2. 在 updateUserInfo 方法上,添加 @PreAuthorize("@ss.hasScope('user.write')") 注解,声明需要满足 scope = user.write
*

View File

@ -12,9 +12,9 @@ import javax.validation.constraints.NotNull;
import java.util.List;
/**
* OAuth2 客户端 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* OAuth2 客户端 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class OAuth2ClientBaseVO {
@ -53,7 +53,7 @@ public class OAuth2ClientBaseVO {
@Schema(description = "可重定向的 URI 地址", required = true, example = "https://www.yixiang.co")
@NotNull(message = "可重定向的 URI 地址不能为空")
private List<@NotEmpty(message = "重定向的 URI 不能为空")
@URL(message = "重定向的 URI 格式不正确") String> redirectUris;
@URL(message = "重定向的 URI 格式不正确") String> redirectUris;
@Schema(description = "授权类型,参见 OAuth2GrantTypeEnum 枚举", required = true, example = "password")
@NotNull(message = "授权类型不能为空")

View File

@ -47,7 +47,7 @@ public class MenuController {
@DeleteMapping("/delete")
@Operation(summary = "删除菜单")
@Parameter(name = "id", description = "角色编号", required= true, example = "1024")
@Parameter(name = "id", description = "角色编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:menu:delete')")
public CommonResult<Boolean> deleteMenu(@RequestParam("id") Long id) {
menuService.deleteMenu(id);

View File

@ -80,7 +80,7 @@ public class SensitiveWordController {
@PreAuthorize("@ss.hasPermission('system:sensitive-word:export')")
@OperateLog(type = EXPORT)
public void exportSensitiveWordExcel(@Valid SensitiveWordExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<SensitiveWordDO> list = sensitiveWordService.getSensitiveWordList(exportReqVO);
// 导出 Excel
List<SensitiveWordExcelVO> datas = SensitiveWordConvert.INSTANCE.convertList02(list);

View File

@ -7,9 +7,9 @@ import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 敏感词 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 敏感词 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class SensitiveWordBaseVO {

View File

@ -1,4 +1,5 @@
package co.yixiang.yshop.module.system.controller.admin.sms.vo.channel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.URL;
@ -6,9 +7,9 @@ import org.hibernate.validator.constraints.URL;
import javax.validation.constraints.NotNull;
/**
* 短信渠道 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 短信渠道 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class SmsChannelBaseVO {

View File

@ -1,13 +1,14 @@
package co.yixiang.yshop.module.system.controller.admin.sms.vo.template;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 短信模板 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 短信模板 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class SmsTemplateBaseVO {

View File

@ -1,4 +1,5 @@
package co.yixiang.yshop.module.system.controller.admin.sms.vo.template;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -7,9 +7,9 @@ import javax.validation.constraints.NotNull;
import java.util.Set;
/**
* 租户套餐 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 租户套餐 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class TenantPackageBaseVO {

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.tenant.vo.packages;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 租户套餐更新 Request VO")

View File

@ -7,9 +7,9 @@ import javax.validation.constraints.*;
import java.time.LocalDateTime;
/**
* 租户 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
* 租户 Base VO提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class TenantBaseVO {

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.tenant.vo.tenant;
import co.yixiang.yshop.module.system.enums.DictTypeConstants;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;

View File

@ -2,6 +2,7 @@ package co.yixiang.yshop.module.system.controller.admin.tenant.vo.tenant;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 租户更新 Request VO")

View File

@ -95,7 +95,8 @@ public class UserProfileController {
return success(true);
}
@RequestMapping(value = "/update-avatar", method = {RequestMethod.POST, RequestMethod.PUT}) // 解决 uni-app 不支持 Put 上传文件的问题
@RequestMapping(value = "/update-avatar", method = {RequestMethod.POST, RequestMethod.PUT})
// 解决 uni-app 不支持 Put 上传文件的问题
@Operation(summary = "上传用户个人头像")
public CommonResult<String> updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception {
if (file.isEmpty()) {

View File

@ -34,7 +34,7 @@ public class AppDictDataController {
// 无需添加权限认证,因为前端全局都需要
@PermitAll
public void getAgreement(@PathVariable Integer type, HttpServletResponse response) throws IOException {
response.setHeader("Content-Type","text/html;charset=UTF-8");
response.setHeader("Content-Type", "text/html;charset=UTF-8");
DictDataRespVO dict = dictDataService.getAgreement(type);
PrintWriter writer = response.getWriter();
writer.write(dict.getValue());
@ -47,7 +47,7 @@ public class AppDictDataController {
// 无需添加权限认证,因为前端全局都需要
@PermitAll
public void getStream(@RequestParam("dictType") String dictType, @RequestParam("label") String label, HttpServletResponse response) throws IOException {
response.setHeader("Content-Type","text/html;charset=UTF-8");
response.setHeader("Content-Type", "text/html;charset=UTF-8");
String value = DictFrameworkUtils.parseDictDataValue(dictType, label);
PrintWriter writer = response.getWriter();
writer.write(value);

View File

@ -27,10 +27,10 @@ public interface AuthConvert {
default AuthPermissionInfoRespVO convert(AdminUserDO user, List<RoleDO> roleList, List<MenuDO> menuList) {
return AuthPermissionInfoRespVO.builder()
.user(AuthPermissionInfoRespVO.UserVO.builder().id(user.getId()).nickname(user.getNickname()).avatar(user.getAvatar()).build())
.roles(CollectionUtils.convertSet(roleList, RoleDO::getCode))
.permissions(CollectionUtils.convertSet(menuList, MenuDO::getPermission))
.build();
.user(AuthPermissionInfoRespVO.UserVO.builder().id(user.getId()).nickname(user.getNickname()).avatar(user.getAvatar()).build())
.roles(CollectionUtils.convertSet(roleList, RoleDO::getCode))
.permissions(CollectionUtils.convertSet(menuList, MenuDO::getPermission))
.build();
}
AuthMenuRespVO convertTreeNode(MenuDO menu);
@ -54,7 +54,7 @@ public interface AuthConvert {
AuthMenuRespVO parentNode = treeNodeMap.get(childNode.getParentId());
if (parentNode == null) {
LoggerFactory.getLogger(getClass()).error("[buildRouterTree][resource({}) 找不到父资源({})]",
childNode.getId(), childNode.getParentId());
childNode.getId(), childNode.getParentId());
return;
}
// 将自己添加到父节点中

View File

@ -31,6 +31,7 @@ public interface OAuth2OpenConvert {
respVO.setScope(OAuth2Utils.buildScopeStr(bean.getScopes()));
return respVO;
}
OAuth2OpenAccessTokenRespVO convert0(OAuth2AccessTokenDO bean);
default OAuth2OpenCheckTokenRespVO convert2(OAuth2AccessTokenDO bean) {
@ -39,6 +40,7 @@ public interface OAuth2OpenConvert {
respVO.setUserType(UserTypeEnum.ADMIN.getValue());
return respVO;
}
OAuth2OpenCheckTokenRespVO convert3(OAuth2AccessTokenDO bean);
default OAuth2OpenAuthorizeInfoRespVO convert(OAuth2ClientDO client, List<OAuth2ApproveDO> approves) {

View File

@ -17,7 +17,9 @@ public interface OAuth2UserConvert {
OAuth2UserConvert INSTANCE = Mappers.getMapper(OAuth2UserConvert.class);
OAuth2UserInfoRespVO convert(AdminUserDO bean);
OAuth2UserInfoRespVO.Dept convert(DeptDO dept);
List<OAuth2UserInfoRespVO.Post> convertList(List<PostDO> list);
UserProfileUpdateReqVO convert(OAuth2UserUpdateReqVO bean);

View File

@ -1,6 +1,6 @@
/**
* 提供 POJO 类的实体转换
*
* <p>
* 目前使用 MapStruct 框架
*/
package co.yixiang.yshop.module.system.convert;

View File

@ -32,7 +32,7 @@ public class DeptDO extends TenantBaseDO {
private String name;
/**
* 父部门ID
*
* <p>
* 关联 {@link #id}
*/
private Long parentId;
@ -42,7 +42,7 @@ public class DeptDO extends TenantBaseDO {
private Integer sort;
/**
* 负责人
*
* <p>
* 关联 {@link AdminUserDO#getId()}
*/
private Long leaderUserId;
@ -56,7 +56,7 @@ public class DeptDO extends TenantBaseDO {
private String email;
/**
* 部门状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -38,7 +38,7 @@ public class PostDO extends BaseDO {
private Integer sort;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -26,13 +26,13 @@ public class UserPostDO extends BaseDO {
private Long id;
/**
* 用户 ID
*
* <p>
* 关联 {@link AdminUserDO#getId()}
*/
private Long userId;
/**
* 角色 ID
*
* <p>
* 关联 {@link PostDO#getId()}
*/
private Long postId;

View File

@ -36,19 +36,19 @@ public class DictDataDO extends BaseDO {
private String value;
/**
* 字典类型
*
* <p>
* 冗余 {@link DictDataDO#getDictType()}
*/
private String dictType;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
/**
* 颜色类型
*
* <p>
* 对应到 element-ui 为 default、primary、success、info、warning、danger
*/
private String colorType;

View File

@ -40,7 +40,7 @@ public class DictTypeDO extends BaseDO {
private String type;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -28,7 +28,7 @@ public class ErrorCodeDO extends BaseDO {
private Long id;
/**
* 错误码类型
*
* <p>
* 枚举 {@link ErrorCodeTypeEnum}
*/
private Integer type;

View File

@ -12,7 +12,7 @@ import lombok.ToString;
/**
* 登录日志表
*
* <p>
* 注意,包括登录和登出两种行为
*
* @author yshop
@ -30,7 +30,7 @@ public class LoginLogDO extends BaseDO {
private Long id;
/**
* 日志类型
*
* <p>
* 枚举 {@link LoginLogTypeEnum}
*/
private Integer logType;
@ -44,19 +44,19 @@ public class LoginLogDO extends BaseDO {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
/**
* 用户账号
*
* <p>
* 冗余,因为账号可以变更
*/
private String username;
/**
* 登录结果
*
* <p>
* 枚举 {@link LoginResultEnum}
*/
private Integer result;

View File

@ -43,19 +43,19 @@ public class OperateLogDO extends BaseDO {
private Long id;
/**
* 链路追踪编号
*
* <p>
* 一般来说通过链路追踪编号可以将访问日志错误日志链路追踪日志logger 打印日志等,结合在一起,从而进行排错。
*/
private String traceId;
/**
* 用户编号
*
* <p>
* 关联 MemberUserDO 的 id 属性,或者 AdminUserDO 的 id 属性
*/
private Long userId;
/**
* 用户类型
*
* <p>
* 关联 {@link UserTypeEnum}
*/
private Integer userType;
@ -69,7 +69,7 @@ public class OperateLogDO extends BaseDO {
private String name;
/**
* 操作分类
*
* <p>
* 枚举 {@link OperateTypeEnum}
*/
private Integer type;
@ -108,10 +108,10 @@ public class OperateLogDO extends BaseDO {
private String javaMethod;
/**
* Java 方法的参数
*
* <p>
* 实际格式为 Map<String, Object>
* 不使用 @TableField(typeHandler = FastjsonTypeHandler.class) 注解的原因是,数据库存储有长度限制,会进行裁剪,会导致 JSON 反序列化失败
* 其中key 为参数名value 为参数值
* 不使用 @TableField(typeHandler = FastjsonTypeHandler.class) 注解的原因是,数据库存储有长度限制,会进行裁剪,会导致 JSON 反序列化失败
* 其中key 为参数名value 为参数值
*/
private String javaMethodArgs;
/**
@ -124,19 +124,19 @@ public class OperateLogDO extends BaseDO {
private Integer duration;
/**
* 结果码
*
* <p>
* 目前使用的 {@link CommonResult#getCode()} 属性
*/
private Integer resultCode;
/**
* 结果提示
*
* <p>
* 目前使用的 {@link CommonResult#getMsg()} 属性
*/
private String resultMsg;
/**
* 结果数据
*
* <p>
* 如果是对象,则使用 JSON 格式化
*/
private String resultData;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
/**
* 邮箱账号 DO
*
* <p>
* 用途:配置发送邮箱的账号
*
* @author wangjingyi

View File

@ -39,7 +39,7 @@ public class MailLogDO extends BaseDO implements Serializable {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
@ -50,13 +50,13 @@ public class MailLogDO extends BaseDO implements Serializable {
/**
* 邮箱账号编号
*
* <p>
* 关联 {@link MailAccountDO#getId()}
*/
private Long accountId;
/**
* 发送邮箱地址
*
* <p>
* 冗余 {@link MailAccountDO#getMail()}
*/
private String fromMail;
@ -64,19 +64,19 @@ public class MailLogDO extends BaseDO implements Serializable {
// ========= 模板相关字段 =========
/**
* 模版编号
*
* <p>
* 关联 {@link MailTemplateDO#getId()}
*/
private Long templateId;
/**
* 模版编码
*
* <p>
* 冗余 {@link MailTemplateDO#getCode()}
*/
private String templateCode;
/**
* 模版发送人名称
*
* <p>
* 冗余 {@link MailTemplateDO#getNickname()}
*/
private String templateNickname;
@ -86,13 +86,13 @@ public class MailLogDO extends BaseDO implements Serializable {
private String templateTitle;
/**
* 模版内容
*
* <p>
* 基于 {@link MailTemplateDO#getContent()} 格式化后的内容
*/
private String templateContent;
/**
* 模版参数
*
* <p>
* 基于 {@link MailTemplateDO#getParams()} 输入后的参数
*/
@TableField(typeHandler = JacksonTypeHandler.class)
@ -101,7 +101,7 @@ public class MailLogDO extends BaseDO implements Serializable {
// ========= 发送相关字段 =========
/**
* 发送状态
*
* <p>
* 枚举 {@link MailSendStatusEnum}
*/
private Integer sendStatus;

View File

@ -35,7 +35,7 @@ public class MailTemplateDO extends BaseDO {
private String code;
/**
* 发送的邮箱账号编号
*
* <p>
* 关联 {@link MailAccountDO#getId()}
*/
private Long accountId;
@ -59,7 +59,7 @@ public class MailTemplateDO extends BaseDO {
private List<String> params;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -29,7 +29,7 @@ public class NoticeDO extends BaseDO {
private String title;
/**
* 公告类型
*
* <p>
* 枚举 {@link NoticeTypeEnum}
*/
private Integer type;
@ -39,7 +39,7 @@ public class NoticeDO extends BaseDO {
private String content;
/**
* 公告状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -36,13 +36,13 @@ public class NotifyMessageDO extends BaseDO {
private Long id;
/**
* 用户编号
*
* <p>
* 关联 MemberUserDO 的 id 字段、或者 AdminUserDO 的 id 字段
*/
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
@ -51,37 +51,37 @@ public class NotifyMessageDO extends BaseDO {
/**
* 模版编号
*
* <p>
* 关联 {@link NotifyTemplateDO#getId()}
*/
private Long templateId;
/**
* 模版编码
*
* <p>
* 关联 {@link NotifyTemplateDO#getCode()}
*/
private String templateCode;
/**
* 模版类型
*
* <p>
* 冗余 {@link NotifyTemplateDO#getType()}
*/
private Integer templateType;
/**
* 模版发送人名称
*
* <p>
* 冗余 {@link NotifyTemplateDO#getNickname()}
*/
private String templateNickname;
/**
* 模版内容
*
* <p>
* 基于 {@link NotifyTemplateDO#getContent()} 格式化后的内容
*/
private String templateContent;
/**
* 模版参数
*
* <p>
* 基于 {@link NotifyTemplateDO#getParams()} 输入后的参数
*/
@TableField(typeHandler = JacksonTypeHandler.class)

View File

@ -41,7 +41,7 @@ public class NotifyTemplateDO extends BaseDO {
private String code;
/**
* 模版类型
*
* <p>
* 对应 system_notify_template_type 字典
*/
private Integer type;
@ -60,7 +60,7 @@ public class NotifyTemplateDO extends BaseDO {
private List<String> params;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -15,7 +15,7 @@ import java.util.List;
/**
* OAuth2 访问令牌 DO
*
* <p>
* 如下字段,暂时未使用,暂时不支持:
* user_name、authentication用户信息
*
@ -46,13 +46,13 @@ public class OAuth2AccessTokenDO extends TenantBaseDO {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
/**
* 客户端编号
*
* <p>
* 关联 {@link OAuth2ClientDO#getId()}
*/
private String clientId;

View File

@ -12,7 +12,7 @@ import java.time.LocalDateTime;
/**
* OAuth2 批准 DO
*
* <p>
* 用户在 sso.vue 界面时,记录接受的 scope 列表
*
* @author yshop
@ -34,13 +34,13 @@ public class OAuth2ApproveDO extends BaseDO {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
/**
* 客户端编号
*
* <p>
* 关联 {@link OAuth2ClientDO#getId()}
*/
private String clientId;
@ -50,7 +50,7 @@ public class OAuth2ApproveDO extends BaseDO {
private String scope;
/**
* 是否接受
*
* <p>
* true - 接受
* false - 拒绝
*/

View File

@ -26,7 +26,7 @@ public class OAuth2ClientDO extends BaseDO {
/**
* 编号,数据库自增
*
* <p>
* 由于 SQL Server 在存储 String 主键有点问题,所以暂时使用 Long 类型
*/
@TableId
@ -53,7 +53,7 @@ public class OAuth2ClientDO extends BaseDO {
private String description;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
@ -72,7 +72,7 @@ public class OAuth2ClientDO extends BaseDO {
private List<String> redirectUris;
/**
* 授权类型(模式)
*
* <p>
* 枚举 {@link OAuth2GrantTypeEnum}
*/
@TableField(typeHandler = JacksonTypeHandler.class)
@ -84,7 +84,7 @@ public class OAuth2ClientDO extends BaseDO {
private List<String> scopes;
/**
* 自动授权的 Scope
*
* <p>
* code 授权时,如果 scope 在这个范围内,则自动通过
*/
@TableField(typeHandler = JacksonTypeHandler.class)

View File

@ -37,13 +37,13 @@ public class OAuth2CodeDO extends BaseDO {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
/**
* 客户端编号
*
* <p>
* 关联 {@link OAuth2ClientDO#getClientId()}
*/
private String clientId;

View File

@ -40,13 +40,13 @@ public class OAuth2RefreshTokenDO extends BaseDO {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
/**
* 客户端编号
*
* <p>
* 关联 {@link OAuth2ClientDO#getId()}
*/
private String clientId;

View File

@ -36,10 +36,10 @@ public class MenuDO extends BaseDO {
private String name;
/**
* 权限标识
*
* <p>
* 一般格式为:${系统}:${模块}:${操作}
* 例如说system:admin:add即 system 服务的添加管理员。
*
* <p>
* 当我们把该 MenuDO 赋予给角色后,意味着该角色有该资源:
* - 对于后端,配合 @PreAuthorize 注解,配置 API 接口需要该权限,从而对 API 接口进行权限控制。
* - 对于前端,配合前端标签,配置按钮是否展示,避免用户没有该权限时,结果可以看到该操作。
@ -47,7 +47,7 @@ public class MenuDO extends BaseDO {
private String permission;
/**
* 菜单类型
*
* <p>
* 枚举 {@link MenuTypeEnum}
*/
private Integer type;
@ -61,7 +61,7 @@ public class MenuDO extends BaseDO {
private Long parentId;
/**
* 路由地址
*
* <p>
* 如果 path 为 http(s) 时,则它是外链
*/
private String path;
@ -79,27 +79,27 @@ public class MenuDO extends BaseDO {
private String componentName;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
/**
* 是否可见
*
* <p>
* 只有菜单、目录使用
* 当设置为 true 时,该菜单不会展示在侧边栏,但是路由还是存在。例如说,一些独立的编辑页面 /edit/1024 等等
*/
private Boolean visible;
/**
* 是否缓存
*
* <p>
* 只有菜单、目录使用,否使用 Vue 路由的 keep-alive 特性
* 注意:如果开启缓存,则必须填写 {@link #componentName} 属性,否则无法缓存
*/
private Boolean keepAlive;
/**
* 是否总是显示
*
* <p>
* 如果为 false 时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单
*/
private Boolean alwaysShow;

View File

@ -36,7 +36,7 @@ public class RoleDO extends TenantBaseDO {
private String name;
/**
* 角色标识
*
* <p>
* 枚举
*/
private String code;
@ -46,13 +46,13 @@ public class RoleDO extends TenantBaseDO {
private Integer sort;
/**
* 角色状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
/**
* 角色类型
*
* <p>
* 枚举 {@link RoleTypeEnum}
*/
private Integer type;
@ -63,13 +63,13 @@ public class RoleDO extends TenantBaseDO {
/**
* 数据范围
*
* <p>
* 枚举 {@link DataScopeEnum}
*/
private Integer dataScope;
/**
* 数据范围(指定部门数组)
*
* <p>
* 适用于 {@link #dataScope} 的值为 {@link DataScopeEnum#DEPT_CUSTOM} 时
*/
@TableField(typeHandler = JsonLongSetTypeHandler.class)

View File

@ -41,7 +41,7 @@ public class SensitiveWordDO extends BaseDO {
private String description;
/**
* 标签数组
*
* <p>
* 用于实现不同的业务场景下,需要使用不同标签的敏感词。
* 例如说tag 有短信、论坛两种,敏感词 "推广" 在短信下是敏感词,在论坛下不是敏感词。
* 此时,我们会存储一条敏感词记录,它的 name 为"推广"tag 为短信。
@ -50,7 +50,7 @@ public class SensitiveWordDO extends BaseDO {
private List<String> tags;
/**
* 状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -32,13 +32,13 @@ public class SmsChannelDO extends BaseDO {
private String signature;
/**
* 渠道编码
*
* <p>
* 枚举 {@link SmsChannelEnum}
*/
private String code;
/**
* 启用状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -9,7 +9,7 @@ import java.time.LocalDateTime;
/**
* 手机验证码 DO
*
* <p>
* idx_mobile 索引:基于 {@link #mobile} 字段
*
* @author yshop
@ -37,7 +37,7 @@ public class SmsCodeDO extends BaseDO {
private String code;
/**
* 发送场景
*
* <p>
* 枚举 {@link SmsCodeDO}
*/
private Integer scene;

View File

@ -39,13 +39,13 @@ public class SmsLogDO extends BaseDO {
/**
* 短信渠道编号
*
* <p>
* 关联 {@link SmsChannelDO#getId()}
*/
private Long channelId;
/**
* 短信渠道编码
*
* <p>
* 冗余 {@link SmsChannelDO#getCode()}
*/
private String channelCode;
@ -54,19 +54,19 @@ public class SmsLogDO extends BaseDO {
/**
* 模板编号
*
* <p>
* 关联 {@link SmsTemplateDO#getId()}
*/
private Long templateId;
/**
* 模板编码
*
* <p>
* 冗余 {@link SmsTemplateDO#getCode()}
*/
private String templateCode;
/**
* 短信类型
*
* <p>
* 冗余 {@link SmsTemplateDO#getType()}
*/
private Integer templateType;
@ -81,7 +81,7 @@ public class SmsLogDO extends BaseDO {
private Map<String, Object> templateParams;
/**
* 短信 API 的模板编号
*
* <p>
* 冗余 {@link SmsTemplateDO#getApiTemplateId()}
*/
private String apiTemplateId;
@ -98,7 +98,7 @@ public class SmsLogDO extends BaseDO {
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
@ -107,7 +107,7 @@ public class SmsLogDO extends BaseDO {
/**
* 发送状态
*
* <p>
* 枚举 {@link SmsSendStatusEnum}
*/
private Integer sendStatus;
@ -117,20 +117,20 @@ public class SmsLogDO extends BaseDO {
private LocalDateTime sendTime;
/**
* 发送结果的编码
*
* <p>
* 枚举 {@link SmsFrameworkErrorCodeConstants}
*/
private Integer sendCode;
/**
* 发送结果的提示
*
* <p>
* 一般情况下,使用 {@link SmsFrameworkErrorCodeConstants}
* 异常情况下,通过格式化 Exception 的提示存储
*/
private String sendMsg;
/**
* 短信 API 发送结果的编码
*
* <p>
* 由于第三方的错误码可能是字符串,所以使用 String 类型
*/
private String apiSendCode;
@ -140,13 +140,13 @@ public class SmsLogDO extends BaseDO {
private String apiSendMsg;
/**
* 短信 API 发送返回的唯一请求 ID
*
* <p>
* 用于和短信 API 进行定位于排错
*/
private String apiRequestId;
/**
* 短信 API 发送返回的序号
*
* <p>
* 用于和短信 API 平台的发送记录关联
*/
private String apiSerialNo;
@ -155,7 +155,7 @@ public class SmsLogDO extends BaseDO {
/**
* 接收状态
*
* <p>
* 枚举 {@link SmsReceiveStatusEnum}
*/
private Integer receiveStatus;

View File

@ -35,13 +35,13 @@ public class SmsTemplateDO extends BaseDO {
/**
* 短信类型
*
* <p>
* 枚举 {@link SmsTemplateTypeEnum}
*/
private Integer type;
/**
* 启用状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
@ -55,7 +55,7 @@ public class SmsTemplateDO extends BaseDO {
private String name;
/**
* 模板内容
*
* <p>
* 内容的参数,使用 {} 包括,例如说 {name}
*/
private String content;
@ -77,13 +77,13 @@ public class SmsTemplateDO extends BaseDO {
/**
* 短信渠道编号
*
* <p>
* 关联 {@link SmsChannelDO#getId()}
*/
private Long channelId;
/**
* 短信渠道编码
*
* <p>
* 冗余 {@link SmsChannelDO#getCode()}
*/
private String channelCode;

View File

@ -29,26 +29,26 @@ public class SocialUserBindDO extends BaseDO {
private Long id;
/**
* 关联的用户编号
*
* <p>
* 关联 UserDO 的编号
*/
private Long userId;
/**
* 用户类型
*
* <p>
* 枚举 {@link UserTypeEnum}
*/
private Integer userType;
/**
* 社交平台的用户编号
*
* <p>
* 关联 {@link SocialUserDO#getId()}
*/
private Long socialUserId;
/**
* 社交平台的类型
*
* <p>
* 冗余 {@link SocialUserDO#getType()}
*/
private Integer socialType;

View File

@ -28,7 +28,7 @@ public class SocialUserDO extends BaseDO {
private Long id;
/**
* 社交平台的类型
*
* <p>
* 枚举 {@link SocialTypeEnum}
*/
private Integer type;

View File

@ -39,7 +39,7 @@ public class TenantDO extends BaseDO {
private String name;
/**
* 联系人的用户编号
*
* <p>
* 关联 {@link AdminUserDO#getId()}
*/
private Long contactUserId;
@ -53,19 +53,19 @@ public class TenantDO extends BaseDO {
private String contactMobile;
/**
* 租户状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
/**
* 绑定域名
*
* <p>
* TODO yshop目前是预留字段未来会支持根据域名自动查询到对应的租户。等等
*/
private String domain;
/**
* 租户套餐编号
*
* <p>
* 关联 {@link TenantPackageDO#getId()}
* 特殊逻辑:系统内置租户,不使用套餐,暂时使用 {@link #PACKAGE_ID_SYSTEM} 标识
*/

View File

@ -35,7 +35,7 @@ public class TenantPackageDO extends BaseDO {
private String name;
/**
* 租户套餐状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -39,7 +39,7 @@ public class AdminUserDO extends TenantBaseDO {
private String username;
/**
* 加密后的密码
*
* <p>
* 因为目前使用 {@link BCryptPasswordEncoder} 加密器,所以无需自己处理 salt 盐
*/
private String password;
@ -70,7 +70,7 @@ public class AdminUserDO extends TenantBaseDO {
private String mobile;
/**
* 用户性别
*
* <p>
* 枚举类 {@link SexEnum}
*/
private Integer sex;
@ -80,7 +80,7 @@ public class AdminUserDO extends TenantBaseDO {
private String avatar;
/**
* 帐号状态
*
* <p>
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -51,5 +51,5 @@ public interface DictDataMapper extends BaseMapperX<DictDataDO> {
}
@Update("update system_dict_data set value = #{value} where label = #{label}")
void updateDictByLabel(@Param("label") String label,@Param("value") String value);
void updateDictByLabel(@Param("label") String label, @Param("value") String value);
}

View File

@ -14,7 +14,7 @@ public interface MailAccountMapper extends BaseMapperX<MailAccountDO> {
default PageResult<MailAccountDO> selectPage(MailAccountPageReqVO pageReqVO) {
return selectPage(pageReqVO, new LambdaQueryWrapperX<MailAccountDO>()
.likeIfPresent(MailAccountDO::getMail, pageReqVO.getMail())
.likeIfPresent(MailAccountDO::getUsername , pageReqVO.getUsername()));
.likeIfPresent(MailAccountDO::getUsername, pageReqVO.getUsername()));
}
}

View File

@ -15,8 +15,8 @@ import java.util.Date;
@Mapper
public interface MailTemplateMapper extends BaseMapperX<MailTemplateDO> {
default PageResult<MailTemplateDO> selectPage(MailTemplatePageReqVO pageReqVO){
return selectPage(pageReqVO , new LambdaQueryWrapperX<MailTemplateDO>()
default PageResult<MailTemplateDO> selectPage(MailTemplatePageReqVO pageReqVO) {
return selectPage(pageReqVO, new LambdaQueryWrapperX<MailTemplateDO>()
.eqIfPresent(MailTemplateDO::getStatus, pageReqVO.getStatus())
.likeIfPresent(MailTemplateDO::getCode, pageReqVO.getCode())
.likeIfPresent(MailTemplateDO::getName, pageReqVO.getName())

View File

@ -3,7 +3,7 @@
* 1. data object数据对象
* 2. redisRedis 的 CRUD 操作
* 3. mysqlMySQL 的 CRUD 操作
*
* <p>
* 其中MySQL 的表以 system_ 作为前缀
*/
package co.yixiang.yshop.module.system.dal.mysql;

View File

@ -12,8 +12,8 @@ public interface SmsCodeMapper extends BaseMapperX<SmsCodeDO> {
* 获得手机号的最后一个手机验证码
*
* @param mobile 手机号
* @param scene 发送场景,选填
* @param code 验证码 选填
* @param scene 发送场景,选填
* @param code 验证码 选填
* @return 手机验证码
*/
default SmsCodeDO selectLastByMobile(String mobile, String code, Integer scene) {

View File

@ -42,11 +42,11 @@ public class MailProducer {
* 发送 {@link MailSendMessage} 消息
*
* @param sendLogId 发送日志编码
* @param mail 接收邮件地址
* @param mail 接收邮件地址
* @param accountId 邮件账号编号
* @param nickname 邮件发件人
* @param title 邮件标题
* @param content 邮件内容
* @param nickname 邮件发件人
* @param title 邮件标题
* @param content 邮件内容
*/
public void sendMailSendMessage(Long sendLogId, String mail, Long accountId,
String nickname, String title, String content) {

View File

@ -43,10 +43,10 @@ public class SmsProducer {
/**
* 发送 {@link SmsSendMessage} 消息
*
* @param logId 短信日志编号
* @param mobile 手机号
* @param channelId 渠道编号
* @param apiTemplateId 短信模板编号
* @param logId 短信日志编号
* @param mobile 手机号
* @param channelId 渠道编号
* @param apiTemplateId 短信模板编号
* @param templateParams 短信模板参数
*/
public void sendSmsSendMessage(Long logId, String mobile,

View File

@ -1,7 +1,7 @@
/**
* system 模块下,我们放通用业务,支撑上层的核心业务。
* 例如说:用户、部门、权限、数据字典等等
*
* <p>
* 1. Controller URL以 /system/ 开头,避免和其它 Module 冲突
* 2. DataObject 表名:以 system_ 开头,方便在数据库中区分
*/

View File

@ -7,7 +7,7 @@ import javax.validation.Valid;
/**
* 管理后台的认证 Service 接口
*
* <p>
* 提供用户的登录、登出的能力
*
* @author yshop
@ -34,7 +34,7 @@ public interface AdminAuthService {
/**
* 基于 token 退出登录
*
* @param token token
* @param token token
* @param logType 登出类型
*/
void logout(String token, Integer logType);
@ -52,7 +52,7 @@ public interface AdminAuthService {
* @param reqVO 登录信息
* @return 登录结果
*/
AuthLoginRespVO smsLogin(AuthSmsLoginReqVO reqVO) ;
AuthLoginRespVO smsLogin(AuthSmsLoginReqVO reqVO);
/**
* 社交快捷登录,使用 code 授权码

View File

@ -13,6 +13,7 @@ import co.yixiang.yshop.module.system.dal.dataobject.backup.BackupRecordDO;
public interface BackupRecordService {
PageResult<BackupRecordRespVO> backupPageList(BackupPageReqVO pageVO);
void backup();
void revertBackup();

View File

@ -57,7 +57,7 @@ public interface DeptService {
/**
* 获得所有子部门,从缓存中
*
* @param parentId 部门编号
* @param parentId 部门编号
* @param recursive 是否递归获取所有
* @return 子部门列表
*/

View File

@ -40,7 +40,7 @@ public class DeptServiceImpl implements DeptService {
/**
* 部门缓存
* key部门编号 {@link DeptDO#getId()}
*
* <p>
* 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向
*/
@Getter
@ -49,7 +49,7 @@ public class DeptServiceImpl implements DeptService {
* 父部门缓存
* key部门编号 {@link DeptDO#getParentId()}
* value: 直接子部门列表
*
* <p>
* 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向
*/
@Getter
@ -140,19 +140,19 @@ public class DeptServiceImpl implements DeptService {
}
List<DeptDO> result = new ArrayList<>();
// 递归,简单粗暴
getDeptsByParentIdFromCache(result, parentId,
recursive ? Integer.MAX_VALUE : 1, // 如果递归获取,则无限;否则,只递归 1 次
parentDeptCache);
getDeptsByParentIdFromCache(result, parentId,
recursive ? Integer.MAX_VALUE : 1, // 如果递归获取,则无限;否则,只递归 1 次
parentDeptCache);
return result;
}
/**
* 递归获取所有的子部门,添加到 result 结果
*
* @param result 结果
* @param parentId 父编号
* @param result 结果
* @param parentId 父编号
* @param recursiveCount 递归次数
* @param parentDeptMap 父部门 Map使用缓存避免变化
* @param parentDeptMap 父部门 Map使用缓存避免变化
*/
private void getDeptsByParentIdFromCache(List<DeptDO> result, Long parentId, int recursiveCount,
Multimap<Long, DeptDO> parentDeptMap) {

View File

@ -56,7 +56,7 @@ public interface PostService {
/**
* 获得符合条件的岗位列表
*
* @param ids 岗位编号数组。如果为空,不进行筛选
* @param ids 岗位编号数组。如果为空,不进行筛选
* @param statuses 状态数组。如果为空,不进行筛选
* @return 部门列表
*/

View File

@ -81,7 +81,7 @@ public interface DictDataService {
* 2. 字典数据被禁用
*
* @param dictType 字典类型
* @param values 字典数据值的数组
* @param values 字典数据值的数组
*/
void validateDictDataList(String dictType, Collection<String> values);
@ -89,7 +89,7 @@ public interface DictDataService {
* 获得指定的字典数据
*
* @param dictType 字典类型
* @param value 字典数据值
* @param value 字典数据值
* @return 字典数据
*/
DictDataDO getDictData(String dictType, String value);
@ -98,7 +98,7 @@ public interface DictDataService {
* 解析获得指定的字典数据,从缓存中
*
* @param dictType 字典类型
* @param label 字典数据标签
* @param label 字典数据标签
* @return 字典数据
*/
DictDataDO parseDictData(String dictType, String label);
@ -113,6 +113,7 @@ public interface DictDataService {
/**
* 获得用户默认头像
*
* @return
*/
DictDataRespVO getDefaultHead();
@ -121,7 +122,7 @@ public interface DictDataService {
* 解析获得指定的字典数据,从缓存中
*
* @param dictType 字典类型
* @param label 字典数据标签
* @param label 字典数据标签
* @return 字典数据
*/
String getDictDataStr(String dictType, String label);
@ -130,7 +131,7 @@ public interface DictDataService {
* 解析获得指定的字典数据,从缓存中
*
* @param dictType 字典类型
* @param label 字典数据标签
* @param label 字典数据标签
* @return 字典数据
*/
Integer getDictDataInt(String dictType, String label);

View File

@ -193,9 +193,9 @@ public class DictDataServiceImpl implements DictDataService {
}
@Override
public DictDataRespVO getDefaultHead(){
public DictDataRespVO getDefaultHead() {
LambdaQueryWrapper<DictDataDO> qw = new LambdaQueryWrapper<>();
DictDataDO dictDataDO = dictDataMapper.selectOne(qw.eq(DictDataDO::getLabel,DEFAULT_HEAD));
DictDataDO dictDataDO = dictDataMapper.selectOne(qw.eq(DictDataDO::getLabel, DEFAULT_HEAD));
return DictDataConvert.INSTANCE.convert(dictDataDO);
}
@ -232,6 +232,6 @@ public class DictDataServiceImpl implements DictDataService {
@Override
public void updateDictByLabel(String label, String value) {
dictDataMapper.updateDictByLabel(label,value);
dictDataMapper.updateDictByLabel(label, value);
}
}

View File

@ -29,11 +29,11 @@ public interface ErrorCodeService {
/**
* 增量获得错误码数组
*
* <p>
* 如果 minUpdateTime 为空时,则获取所有错误码
*
* @param applicationName 应用名
* @param minUpdateTime 最小更新时间
* @param minUpdateTime 最小更新时间
* @return 错误码数组
*/
List<ErrorCodeRespDTO> getErrorCodeList(String applicationName, LocalDateTime minUpdateTime);

View File

@ -78,11 +78,11 @@ public class ErrorCodeServiceImpl implements ErrorCodeService {
/**
* 校验错误码的唯一字段是否重复
*
* <p>
* 是否存在相同编码的错误码
*
* @param code 错误码编码
* @param id 错误码编号
* @param id 错误码编号
*/
@VisibleForTesting
public void validateCodeDuplicate(Integer code, Long id) {

View File

@ -45,7 +45,7 @@ public class MailAccountServiceImpl implements MailAccountService {
/**
* 邮箱账号缓存
* key邮箱账号编码 {@link MailAccountDO#getId()}
*
* <p>
* 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向
*/
@Getter

View File

@ -35,24 +35,24 @@ public interface MailLogService {
/**
* 创建邮件日志
*
* @param userId 用户编码
* @param userType 用户类型
* @param toMail 收件人邮件
* @param account 邮件账号信息
* @param template 模版信息
* @param userId 用户编码
* @param userType 用户类型
* @param toMail 收件人邮件
* @param account 邮件账号信息
* @param template 模版信息
* @param templateContent 模版内容
* @param templateParams 模版参数
* @param isSend 是否发送成功
* @param templateParams 模版参数
* @param isSend 是否发送成功
* @return 日志编号
*/
Long createMailLog(Long userId, Integer userType, String toMail,
MailAccountDO account, MailTemplateDO template ,
MailAccountDO account, MailTemplateDO template,
String templateContent, Map<String, Object> templateParams, Boolean isSend);
/**
* 更新邮件发送结果
*
* @param logId 日志编号
* @param logId 日志编号
* @param messageId 发送后的消息编号
* @param exception 发送异常
*/

View File

@ -47,7 +47,7 @@ public class MailLogServiceImpl implements MailLogService {
MailLogDO.MailLogDOBuilder logDOBuilder = MailLogDO.builder();
// 根据是否要发送,设置状态
logDOBuilder.sendStatus(Objects.equals(isSend, true) ? MailSendStatusEnum.INIT.getStatus()
: MailSendStatusEnum.IGNORE.getStatus())
: MailSendStatusEnum.IGNORE.getStatus())
// 用户信息
.userId(userId).userType(userType).toMail(toMail)
.accountId(account.getId()).fromMail(account.getMail())

View File

@ -15,9 +15,9 @@ public interface MailSendService {
/**
* 发送单条邮件给管理后台的用户
*
* @param mail 邮箱
* @param userId 用户编码
* @param templateCode 邮件模版编码
* @param mail 邮箱
* @param userId 用户编码
* @param templateCode 邮件模版编码
* @param templateParams 邮件模版参数
* @return 发送日志编号
*/
@ -27,9 +27,9 @@ public interface MailSendService {
/**
* 发送单条邮件给用户 APP 的用户
*
* @param mail 邮箱
* @param userId 用户编码
* @param templateCode 邮件模版编码
* @param mail 邮箱
* @param userId 用户编码
* @param templateCode 邮件模版编码
* @param templateParams 邮件模版参数
* @return 发送日志编号
*/
@ -39,10 +39,10 @@ public interface MailSendService {
/**
* 发送单条邮件给用户
*
* @param mail 邮箱
* @param userId 用户编码
* @param userType 用户类型
* @param templateCode 邮件模版编码
* @param mail 邮箱
* @param userId 用户编码
* @param userType 用户类型
* @param templateCode 邮件模版编码
* @param templateParams 邮件模版参数
* @return 发送日志编号
*/

View File

@ -104,11 +104,11 @@ public class MailSendServiceImpl implements MailSendService {
public void doSendMail(MailSendMessage message) {
// 1. 创建发送账号
MailAccountDO account = validateMailAccount(message.getAccountId());
MailAccount mailAccount = MailAccountConvert.INSTANCE.convert(account, message.getNickname());
MailAccount mailAccount = MailAccountConvert.INSTANCE.convert(account, message.getNickname());
// 2. 发送邮件
try {
String messageId = MailUtil.send(mailAccount, message.getMail(),
message.getTitle(), message.getContent(),true);
message.getTitle(), message.getContent(), true);
// 3. 更新结果(成功)
mailLogService.updateMailSendResult(message.getLogId(), messageId, null);
} catch (Exception e) {
@ -150,7 +150,7 @@ public class MailSendServiceImpl implements MailSendService {
/**
* 校验邮件参数是否确实
*
* @param template 邮箱模板
* @param template 邮箱模板
* @param templateParams 参数列表
*/
@VisibleForTesting

View File

@ -80,7 +80,7 @@ public interface MailTemplateService {
* 邮件模版内容合成
*
* @param content 邮件模版
* @param params 合成参数
* @param params 合成参数
* @return 格式化后的内容
*/
String formatMailTemplateContent(String content, Map<String, Object> params);

View File

@ -53,7 +53,7 @@ public class MailTemplateServiceImpl implements MailTemplateService {
/**
* 邮件模板缓存
* key邮件模版标识 {@link MailTemplateDO#getCode()}
*
* <p>
* 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向
*/
@Getter
@ -89,7 +89,7 @@ public class MailTemplateServiceImpl implements MailTemplateService {
// 校验是否存在
validateMailTemplateExists(updateReqVO.getId());
// 校验 code 是否唯一
validateCodeUnique(updateReqVO.getId(),updateReqVO.getCode());
validateCodeUnique(updateReqVO.getId(), updateReqVO.getCode());
// 更新
MailTemplateDO updateObj = MailTemplateConvert.INSTANCE.convert(updateReqVO)
@ -130,7 +130,9 @@ public class MailTemplateServiceImpl implements MailTemplateService {
}
@Override
public MailTemplateDO getMailTemplate(Long id) {return mailTemplateMapper.selectById(id);}
public MailTemplateDO getMailTemplate(Long id) {
return mailTemplateMapper.selectById(id);
}
@Override
public PageResult<MailTemplateDO> getMailTemplatePage(MailTemplatePageReqVO pageReqVO) {
@ -138,7 +140,9 @@ public class MailTemplateServiceImpl implements MailTemplateService {
}
@Override
public List<MailTemplateDO> getMailTemplateList() {return mailTemplateMapper.selectList();}
public List<MailTemplateDO> getMailTemplateList() {
return mailTemplateMapper.selectList();
}
@Override
public MailTemplateDO getMailTemplateByCodeFromCache(String code) {

View File

@ -20,11 +20,11 @@ public interface NotifyMessageService {
/**
* 创建站内信
*
* @param userId 用户编号
* @param userType 用户类型
* @param template 模版信息
* @param userId 用户编号
* @param userType 用户类型
* @param template 模版信息
* @param templateContent 模版内容
* @param templateParams 模版参数
* @param templateParams 模版参数
* @return 站内信编号
*/
Long createNotifyMessage(Long userId, Integer userType,
@ -42,8 +42,8 @@ public interface NotifyMessageService {
* 获得【我的】站内信分页
*
* @param pageReqVO 分页查询
* @param userId 用户编号
* @param userType 用户类型
* @param userId 用户编号
* @param userType 用户类型
* @return 站内信分页
*/
PageResult<NotifyMessageDO> getMyMyNotifyMessagePage(NotifyMessageMyPageReqVO pageReqVO, Long userId, Integer userType);
@ -78,8 +78,8 @@ public interface NotifyMessageService {
/**
* 标记站内信为已读
*
* @param ids 站内信编号集合
* @param userId 用户编号
* @param ids 站内信编号集合
* @param userId 用户编号
* @param userType 用户类型
* @return 更新到的条数
*/

View File

@ -12,23 +12,24 @@ public interface NotifySendService {
/**
* 发送单条站内信给管理后台的用户
*
* <p>
* 在 mobile 为空时,使用 userId 加载对应管理员的手机号
*
* @param userId 用户编号
* @param templateCode 短信模板编号
* @param userId 用户编号
* @param templateCode 短信模板编号
* @param templateParams 短信模板参数
* @return 发送日志编号
*/
Long sendSingleNotifyToAdmin(Long userId,
String templateCode, Map<String, Object> templateParams);
/**
* 发送单条站内信给用户 APP 的用户
*
* <p>
* 在 mobile 为空时,使用 userId 加载对应会员的手机号
*
* @param userId 用户编号
* @param templateCode 站内信模板编号
* @param userId 用户编号
* @param templateCode 站内信模板编号
* @param templateParams 站内信模板参数
* @return 发送日志编号
*/
@ -38,17 +39,17 @@ public interface NotifySendService {
/**
* 发送单条站内信给用户
*
* @param userId 用户编号
* @param userType 用户类型
* @param templateCode 站内信模板编号
* @param userId 用户编号
* @param userType 用户类型
* @param templateCode 站内信模板编号
* @param templateParams 站内信模板参数
* @return 发送日志编号
*/
Long sendSingleNotify( Long userId, Integer userType,
String templateCode, Map<String, Object> templateParams);
Long sendSingleNotify(Long userId, Integer userType,
String templateCode, Map<String, Object> templateParams);
default void sendBatchNotify(List<String> mobiles, List<Long> userIds, Integer userType,
String templateCode, Map<String, Object> templateParams) {
String templateCode, Map<String, Object> templateParams) {
throw new UnsupportedOperationException("暂时不支持该操作,感兴趣可以实现该功能哟!");
}

View File

@ -71,7 +71,7 @@ public class NotifySendServiceImpl implements NotifySendService {
/**
* 校验站内信模版参数是否确实
*
* @param template 邮箱模板
* @param template 邮箱模板
* @param templateParams 参数列表
*/
@VisibleForTesting

View File

@ -71,7 +71,7 @@ public interface NotifyTemplateService {
* 格式化站内信内容
*
* @param content 站内信模板的内容
* @param params 站内信内容的参数
* @param params 站内信内容的参数
* @return 格式化后的内容
*/
String formatNotifyTemplateContent(String content, Map<String, Object> params);

View File

@ -8,7 +8,7 @@ import java.util.Map;
/**
* OAuth2 批准 Service 接口
*
* <p>
* 从功能上,和 Spring Security OAuth 的 ApprovalStoreUserApprovalHandler 的功能,记录用户针对指定客户端的授权,减少手动确定。
*
* @author yshop
@ -17,12 +17,12 @@ public interface OAuth2ApproveService {
/**
* 获得指定用户,针对指定客户端的指定授权,是否通过
*
* <p>
* 参考 ApprovalStoreUserApprovalHandler 的 checkForPreApproval 方法
*
* @param userId 用户编号
* @param userType 用户类型
* @param clientId 客户端编号
* @param userId 用户编号
* @param userType 用户类型
* @param clientId 客户端编号
* @param requestedScopes 授权范围
* @return 是否授权通过
*/
@ -31,9 +31,9 @@ public interface OAuth2ApproveService {
/**
* 在用户发起批准时,基于 scopes 的选项,计算最终是否通过
*
* @param userId 用户编号
* @param userType 用户类型
* @param clientId 客户端编号
* @param userId 用户编号
* @param userType 用户类型
* @param clientId 客户端编号
* @param requestedScopes 授权范围
* @return 是否授权通过
*/
@ -42,7 +42,7 @@ public interface OAuth2ApproveService {
/**
* 获得用户的批准列表,排除已过期的
*
* @param userId 用户编号
* @param userId 用户编号
* @param userType 用户类型
* @param clientId 客户端编号
* @return 是否授权通过

Some files were not shown because too many files have changed in this diff Show More