diff --git a/dao/src/main/java/cn/bunny/dao/dto/email/EmailTemplateDto.java b/dao/src/main/java/cn/bunny/dao/dto/email/EmailTemplateDto.java index e890cf4..506e2b3 100644 --- a/dao/src/main/java/cn/bunny/dao/dto/email/EmailTemplateDto.java +++ b/dao/src/main/java/cn/bunny/dao/dto/email/EmailTemplateDto.java @@ -1,4 +1,4 @@ -package cn.bunny.dto.email; +package cn.bunny.dao.dto.email; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; diff --git a/dao/src/main/java/cn/bunny/dao/dto/email/EmailUsersDto.java b/dao/src/main/java/cn/bunny/dao/dto/email/EmailUsersDto.java index 8953864..ad00813 100644 --- a/dao/src/main/java/cn/bunny/dao/dto/email/EmailUsersDto.java +++ b/dao/src/main/java/cn/bunny/dao/dto/email/EmailUsersDto.java @@ -1,4 +1,4 @@ -package cn.bunny.dto.email; +package cn.bunny.dao.dto.email; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; diff --git a/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nDto.java b/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nDto.java new file mode 100644 index 0000000..4bbea7d --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nDto.java @@ -0,0 +1,22 @@ +package cn.bunny.dao.dto.i18n; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "I18nDto对象", title = "多语言分页查询", description = "多语言分页查询") +public class I18nDto { + + @Schema(name = "keyName", title = "多语言key") + private Integer keyName; + + @Schema(name = "translation", title = "多语言翻译名称") + private String translation; + +} \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nTypeAddDto.java b/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nTypeAddDto.java new file mode 100644 index 0000000..5005d64 --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nTypeAddDto.java @@ -0,0 +1,29 @@ +package cn.bunny.dao.dto.i18n; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "I18nTypeAddDto对象", title = "多语言类型添加", description = "多语言类型添加内容") +public class I18nTypeAddDto { + + @Schema(name = "typeName", title = "多语言类型(比如zh,en)") + @NotBlank(message = "多语言类型不能为空") + private String typeName; + + @Schema(name = "summary", title = "名称解释(比如中文,英文)") + @NotBlank(message = "名称解释不能为空") + private String summary; + + @Schema(name = "isDefault", title = "是否为默认") + private Boolean isDefault = false; + +} + diff --git a/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nTypeUpdateDto.java b/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nTypeUpdateDto.java new file mode 100644 index 0000000..f3dc022 --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/dto/i18n/I18nTypeUpdateDto.java @@ -0,0 +1,32 @@ +package cn.bunny.dao.dto.i18n; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "I18nTypeUpdateDto对象", title = "多语言类型更新", description = "多语言类型更新内容") +public class I18nTypeUpdateDto { + + @Schema(name = "id", title = "主键") + @NotBlank(message = "id不能为空") + private Long id; + + @Schema(name = "typeName", title = "多语言类型(比如zh,en)") + @NotBlank(message = "多语言类型不能为空") + private String typeName; + + @Schema(name = "summary", title = "名称解释(比如中文,英文)") + @NotBlank(message = "名称解释不能为空") + private String summary; + + @Schema(name = "isDefault", title = "是否为默认") + private Boolean isDefault = false; + +} \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/dto/menuIcon/MenuIconDto.java b/dao/src/main/java/cn/bunny/dao/dto/menuIcon/MenuIconDto.java new file mode 100644 index 0000000..90e710d --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/dto/menuIcon/MenuIconDto.java @@ -0,0 +1,19 @@ +package cn.bunny.dao.dto.menuIcon; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "MenuIconDto对象", title = "系统菜单图标分页查询对象", description = "系统菜单图标分页查询对象") +public class MenuIconDto { + + @Schema(name = "iconName", title = "icon 名称") + private String iconName; + +} diff --git a/dao/src/main/java/cn/bunny/dao/entity/i18n/I18n.java b/dao/src/main/java/cn/bunny/dao/entity/i18n/I18n.java index 893ea12..6d386ef 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/i18n/I18n.java +++ b/dao/src/main/java/cn/bunny/dao/entity/i18n/I18n.java @@ -2,8 +2,7 @@ package cn.bunny.dao.entity.i18n; import cn.bunny.dao.entity.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -20,16 +19,16 @@ import lombok.experimental.Accessors; @Setter @Accessors(chain = true) @TableName("sys_i18n") -@ApiModel(value = "I18n对象", description = "多语言表") +@Schema(name = "I18n对象", title = "多语言表", description = "多语言表") public class I18n extends BaseEntity { - @ApiModelProperty("多语言key") - private Integer keyName; + @Schema(name = "keyName", title = "多语言key") + private String keyName; - @ApiModelProperty("多语言翻译名称") + @Schema(name = "translation", title = "多语言翻译名称") private String translation; - @ApiModelProperty("多语言类型id") + @Schema(name = "typeId", title = "多语言类型id") private Long typeId; } diff --git a/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nType.java b/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nType.java index 4ca2dd1..2bca155 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nType.java +++ b/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nType.java @@ -2,8 +2,7 @@ package cn.bunny.dao.entity.i18n; import cn.bunny.dao.entity.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -20,13 +19,16 @@ import lombok.experimental.Accessors; @Setter @Accessors(chain = true) @TableName("sys_i18n_type") -@ApiModel(value = "I18nType对象", description = "多语言类型表") +@Schema(name = "I18nType对象", title = "多语言类型表", description = "多语言类型表") public class I18nType extends BaseEntity { - @ApiModelProperty("多语言类型(比如zh,en)") + @Schema(name = "typeName", title = "多语言类型(比如zh,en)") private String typeName; - @ApiModelProperty("名称解释(比如中文,英文)") + @Schema(name = "summary", title = "名称解释(比如中文,英文)") private String summary; + @Schema(name = "isDefault", title = "是否为默认") + private Boolean isDefault; + } diff --git a/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nWithI18nType.java b/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nWithI18nType.java new file mode 100644 index 0000000..eb6aa0c --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/entity/i18n/I18nWithI18nType.java @@ -0,0 +1,29 @@ +package cn.bunny.dao.entity.i18n; + +import cn.bunny.dao.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Getter +@Setter +@Accessors(chain = true) +@TableName("sys_i18n") +@Schema(name = "I18nWithI18nType对象", title = "多语言和多语言类型", description = "多语言和多语言类型内容") +public class I18nWithI18nType extends BaseEntity { + + @Schema(name = "keyName", title = "多语言key") + private String keyName; + + @Schema(name = "translation", title = "多语言翻译名称") + private String translation; + + @Schema(name = "typeName", title = "多语言类型(比如zh,en)") + private String typeName; + + @Schema(name = "summary", title = "名称解释(比如中文,英文)") + private String summary; + +} \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/EmailTemplate.java b/dao/src/main/java/cn/bunny/dao/entity/system/EmailTemplate.java index 24b5a7f..0b1165a 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/EmailTemplate.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/EmailTemplate.java @@ -21,6 +21,7 @@ import lombok.experimental.Accessors; @TableName("sys_email_template") @Schema(name = "EmailTemplate对象", title = "邮件模板表", description = "邮件模板表") public class EmailTemplate extends BaseEntity { + @Schema(name = "templateName", title = "模板名称") private String templateName; @@ -35,4 +36,5 @@ public class EmailTemplate extends BaseEntity { @Schema(name = "isDefault", title = "是否默认") private Boolean isDefault; + } \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/MenuIcon.java b/dao/src/main/java/cn/bunny/dao/entity/system/MenuIcon.java index 4e399c2..a71e711 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/MenuIcon.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/MenuIcon.java @@ -13,6 +13,7 @@ import lombok.experimental.Accessors; @TableName("sys_menu_icon") @Schema(name = "MenuIcon对象", title = "系统菜单图标", description = "系统菜单图标") public class MenuIcon extends BaseEntity { + @Schema(name = "iconName", title = "icon 名称") private String iconName; diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/Power.java b/dao/src/main/java/cn/bunny/dao/entity/system/Power.java index 0d2a778..ab2f6ec 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/Power.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/Power.java @@ -12,16 +12,18 @@ import lombok.Setter; @TableName("sys_power") @Schema(name = "Power对象", title = "权限", description = "权限") public class Power extends BaseEntity { + @Schema(name = "parentId", title = "父级id") private Long parentId; @ApiModelProperty("权限编码") + @Schema(name = "parentId", title = "权限编码") private String powerCode; - @ApiModelProperty("权限名称") + @Schema(name = "powerName", title = "权限名称") private String powerName; - @ApiModelProperty("请求路径") + @Schema(name = "requestUrl", title = "请求路径") private String requestUrl; } \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/Role.java b/dao/src/main/java/cn/bunny/dao/entity/system/Role.java index 52e3095..5c435f7 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/Role.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/Role.java @@ -13,6 +13,7 @@ import lombok.experimental.Accessors; @TableName("sys_role") @Schema(name = "Role对象", title = "角色", description = "角色") public class Role extends BaseEntity { + @Schema(name = "roleCode", title = "角色代码") private String roleCode; diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/RolePower.java b/dao/src/main/java/cn/bunny/dao/entity/system/RolePower.java index 738f045..ee90dc8 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/RolePower.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/RolePower.java @@ -15,6 +15,7 @@ import lombok.experimental.Accessors; @TableName("sys_role_power") @Schema(name = "RolePower对象", title = "角色权限关系", description = "角色权限关系") public class RolePower extends BaseEntity { + @Schema(name = "roleId", title = "角色id") private String roleId; diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/Router.java b/dao/src/main/java/cn/bunny/dao/entity/system/Router.java index ecb15e6..300b281 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/Router.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/Router.java @@ -2,8 +2,8 @@ package cn.bunny.dao.entity.system; import cn.bunny.dao.entity.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -20,55 +20,56 @@ import lombok.experimental.Accessors; @Setter @Accessors(chain = true) @TableName("sys_router") -@ApiModel(value = "Router对象", description = "系统菜单表") +@Schema(name = "Router对象", title = "系统菜单表", description = "系统菜单表") public class Router extends BaseEntity { @ApiModelProperty("父级id") + @Schema(name = "parentId", title = "父级id") private Long parentId; - @ApiModelProperty("在项目中路径") + @Schema(name = "path", title = "在项目中路径") private String path; - @ApiModelProperty("组件位置") + @Schema(name = "component", title = "组件位置") private String component; - @ApiModelProperty("frame路径") + @Schema(name = "frameSrc", title = "frame路径") private String frameSrc; - @ApiModelProperty("重定向") + @Schema(name = "redirect", title = "重定向") private String redirect; - @ApiModelProperty("路由名称") + @Schema(name = "routeName", title = "路由名称") private String routeName; - @ApiModelProperty("路由title") + @Schema(name = "title", title = "路由title") private String title; - @ApiModelProperty("菜单类型") + @Schema(name = "menuType", title = "菜单类型") private Integer menuType; - @ApiModelProperty("图标") + @Schema(name = "icon", title = "图标") private String icon; - @ApiModelProperty("进入动画") + @Schema(name = "enterTransition", title = "进入动画") private String enterTransition; - @ApiModelProperty("退出动画") + @Schema(name = "leaveTransition", title = "退出动画") private String leaveTransition; - @ApiModelProperty("等级") + @Schema(name = "routerRank", title = "等级") private Integer routerRank; - @ApiModelProperty("是否隐藏标签") + @Schema(name = "hiddenTag", title = "是否隐藏标签") private Boolean hiddenTag; - @ApiModelProperty("是否固定标签") + @Schema(name = "fixedTag", title = "是否固定标签") private Boolean fixedTag; - @ApiModelProperty("是否显示父级") + @Schema(name = "showParent", title = "是否显示父级") private Boolean showParent; - @ApiModelProperty("是否显示 返给前端为 showLink") + @Schema(name = "visible", title = "是否显示 返给前端为 showLink") private Boolean visible; } diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/RouterPower.java b/dao/src/main/java/cn/bunny/dao/entity/system/RouterPower.java index efec620..2a1deaa 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/RouterPower.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/RouterPower.java @@ -13,6 +13,7 @@ import lombok.experimental.Accessors; @TableName("sys_router_power") @Schema(name = "RouterPower对象", title = "路由和权限关系表", description = "路由和权限关系表") public class RouterPower extends BaseEntity { + @Schema(name = "routerId", title = "路由ID") private Long routerId; diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/RouterRole.java b/dao/src/main/java/cn/bunny/dao/entity/system/RouterRole.java index 01eac04..c2a549f 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/RouterRole.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/RouterRole.java @@ -13,6 +13,7 @@ import lombok.experimental.Accessors; @TableName("sys_router_role") @Schema(name = "RouterRole对象", title = "路由角色关系", description = "路由角色关系") public class RouterRole extends BaseEntity { + @Schema(name = "routerId", title = "路由ID") private Long routerId; diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/SystemLog.java b/dao/src/main/java/cn/bunny/dao/entity/system/SystemLog.java index 6b0b150..1c8191a 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/SystemLog.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/SystemLog.java @@ -2,8 +2,7 @@ package cn.bunny.dao.entity.system; import cn.bunny.dao.entity.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -20,37 +19,37 @@ import lombok.experimental.Accessors; @Setter @Accessors(chain = true) @TableName("system_log") -@ApiModel(value = "SystemLog对象", description = "系统日志表") +@Schema(name = "SystemLog对象", title = "系统日志表", description = "系统日志表") public class SystemLog extends BaseEntity { - @ApiModelProperty("所在类路径") + @Schema(name = "classPath", title = "所在类路径") private String classPath; - @ApiModelProperty("执行方法名称") + @Schema(name = "methodName", title = "执行方法名称") private String methodName; - @ApiModelProperty("入参内容") + @Schema(name = "args", title = "入参内容") private String args; - @ApiModelProperty("返回参数") + @Schema(name = "result", title = "返回参数") private String result; - @ApiModelProperty("报错堆栈") + @Schema(name = "errorStack", title = "报错堆栈") private String errorStack; - @ApiModelProperty("报错") + @Schema(name = "errorMessage", title = "报错") private String errorMessage; - @ApiModelProperty("邮箱") + @Schema(name = "email", title = "邮箱") private String email; - @ApiModelProperty("用户名") + @Schema(name = "nickname", title = "用户名") private String nickname; - @ApiModelProperty("当前用户token") + @Schema(name = "token", title = "当前用户token") private String token; - @ApiModelProperty("当前用户IP地址") + @Schema(name = "ipAddress", title = "当前用户IP地址") private String ipAddress; } \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/entity/system/UserRole.java b/dao/src/main/java/cn/bunny/dao/entity/system/UserRole.java index 8bbeb4a..2595858 100644 --- a/dao/src/main/java/cn/bunny/dao/entity/system/UserRole.java +++ b/dao/src/main/java/cn/bunny/dao/entity/system/UserRole.java @@ -13,9 +13,11 @@ import lombok.experimental.Accessors; @TableName("sys_user_role") @Schema(name = "UserRole对象", title = "用户角色关系", description = "用户角色关系") public class UserRole extends BaseEntity { + @Schema(name = "userId", title = "用户id") private String userId; @Schema(name = "roleId", title = "角色id") private String roleId; + } \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/pojo/result/PageResult.java b/dao/src/main/java/cn/bunny/dao/pojo/result/PageResult.java index a810c2e..aed48e4 100644 --- a/dao/src/main/java/cn/bunny/dao/pojo/result/PageResult.java +++ b/dao/src/main/java/cn/bunny/dao/pojo/result/PageResult.java @@ -1,5 +1,6 @@ package cn.bunny.dao.pojo.result; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -15,13 +16,19 @@ import java.util.List; @AllArgsConstructor @NoArgsConstructor @Builder +@Schema(name = "PageResult 对象", title = "分页返回结果", description = "分页返回结果") public class PageResult implements Serializable { - // 当前页 + + @Schema(name = "pageNo", title = "当前页") private Long pageNo; - // 每页记录数 + + @Schema(name = "pageSize", title = "每页记录数") private Long pageSize; - // 总记录数 + + @Schema(name = "total", title = "总记录数") private Long total; - // 当前页数据集合 + + @Schema(name = "list", title = "当前页数据集合") private List list; + } \ No newline at end of file diff --git a/dao/src/main/java/cn/bunny/dao/vo/i18n/I18nTypeVo.java b/dao/src/main/java/cn/bunny/dao/vo/i18n/I18nTypeVo.java new file mode 100644 index 0000000..822d774 --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/vo/i18n/I18nTypeVo.java @@ -0,0 +1,26 @@ +package cn.bunny.dao.vo.i18n; + +import cn.bunny.dao.vo.BaseVo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@EqualsAndHashCode(callSuper = true) +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "I18nVo对象", title = "多语言返回内容", description = "多语言返回内容") +public class I18nTypeVo extends BaseVo { + + @Schema(name = "typeName", title = "多语言类型(比如zh,en)") + private String typeName; + + @Schema(name = "summary", title = "名称解释(比如中文,英文)") + private String summary; + + @Schema(name = "isDefault", title = "是否为默认") + private Boolean isDefault; + +} + + diff --git a/dao/src/main/java/cn/bunny/dao/vo/i18n/I18nVo.java b/dao/src/main/java/cn/bunny/dao/vo/i18n/I18nVo.java new file mode 100644 index 0000000..ecefbde --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/vo/i18n/I18nVo.java @@ -0,0 +1,27 @@ +package cn.bunny.dao.vo.i18n; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "I18nVo对象", title = "多语言返回内容", description = "多语言返回内容") +public class I18nVo { + + @Schema(name = "keyName", title = "多语言key") + private Integer keyName; + + @Schema(name = "translation", title = "多语言翻译名称") + private String translation; + + @Schema(name = "typeId", title = "多语言类型id") + private Long typeId; + +} + + diff --git a/dao/src/main/java/cn/bunny/dao/vo/menuIcon/MenuIconVo.java b/dao/src/main/java/cn/bunny/dao/vo/menuIcon/MenuIconVo.java new file mode 100644 index 0000000..f8c272c --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/vo/menuIcon/MenuIconVo.java @@ -0,0 +1,18 @@ +package cn.bunny.dao.vo.menuIcon; + +import cn.bunny.dao.vo.BaseVo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@EqualsAndHashCode(callSuper = true) +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Schema(name = "RouterControllerVo对象", title = "路由管理端返回对象", description = "路由管理端返回对象") +public class MenuIconVo extends BaseVo { + + @Schema(name = "iconName", title = "icon 名称") + private String iconName; + +} diff --git a/service/src/main/java/cn/bunny/services/controller/I18nController.java b/service/src/main/java/cn/bunny/services/controller/I18nController.java index 23be90c..424b246 100644 --- a/service/src/main/java/cn/bunny/services/controller/I18nController.java +++ b/service/src/main/java/cn/bunny/services/controller/I18nController.java @@ -1,7 +1,23 @@ package cn.bunny.services.controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import cn.bunny.dao.dto.i18n.I18nDto; +import cn.bunny.dao.entity.system.MenuIcon; +import cn.bunny.dao.pojo.result.PageResult; +import cn.bunny.dao.pojo.result.Result; +import cn.bunny.dao.pojo.result.ResultCodeEnum; +import cn.bunny.dao.vo.i18n.I18nVo; +import cn.bunny.services.service.I18nService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import reactor.core.publisher.Mono; + +import java.util.List; +import java.util.Map; /** *

@@ -11,8 +27,52 @@ import org.springframework.web.bind.annotation.RestController; * @author Bunny * @since 2024-09-28 */ +@Tag(name = "多语言", description = "多语言相关接口") @RestController -@RequestMapping("/i18n") +@RequestMapping("admin/i18n") public class I18nController { + @Autowired + private I18nService i18nService; + + @Operation(summary = "获取多语言内容", description = "获取多语言内容") + @GetMapping("getI18n") + public Mono>>> getI18n() { + Map> vo = i18nService.getI18n(); + return Mono.just(Result.success(vo)); + } + + @Operation(summary = "获取管理多语言列表", description = "获取管理多语言列表") + @GetMapping("getI18nList/{page}/{limit}") + public Mono>> getI18nList( + @Parameter(name = "page", description = "当前页", required = true) + @PathVariable("page") Integer page, + @Parameter(name = "limit", description = "每页记录数", required = true) + @PathVariable("limit") Integer limit, + I18nDto dto) { + Page pageParams = new Page<>(page, limit); + PageResult vo = i18nService.getI18nList(pageParams, dto); + return Mono.just(Result.success(vo)); + } + + @Operation(summary = "添加多语言", description = "添加多语言") + @PostMapping("addI18n") + public Mono> addI18n(@Valid @RequestBody I18nDto dto) { + i18nService.addI18n(dto); + return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS)); + } + + @Operation(summary = "更新多语言", description = "更新多语言") + @PostMapping("updateI18n") + public Mono> updateI18n(@Valid @RequestBody I18nDto dto) { + i18nService.updateI18n(dto); + return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS)); + } + + @Operation(summary = "删除多语言类型", description = "删除多语言类型") + @PostMapping("deleteI18n") + public Mono> deleteI18n(@RequestBody List ids) { + i18nService.deleteI18n(ids); + return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS)); + } } diff --git a/service/src/main/java/cn/bunny/services/controller/I18nTypeController.java b/service/src/main/java/cn/bunny/services/controller/I18nTypeController.java index 0596100..0098254 100644 --- a/service/src/main/java/cn/bunny/services/controller/I18nTypeController.java +++ b/service/src/main/java/cn/bunny/services/controller/I18nTypeController.java @@ -1,7 +1,18 @@ package cn.bunny.services.controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import cn.bunny.dao.dto.i18n.I18nTypeAddDto; +import cn.bunny.dao.dto.i18n.I18nTypeUpdateDto; +import cn.bunny.dao.pojo.result.Result; +import cn.bunny.dao.pojo.result.ResultCodeEnum; +import cn.bunny.dao.vo.i18n.I18nTypeVo; +import cn.bunny.services.service.I18nTypeService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import reactor.core.publisher.Mono; + +import java.util.List; /** *

@@ -11,8 +22,39 @@ import org.springframework.web.bind.annotation.RestController; * @author Bunny * @since 2024-09-28 */ +@Tag(name = "多语言类型", description = "多语言类型相关接口") @RestController -@RequestMapping("/i18nType") +@RequestMapping("admin/i18nType") public class I18nTypeController { + @Autowired + private I18nTypeService i18nTypeService; + + @Operation(summary = "获取多语言类型", description = "获取多语言类型") + @GetMapping("getI18nTypeList") + public Mono>> getI18nTypeList() { + List voList = i18nTypeService.getI18nTypeList(); + return Mono.just(Result.success(voList)); + } + + @Operation(summary = "添加多语言类型", description = "添加多语言类型") + @PostMapping("addI18nType") + public Mono> addI18nType(@RequestBody I18nTypeAddDto dto) { + i18nTypeService.addI18nType(dto); + return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS)); + } + + @Operation(summary = "更新多语言类型", description = "更新多语言类型") + @PostMapping("updateI18nType") + public Mono> updateI18nType(@RequestBody I18nTypeUpdateDto dto) { + i18nTypeService.updateI18nType(dto); + return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS)); + } + + @Operation(summary = "删除多语言类型", description = "删除多语言类型") + @PostMapping("deleteI18nType") + public Mono> deleteI18nType(@RequestBody List ids) { + i18nTypeService.deleteI18nType(ids); + return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS)); + } } diff --git a/service/src/main/java/cn/bunny/services/controller/MenuIconController.java b/service/src/main/java/cn/bunny/services/controller/MenuIconController.java index b7a4f17..d1b9bd6 100644 --- a/service/src/main/java/cn/bunny/services/controller/MenuIconController.java +++ b/service/src/main/java/cn/bunny/services/controller/MenuIconController.java @@ -1,8 +1,21 @@ package cn.bunny.services.controller; +import cn.bunny.dao.dto.menuIcon.MenuIconDto; +import cn.bunny.dao.entity.system.MenuIcon; +import cn.bunny.dao.pojo.result.PageResult; +import cn.bunny.dao.pojo.result.Result; +import cn.bunny.dao.vo.menuIcon.MenuIconVo; +import cn.bunny.services.service.MenuIconService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Mono; /** *

@@ -14,7 +27,22 @@ import org.springframework.web.bind.annotation.RestController; */ @Tag(name = "菜单Icon", description = "菜单Icon相关接口") @RestController -@RequestMapping("/menuIcon") +@RequestMapping("admin/menuIcon") public class MenuIconController { + @Autowired + private MenuIconService menuIconService; + + @Operation(summary = "获取菜单Icon", description = "获取菜单Icon") + @GetMapping("getMenuIconList/{page}/{limit}") + public Mono>> getMenuIconList( + @Parameter(name = "page", description = "当前页", required = true) + @PathVariable("page") Integer page, + @Parameter(name = "limit", description = "每页记录数", required = true) + @PathVariable("limit") Integer limit, + MenuIconDto dto) { + Page pageParams = new Page<>(page, limit); + PageResult pageResult = menuIconService.getMenuIconList(pageParams, dto); + return Mono.just(Result.success(pageResult)); + } } diff --git a/service/src/main/java/cn/bunny/services/mapper/I18nMapper.java b/service/src/main/java/cn/bunny/services/mapper/I18nMapper.java index fd58417..5d48301 100644 --- a/service/src/main/java/cn/bunny/services/mapper/I18nMapper.java +++ b/service/src/main/java/cn/bunny/services/mapper/I18nMapper.java @@ -1,8 +1,16 @@ package cn.bunny.services.mapper; +import cn.bunny.dao.dto.i18n.I18nDto; import cn.bunny.dao.entity.i18n.I18n; +import cn.bunny.dao.entity.i18n.I18nWithI18nType; +import cn.bunny.dao.entity.system.MenuIcon; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** *

