From c91f46d8574f7d3c6df7d5ffdf0420ac78fec443 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 16 Apr 2024 15:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bweb/config/AuthConfig.java | 1 + .../bweb/controller/SecMenuController.java | 14 ++++ .../bweb/controller/SecUserController.java | 2 +- .../main/java/com/hfkj/dao/SecMenuMapper.java | 19 ++--- .../java/com/hfkj/dao/SecMenuSqlProvider.java | 14 ++++ .../main/java/com/hfkj/entity/SecMenu.java | 18 ++++- .../java/com/hfkj/entity/SecMenuExample.java | 70 +++++++++++++++++++ 7 files changed, 128 insertions(+), 10 deletions(-) diff --git a/bweb/src/main/java/com/bweb/config/AuthConfig.java b/bweb/src/main/java/com/bweb/config/AuthConfig.java index c591cec..95747fb 100644 --- a/bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -86,6 +86,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/**/api-docs") .excludePathPatterns("/**/springfox-swagger-ui/**") .excludePathPatterns("/**/swagger-ui.html") + .excludePathPatterns("/secMenu/queryMenuList") ; } diff --git a/bweb/src/main/java/com/bweb/controller/SecMenuController.java b/bweb/src/main/java/com/bweb/controller/SecMenuController.java index 4312a82..5c56e99 100644 --- a/bweb/src/main/java/com/bweb/controller/SecMenuController.java +++ b/bweb/src/main/java/com/bweb/controller/SecMenuController.java @@ -129,6 +129,20 @@ public class SecMenuController { } } + @RequestMapping(value="/queryMenuList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询菜单列表") + public ResponseData queryMenuList() { + try { + + return ResponseMsgUtil.success(secMenuService.getAllList()); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/queryAssignMenuTree",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询分配菜单树") diff --git a/bweb/src/main/java/com/bweb/controller/SecUserController.java b/bweb/src/main/java/com/bweb/controller/SecUserController.java index f2ad6f3..99a89af 100644 --- a/bweb/src/main/java/com/bweb/controller/SecUserController.java +++ b/bweb/src/main/java/com/bweb/controller/SecUserController.java @@ -221,7 +221,7 @@ public class SecUserController { } - @RequestMapping(value="/queryList",method = RequestMethod.GET) + @RequestMapping(value="/queryLoginLogList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询登录日志列表") public ResponseData queryLoginLogList(@RequestParam(value = "userId", required = true) String userId, diff --git a/service/src/main/java/com/hfkj/dao/SecMenuMapper.java b/service/src/main/java/com/hfkj/dao/SecMenuMapper.java index 54b97e7..78865ac 100644 --- a/service/src/main/java/com/hfkj/dao/SecMenuMapper.java +++ b/service/src/main/java/com/hfkj/dao/SecMenuMapper.java @@ -41,14 +41,14 @@ public interface SecMenuMapper extends SecMenuMapperExt { @Insert({ "insert into sec_menu (menu_name, menu_type, ", "menu_url, menu_url_img, ", - "menu_p_sid, menu_sort, ", - "menu_desc, create_time, ", - "update_time)", + "menu_full_url, menu_p_sid, ", + "menu_sort, menu_desc, ", + "create_time, update_time)", "values (#{menuName,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, ", "#{menuUrl,jdbcType=VARCHAR}, #{menuUrlImg,jdbcType=VARCHAR}, ", - "#{menuPSid,jdbcType=BIGINT}, #{menuSort,jdbcType=INTEGER}, ", - "#{menuDesc,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP})" + "#{menuFullUrl,jdbcType=VARCHAR}, #{menuPSid,jdbcType=BIGINT}, ", + "#{menuSort,jdbcType=INTEGER}, #{menuDesc,jdbcType=VARCHAR}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(SecMenu record); @@ -64,6 +64,7 @@ public interface SecMenuMapper extends SecMenuMapperExt { @Result(column="menu_type", property="menuType", jdbcType=JdbcType.INTEGER), @Result(column="menu_url", property="menuUrl", jdbcType=JdbcType.VARCHAR), @Result(column="menu_url_img", property="menuUrlImg", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_full_url", property="menuFullUrl", jdbcType=JdbcType.VARCHAR), @Result(column="menu_p_sid", property="menuPSid", jdbcType=JdbcType.BIGINT), @Result(column="menu_sort", property="menuSort", jdbcType=JdbcType.INTEGER), @Result(column="menu_desc", property="menuDesc", jdbcType=JdbcType.VARCHAR), @@ -74,8 +75,8 @@ public interface SecMenuMapper extends SecMenuMapperExt { @Select({ "select", - "id, menu_name, menu_type, menu_url, menu_url_img, menu_p_sid, menu_sort, menu_desc, ", - "create_time, update_time", + "id, menu_name, menu_type, menu_url, menu_url_img, menu_full_url, menu_p_sid, ", + "menu_sort, menu_desc, create_time, update_time", "from sec_menu", "where id = #{id,jdbcType=BIGINT}" }) @@ -85,6 +86,7 @@ public interface SecMenuMapper extends SecMenuMapperExt { @Result(column="menu_type", property="menuType", jdbcType=JdbcType.INTEGER), @Result(column="menu_url", property="menuUrl", jdbcType=JdbcType.VARCHAR), @Result(column="menu_url_img", property="menuUrlImg", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_full_url", property="menuFullUrl", jdbcType=JdbcType.VARCHAR), @Result(column="menu_p_sid", property="menuPSid", jdbcType=JdbcType.BIGINT), @Result(column="menu_sort", property="menuSort", jdbcType=JdbcType.INTEGER), @Result(column="menu_desc", property="menuDesc", jdbcType=JdbcType.VARCHAR), @@ -108,6 +110,7 @@ public interface SecMenuMapper extends SecMenuMapperExt { "menu_type = #{menuType,jdbcType=INTEGER},", "menu_url = #{menuUrl,jdbcType=VARCHAR},", "menu_url_img = #{menuUrlImg,jdbcType=VARCHAR},", + "menu_full_url = #{menuFullUrl,jdbcType=VARCHAR},", "menu_p_sid = #{menuPSid,jdbcType=BIGINT},", "menu_sort = #{menuSort,jdbcType=INTEGER},", "menu_desc = #{menuDesc,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java index 568144f..a749763 100644 --- a/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java @@ -44,6 +44,10 @@ public class SecMenuSqlProvider { sql.VALUES("menu_url_img", "#{menuUrlImg,jdbcType=VARCHAR}"); } + if (record.getMenuFullUrl() != null) { + sql.VALUES("menu_full_url", "#{menuFullUrl,jdbcType=VARCHAR}"); + } + if (record.getMenuPSid() != null) { sql.VALUES("menu_p_sid", "#{menuPSid,jdbcType=BIGINT}"); } @@ -78,6 +82,7 @@ public class SecMenuSqlProvider { sql.SELECT("menu_type"); sql.SELECT("menu_url"); sql.SELECT("menu_url_img"); + sql.SELECT("menu_full_url"); sql.SELECT("menu_p_sid"); sql.SELECT("menu_sort"); sql.SELECT("menu_desc"); @@ -120,6 +125,10 @@ public class SecMenuSqlProvider { sql.SET("menu_url_img = #{record.menuUrlImg,jdbcType=VARCHAR}"); } + if (record.getMenuFullUrl() != null) { + sql.SET("menu_full_url = #{record.menuFullUrl,jdbcType=VARCHAR}"); + } + if (record.getMenuPSid() != null) { sql.SET("menu_p_sid = #{record.menuPSid,jdbcType=BIGINT}"); } @@ -153,6 +162,7 @@ public class SecMenuSqlProvider { sql.SET("menu_type = #{record.menuType,jdbcType=INTEGER}"); sql.SET("menu_url = #{record.menuUrl,jdbcType=VARCHAR}"); sql.SET("menu_url_img = #{record.menuUrlImg,jdbcType=VARCHAR}"); + sql.SET("menu_full_url = #{record.menuFullUrl,jdbcType=VARCHAR}"); sql.SET("menu_p_sid = #{record.menuPSid,jdbcType=BIGINT}"); sql.SET("menu_sort = #{record.menuSort,jdbcType=INTEGER}"); sql.SET("menu_desc = #{record.menuDesc,jdbcType=VARCHAR}"); @@ -184,6 +194,10 @@ public class SecMenuSqlProvider { sql.SET("menu_url_img = #{menuUrlImg,jdbcType=VARCHAR}"); } + if (record.getMenuFullUrl() != null) { + sql.SET("menu_full_url = #{menuFullUrl,jdbcType=VARCHAR}"); + } + if (record.getMenuPSid() != null) { sql.SET("menu_p_sid = #{menuPSid,jdbcType=BIGINT}"); } diff --git a/service/src/main/java/com/hfkj/entity/SecMenu.java b/service/src/main/java/com/hfkj/entity/SecMenu.java index 164b35f..3fdcead 100644 --- a/service/src/main/java/com/hfkj/entity/SecMenu.java +++ b/service/src/main/java/com/hfkj/entity/SecMenu.java @@ -24,7 +24,7 @@ public class SecMenu implements Serializable { private String menuName; /** - * 菜单类型 0:菜单 1:按钮 + * 菜单类型 1:菜单 2:按钮 */ private Integer menuType; @@ -38,6 +38,11 @@ public class SecMenu implements Serializable { */ private String menuUrlImg; + /** + * 菜单完整URL + */ + private String menuFullUrl; + /** * 父级菜单主键 */ @@ -105,6 +110,14 @@ public class SecMenu implements Serializable { this.menuUrlImg = menuUrlImg; } + public String getMenuFullUrl() { + return menuFullUrl; + } + + public void setMenuFullUrl(String menuFullUrl) { + this.menuFullUrl = menuFullUrl; + } + public Long getMenuPSid() { return menuPSid; } @@ -162,6 +175,7 @@ public class SecMenu implements Serializable { && (this.getMenuType() == null ? other.getMenuType() == null : this.getMenuType().equals(other.getMenuType())) && (this.getMenuUrl() == null ? other.getMenuUrl() == null : this.getMenuUrl().equals(other.getMenuUrl())) && (this.getMenuUrlImg() == null ? other.getMenuUrlImg() == null : this.getMenuUrlImg().equals(other.getMenuUrlImg())) + && (this.getMenuFullUrl() == null ? other.getMenuFullUrl() == null : this.getMenuFullUrl().equals(other.getMenuFullUrl())) && (this.getMenuPSid() == null ? other.getMenuPSid() == null : this.getMenuPSid().equals(other.getMenuPSid())) && (this.getMenuSort() == null ? other.getMenuSort() == null : this.getMenuSort().equals(other.getMenuSort())) && (this.getMenuDesc() == null ? other.getMenuDesc() == null : this.getMenuDesc().equals(other.getMenuDesc())) @@ -178,6 +192,7 @@ public class SecMenu implements Serializable { result = prime * result + ((getMenuType() == null) ? 0 : getMenuType().hashCode()); result = prime * result + ((getMenuUrl() == null) ? 0 : getMenuUrl().hashCode()); result = prime * result + ((getMenuUrlImg() == null) ? 0 : getMenuUrlImg().hashCode()); + result = prime * result + ((getMenuFullUrl() == null) ? 0 : getMenuFullUrl().hashCode()); result = prime * result + ((getMenuPSid() == null) ? 0 : getMenuPSid().hashCode()); result = prime * result + ((getMenuSort() == null) ? 0 : getMenuSort().hashCode()); result = prime * result + ((getMenuDesc() == null) ? 0 : getMenuDesc().hashCode()); @@ -197,6 +212,7 @@ public class SecMenu implements Serializable { sb.append(", menuType=").append(menuType); sb.append(", menuUrl=").append(menuUrl); sb.append(", menuUrlImg=").append(menuUrlImg); + sb.append(", menuFullUrl=").append(menuFullUrl); sb.append(", menuPSid=").append(menuPSid); sb.append(", menuSort=").append(menuSort); sb.append(", menuDesc=").append(menuDesc); diff --git a/service/src/main/java/com/hfkj/entity/SecMenuExample.java b/service/src/main/java/com/hfkj/entity/SecMenuExample.java index af6da6b..c5e74a5 100644 --- a/service/src/main/java/com/hfkj/entity/SecMenuExample.java +++ b/service/src/main/java/com/hfkj/entity/SecMenuExample.java @@ -455,6 +455,76 @@ public class SecMenuExample { return (Criteria) this; } + public Criteria andMenuFullUrlIsNull() { + addCriterion("menu_full_url is null"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlIsNotNull() { + addCriterion("menu_full_url is not null"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlEqualTo(String value) { + addCriterion("menu_full_url =", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlNotEqualTo(String value) { + addCriterion("menu_full_url <>", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlGreaterThan(String value) { + addCriterion("menu_full_url >", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlGreaterThanOrEqualTo(String value) { + addCriterion("menu_full_url >=", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlLessThan(String value) { + addCriterion("menu_full_url <", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlLessThanOrEqualTo(String value) { + addCriterion("menu_full_url <=", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlLike(String value) { + addCriterion("menu_full_url like", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlNotLike(String value) { + addCriterion("menu_full_url not like", value, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlIn(List values) { + addCriterion("menu_full_url in", values, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlNotIn(List values) { + addCriterion("menu_full_url not in", values, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlBetween(String value1, String value2) { + addCriterion("menu_full_url between", value1, value2, "menuFullUrl"); + return (Criteria) this; + } + + public Criteria andMenuFullUrlNotBetween(String value1, String value2) { + addCriterion("menu_full_url not between", value1, value2, "menuFullUrl"); + return (Criteria) this; + } + public Criteria andMenuPSidIsNull() { addCriterion("menu_p_sid is null"); return (Criteria) this;