@@ -15,4 +23,19 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface I18nMapper extends BaseMapper { + /** + * * 多语言和多语言类型 + * + * @return 多语言和多语言类型列表 + */ + List selectListWithI18nType(); + + /** + * * 分页查询多语言内容 + * + * @param pageParams 分页想去 + * @param dto 路由查询表单 + * @return 分页结果 + */ + IPage selectListByPage(@Param("page") Page pageParams, @Param("dto") I18nDto dto); } diff --git a/service/src/main/java/cn/bunny/services/mapper/I18nTypeMapper.java b/service/src/main/java/cn/bunny/services/mapper/I18nTypeMapper.java index 8acf71c..844fe67 100644 --- a/service/src/main/java/cn/bunny/services/mapper/I18nTypeMapper.java +++ b/service/src/main/java/cn/bunny/services/mapper/I18nTypeMapper.java @@ -4,6 +4,8 @@ import cn.bunny.dao.entity.i18n.I18nType; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** *

* 多语言类型表 Mapper 接口 @@ -15,4 +17,10 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface I18nTypeMapper extends BaseMapper { + /** + * 物理删除多语言类型 + * + * @param ids 删除 id 列表 + */ + void deleteBatchIdsWithPhysics(List ids); } diff --git a/service/src/main/java/cn/bunny/services/mapper/MenuIconMapper.java b/service/src/main/java/cn/bunny/services/mapper/MenuIconMapper.java index 5893726..0519898 100644 --- a/service/src/main/java/cn/bunny/services/mapper/MenuIconMapper.java +++ b/service/src/main/java/cn/bunny/services/mapper/MenuIconMapper.java @@ -1,8 +1,12 @@ package cn.bunny.services.mapper; +import cn.bunny.dao.dto.menuIcon.MenuIconDto; import cn.bunny.dao.entity.system.MenuIcon; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** *

@@ -15,4 +19,12 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface MenuIconMapper extends BaseMapper { + /** + * 分页查询菜单图标 + * + * @param pageParams 分页查询结果 + * @param dto 系统菜单图标分页查询对象 + * @return 分页查询结果返回内容 + */ + IPage selectListByPage(@Param("page") Page pageParams, @Param("dto") MenuIconDto dto); } diff --git a/service/src/main/java/cn/bunny/services/mapper/RouterMapper.java b/service/src/main/java/cn/bunny/services/mapper/RouterMapper.java index ac999f1..18153c9 100644 --- a/service/src/main/java/cn/bunny/services/mapper/RouterMapper.java +++ b/service/src/main/java/cn/bunny/services/mapper/RouterMapper.java @@ -52,5 +52,5 @@ public interface RouterMapper extends BaseMapper { * * @param ids 删除id列表 */ - void deletedMenuByIds(List ids); + void deleteBatchIdsWithPhysics(List ids); } diff --git a/service/src/main/java/cn/bunny/services/security/config/WebSecurityConfig.java b/service/src/main/java/cn/bunny/services/security/config/WebSecurityConfig.java index 21a876e..e7f74af 100644 --- a/service/src/main/java/cn/bunny/services/security/config/WebSecurityConfig.java +++ b/service/src/main/java/cn/bunny/services/security/config/WebSecurityConfig.java @@ -94,7 +94,7 @@ public class WebSecurityConfig { String[] annotations = { "/", "/ws/**", "/*/*/noAuth/**", "/*/noAuth/**", "/noAuth/**", - "/media.ico", "/favicon.ico", "*.html", + "/media.ico", "/favicon.ico", "*.html", "/webjars/**", "/swagger-resources/**", "/v3/**", "/swagger-ui/**" }; return web -> web.ignoring().requestMatchers(annotations); diff --git a/service/src/main/java/cn/bunny/services/service/I18nService.java b/service/src/main/java/cn/bunny/services/service/I18nService.java index 464c607..bc912cb 100644 --- a/service/src/main/java/cn/bunny/services/service/I18nService.java +++ b/service/src/main/java/cn/bunny/services/service/I18nService.java @@ -1,8 +1,16 @@ package cn.bunny.services.service; +import cn.bunny.dao.dto.i18n.I18nDto; import cn.bunny.dao.entity.i18n.I18n; +import cn.bunny.dao.entity.system.MenuIcon; +import cn.bunny.dao.pojo.result.PageResult; +import cn.bunny.dao.vo.i18n.I18nVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; +import java.util.Map; + /** *

* 多语言表 服务类 @@ -13,4 +21,38 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface I18nService extends IService { + /** + * * 获取多语言内容 + * + * @return 多语言返回内容 + */ + Map> getI18n(); + + /** + * * 获取管理多语言列表 + * + * @return 多语言返回列表 + */ + PageResult getI18nList(Page pageParams, I18nDto dto); + + /** + * * 添加多语言 + * + * @param dto 添加表单 + */ + void addI18n(I18nDto dto); + + /** + * * 更新多语言 + * + * @param dto 更新表单 + */ + void updateI18n(I18nDto dto); + + /** + * * 删除多语言类型 + * + * @param ids 删除id列表 + */ + void deleteI18n(List ids); } diff --git a/service/src/main/java/cn/bunny/services/service/I18nTypeService.java b/service/src/main/java/cn/bunny/services/service/I18nTypeService.java index 7295a73..e5786ed 100644 --- a/service/src/main/java/cn/bunny/services/service/I18nTypeService.java +++ b/service/src/main/java/cn/bunny/services/service/I18nTypeService.java @@ -1,8 +1,13 @@ package cn.bunny.services.service; +import cn.bunny.dao.dto.i18n.I18nTypeAddDto; +import cn.bunny.dao.dto.i18n.I18nTypeUpdateDto; import cn.bunny.dao.entity.i18n.I18nType; +import cn.bunny.dao.vo.i18n.I18nTypeVo; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** *

* 多语言类型表 服务类 @@ -13,4 +18,31 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface I18nTypeService extends IService { + /** + * 获取多语言类型 + * + * @return 多语言类型列表 + */ + List getI18nTypeList(); + + /** + * 添加多语言类型 + * + * @param dto 多语言类型添加 + */ + void addI18nType(I18nTypeAddDto dto); + + /** + * 更新多语言类型 + * + * @param dto 多语言类型更新 + */ + void updateI18nType(I18nTypeUpdateDto dto); + + /** + * 删除多语言类型 + * + * @param ids 删除id列表 + */ + void deleteI18nType(List ids); } diff --git a/service/src/main/java/cn/bunny/services/service/MenuIconService.java b/service/src/main/java/cn/bunny/services/service/MenuIconService.java index f9c8d6d..5836076 100644 --- a/service/src/main/java/cn/bunny/services/service/MenuIconService.java +++ b/service/src/main/java/cn/bunny/services/service/MenuIconService.java @@ -1,6 +1,10 @@ package cn.bunny.services.service; +import cn.bunny.dao.dto.menuIcon.MenuIconDto; import cn.bunny.dao.entity.system.MenuIcon; +import cn.bunny.dao.pojo.result.PageResult; +import cn.bunny.dao.vo.menuIcon.MenuIconVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; /** @@ -13,4 +17,12 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface MenuIconService extends IService { + /** + * * 获取菜单Icon + * + * @param pageParams 分页查询结果 + * @param dto 系统菜单图标分页查询对象 + * @return 分页查询结果返回内容 + */ + PageResult getMenuIconList(Page pageParams, MenuIconDto dto); } diff --git a/service/src/main/java/cn/bunny/services/service/impl/I18nServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/I18nServiceImpl.java index c12b5b0..acde34f 100644 --- a/service/src/main/java/cn/bunny/services/service/impl/I18nServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/impl/I18nServiceImpl.java @@ -1,11 +1,23 @@ package cn.bunny.services.service.impl; +import cn.bunny.dao.dto.i18n.I18nDto; import cn.bunny.dao.entity.i18n.I18n; +import cn.bunny.dao.entity.i18n.I18nWithI18nType; +import cn.bunny.dao.entity.system.MenuIcon; +import cn.bunny.dao.pojo.result.PageResult; +import cn.bunny.dao.vo.i18n.I18nVo; import cn.bunny.services.mapper.I18nMapper; import cn.bunny.services.service.I18nService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + /** *

* 多语言表 服务实现类 @@ -17,4 +29,67 @@ import org.springframework.stereotype.Service; @Service public class I18nServiceImpl extends ServiceImpl implements I18nService { + /** + * * 获取多语言内容 + * + * @return 多语言返回内容 + */ + @Override + public Map> getI18n() { + List i18nWithI18nTypes = baseMapper.selectListWithI18nType(); + return i18nWithI18nTypes.stream() + .collect(Collectors.groupingBy(I18nWithI18nType::getTypeName, Collectors.toMap(I18nWithI18nType::getKeyName, I18nWithI18nType::getSummary))); + } + + /** + * * 获取管理多语言列表 + * + * @return 多语言返回列表 + */ + @Override + public PageResult getI18nList(Page pageParams, I18nDto dto) { + IPage page = baseMapper.selectListByPage(pageParams, dto); + + List i18nVoList = page.getRecords().stream().map(i18n -> { + I18nVo i18nVo = new I18nVo(); + BeanUtils.copyProperties(i18n, i18nVo); + return i18nVo; + }).toList(); + return PageResult.builder() + .list(i18nVoList) + .pageSize(page.getSize()) + .pageNo(page.getCurrent()) + .total(page.getTotal()) + .build(); + } + + /** + * * 添加多语言 + * + * @param dto 添加表单 + */ + @Override + public void addI18n(I18nDto dto) { + + } + + /** + * * 更新多语言 + * + * @param dto 更新表单 + */ + @Override + public void updateI18n(I18nDto dto) { + + } + + /** + * * 删除多语言类型 + * + * @param ids 删除id列表 + */ + @Override + public void deleteI18n(List ids) { + + } } diff --git a/service/src/main/java/cn/bunny/services/service/impl/I18nTypeServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/I18nTypeServiceImpl.java index d116ef5..ab17347 100644 --- a/service/src/main/java/cn/bunny/services/service/impl/I18nTypeServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/impl/I18nTypeServiceImpl.java @@ -1,10 +1,21 @@ package cn.bunny.services.service.impl; +import cn.bunny.common.service.exception.BunnyException; +import cn.bunny.dao.dto.i18n.I18nTypeAddDto; +import cn.bunny.dao.dto.i18n.I18nTypeUpdateDto; import cn.bunny.dao.entity.i18n.I18nType; +import cn.bunny.dao.pojo.result.ResultCodeEnum; +import cn.bunny.dao.vo.i18n.I18nTypeVo; import cn.bunny.services.mapper.I18nTypeMapper; import cn.bunny.services.service.I18nTypeService; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; /** *

@@ -15,6 +26,82 @@ import org.springframework.stereotype.Service; * @since 2024-09-28 */ @Service +@Transactional public class I18nTypeServiceImpl extends ServiceImpl implements I18nTypeService { + /** + * 获取多语言类型 + * + * @return 多语言类型列表 + */ + @Override + public List getI18nTypeList() { + return list().stream().map(i18nType -> { + I18nTypeVo i18nTypeVo = new I18nTypeVo(); + BeanUtils.copyProperties(i18nType, i18nTypeVo); + return i18nTypeVo; + }).toList(); + } + + /** + * 添加多语言类型 + * + * @param dto 多语言类型添加 + */ + @Override + public void addI18nType(I18nTypeAddDto dto) { + String typeName = dto.getTypeName(); + Boolean isDefault = dto.getIsDefault(); + + // 查询添加的数据是否之前添加过 + List i18nTypeList = list(Wrappers.lambdaQuery().eq(I18nType::getTypeName, typeName)); + if (!i18nTypeList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_EXIST); + + // 如果是默认,将其它内容设为false + if (isDefault) { + LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.update().lambda().set(I18nType::getIsDefault, false); + update(null, lambdaUpdateWrapper); + } + + // 保存数据 + I18nType i18nType = new I18nType(); + BeanUtils.copyProperties(dto, i18nType); + save(i18nType); + } + + /** + * 更新多语言类型 + * + * @param dto 多语言类型更新 + */ + @Override + public void updateI18nType(I18nTypeUpdateDto dto) { + Long id = dto.getId(); + Boolean isDefault = dto.getIsDefault(); + + // 查询更新的内容是否存在 + List i18nTypeList = list(Wrappers.lambdaQuery().eq(I18nType::getId, id)); + if (i18nTypeList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST); + + // 如果是默认,将其它内容设为false + if (isDefault) { + LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.update().lambda().set(I18nType::getIsDefault, false); + update(null, lambdaUpdateWrapper); + } + + // 更新内容 + I18nType i18nType = new I18nType(); + BeanUtils.copyProperties(dto, i18nType); + updateById(i18nType); + } + + /** + * 删除多语言类型 + * + * @param ids 删除id列表 + */ + @Override + public void deleteI18nType(List ids) { + baseMapper.deleteBatchIdsWithPhysics(ids); + } } diff --git a/service/src/main/java/cn/bunny/services/service/impl/MenuIconServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/MenuIconServiceImpl.java index e1851b9..12a35ea 100644 --- a/service/src/main/java/cn/bunny/services/service/impl/MenuIconServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/impl/MenuIconServiceImpl.java @@ -1,11 +1,19 @@ package cn.bunny.services.service.impl; +import cn.bunny.dao.dto.menuIcon.MenuIconDto; import cn.bunny.dao.entity.system.MenuIcon; +import cn.bunny.dao.pojo.result.PageResult; +import cn.bunny.dao.vo.menuIcon.MenuIconVo; import cn.bunny.services.mapper.MenuIconMapper; import cn.bunny.services.service.MenuIconService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 系统菜单图标 服务实现类 @@ -17,4 +25,29 @@ import org.springframework.stereotype.Service; @Service public class MenuIconServiceImpl extends ServiceImpl implements MenuIconService { + /** + * * 获取菜单Icon + * + * @param pageParams 分页查询结果 + * @param dto 系统菜单图标分页查询对象 + * @return 分页查询结果返回内容 + */ + @Override + public PageResult getMenuIconList(Page pageParams, MenuIconDto dto) { + // 分页查询菜单图标 + IPage page = baseMapper.selectListByPage(pageParams, dto); + + List voList = page.getRecords().stream().map(menuIcon -> { + MenuIconVo menuIconVo = new MenuIconVo(); + BeanUtils.copyProperties(menuIcon, menuIconVo); + return menuIconVo; + }).toList(); + + return PageResult.builder() + .list(voList) + .pageNo(page.getCurrent()) + .pageSize(page.getSize()) + .total(page.getTotal()) + .build(); + } } diff --git a/service/src/main/java/cn/bunny/services/service/impl/RouterServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/RouterServiceImpl.java index d41c540..061e269 100644 --- a/service/src/main/java/cn/bunny/services/service/impl/RouterServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/impl/RouterServiceImpl.java @@ -205,6 +205,6 @@ public class RouterServiceImpl extends ServiceImpl impleme List longList = list(Wrappers.lambdaQuery().in(Router::getParentId, ids)).stream().map(Router::getId).toList(); ids.addAll(longList); - baseMapper.deletedMenuByIds(ids); + baseMapper.deleteBatchIdsWithPhysics(ids); } } diff --git a/service/src/main/resources/mapper/I18nMapper.xml b/service/src/main/resources/mapper/I18nMapper.xml index 5e76f4f..c68500d 100644 --- a/service/src/main/resources/mapper/I18nMapper.xml +++ b/service/src/main/resources/mapper/I18nMapper.xml @@ -20,4 +20,24 @@ id, key_name, translation, type_id, create_user, update_user, update_time, create_time, is_deleted + + + + + + diff --git a/service/src/main/resources/mapper/I18nTypeMapper.xml b/service/src/main/resources/mapper/I18nTypeMapper.xml index 7a6bc2b..235d332 100644 --- a/service/src/main/resources/mapper/I18nTypeMapper.xml +++ b/service/src/main/resources/mapper/I18nTypeMapper.xml @@ -12,11 +12,22 @@ + - id, type_name, summary, create_user, update_user, update_time, create_time, is_deleted + id, type_name, summary, create_user, update_user, update_time, create_time, is_deleted,is_default + + + delete + from sys_i18n_type + where id in + + #{id} + + + diff --git a/service/src/main/resources/mapper/MenuIconMapper.xml b/service/src/main/resources/mapper/MenuIconMapper.xml index 106bbc6..6e3d371 100644 --- a/service/src/main/resources/mapper/MenuIconMapper.xml +++ b/service/src/main/resources/mapper/MenuIconMapper.xml @@ -18,4 +18,16 @@ id, icon_name, create_user, update_user, create_time, update_time, is_deleted + + + diff --git a/service/src/main/resources/mapper/RouterMapper.xml b/service/src/main/resources/mapper/RouterMapper.xml index da8106d..946ee7a 100644 --- a/service/src/main/resources/mapper/RouterMapper.xml +++ b/service/src/main/resources/mapper/RouterMapper.xml @@ -34,7 +34,7 @@ - + delete from sys_router where id in