作者 钟来

集成权限模块

正在显示 52 个修改的文件 包含 4571 行增加25 行删除
@@ -18,6 +18,8 @@ public class BaseEntity @@ -18,6 +18,8 @@ public class BaseEntity
18 18
19 private String orderBy; //排序(如:"id desc,name asc") 19 private String orderBy; //排序(如:"id desc,name asc")
20 20
  21 + private String remark; //备注
  22 +
21 public Map<String, Object[]> getTimeMap() { 23 public Map<String, Object[]> getTimeMap() {
22 return timeMap; 24 return timeMap;
23 } 25 }
@@ -50,4 +52,12 @@ public class BaseEntity @@ -50,4 +52,12 @@ public class BaseEntity
50 public void setParams(Map<String, QueryType> params) { 52 public void setParams(Map<String, QueryType> params) {
51 this.params = params; 53 this.params = params;
52 } 54 }
  55 +
  56 + public String getRemark() {
  57 + return remark;
  58 + }
  59 +
  60 + public void setRemark(String remark) {
  61 + this.remark = remark;
  62 + }
53 } 63 }
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 参数配置表对象 sys_config
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("参数配置表")
  17 +public class SysConfig extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 参数主键 */
  22 + @ApiModelProperty("参数主键")
  23 + private Integer config_id;
  24 +
  25 + /** 参数名称 */
  26 + @ApiModelProperty("参数名称")
  27 + private String config_name;
  28 +
  29 + /** 参数键名 */
  30 + @ApiModelProperty("参数键名")
  31 + private String config_key;
  32 +
  33 + /** 参数键值 */
  34 + @ApiModelProperty("参数键值")
  35 + private String config_value;
  36 +
  37 + /** 系统内置(Y是 N否) */
  38 + @ApiModelProperty("系统内置(Y是 N否)")
  39 + private String config_type;
  40 +
  41 + /** 创建者 */
  42 + @ApiModelProperty("创建者")
  43 + private String create_by;
  44 +
  45 + /** 创建时间 */
  46 + @ApiModelProperty("创建时间")
  47 + private java.util.Date create_time;
  48 +
  49 + /** 更新者 */
  50 + @ApiModelProperty("更新者")
  51 + private String update_by;
  52 +
  53 + /** 更新时间 */
  54 + @ApiModelProperty("更新时间")
  55 + private java.util.Date update_time;
  56 +
  57 + public void setConfig_id(Integer config_id)
  58 + {
  59 + this.config_id = config_id;
  60 + }
  61 +
  62 + public Integer getConfig_id()
  63 + {
  64 + return config_id;
  65 + }
  66 + public void setConfig_name(String config_name)
  67 + {
  68 + this.config_name = config_name;
  69 + }
  70 +
  71 + public String getConfig_name()
  72 + {
  73 + return config_name;
  74 + }
  75 + public void setConfig_key(String config_key)
  76 + {
  77 + this.config_key = config_key;
  78 + }
  79 +
  80 + public String getConfig_key()
  81 + {
  82 + return config_key;
  83 + }
  84 + public void setConfig_value(String config_value)
  85 + {
  86 + this.config_value = config_value;
  87 + }
  88 +
  89 + public String getConfig_value()
  90 + {
  91 + return config_value;
  92 + }
  93 + public void setConfig_type(String config_type)
  94 + {
  95 + this.config_type = config_type;
  96 + }
  97 +
  98 + public String getConfig_type()
  99 + {
  100 + return config_type;
  101 + }
  102 + public void setCreate_by(String create_by)
  103 + {
  104 + this.create_by = create_by;
  105 + }
  106 +
  107 + public String getCreate_by()
  108 + {
  109 + return create_by;
  110 + }
  111 + public void setCreate_time(java.util.Date create_time)
  112 + {
  113 + this.create_time = create_time;
  114 + }
  115 +
  116 + public java.util.Date getCreate_time()
  117 + {
  118 + return create_time;
  119 + }
  120 + public void setUpdate_by(String update_by)
  121 + {
  122 + this.update_by = update_by;
  123 + }
  124 +
  125 + public String getUpdate_by()
  126 + {
  127 + return update_by;
  128 + }
  129 + public void setUpdate_time(java.util.Date update_time)
  130 + {
  131 + this.update_time = update_time;
  132 + }
  133 +
  134 + public java.util.Date getUpdate_time()
  135 + {
  136 + return update_time;
  137 + }
  138 +
  139 + @Override
  140 + public String toString() {
  141 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  142 + .append("config_id", getConfig_id())
  143 + .append("config_name", getConfig_name())
  144 + .append("config_key", getConfig_key())
  145 + .append("config_value", getConfig_value())
  146 + .append("config_type", getConfig_type())
  147 + .append("create_by", getCreate_by())
  148 + .append("create_time", getCreate_time())
  149 + .append("update_by", getUpdate_by())
  150 + .append("update_time", getUpdate_time())
  151 + .append("remark", getRemark())
  152 + .toString();
  153 + }
  154 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 部门表对象 sys_dept
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("部门表")
  17 +public class SysDept extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 部门id */
  22 + @ApiModelProperty("部门id")
  23 + private java.math.BigInteger dept_id;
  24 +
  25 + /** 父部门id */
  26 + @ApiModelProperty("父部门id")
  27 + private java.math.BigInteger parent_id;
  28 +
  29 + /** 祖级列表 */
  30 + @ApiModelProperty("祖级列表")
  31 + private String ancestors;
  32 +
  33 + /** 部门名称 */
  34 + @ApiModelProperty("部门名称")
  35 + private String dept_name;
  36 +
  37 + /** 显示顺序 */
  38 + @ApiModelProperty("显示顺序")
  39 + private Integer order_num;
  40 +
  41 + /** 负责人 */
  42 + @ApiModelProperty("负责人")
  43 + private String leader;
  44 +
  45 + /** 联系电话 */
  46 + @ApiModelProperty("联系电话")
  47 + private String phone;
  48 +
  49 + /** 邮箱 */
  50 + @ApiModelProperty("邮箱")
  51 + private String email;
  52 +
  53 + /** 部门状态(0正常 1停用) */
  54 + @ApiModelProperty("部门状态(0正常 1停用)")
  55 + private String status;
  56 +
  57 + /** 删除标志(0代表存在 2代表删除) */
  58 + @ApiModelProperty("删除标志(0代表存在 2代表删除)")
  59 + private String del_flag;
  60 +
  61 + /** 创建者 */
  62 + @ApiModelProperty("创建者")
  63 + private String create_by;
  64 +
  65 + /** 创建时间 */
  66 + @ApiModelProperty("创建时间")
  67 + private java.util.Date create_time;
  68 +
  69 + /** 更新者 */
  70 + @ApiModelProperty("更新者")
  71 + private String update_by;
  72 +
  73 + /** 更新时间 */
  74 + @ApiModelProperty("更新时间")
  75 + private java.util.Date update_time;
  76 +
  77 + public void setDept_id(java.math.BigInteger dept_id)
  78 + {
  79 + this.dept_id = dept_id;
  80 + }
  81 +
  82 + public java.math.BigInteger getDept_id()
  83 + {
  84 + return dept_id;
  85 + }
  86 + public void setParent_id(java.math.BigInteger parent_id)
  87 + {
  88 + this.parent_id = parent_id;
  89 + }
  90 +
  91 + public java.math.BigInteger getParent_id()
  92 + {
  93 + return parent_id;
  94 + }
  95 + public void setAncestors(String ancestors)
  96 + {
  97 + this.ancestors = ancestors;
  98 + }
  99 +
  100 + public String getAncestors()
  101 + {
  102 + return ancestors;
  103 + }
  104 + public void setDept_name(String dept_name)
  105 + {
  106 + this.dept_name = dept_name;
  107 + }
  108 +
  109 + public String getDept_name()
  110 + {
  111 + return dept_name;
  112 + }
  113 + public void setOrder_num(Integer order_num)
  114 + {
  115 + this.order_num = order_num;
  116 + }
  117 +
  118 + public Integer getOrder_num()
  119 + {
  120 + return order_num;
  121 + }
  122 + public void setLeader(String leader)
  123 + {
  124 + this.leader = leader;
  125 + }
  126 +
  127 + public String getLeader()
  128 + {
  129 + return leader;
  130 + }
  131 + public void setPhone(String phone)
  132 + {
  133 + this.phone = phone;
  134 + }
  135 +
  136 + public String getPhone()
  137 + {
  138 + return phone;
  139 + }
  140 + public void setEmail(String email)
  141 + {
  142 + this.email = email;
  143 + }
  144 +
  145 + public String getEmail()
  146 + {
  147 + return email;
  148 + }
  149 + public void setStatus(String status)
  150 + {
  151 + this.status = status;
  152 + }
  153 +
  154 + public String getStatus()
  155 + {
  156 + return status;
  157 + }
  158 + public void setDel_flag(String del_flag)
  159 + {
  160 + this.del_flag = del_flag;
  161 + }
  162 +
  163 + public String getDel_flag()
  164 + {
  165 + return del_flag;
  166 + }
  167 + public void setCreate_by(String create_by)
  168 + {
  169 + this.create_by = create_by;
  170 + }
  171 +
  172 + public String getCreate_by()
  173 + {
  174 + return create_by;
  175 + }
  176 + public void setCreate_time(java.util.Date create_time)
  177 + {
  178 + this.create_time = create_time;
  179 + }
  180 +
  181 + public java.util.Date getCreate_time()
  182 + {
  183 + return create_time;
  184 + }
  185 + public void setUpdate_by(String update_by)
  186 + {
  187 + this.update_by = update_by;
  188 + }
  189 +
  190 + public String getUpdate_by()
  191 + {
  192 + return update_by;
  193 + }
  194 + public void setUpdate_time(java.util.Date update_time)
  195 + {
  196 + this.update_time = update_time;
  197 + }
  198 +
  199 + public java.util.Date getUpdate_time()
  200 + {
  201 + return update_time;
  202 + }
  203 +
  204 + @Override
  205 + public String toString() {
  206 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  207 + .append("dept_id", getDept_id())
  208 + .append("parent_id", getParent_id())
  209 + .append("ancestors", getAncestors())
  210 + .append("dept_name", getDept_name())
  211 + .append("order_num", getOrder_num())
  212 + .append("leader", getLeader())
  213 + .append("phone", getPhone())
  214 + .append("email", getEmail())
  215 + .append("status", getStatus())
  216 + .append("del_flag", getDel_flag())
  217 + .append("create_by", getCreate_by())
  218 + .append("create_time", getCreate_time())
  219 + .append("update_by", getUpdate_by())
  220 + .append("update_time", getUpdate_time())
  221 + .toString();
  222 + }
  223 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 字典数据表对象 sys_dict_data
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("字典数据表")
  17 +public class SysDictData extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 字典编码 */
  22 + @ApiModelProperty("字典编码")
  23 + private java.math.BigInteger dict_code;
  24 +
  25 + /** 字典排序 */
  26 + @ApiModelProperty("字典排序")
  27 + private Integer dict_sort;
  28 +
  29 + /** 字典标签 */
  30 + @ApiModelProperty("字典标签")
  31 + private String dict_label;
  32 +
  33 + /** 字典键值 */
  34 + @ApiModelProperty("字典键值")
  35 + private String dict_value;
  36 +
  37 + /** 字典类型 */
  38 + @ApiModelProperty("字典类型")
  39 + private String dict_type;
  40 +
  41 + /** 样式属性(其他样式扩展) */
  42 + @ApiModelProperty("样式属性(其他样式扩展)")
  43 + private String css_class;
  44 +
  45 + /** 表格回显样式 */
  46 + @ApiModelProperty("表格回显样式")
  47 + private String list_class;
  48 +
  49 + /** 是否默认(Y是 N否) */
  50 + @ApiModelProperty("是否默认(Y是 N否)")
  51 + private String is_default;
  52 +
  53 + /** 状态(0正常 1停用) */
  54 + @ApiModelProperty("状态(0正常 1停用)")
  55 + private String status;
  56 +
  57 + /** 创建者 */
  58 + @ApiModelProperty("创建者")
  59 + private String create_by;
  60 +
  61 + /** 创建时间 */
  62 + @ApiModelProperty("创建时间")
  63 + private java.util.Date create_time;
  64 +
  65 + /** 更新者 */
  66 + @ApiModelProperty("更新者")
  67 + private String update_by;
  68 +
  69 + /** 更新时间 */
  70 + @ApiModelProperty("更新时间")
  71 + private java.util.Date update_time;
  72 +
  73 + public void setDict_code(java.math.BigInteger dict_code)
  74 + {
  75 + this.dict_code = dict_code;
  76 + }
  77 +
  78 + public java.math.BigInteger getDict_code()
  79 + {
  80 + return dict_code;
  81 + }
  82 + public void setDict_sort(Integer dict_sort)
  83 + {
  84 + this.dict_sort = dict_sort;
  85 + }
  86 +
  87 + public Integer getDict_sort()
  88 + {
  89 + return dict_sort;
  90 + }
  91 + public void setDict_label(String dict_label)
  92 + {
  93 + this.dict_label = dict_label;
  94 + }
  95 +
  96 + public String getDict_label()
  97 + {
  98 + return dict_label;
  99 + }
  100 + public void setDict_value(String dict_value)
  101 + {
  102 + this.dict_value = dict_value;
  103 + }
  104 +
  105 + public String getDict_value()
  106 + {
  107 + return dict_value;
  108 + }
  109 + public void setDict_type(String dict_type)
  110 + {
  111 + this.dict_type = dict_type;
  112 + }
  113 +
  114 + public String getDict_type()
  115 + {
  116 + return dict_type;
  117 + }
  118 + public void setCss_class(String css_class)
  119 + {
  120 + this.css_class = css_class;
  121 + }
  122 +
  123 + public String getCss_class()
  124 + {
  125 + return css_class;
  126 + }
  127 + public void setList_class(String list_class)
  128 + {
  129 + this.list_class = list_class;
  130 + }
  131 +
  132 + public String getList_class()
  133 + {
  134 + return list_class;
  135 + }
  136 + public void setIs_default(String is_default)
  137 + {
  138 + this.is_default = is_default;
  139 + }
  140 +
  141 + public String getIs_default()
  142 + {
  143 + return is_default;
  144 + }
  145 + public void setStatus(String status)
  146 + {
  147 + this.status = status;
  148 + }
  149 +
  150 + public String getStatus()
  151 + {
  152 + return status;
  153 + }
  154 + public void setCreate_by(String create_by)
  155 + {
  156 + this.create_by = create_by;
  157 + }
  158 +
  159 + public String getCreate_by()
  160 + {
  161 + return create_by;
  162 + }
  163 + public void setCreate_time(java.util.Date create_time)
  164 + {
  165 + this.create_time = create_time;
  166 + }
  167 +
  168 + public java.util.Date getCreate_time()
  169 + {
  170 + return create_time;
  171 + }
  172 + public void setUpdate_by(String update_by)
  173 + {
  174 + this.update_by = update_by;
  175 + }
  176 +
  177 + public String getUpdate_by()
  178 + {
  179 + return update_by;
  180 + }
  181 + public void setUpdate_time(java.util.Date update_time)
  182 + {
  183 + this.update_time = update_time;
  184 + }
  185 +
  186 + public java.util.Date getUpdate_time()
  187 + {
  188 + return update_time;
  189 + }
  190 +
  191 + @Override
  192 + public String toString() {
  193 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  194 + .append("dict_code", getDict_code())
  195 + .append("dict_sort", getDict_sort())
  196 + .append("dict_label", getDict_label())
  197 + .append("dict_value", getDict_value())
  198 + .append("dict_type", getDict_type())
  199 + .append("css_class", getCss_class())
  200 + .append("list_class", getList_class())
  201 + .append("is_default", getIs_default())
  202 + .append("status", getStatus())
  203 + .append("create_by", getCreate_by())
  204 + .append("create_time", getCreate_time())
  205 + .append("update_by", getUpdate_by())
  206 + .append("update_time", getUpdate_time())
  207 + .append("remark", getRemark())
  208 + .toString();
  209 + }
  210 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 字典类型表对象 sys_dict_type
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("字典类型表")
  17 +public class SysDictType extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 字典主键 */
  22 + @ApiModelProperty("字典主键")
  23 + private java.math.BigInteger dict_id;
  24 +
  25 + /** 字典名称 */
  26 + @ApiModelProperty("字典名称")
  27 + private String dict_name;
  28 +
  29 + /** 字典类型 */
  30 + @ApiModelProperty("字典类型")
  31 + private String dict_type;
  32 +
  33 + /** 状态(0正常 1停用) */
  34 + @ApiModelProperty("状态(0正常 1停用)")
  35 + private String status;
  36 +
  37 + /** 创建者 */
  38 + @ApiModelProperty("创建者")
  39 + private String create_by;
  40 +
  41 + /** 创建时间 */
  42 + @ApiModelProperty("创建时间")
  43 + private java.util.Date create_time;
  44 +
  45 + /** 更新者 */
  46 + @ApiModelProperty("更新者")
  47 + private String update_by;
  48 +
  49 + /** 更新时间 */
  50 + @ApiModelProperty("更新时间")
  51 + private java.util.Date update_time;
  52 +
  53 + public void setDict_id(java.math.BigInteger dict_id)
  54 + {
  55 + this.dict_id = dict_id;
  56 + }
  57 +
  58 + public java.math.BigInteger getDict_id()
  59 + {
  60 + return dict_id;
  61 + }
  62 + public void setDict_name(String dict_name)
  63 + {
  64 + this.dict_name = dict_name;
  65 + }
  66 +
  67 + public String getDict_name()
  68 + {
  69 + return dict_name;
  70 + }
  71 + public void setDict_type(String dict_type)
  72 + {
  73 + this.dict_type = dict_type;
  74 + }
  75 +
  76 + public String getDict_type()
  77 + {
  78 + return dict_type;
  79 + }
  80 + public void setStatus(String status)
  81 + {
  82 + this.status = status;
  83 + }
  84 +
  85 + public String getStatus()
  86 + {
  87 + return status;
  88 + }
  89 + public void setCreate_by(String create_by)
  90 + {
  91 + this.create_by = create_by;
  92 + }
  93 +
  94 + public String getCreate_by()
  95 + {
  96 + return create_by;
  97 + }
  98 + public void setCreate_time(java.util.Date create_time)
  99 + {
  100 + this.create_time = create_time;
  101 + }
  102 +
  103 + public java.util.Date getCreate_time()
  104 + {
  105 + return create_time;
  106 + }
  107 + public void setUpdate_by(String update_by)
  108 + {
  109 + this.update_by = update_by;
  110 + }
  111 +
  112 + public String getUpdate_by()
  113 + {
  114 + return update_by;
  115 + }
  116 + public void setUpdate_time(java.util.Date update_time)
  117 + {
  118 + this.update_time = update_time;
  119 + }
  120 +
  121 + public java.util.Date getUpdate_time()
  122 + {
  123 + return update_time;
  124 + }
  125 +
  126 + @Override
  127 + public String toString() {
  128 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  129 + .append("dict_id", getDict_id())
  130 + .append("dict_name", getDict_name())
  131 + .append("dict_type", getDict_type())
  132 + .append("status", getStatus())
  133 + .append("create_by", getCreate_by())
  134 + .append("create_time", getCreate_time())
  135 + .append("update_by", getUpdate_by())
  136 + .append("update_time", getUpdate_time())
  137 + .append("remark", getRemark())
  138 + .toString();
  139 + }
  140 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 定时任务调度表对象 sys_job
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("定时任务调度表")
  17 +public class SysJob extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 任务ID */
  22 + @ApiModelProperty("任务ID")
  23 + private java.math.BigInteger job_id;
  24 +
  25 + /** 任务名称 */
  26 + @ApiModelProperty("任务名称")
  27 + private String job_name;
  28 +
  29 + /** 任务组名 */
  30 + @ApiModelProperty("任务组名")
  31 + private String job_group;
  32 +
  33 + /** 调用目标字符串 */
  34 + @ApiModelProperty("调用目标字符串")
  35 + private String invoke_target;
  36 +
  37 + /** cron执行表达式 */
  38 + @ApiModelProperty("cron执行表达式")
  39 + private String cron_expression;
  40 +
  41 + /** 计划执行错误策略(1立即执行 2执行一次 3放弃执行) */
  42 + @ApiModelProperty("计划执行错误策略(1立即执行 2执行一次 3放弃执行)")
  43 + private String misfire_policy;
  44 +
  45 + /** 是否并发执行(0允许 1禁止) */
  46 + @ApiModelProperty("是否并发执行(0允许 1禁止)")
  47 + private String concurrent;
  48 +
  49 + /** 状态(0正常 1暂停) */
  50 + @ApiModelProperty("状态(0正常 1暂停)")
  51 + private String status;
  52 +
  53 + /** 创建者 */
  54 + @ApiModelProperty("创建者")
  55 + private String create_by;
  56 +
  57 + /** 创建时间 */
  58 + @ApiModelProperty("创建时间")
  59 + private java.util.Date create_time;
  60 +
  61 + /** 更新者 */
  62 + @ApiModelProperty("更新者")
  63 + private String update_by;
  64 +
  65 + /** 更新时间 */
  66 + @ApiModelProperty("更新时间")
  67 + private java.util.Date update_time;
  68 +
  69 + public void setJob_id(java.math.BigInteger job_id)
  70 + {
  71 + this.job_id = job_id;
  72 + }
  73 +
  74 + public java.math.BigInteger getJob_id()
  75 + {
  76 + return job_id;
  77 + }
  78 + public void setJob_name(String job_name)
  79 + {
  80 + this.job_name = job_name;
  81 + }
  82 +
  83 + public String getJob_name()
  84 + {
  85 + return job_name;
  86 + }
  87 + public void setJob_group(String job_group)
  88 + {
  89 + this.job_group = job_group;
  90 + }
  91 +
  92 + public String getJob_group()
  93 + {
  94 + return job_group;
  95 + }
  96 + public void setInvoke_target(String invoke_target)
  97 + {
  98 + this.invoke_target = invoke_target;
  99 + }
  100 +
  101 + public String getInvoke_target()
  102 + {
  103 + return invoke_target;
  104 + }
  105 + public void setCron_expression(String cron_expression)
  106 + {
  107 + this.cron_expression = cron_expression;
  108 + }
  109 +
  110 + public String getCron_expression()
  111 + {
  112 + return cron_expression;
  113 + }
  114 + public void setMisfire_policy(String misfire_policy)
  115 + {
  116 + this.misfire_policy = misfire_policy;
  117 + }
  118 +
  119 + public String getMisfire_policy()
  120 + {
  121 + return misfire_policy;
  122 + }
  123 + public void setConcurrent(String concurrent)
  124 + {
  125 + this.concurrent = concurrent;
  126 + }
  127 +
  128 + public String getConcurrent()
  129 + {
  130 + return concurrent;
  131 + }
  132 + public void setStatus(String status)
  133 + {
  134 + this.status = status;
  135 + }
  136 +
  137 + public String getStatus()
  138 + {
  139 + return status;
  140 + }
  141 + public void setCreate_by(String create_by)
  142 + {
  143 + this.create_by = create_by;
  144 + }
  145 +
  146 + public String getCreate_by()
  147 + {
  148 + return create_by;
  149 + }
  150 + public void setCreate_time(java.util.Date create_time)
  151 + {
  152 + this.create_time = create_time;
  153 + }
  154 +
  155 + public java.util.Date getCreate_time()
  156 + {
  157 + return create_time;
  158 + }
  159 + public void setUpdate_by(String update_by)
  160 + {
  161 + this.update_by = update_by;
  162 + }
  163 +
  164 + public String getUpdate_by()
  165 + {
  166 + return update_by;
  167 + }
  168 + public void setUpdate_time(java.util.Date update_time)
  169 + {
  170 + this.update_time = update_time;
  171 + }
  172 +
  173 + public java.util.Date getUpdate_time()
  174 + {
  175 + return update_time;
  176 + }
  177 +
  178 + @Override
  179 + public String toString() {
  180 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  181 + .append("job_id", getJob_id())
  182 + .append("job_name", getJob_name())
  183 + .append("job_group", getJob_group())
  184 + .append("invoke_target", getInvoke_target())
  185 + .append("cron_expression", getCron_expression())
  186 + .append("misfire_policy", getMisfire_policy())
  187 + .append("concurrent", getConcurrent())
  188 + .append("status", getStatus())
  189 + .append("create_by", getCreate_by())
  190 + .append("create_time", getCreate_time())
  191 + .append("update_by", getUpdate_by())
  192 + .append("update_time", getUpdate_time())
  193 + .append("remark", getRemark())
  194 + .toString();
  195 + }
  196 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 定时任务调度日志表对象 sys_job_log
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("定时任务调度日志表")
  17 +public class SysJobLog extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 任务日志ID */
  22 + @ApiModelProperty("任务日志ID")
  23 + private java.math.BigInteger job_log_id;
  24 +
  25 + /** 任务名称 */
  26 + @ApiModelProperty("任务名称")
  27 + private String job_name;
  28 +
  29 + /** 任务组名 */
  30 + @ApiModelProperty("任务组名")
  31 + private String job_group;
  32 +
  33 + /** 调用目标字符串 */
  34 + @ApiModelProperty("调用目标字符串")
  35 + private String invoke_target;
  36 +
  37 + /** 日志信息 */
  38 + @ApiModelProperty("日志信息")
  39 + private String job_message;
  40 +
  41 + /** 执行状态(0正常 1失败) */
  42 + @ApiModelProperty("执行状态(0正常 1失败)")
  43 + private String status;
  44 +
  45 + /** 异常信息 */
  46 + @ApiModelProperty("异常信息")
  47 + private String exception_info;
  48 +
  49 + /** 创建时间 */
  50 + @ApiModelProperty("创建时间")
  51 + private java.util.Date create_time;
  52 +
  53 + public void setJob_log_id(java.math.BigInteger job_log_id)
  54 + {
  55 + this.job_log_id = job_log_id;
  56 + }
  57 +
  58 + public java.math.BigInteger getJob_log_id()
  59 + {
  60 + return job_log_id;
  61 + }
  62 + public void setJob_name(String job_name)
  63 + {
  64 + this.job_name = job_name;
  65 + }
  66 +
  67 + public String getJob_name()
  68 + {
  69 + return job_name;
  70 + }
  71 + public void setJob_group(String job_group)
  72 + {
  73 + this.job_group = job_group;
  74 + }
  75 +
  76 + public String getJob_group()
  77 + {
  78 + return job_group;
  79 + }
  80 + public void setInvoke_target(String invoke_target)
  81 + {
  82 + this.invoke_target = invoke_target;
  83 + }
  84 +
  85 + public String getInvoke_target()
  86 + {
  87 + return invoke_target;
  88 + }
  89 + public void setJob_message(String job_message)
  90 + {
  91 + this.job_message = job_message;
  92 + }
  93 +
  94 + public String getJob_message()
  95 + {
  96 + return job_message;
  97 + }
  98 + public void setStatus(String status)
  99 + {
  100 + this.status = status;
  101 + }
  102 +
  103 + public String getStatus()
  104 + {
  105 + return status;
  106 + }
  107 + public void setException_info(String exception_info)
  108 + {
  109 + this.exception_info = exception_info;
  110 + }
  111 +
  112 + public String getException_info()
  113 + {
  114 + return exception_info;
  115 + }
  116 + public void setCreate_time(java.util.Date create_time)
  117 + {
  118 + this.create_time = create_time;
  119 + }
  120 +
  121 + public java.util.Date getCreate_time()
  122 + {
  123 + return create_time;
  124 + }
  125 +
  126 + @Override
  127 + public String toString() {
  128 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  129 + .append("job_log_id", getJob_log_id())
  130 + .append("job_name", getJob_name())
  131 + .append("job_group", getJob_group())
  132 + .append("invoke_target", getInvoke_target())
  133 + .append("job_message", getJob_message())
  134 + .append("status", getStatus())
  135 + .append("exception_info", getException_info())
  136 + .append("create_time", getCreate_time())
  137 + .toString();
  138 + }
  139 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 系统访问记录对象 sys_logininfor
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("系统访问记录")
  17 +public class SysLogininfor extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 访问ID */
  22 + @ApiModelProperty("访问ID")
  23 + private java.math.BigInteger info_id;
  24 +
  25 + /** 用户账号 */
  26 + @ApiModelProperty("用户账号")
  27 + private String user_name;
  28 +
  29 + /** 登录IP地址 */
  30 + @ApiModelProperty("登录IP地址")
  31 + private String ipaddr;
  32 +
  33 + /** 登录地点 */
  34 + @ApiModelProperty("登录地点")
  35 + private String login_location;
  36 +
  37 + /** 浏览器类型 */
  38 + @ApiModelProperty("浏览器类型")
  39 + private String browser;
  40 +
  41 + /** 操作系统 */
  42 + @ApiModelProperty("操作系统")
  43 + private String os;
  44 +
  45 + /** 登录状态(0成功 1失败) */
  46 + @ApiModelProperty("登录状态(0成功 1失败)")
  47 + private String status;
  48 +
  49 + /** 提示消息 */
  50 + @ApiModelProperty("提示消息")
  51 + private String msg;
  52 +
  53 + /** 访问时间 */
  54 + @ApiModelProperty("访问时间")
  55 + private java.util.Date login_time;
  56 +
  57 + public void setInfo_id(java.math.BigInteger info_id)
  58 + {
  59 + this.info_id = info_id;
  60 + }
  61 +
  62 + public java.math.BigInteger getInfo_id()
  63 + {
  64 + return info_id;
  65 + }
  66 + public void setUser_name(String user_name)
  67 + {
  68 + this.user_name = user_name;
  69 + }
  70 +
  71 + public String getUser_name()
  72 + {
  73 + return user_name;
  74 + }
  75 + public void setIpaddr(String ipaddr)
  76 + {
  77 + this.ipaddr = ipaddr;
  78 + }
  79 +
  80 + public String getIpaddr()
  81 + {
  82 + return ipaddr;
  83 + }
  84 + public void setLogin_location(String login_location)
  85 + {
  86 + this.login_location = login_location;
  87 + }
  88 +
  89 + public String getLogin_location()
  90 + {
  91 + return login_location;
  92 + }
  93 + public void setBrowser(String browser)
  94 + {
  95 + this.browser = browser;
  96 + }
  97 +
  98 + public String getBrowser()
  99 + {
  100 + return browser;
  101 + }
  102 + public void setOs(String os)
  103 + {
  104 + this.os = os;
  105 + }
  106 +
  107 + public String getOs()
  108 + {
  109 + return os;
  110 + }
  111 + public void setStatus(String status)
  112 + {
  113 + this.status = status;
  114 + }
  115 +
  116 + public String getStatus()
  117 + {
  118 + return status;
  119 + }
  120 + public void setMsg(String msg)
  121 + {
  122 + this.msg = msg;
  123 + }
  124 +
  125 + public String getMsg()
  126 + {
  127 + return msg;
  128 + }
  129 + public void setLogin_time(java.util.Date login_time)
  130 + {
  131 + this.login_time = login_time;
  132 + }
  133 +
  134 + public java.util.Date getLogin_time()
  135 + {
  136 + return login_time;
  137 + }
  138 +
  139 + @Override
  140 + public String toString() {
  141 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  142 + .append("info_id", getInfo_id())
  143 + .append("user_name", getUser_name())
  144 + .append("ipaddr", getIpaddr())
  145 + .append("login_location", getLogin_location())
  146 + .append("browser", getBrowser())
  147 + .append("os", getOs())
  148 + .append("status", getStatus())
  149 + .append("msg", getMsg())
  150 + .append("login_time", getLogin_time())
  151 + .toString();
  152 + }
  153 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 菜单权限表对象 sys_menu
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("菜单权限表")
  17 +public class SysMenu extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 菜单ID */
  22 + @ApiModelProperty("菜单ID")
  23 + private java.math.BigInteger menu_id;
  24 +
  25 + /** 菜单名称 */
  26 + @ApiModelProperty("菜单名称")
  27 + private String menu_name;
  28 +
  29 + /** 父菜单ID */
  30 + @ApiModelProperty("父菜单ID")
  31 + private java.math.BigInteger parent_id;
  32 +
  33 + /** 显示顺序 */
  34 + @ApiModelProperty("显示顺序")
  35 + private Integer order_num;
  36 +
  37 + /** 路由地址 */
  38 + @ApiModelProperty("路由地址")
  39 + private String path;
  40 +
  41 + /** 组件路径 */
  42 + @ApiModelProperty("组件路径")
  43 + private String component;
  44 +
  45 + /** 路由参数 */
  46 + @ApiModelProperty("路由参数")
  47 + private String query;
  48 +
  49 + /** 是否为外链(0是 1否) */
  50 + @ApiModelProperty("是否为外链(0是 1否)")
  51 + private Integer is_frame;
  52 +
  53 + /** 是否缓存(0缓存 1不缓存) */
  54 + @ApiModelProperty("是否缓存(0缓存 1不缓存)")
  55 + private Integer is_cache;
  56 +
  57 + /** 菜单类型(M目录 C菜单 F按钮) */
  58 + @ApiModelProperty("菜单类型(M目录 C菜单 F按钮)")
  59 + private String menu_type;
  60 +
  61 + /** 菜单状态(0显示 1隐藏) */
  62 + @ApiModelProperty("菜单状态(0显示 1隐藏)")
  63 + private String visible;
  64 +
  65 + /** 菜单状态(0正常 1停用) */
  66 + @ApiModelProperty("菜单状态(0正常 1停用)")
  67 + private String status;
  68 +
  69 + /** 权限标识 */
  70 + @ApiModelProperty("权限标识")
  71 + private String perms;
  72 +
  73 + /** 菜单图标 */
  74 + @ApiModelProperty("菜单图标")
  75 + private String icon;
  76 +
  77 + /** 创建者 */
  78 + @ApiModelProperty("创建者")
  79 + private String create_by;
  80 +
  81 + /** 创建时间 */
  82 + @ApiModelProperty("创建时间")
  83 + private java.util.Date create_time;
  84 +
  85 + /** 更新者 */
  86 + @ApiModelProperty("更新者")
  87 + private String update_by;
  88 +
  89 + /** 更新时间 */
  90 + @ApiModelProperty("更新时间")
  91 + private java.util.Date update_time;
  92 +
  93 + public void setMenu_id(java.math.BigInteger menu_id)
  94 + {
  95 + this.menu_id = menu_id;
  96 + }
  97 +
  98 + public java.math.BigInteger getMenu_id()
  99 + {
  100 + return menu_id;
  101 + }
  102 + public void setMenu_name(String menu_name)
  103 + {
  104 + this.menu_name = menu_name;
  105 + }
  106 +
  107 + public String getMenu_name()
  108 + {
  109 + return menu_name;
  110 + }
  111 + public void setParent_id(java.math.BigInteger parent_id)
  112 + {
  113 + this.parent_id = parent_id;
  114 + }
  115 +
  116 + public java.math.BigInteger getParent_id()
  117 + {
  118 + return parent_id;
  119 + }
  120 + public void setOrder_num(Integer order_num)
  121 + {
  122 + this.order_num = order_num;
  123 + }
  124 +
  125 + public Integer getOrder_num()
  126 + {
  127 + return order_num;
  128 + }
  129 + public void setPath(String path)
  130 + {
  131 + this.path = path;
  132 + }
  133 +
  134 + public String getPath()
  135 + {
  136 + return path;
  137 + }
  138 + public void setComponent(String component)
  139 + {
  140 + this.component = component;
  141 + }
  142 +
  143 + public String getComponent()
  144 + {
  145 + return component;
  146 + }
  147 + public void setQuery(String query)
  148 + {
  149 + this.query = query;
  150 + }
  151 +
  152 + public String getQuery()
  153 + {
  154 + return query;
  155 + }
  156 + public void setIs_frame(Integer is_frame)
  157 + {
  158 + this.is_frame = is_frame;
  159 + }
  160 +
  161 + public Integer getIs_frame()
  162 + {
  163 + return is_frame;
  164 + }
  165 + public void setIs_cache(Integer is_cache)
  166 + {
  167 + this.is_cache = is_cache;
  168 + }
  169 +
  170 + public Integer getIs_cache()
  171 + {
  172 + return is_cache;
  173 + }
  174 + public void setMenu_type(String menu_type)
  175 + {
  176 + this.menu_type = menu_type;
  177 + }
  178 +
  179 + public String getMenu_type()
  180 + {
  181 + return menu_type;
  182 + }
  183 + public void setVisible(String visible)
  184 + {
  185 + this.visible = visible;
  186 + }
  187 +
  188 + public String getVisible()
  189 + {
  190 + return visible;
  191 + }
  192 + public void setStatus(String status)
  193 + {
  194 + this.status = status;
  195 + }
  196 +
  197 + public String getStatus()
  198 + {
  199 + return status;
  200 + }
  201 + public void setPerms(String perms)
  202 + {
  203 + this.perms = perms;
  204 + }
  205 +
  206 + public String getPerms()
  207 + {
  208 + return perms;
  209 + }
  210 + public void setIcon(String icon)
  211 + {
  212 + this.icon = icon;
  213 + }
  214 +
  215 + public String getIcon()
  216 + {
  217 + return icon;
  218 + }
  219 + public void setCreate_by(String create_by)
  220 + {
  221 + this.create_by = create_by;
  222 + }
  223 +
  224 + public String getCreate_by()
  225 + {
  226 + return create_by;
  227 + }
  228 + public void setCreate_time(java.util.Date create_time)
  229 + {
  230 + this.create_time = create_time;
  231 + }
  232 +
  233 + public java.util.Date getCreate_time()
  234 + {
  235 + return create_time;
  236 + }
  237 + public void setUpdate_by(String update_by)
  238 + {
  239 + this.update_by = update_by;
  240 + }
  241 +
  242 + public String getUpdate_by()
  243 + {
  244 + return update_by;
  245 + }
  246 + public void setUpdate_time(java.util.Date update_time)
  247 + {
  248 + this.update_time = update_time;
  249 + }
  250 +
  251 + public java.util.Date getUpdate_time()
  252 + {
  253 + return update_time;
  254 + }
  255 +
  256 + @Override
  257 + public String toString() {
  258 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  259 + .append("menu_id", getMenu_id())
  260 + .append("menu_name", getMenu_name())
  261 + .append("parent_id", getParent_id())
  262 + .append("order_num", getOrder_num())
  263 + .append("path", getPath())
  264 + .append("component", getComponent())
  265 + .append("query", getQuery())
  266 + .append("is_frame", getIs_frame())
  267 + .append("is_cache", getIs_cache())
  268 + .append("menu_type", getMenu_type())
  269 + .append("visible", getVisible())
  270 + .append("status", getStatus())
  271 + .append("perms", getPerms())
  272 + .append("icon", getIcon())
  273 + .append("create_by", getCreate_by())
  274 + .append("create_time", getCreate_time())
  275 + .append("update_by", getUpdate_by())
  276 + .append("update_time", getUpdate_time())
  277 + .append("remark", getRemark())
  278 + .toString();
  279 + }
  280 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 通知公告表对象 sys_notice
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("通知公告表")
  17 +public class SysNotice extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 公告ID */
  22 + @ApiModelProperty("公告ID")
  23 + private Integer notice_id;
  24 +
  25 + /** 公告标题 */
  26 + @ApiModelProperty("公告标题")
  27 + private String notice_title;
  28 +
  29 + /** 公告类型(1通知 2公告) */
  30 + @ApiModelProperty("公告类型(1通知 2公告)")
  31 + private String notice_type;
  32 +
  33 + /** 公告内容 */
  34 + @ApiModelProperty("公告内容")
  35 + private String notice_content;
  36 +
  37 + /** 公告状态(0正常 1关闭) */
  38 + @ApiModelProperty("公告状态(0正常 1关闭)")
  39 + private String status;
  40 +
  41 + /** 创建者 */
  42 + @ApiModelProperty("创建者")
  43 + private String create_by;
  44 +
  45 + /** 创建时间 */
  46 + @ApiModelProperty("创建时间")
  47 + private java.util.Date create_time;
  48 +
  49 + /** 更新者 */
  50 + @ApiModelProperty("更新者")
  51 + private String update_by;
  52 +
  53 + /** 更新时间 */
  54 + @ApiModelProperty("更新时间")
  55 + private java.util.Date update_time;
  56 +
  57 + public void setNotice_id(Integer notice_id)
  58 + {
  59 + this.notice_id = notice_id;
  60 + }
  61 +
  62 + public Integer getNotice_id()
  63 + {
  64 + return notice_id;
  65 + }
  66 + public void setNotice_title(String notice_title)
  67 + {
  68 + this.notice_title = notice_title;
  69 + }
  70 +
  71 + public String getNotice_title()
  72 + {
  73 + return notice_title;
  74 + }
  75 + public void setNotice_type(String notice_type)
  76 + {
  77 + this.notice_type = notice_type;
  78 + }
  79 +
  80 + public String getNotice_type()
  81 + {
  82 + return notice_type;
  83 + }
  84 + public void setNotice_content(String notice_content)
  85 + {
  86 + this.notice_content = notice_content;
  87 + }
  88 +
  89 + public String getNotice_content()
  90 + {
  91 + return notice_content;
  92 + }
  93 + public void setStatus(String status)
  94 + {
  95 + this.status = status;
  96 + }
  97 +
  98 + public String getStatus()
  99 + {
  100 + return status;
  101 + }
  102 + public void setCreate_by(String create_by)
  103 + {
  104 + this.create_by = create_by;
  105 + }
  106 +
  107 + public String getCreate_by()
  108 + {
  109 + return create_by;
  110 + }
  111 + public void setCreate_time(java.util.Date create_time)
  112 + {
  113 + this.create_time = create_time;
  114 + }
  115 +
  116 + public java.util.Date getCreate_time()
  117 + {
  118 + return create_time;
  119 + }
  120 + public void setUpdate_by(String update_by)
  121 + {
  122 + this.update_by = update_by;
  123 + }
  124 +
  125 + public String getUpdate_by()
  126 + {
  127 + return update_by;
  128 + }
  129 + public void setUpdate_time(java.util.Date update_time)
  130 + {
  131 + this.update_time = update_time;
  132 + }
  133 +
  134 + public java.util.Date getUpdate_time()
  135 + {
  136 + return update_time;
  137 + }
  138 +
  139 + @Override
  140 + public String toString() {
  141 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  142 + .append("notice_id", getNotice_id())
  143 + .append("notice_title", getNotice_title())
  144 + .append("notice_type", getNotice_type())
  145 + .append("notice_content", getNotice_content())
  146 + .append("status", getStatus())
  147 + .append("create_by", getCreate_by())
  148 + .append("create_time", getCreate_time())
  149 + .append("update_by", getUpdate_by())
  150 + .append("update_time", getUpdate_time())
  151 + .append("remark", getRemark())
  152 + .toString();
  153 + }
  154 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 操作日志记录对象 sys_oper_log
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("操作日志记录")
  17 +public class SysOperLog extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 日志主键 */
  22 + @ApiModelProperty("日志主键")
  23 + private java.math.BigInteger oper_id;
  24 +
  25 + /** 模块标题 */
  26 + @ApiModelProperty("模块标题")
  27 + private String title;
  28 +
  29 + /** 业务类型(0其它 1新增 2修改 3删除) */
  30 + @ApiModelProperty("业务类型(0其它 1新增 2修改 3删除)")
  31 + private Integer business_type;
  32 +
  33 + /** 方法名称 */
  34 + @ApiModelProperty("方法名称")
  35 + private String method;
  36 +
  37 + /** 请求方式 */
  38 + @ApiModelProperty("请求方式")
  39 + private String request_method;
  40 +
  41 + /** 操作类别(0其它 1后台用户 2手机端用户) */
  42 + @ApiModelProperty("操作类别(0其它 1后台用户 2手机端用户)")
  43 + private Integer operator_type;
  44 +
  45 + /** 操作人员 */
  46 + @ApiModelProperty("操作人员")
  47 + private String oper_name;
  48 +
  49 + /** 部门名称 */
  50 + @ApiModelProperty("部门名称")
  51 + private String dept_name;
  52 +
  53 + /** 请求URL */
  54 + @ApiModelProperty("请求URL")
  55 + private String oper_url;
  56 +
  57 + /** 主机地址 */
  58 + @ApiModelProperty("主机地址")
  59 + private String oper_ip;
  60 +
  61 + /** 操作地点 */
  62 + @ApiModelProperty("操作地点")
  63 + private String oper_location;
  64 +
  65 + /** 请求参数 */
  66 + @ApiModelProperty("请求参数")
  67 + private String oper_param;
  68 +
  69 + /** 返回参数 */
  70 + @ApiModelProperty("返回参数")
  71 + private String json_result;
  72 +
  73 + /** 操作状态(0正常 1异常) */
  74 + @ApiModelProperty("操作状态(0正常 1异常)")
  75 + private Integer status;
  76 +
  77 + /** 错误消息 */
  78 + @ApiModelProperty("错误消息")
  79 + private String error_msg;
  80 +
  81 + /** 操作时间 */
  82 + @ApiModelProperty("操作时间")
  83 + private java.util.Date oper_time;
  84 +
  85 + /** 消耗时间 */
  86 + @ApiModelProperty("消耗时间")
  87 + private java.math.BigInteger cost_time;
  88 +
  89 + public void setOper_id(java.math.BigInteger oper_id)
  90 + {
  91 + this.oper_id = oper_id;
  92 + }
  93 +
  94 + public java.math.BigInteger getOper_id()
  95 + {
  96 + return oper_id;
  97 + }
  98 + public void setTitle(String title)
  99 + {
  100 + this.title = title;
  101 + }
  102 +
  103 + public String getTitle()
  104 + {
  105 + return title;
  106 + }
  107 + public void setBusiness_type(Integer business_type)
  108 + {
  109 + this.business_type = business_type;
  110 + }
  111 +
  112 + public Integer getBusiness_type()
  113 + {
  114 + return business_type;
  115 + }
  116 + public void setMethod(String method)
  117 + {
  118 + this.method = method;
  119 + }
  120 +
  121 + public String getMethod()
  122 + {
  123 + return method;
  124 + }
  125 + public void setRequest_method(String request_method)
  126 + {
  127 + this.request_method = request_method;
  128 + }
  129 +
  130 + public String getRequest_method()
  131 + {
  132 + return request_method;
  133 + }
  134 + public void setOperator_type(Integer operator_type)
  135 + {
  136 + this.operator_type = operator_type;
  137 + }
  138 +
  139 + public Integer getOperator_type()
  140 + {
  141 + return operator_type;
  142 + }
  143 + public void setOper_name(String oper_name)
  144 + {
  145 + this.oper_name = oper_name;
  146 + }
  147 +
  148 + public String getOper_name()
  149 + {
  150 + return oper_name;
  151 + }
  152 + public void setDept_name(String dept_name)
  153 + {
  154 + this.dept_name = dept_name;
  155 + }
  156 +
  157 + public String getDept_name()
  158 + {
  159 + return dept_name;
  160 + }
  161 + public void setOper_url(String oper_url)
  162 + {
  163 + this.oper_url = oper_url;
  164 + }
  165 +
  166 + public String getOper_url()
  167 + {
  168 + return oper_url;
  169 + }
  170 + public void setOper_ip(String oper_ip)
  171 + {
  172 + this.oper_ip = oper_ip;
  173 + }
  174 +
  175 + public String getOper_ip()
  176 + {
  177 + return oper_ip;
  178 + }
  179 + public void setOper_location(String oper_location)
  180 + {
  181 + this.oper_location = oper_location;
  182 + }
  183 +
  184 + public String getOper_location()
  185 + {
  186 + return oper_location;
  187 + }
  188 + public void setOper_param(String oper_param)
  189 + {
  190 + this.oper_param = oper_param;
  191 + }
  192 +
  193 + public String getOper_param()
  194 + {
  195 + return oper_param;
  196 + }
  197 + public void setJson_result(String json_result)
  198 + {
  199 + this.json_result = json_result;
  200 + }
  201 +
  202 + public String getJson_result()
  203 + {
  204 + return json_result;
  205 + }
  206 + public void setStatus(Integer status)
  207 + {
  208 + this.status = status;
  209 + }
  210 +
  211 + public Integer getStatus()
  212 + {
  213 + return status;
  214 + }
  215 + public void setError_msg(String error_msg)
  216 + {
  217 + this.error_msg = error_msg;
  218 + }
  219 +
  220 + public String getError_msg()
  221 + {
  222 + return error_msg;
  223 + }
  224 + public void setOper_time(java.util.Date oper_time)
  225 + {
  226 + this.oper_time = oper_time;
  227 + }
  228 +
  229 + public java.util.Date getOper_time()
  230 + {
  231 + return oper_time;
  232 + }
  233 + public void setCost_time(java.math.BigInteger cost_time)
  234 + {
  235 + this.cost_time = cost_time;
  236 + }
  237 +
  238 + public java.math.BigInteger getCost_time()
  239 + {
  240 + return cost_time;
  241 + }
  242 +
  243 + @Override
  244 + public String toString() {
  245 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  246 + .append("oper_id", getOper_id())
  247 + .append("title", getTitle())
  248 + .append("business_type", getBusiness_type())
  249 + .append("method", getMethod())
  250 + .append("request_method", getRequest_method())
  251 + .append("operator_type", getOperator_type())
  252 + .append("oper_name", getOper_name())
  253 + .append("dept_name", getDept_name())
  254 + .append("oper_url", getOper_url())
  255 + .append("oper_ip", getOper_ip())
  256 + .append("oper_location", getOper_location())
  257 + .append("oper_param", getOper_param())
  258 + .append("json_result", getJson_result())
  259 + .append("status", getStatus())
  260 + .append("error_msg", getError_msg())
  261 + .append("oper_time", getOper_time())
  262 + .append("cost_time", getCost_time())
  263 + .toString();
  264 + }
  265 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 岗位信息表对象 sys_post
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("岗位信息表")
  17 +public class SysPost extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 岗位ID */
  22 + @ApiModelProperty("岗位ID")
  23 + private java.math.BigInteger post_id;
  24 +
  25 + /** 岗位编码 */
  26 + @ApiModelProperty("岗位编码")
  27 + private String post_code;
  28 +
  29 + /** 岗位名称 */
  30 + @ApiModelProperty("岗位名称")
  31 + private String post_name;
  32 +
  33 + /** 显示顺序 */
  34 + @ApiModelProperty("显示顺序")
  35 + private Integer post_sort;
  36 +
  37 + /** 状态(0正常 1停用) */
  38 + @ApiModelProperty("状态(0正常 1停用)")
  39 + private String status;
  40 +
  41 + /** 创建者 */
  42 + @ApiModelProperty("创建者")
  43 + private String create_by;
  44 +
  45 + /** 创建时间 */
  46 + @ApiModelProperty("创建时间")
  47 + private java.util.Date create_time;
  48 +
  49 + /** 更新者 */
  50 + @ApiModelProperty("更新者")
  51 + private String update_by;
  52 +
  53 + /** 更新时间 */
  54 + @ApiModelProperty("更新时间")
  55 + private java.util.Date update_time;
  56 +
  57 + public void setPost_id(java.math.BigInteger post_id)
  58 + {
  59 + this.post_id = post_id;
  60 + }
  61 +
  62 + public java.math.BigInteger getPost_id()
  63 + {
  64 + return post_id;
  65 + }
  66 + public void setPost_code(String post_code)
  67 + {
  68 + this.post_code = post_code;
  69 + }
  70 +
  71 + public String getPost_code()
  72 + {
  73 + return post_code;
  74 + }
  75 + public void setPost_name(String post_name)
  76 + {
  77 + this.post_name = post_name;
  78 + }
  79 +
  80 + public String getPost_name()
  81 + {
  82 + return post_name;
  83 + }
  84 + public void setPost_sort(Integer post_sort)
  85 + {
  86 + this.post_sort = post_sort;
  87 + }
  88 +
  89 + public Integer getPost_sort()
  90 + {
  91 + return post_sort;
  92 + }
  93 + public void setStatus(String status)
  94 + {
  95 + this.status = status;
  96 + }
  97 +
  98 + public String getStatus()
  99 + {
  100 + return status;
  101 + }
  102 + public void setCreate_by(String create_by)
  103 + {
  104 + this.create_by = create_by;
  105 + }
  106 +
  107 + public String getCreate_by()
  108 + {
  109 + return create_by;
  110 + }
  111 + public void setCreate_time(java.util.Date create_time)
  112 + {
  113 + this.create_time = create_time;
  114 + }
  115 +
  116 + public java.util.Date getCreate_time()
  117 + {
  118 + return create_time;
  119 + }
  120 + public void setUpdate_by(String update_by)
  121 + {
  122 + this.update_by = update_by;
  123 + }
  124 +
  125 + public String getUpdate_by()
  126 + {
  127 + return update_by;
  128 + }
  129 + public void setUpdate_time(java.util.Date update_time)
  130 + {
  131 + this.update_time = update_time;
  132 + }
  133 +
  134 + public java.util.Date getUpdate_time()
  135 + {
  136 + return update_time;
  137 + }
  138 +
  139 + @Override
  140 + public String toString() {
  141 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  142 + .append("post_id", getPost_id())
  143 + .append("post_code", getPost_code())
  144 + .append("post_name", getPost_name())
  145 + .append("post_sort", getPost_sort())
  146 + .append("status", getStatus())
  147 + .append("create_by", getCreate_by())
  148 + .append("create_time", getCreate_time())
  149 + .append("update_by", getUpdate_by())
  150 + .append("update_time", getUpdate_time())
  151 + .append("remark", getRemark())
  152 + .toString();
  153 + }
  154 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 角色信息表对象 sys_role
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("角色信息表")
  17 +public class SysRole extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 角色ID */
  22 + @ApiModelProperty("角色ID")
  23 + private java.math.BigInteger role_id;
  24 +
  25 + /** 角色名称 */
  26 + @ApiModelProperty("角色名称")
  27 + private String role_name;
  28 +
  29 + /** 角色权限字符串 */
  30 + @ApiModelProperty("角色权限字符串")
  31 + private String role_key;
  32 +
  33 + /** 显示顺序 */
  34 + @ApiModelProperty("显示顺序")
  35 + private Integer role_sort;
  36 +
  37 + /** 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) */
  38 + @ApiModelProperty("数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")
  39 + private String data_scope;
  40 +
  41 + /** 菜单树选择项是否关联显示 */
  42 + @ApiModelProperty("菜单树选择项是否关联显示")
  43 + private Integer menu_check_strictly;
  44 +
  45 + /** 部门树选择项是否关联显示 */
  46 + @ApiModelProperty("部门树选择项是否关联显示")
  47 + private Integer dept_check_strictly;
  48 +
  49 + /** 角色状态(0正常 1停用) */
  50 + @ApiModelProperty("角色状态(0正常 1停用)")
  51 + private String status;
  52 +
  53 + /** 删除标志(0代表存在 2代表删除) */
  54 + @ApiModelProperty("删除标志(0代表存在 2代表删除)")
  55 + private String del_flag;
  56 +
  57 + /** 创建者 */
  58 + @ApiModelProperty("创建者")
  59 + private String create_by;
  60 +
  61 + /** 创建时间 */
  62 + @ApiModelProperty("创建时间")
  63 + private java.util.Date create_time;
  64 +
  65 + /** 更新者 */
  66 + @ApiModelProperty("更新者")
  67 + private String update_by;
  68 +
  69 + /** 更新时间 */
  70 + @ApiModelProperty("更新时间")
  71 + private java.util.Date update_time;
  72 +
  73 + public void setRole_id(java.math.BigInteger role_id)
  74 + {
  75 + this.role_id = role_id;
  76 + }
  77 +
  78 + public java.math.BigInteger getRole_id()
  79 + {
  80 + return role_id;
  81 + }
  82 + public void setRole_name(String role_name)
  83 + {
  84 + this.role_name = role_name;
  85 + }
  86 +
  87 + public String getRole_name()
  88 + {
  89 + return role_name;
  90 + }
  91 + public void setRole_key(String role_key)
  92 + {
  93 + this.role_key = role_key;
  94 + }
  95 +
  96 + public String getRole_key()
  97 + {
  98 + return role_key;
  99 + }
  100 + public void setRole_sort(Integer role_sort)
  101 + {
  102 + this.role_sort = role_sort;
  103 + }
  104 +
  105 + public Integer getRole_sort()
  106 + {
  107 + return role_sort;
  108 + }
  109 + public void setData_scope(String data_scope)
  110 + {
  111 + this.data_scope = data_scope;
  112 + }
  113 +
  114 + public String getData_scope()
  115 + {
  116 + return data_scope;
  117 + }
  118 + public void setMenu_check_strictly(Integer menu_check_strictly)
  119 + {
  120 + this.menu_check_strictly = menu_check_strictly;
  121 + }
  122 +
  123 + public Integer getMenu_check_strictly()
  124 + {
  125 + return menu_check_strictly;
  126 + }
  127 + public void setDept_check_strictly(Integer dept_check_strictly)
  128 + {
  129 + this.dept_check_strictly = dept_check_strictly;
  130 + }
  131 +
  132 + public Integer getDept_check_strictly()
  133 + {
  134 + return dept_check_strictly;
  135 + }
  136 + public void setStatus(String status)
  137 + {
  138 + this.status = status;
  139 + }
  140 +
  141 + public String getStatus()
  142 + {
  143 + return status;
  144 + }
  145 + public void setDel_flag(String del_flag)
  146 + {
  147 + this.del_flag = del_flag;
  148 + }
  149 +
  150 + public String getDel_flag()
  151 + {
  152 + return del_flag;
  153 + }
  154 + public void setCreate_by(String create_by)
  155 + {
  156 + this.create_by = create_by;
  157 + }
  158 +
  159 + public String getCreate_by()
  160 + {
  161 + return create_by;
  162 + }
  163 + public void setCreate_time(java.util.Date create_time)
  164 + {
  165 + this.create_time = create_time;
  166 + }
  167 +
  168 + public java.util.Date getCreate_time()
  169 + {
  170 + return create_time;
  171 + }
  172 + public void setUpdate_by(String update_by)
  173 + {
  174 + this.update_by = update_by;
  175 + }
  176 +
  177 + public String getUpdate_by()
  178 + {
  179 + return update_by;
  180 + }
  181 + public void setUpdate_time(java.util.Date update_time)
  182 + {
  183 + this.update_time = update_time;
  184 + }
  185 +
  186 + public java.util.Date getUpdate_time()
  187 + {
  188 + return update_time;
  189 + }
  190 +
  191 + @Override
  192 + public String toString() {
  193 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  194 + .append("role_id", getRole_id())
  195 + .append("role_name", getRole_name())
  196 + .append("role_key", getRole_key())
  197 + .append("role_sort", getRole_sort())
  198 + .append("data_scope", getData_scope())
  199 + .append("menu_check_strictly", getMenu_check_strictly())
  200 + .append("dept_check_strictly", getDept_check_strictly())
  201 + .append("status", getStatus())
  202 + .append("del_flag", getDel_flag())
  203 + .append("create_by", getCreate_by())
  204 + .append("create_time", getCreate_time())
  205 + .append("update_by", getUpdate_by())
  206 + .append("update_time", getUpdate_time())
  207 + .append("remark", getRemark())
  208 + .toString();
  209 + }
  210 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 角色和部门关联表对象 sys_role_dept
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("角色和部门关联表")
  17 +public class SysRoleDept extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 角色ID */
  22 + @ApiModelProperty("角色ID")
  23 + private java.math.BigInteger role_id;
  24 +
  25 + /** 部门ID */
  26 + @ApiModelProperty("部门ID")
  27 + private java.math.BigInteger dept_id;
  28 +
  29 + public void setRole_id(java.math.BigInteger role_id)
  30 + {
  31 + this.role_id = role_id;
  32 + }
  33 +
  34 + public java.math.BigInteger getRole_id()
  35 + {
  36 + return role_id;
  37 + }
  38 + public void setDept_id(java.math.BigInteger dept_id)
  39 + {
  40 + this.dept_id = dept_id;
  41 + }
  42 +
  43 + public java.math.BigInteger getDept_id()
  44 + {
  45 + return dept_id;
  46 + }
  47 +
  48 + @Override
  49 + public String toString() {
  50 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  51 + .append("role_id", getRole_id())
  52 + .append("dept_id", getDept_id())
  53 + .toString();
  54 + }
  55 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 角色和菜单关联表对象 sys_role_menu
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("角色和菜单关联表")
  17 +public class SysRoleMenu extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 角色ID */
  22 + @ApiModelProperty("角色ID")
  23 + private java.math.BigInteger role_id;
  24 +
  25 + /** 菜单ID */
  26 + @ApiModelProperty("菜单ID")
  27 + private java.math.BigInteger menu_id;
  28 +
  29 + public void setRole_id(java.math.BigInteger role_id)
  30 + {
  31 + this.role_id = role_id;
  32 + }
  33 +
  34 + public java.math.BigInteger getRole_id()
  35 + {
  36 + return role_id;
  37 + }
  38 + public void setMenu_id(java.math.BigInteger menu_id)
  39 + {
  40 + this.menu_id = menu_id;
  41 + }
  42 +
  43 + public java.math.BigInteger getMenu_id()
  44 + {
  45 + return menu_id;
  46 + }
  47 +
  48 + @Override
  49 + public String toString() {
  50 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  51 + .append("role_id", getRole_id())
  52 + .append("menu_id", getMenu_id())
  53 + .toString();
  54 + }
  55 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 用户信息表对象 sys_user
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("用户信息表")
  17 +public class SysUser extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 用户ID */
  22 + @ApiModelProperty("用户ID")
  23 + private java.math.BigInteger user_id;
  24 +
  25 + /** 部门ID */
  26 + @ApiModelProperty("部门ID")
  27 + private java.math.BigInteger dept_id;
  28 +
  29 + /** 用户账号 */
  30 + @ApiModelProperty("用户账号")
  31 + private String user_name;
  32 +
  33 + /** 用户昵称 */
  34 + @ApiModelProperty("用户昵称")
  35 + private String nick_name;
  36 +
  37 + /** 用户类型(00系统用户) */
  38 + @ApiModelProperty("用户类型(00系统用户)")
  39 + private String user_type;
  40 +
  41 + /** 用户邮箱 */
  42 + @ApiModelProperty("用户邮箱")
  43 + private String email;
  44 +
  45 + /** 手机号码 */
  46 + @ApiModelProperty("手机号码")
  47 + private String phonenumber;
  48 +
  49 + /** 用户性别(0男 1女 2未知) */
  50 + @ApiModelProperty("用户性别(0男 1女 2未知)")
  51 + private String sex;
  52 +
  53 + /** 头像地址 */
  54 + @ApiModelProperty("头像地址")
  55 + private String avatar;
  56 +
  57 + /** 密码 */
  58 + @ApiModelProperty("密码")
  59 + private String password;
  60 +
  61 + /** 帐号状态(0正常 1停用) */
  62 + @ApiModelProperty("帐号状态(0正常 1停用)")
  63 + private String status;
  64 +
  65 + /** 删除标志(0代表存在 2代表删除) */
  66 + @ApiModelProperty("删除标志(0代表存在 2代表删除)")
  67 + private String del_flag;
  68 +
  69 + /** 最后登录IP */
  70 + @ApiModelProperty("最后登录IP")
  71 + private String login_ip;
  72 +
  73 + /** 最后登录时间 */
  74 + @ApiModelProperty("最后登录时间")
  75 + private java.util.Date login_date;
  76 +
  77 + /** 创建者 */
  78 + @ApiModelProperty("创建者")
  79 + private String create_by;
  80 +
  81 + /** 创建时间 */
  82 + @ApiModelProperty("创建时间")
  83 + private java.util.Date create_time;
  84 +
  85 + /** 更新者 */
  86 + @ApiModelProperty("更新者")
  87 + private String update_by;
  88 +
  89 + /** 更新时间 */
  90 + @ApiModelProperty("更新时间")
  91 + private java.util.Date update_time;
  92 +
  93 + public void setUser_id(java.math.BigInteger user_id)
  94 + {
  95 + this.user_id = user_id;
  96 + }
  97 +
  98 + public java.math.BigInteger getUser_id()
  99 + {
  100 + return user_id;
  101 + }
  102 + public void setDept_id(java.math.BigInteger dept_id)
  103 + {
  104 + this.dept_id = dept_id;
  105 + }
  106 +
  107 + public java.math.BigInteger getDept_id()
  108 + {
  109 + return dept_id;
  110 + }
  111 + public void setUser_name(String user_name)
  112 + {
  113 + this.user_name = user_name;
  114 + }
  115 +
  116 + public String getUser_name()
  117 + {
  118 + return user_name;
  119 + }
  120 + public void setNick_name(String nick_name)
  121 + {
  122 + this.nick_name = nick_name;
  123 + }
  124 +
  125 + public String getNick_name()
  126 + {
  127 + return nick_name;
  128 + }
  129 + public void setUser_type(String user_type)
  130 + {
  131 + this.user_type = user_type;
  132 + }
  133 +
  134 + public String getUser_type()
  135 + {
  136 + return user_type;
  137 + }
  138 + public void setEmail(String email)
  139 + {
  140 + this.email = email;
  141 + }
  142 +
  143 + public String getEmail()
  144 + {
  145 + return email;
  146 + }
  147 + public void setPhonenumber(String phonenumber)
  148 + {
  149 + this.phonenumber = phonenumber;
  150 + }
  151 +
  152 + public String getPhonenumber()
  153 + {
  154 + return phonenumber;
  155 + }
  156 + public void setSex(String sex)
  157 + {
  158 + this.sex = sex;
  159 + }
  160 +
  161 + public String getSex()
  162 + {
  163 + return sex;
  164 + }
  165 + public void setAvatar(String avatar)
  166 + {
  167 + this.avatar = avatar;
  168 + }
  169 +
  170 + public String getAvatar()
  171 + {
  172 + return avatar;
  173 + }
  174 + public void setPassword(String password)
  175 + {
  176 + this.password = password;
  177 + }
  178 +
  179 + public String getPassword()
  180 + {
  181 + return password;
  182 + }
  183 + public void setStatus(String status)
  184 + {
  185 + this.status = status;
  186 + }
  187 +
  188 + public String getStatus()
  189 + {
  190 + return status;
  191 + }
  192 + public void setDel_flag(String del_flag)
  193 + {
  194 + this.del_flag = del_flag;
  195 + }
  196 +
  197 + public String getDel_flag()
  198 + {
  199 + return del_flag;
  200 + }
  201 + public void setLogin_ip(String login_ip)
  202 + {
  203 + this.login_ip = login_ip;
  204 + }
  205 +
  206 + public String getLogin_ip()
  207 + {
  208 + return login_ip;
  209 + }
  210 + public void setLogin_date(java.util.Date login_date)
  211 + {
  212 + this.login_date = login_date;
  213 + }
  214 +
  215 + public java.util.Date getLogin_date()
  216 + {
  217 + return login_date;
  218 + }
  219 + public void setCreate_by(String create_by)
  220 + {
  221 + this.create_by = create_by;
  222 + }
  223 +
  224 + public String getCreate_by()
  225 + {
  226 + return create_by;
  227 + }
  228 + public void setCreate_time(java.util.Date create_time)
  229 + {
  230 + this.create_time = create_time;
  231 + }
  232 +
  233 + public java.util.Date getCreate_time()
  234 + {
  235 + return create_time;
  236 + }
  237 + public void setUpdate_by(String update_by)
  238 + {
  239 + this.update_by = update_by;
  240 + }
  241 +
  242 + public String getUpdate_by()
  243 + {
  244 + return update_by;
  245 + }
  246 + public void setUpdate_time(java.util.Date update_time)
  247 + {
  248 + this.update_time = update_time;
  249 + }
  250 +
  251 + public java.util.Date getUpdate_time()
  252 + {
  253 + return update_time;
  254 + }
  255 +
  256 + @Override
  257 + public String toString() {
  258 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  259 + .append("user_id", getUser_id())
  260 + .append("dept_id", getDept_id())
  261 + .append("user_name", getUser_name())
  262 + .append("nick_name", getNick_name())
  263 + .append("user_type", getUser_type())
  264 + .append("email", getEmail())
  265 + .append("phonenumber", getPhonenumber())
  266 + .append("sex", getSex())
  267 + .append("avatar", getAvatar())
  268 + .append("password", getPassword())
  269 + .append("status", getStatus())
  270 + .append("del_flag", getDel_flag())
  271 + .append("login_ip", getLogin_ip())
  272 + .append("login_date", getLogin_date())
  273 + .append("create_by", getCreate_by())
  274 + .append("create_time", getCreate_time())
  275 + .append("update_by", getUpdate_by())
  276 + .append("update_time", getUpdate_time())
  277 + .append("remark", getRemark())
  278 + .toString();
  279 + }
  280 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 用户与岗位关联表对象 sys_user_post
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("用户与岗位关联表")
  17 +public class SysUserPost extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 用户ID */
  22 + @ApiModelProperty("用户ID")
  23 + private java.math.BigInteger user_id;
  24 +
  25 + /** 岗位ID */
  26 + @ApiModelProperty("岗位ID")
  27 + private java.math.BigInteger post_id;
  28 +
  29 + public void setUser_id(java.math.BigInteger user_id)
  30 + {
  31 + this.user_id = user_id;
  32 + }
  33 +
  34 + public java.math.BigInteger getUser_id()
  35 + {
  36 + return user_id;
  37 + }
  38 + public void setPost_id(java.math.BigInteger post_id)
  39 + {
  40 + this.post_id = post_id;
  41 + }
  42 +
  43 + public java.math.BigInteger getPost_id()
  44 + {
  45 + return post_id;
  46 + }
  47 +
  48 + @Override
  49 + public String toString() {
  50 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  51 + .append("user_id", getUser_id())
  52 + .append("post_id", getPost_id())
  53 + .toString();
  54 + }
  55 +}
  1 +package com.zhonglai.luhui.domain.sys;
  2 +
  3 +
  4 +import com.zhonglai.luhui.util.sql.BaseEntity;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import org.apache.commons.lang3.builder.ToStringBuilder;
  8 +import org.apache.commons.lang3.builder.ToStringStyle;
  9 +
  10 +/**
  11 + * 用户和角色关联表对象 sys_user_role
  12 + *
  13 + * @author 钟来
  14 + * @date 2024-04-15
  15 + */
  16 +@ApiModel("用户和角色关联表")
  17 +public class SysUserRole extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 用户ID */
  22 + @ApiModelProperty("用户ID")
  23 + private java.math.BigInteger user_id;
  24 +
  25 + /** 角色ID */
  26 + @ApiModelProperty("角色ID")
  27 + private java.math.BigInteger role_id;
  28 +
  29 + public void setUser_id(java.math.BigInteger user_id)
  30 + {
  31 + this.user_id = user_id;
  32 + }
  33 +
  34 + public java.math.BigInteger getUser_id()
  35 + {
  36 + return user_id;
  37 + }
  38 + public void setRole_id(java.math.BigInteger role_id)
  39 + {
  40 + this.role_id = role_id;
  41 + }
  42 +
  43 + public java.math.BigInteger getRole_id()
  44 + {
  45 + return role_id;
  46 + }
  47 +
  48 + @Override
  49 + public String toString() {
  50 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  51 + .append("user_id", getUser_id())
  52 + .append("role_id", getRole_id())
  53 + .toString();
  54 + }
  55 +}
1 package com.zhonglai.luhui.redis.config; 1 package com.zhonglai.luhui.redis.config;
2 2
3 -import com.zhonglai.luhui.redis.service.RedisService; 3 +import com.zhonglai.luhui.redis.service.RedisClien;
4 import redis.clients.jedis.JedisPoolConfig; 4 import redis.clients.jedis.JedisPoolConfig;
5 5
6 -import java.io.File;  
7 import java.io.FileInputStream; 6 import java.io.FileInputStream;
8 import java.io.IOException; 7 import java.io.IOException;
9 import java.io.InputStream; 8 import java.io.InputStream;
@@ -85,7 +84,7 @@ public class RedisConfig { @@ -85,7 +84,7 @@ public class RedisConfig {
85 { 84 {
86 // 加载属性文件 85 // 加载属性文件
87 Properties properties = new Properties(); 86 Properties properties = new Properties();
88 - try (InputStream input = RedisService.class.getClassLoader().getResourceAsStream("jedis.properties")) { 87 + try (InputStream input = RedisClien.class.getClassLoader().getResourceAsStream("jedis.properties")) {
89 if (input == null) { 88 if (input == null) {
90 System.out.println("Cannot find jedis.properties file in the classpath"); 89 System.out.println("Cannot find jedis.properties file in the classpath");
91 return properties; 90 return properties;
@@ -4,11 +4,11 @@ import com.zhonglai.luhui.redis.config.RedisConfig; @@ -4,11 +4,11 @@ import com.zhonglai.luhui.redis.config.RedisConfig;
4 import redis.clients.jedis.Jedis; 4 import redis.clients.jedis.Jedis;
5 import redis.clients.jedis.JedisPool; 5 import redis.clients.jedis.JedisPool;
6 6
7 -public class RedisService { 7 +public class RedisClien {
8 8
9 private JedisPool jedisPool; 9 private JedisPool jedisPool;
10 10
11 - public RedisService(RedisConfig redisConfig) 11 + public RedisClien(RedisConfig redisConfig)
12 { 12 {
13 // 创建JedisPool实例,并传入密码 13 // 创建JedisPool实例,并传入密码
14 jedisPool = new JedisPool(redisConfig.getPoolConfig(), redisConfig.getHost(), redisConfig.getPort(), redisConfig.getTimeout(),redisConfig.getUser(), redisConfig.getPassword(),redisConfig.getDatabase()); 14 jedisPool = new JedisPool(redisConfig.getPoolConfig(), redisConfig.getHost(), redisConfig.getPort(), redisConfig.getTimeout(),redisConfig.getUser(), redisConfig.getPassword(),redisConfig.getDatabase());
@@ -19,11 +19,18 @@ public class RedisService { @@ -19,11 +19,18 @@ public class RedisService {
19 return jedisPool.getResource(); 19 return jedisPool.getResource();
20 } 20 }
21 21
22 - public void exeJedis(RedisServiceExe redisServiceExe) 22 + public void exeJedis(RedisClienExe redisServiceExe)
23 { 23 {
24 Jedis jedis = getJedis(); 24 Jedis jedis = getJedis();
25 redisServiceExe.exe(jedis); 25 redisServiceExe.exe(jedis);
26 jedis.close();//归还连接池 26 jedis.close();//归还连接池
27 } 27 }
28 28
  29 + public <T> T exeGetJedis(Class<T> tClass,RedisClienQuery redisClienQuery)
  30 + {
  31 + Jedis jedis = getJedis();
  32 + T t = redisClienQuery.exe(jedis,tClass);
  33 + jedis.close();//归还连接池
  34 + return t;
  35 + }
29 } 36 }
@@ -2,6 +2,6 @@ package com.zhonglai.luhui.redis.service; @@ -2,6 +2,6 @@ package com.zhonglai.luhui.redis.service;
2 2
3 import redis.clients.jedis.Jedis; 3 import redis.clients.jedis.Jedis;
4 4
5 -public interface RedisServiceExe { 5 +public interface RedisClienExe {
6 void exe(Jedis jedis); 6 void exe(Jedis jedis);
7 } 7 }
  1 +package com.zhonglai.luhui.redis.service;
  2 +
  3 +import redis.clients.jedis.Jedis;
  4 +
  5 +public interface RedisClienQuery {
  6 + <T> T exe(Jedis jedis, Class<T> tClass);
  7 +}
1 import com.zhonglai.luhui.redis.config.RedisConfig; 1 import com.zhonglai.luhui.redis.config.RedisConfig;
2 -import com.zhonglai.luhui.redis.service.RedisService; 2 +import com.zhonglai.luhui.redis.service.RedisClien;
3 3
4 import java.util.concurrent.atomic.AtomicReference; 4 import java.util.concurrent.atomic.AtomicReference;
5 5
6 public class Test { 6 public class Test {
7 public static void main(String[] args) { 7 public static void main(String[] args) {
8 - RedisService redisService = new RedisService(new RedisConfig()); 8 + RedisClien redisService = new RedisClien(new RedisConfig());
9 9
10 AtomicReference<String> str = new AtomicReference<>(""); 10 AtomicReference<String> str = new AtomicReference<>("");
11 redisService.exeJedis(jedis -> { 11 redisService.exeJedis(jedis -> {
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <modelVersion>4.0.0</modelVersion>
  6 + <parent>
  7 + <groupId>com.zhonglai.luhui</groupId>
  8 + <artifactId>lh-common</artifactId>
  9 + <version>1.0.0</version>
  10 + </parent>
  11 +
  12 + <artifactId>lh-springboot-redis</artifactId>
  13 +
  14 + <properties>
  15 + <maven.compiler.source>8</maven.compiler.source>
  16 + <maven.compiler.target>8</maven.compiler.target>
  17 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  18 + </properties>
  19 +
  20 + <dependencies>
  21 + <!-- redis 缓存操作 -->
  22 + <dependency>
  23 + <groupId>org.springframework.boot</groupId>
  24 + <artifactId>spring-boot-starter-data-redis</artifactId>
  25 + </dependency>
  26 + <!-- 阿里JSON解析器 -->
  27 + <dependency>
  28 + <groupId>com.alibaba</groupId>
  29 + <artifactId>fastjson</artifactId>
  30 + </dependency>
  31 + <!-- pool 对象池 -->
  32 + <dependency>
  33 + <groupId>org.apache.commons</groupId>
  34 + <artifactId>commons-pool2</artifactId>
  35 + </dependency>
  36 + </dependencies>
  37 +</project>
  1 +package com.zhonglai.luhui.springboot.redis.config;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONReader;
  5 +import com.alibaba.fastjson.JSONWriter;
  6 +import com.alibaba.fastjson.serializer.SerializerFeature;
  7 +import org.springframework.data.redis.serializer.RedisSerializer;
  8 +import org.springframework.data.redis.serializer.SerializationException;
  9 +
  10 +import java.nio.charset.Charset;
  11 +
  12 +/**
  13 + * Redis使用FastJson序列化
  14 + *
  15 + * @author ruoyi
  16 + */
  17 +public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
  18 +{
  19 + public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
  20 +
  21 + private Class<T> clazz;
  22 +
  23 + public FastJson2JsonRedisSerializer(Class<T> clazz)
  24 + {
  25 + super();
  26 + this.clazz = clazz;
  27 + }
  28 +
  29 + @Override
  30 + public byte[] serialize(T t) throws SerializationException
  31 + {
  32 + if (t == null)
  33 + {
  34 + return new byte[0];
  35 + }
  36 + return JSON.toJSONString(t, SerializerFeature.WriteClassName,SerializerFeature.DisableCircularReferenceDetect).getBytes(DEFAULT_CHARSET);
  37 + }
  38 +
  39 + @Override
  40 + public T deserialize(byte[] bytes) throws SerializationException
  41 + {
  42 + if (bytes == null || bytes.length <= 0)
  43 + {
  44 + return null;
  45 + }
  46 + String str = new String(bytes, DEFAULT_CHARSET);
  47 +
  48 + return JSON.parseObject(str, clazz);
  49 + }
  50 +}
  1 +package com.zhonglai.luhui.springboot.redis.config;
  2 +
  3 +import org.springframework.cache.annotation.CachingConfigurerSupport;
  4 +import org.springframework.cache.annotation.EnableCaching;
  5 +import org.springframework.context.annotation.Bean;
  6 +import org.springframework.context.annotation.Configuration;
  7 +import org.springframework.data.redis.connection.RedisConnectionFactory;
  8 +import org.springframework.data.redis.core.RedisTemplate;
  9 +import org.springframework.data.redis.core.script.DefaultRedisScript;
  10 +import org.springframework.data.redis.serializer.StringRedisSerializer;
  11 +
  12 +/**
  13 + * redis配置
  14 + *
  15 + * @author ruoyi
  16 + */
  17 +@Configuration
  18 +@EnableCaching
  19 +public class RedisConfig extends CachingConfigurerSupport
  20 +{
  21 + @Bean
  22 + @SuppressWarnings(value = { "unchecked", "rawtypes" })
  23 + public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
  24 + {
  25 + RedisTemplate<Object, Object> template = new RedisTemplate<>();
  26 + template.setConnectionFactory(connectionFactory);
  27 +
  28 + FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
  29 +
  30 + // 使用StringRedisSerializer来序列化和反序列化redis的key值
  31 + template.setKeySerializer(new StringRedisSerializer());
  32 + template.setValueSerializer(serializer);
  33 +
  34 + // Hash的key也采用StringRedisSerializer的序列化方式
  35 + template.setHashKeySerializer(new StringRedisSerializer());
  36 + template.setHashValueSerializer(serializer);
  37 +
  38 + template.afterPropertiesSet();
  39 + return template;
  40 + }
  41 +
  42 + @Bean
  43 + public DefaultRedisScript<Long> limitScript()
  44 + {
  45 + DefaultRedisScript<Long> redisScript = new DefaultRedisScript<>();
  46 + redisScript.setScriptText(limitScriptText());
  47 + redisScript.setResultType(Long.class);
  48 + return redisScript;
  49 + }
  50 +
  51 + /**
  52 + * 限流脚本
  53 + */
  54 + private String limitScriptText()
  55 + {
  56 + return "local key = KEYS[1]\n" +
  57 + "local count = tonumber(ARGV[1])\n" +
  58 + "local time = tonumber(ARGV[2])\n" +
  59 + "local current = redis.call('get', key);\n" +
  60 + "if current and tonumber(current) > count then\n" +
  61 + " return tonumber(current);\n" +
  62 + "end\n" +
  63 + "current = redis.call('incr', key)\n" +
  64 + "if tonumber(current) == 1 then\n" +
  65 + " redis.call('expire', key, time)\n" +
  66 + "end\n" +
  67 + "return tonumber(current);";
  68 + }
  69 +}
  1 +package com.zhonglai.luhui.springboot.redis.service;
  2 +
  3 +import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.data.redis.core.BoundSetOperations;
  5 +import org.springframework.data.redis.core.HashOperations;
  6 +import org.springframework.data.redis.core.RedisTemplate;
  7 +import org.springframework.data.redis.core.ValueOperations;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +import java.util.*;
  11 +import java.util.concurrent.TimeUnit;
  12 +
  13 +/**
  14 + * spring redis 工具类
  15 + *
  16 + * @author ruoyi
  17 + **/
  18 +@SuppressWarnings(value = { "unchecked", "rawtypes" })
  19 +@Component
  20 +public class RedisCache
  21 +{
  22 + @Autowired
  23 + public RedisTemplate redisTemplate;
  24 +
  25 + /**
  26 + * 缓存基本的对象,Integer、String、实体类等
  27 + *
  28 + * @param key 缓存的键值
  29 + * @param value 缓存的值
  30 + */
  31 + public <T> void setCacheObject(final String key, final T value)
  32 + {
  33 + redisTemplate.opsForValue().set(key, value);
  34 + }
  35 +
  36 + /**
  37 + * 缓存基本的对象,Integer、String、实体类等
  38 + *
  39 + * @param key 缓存的键值
  40 + * @param value 缓存的值
  41 + * @param timeout 时间
  42 + * @param timeUnit 时间颗粒度
  43 + */
  44 + public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit)
  45 + {
  46 + redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
  47 + }
  48 +
  49 + /**
  50 + * 设置有效时间
  51 + *
  52 + * @param key Redis键
  53 + * @param timeout 超时时间
  54 + * @return true=设置成功;false=设置失败
  55 + */
  56 + public boolean expire(final String key, final long timeout)
  57 + {
  58 + return expire(key, timeout, TimeUnit.SECONDS);
  59 + }
  60 +
  61 + /**
  62 + * 设置有效时间
  63 + *
  64 + * @param key Redis键
  65 + * @param timeout 超时时间
  66 + * @param unit 时间单位
  67 + * @return true=设置成功;false=设置失败
  68 + */
  69 + public boolean expire(final String key, final long timeout, final TimeUnit unit)
  70 + {
  71 + return redisTemplate.expire(key, timeout, unit);
  72 + }
  73 +
  74 + /**
  75 + * 获取有效时间
  76 + *
  77 + * @param key Redis键
  78 + * @return 有效时间
  79 + */
  80 + public long getExpire(final String key)
  81 + {
  82 + return redisTemplate.getExpire(key);
  83 + }
  84 +
  85 + /**
  86 + * 判断 key是否存在
  87 + *
  88 + * @param key 键
  89 + * @return true 存在 false不存在
  90 + */
  91 + public Boolean hasKey(String key)
  92 + {
  93 + return redisTemplate.hasKey(key);
  94 + }
  95 +
  96 + /**
  97 + * 获得缓存的基本对象。
  98 + *
  99 + * @param key 缓存键值
  100 + * @return 缓存键值对应的数据
  101 + */
  102 + public <T> T getCacheObject(final String key)
  103 + {
  104 + ValueOperations<String, T> operation = redisTemplate.opsForValue();
  105 + return operation.get(key);
  106 + }
  107 +
  108 + /**
  109 + * 删除单个对象
  110 + *
  111 + * @param key
  112 + */
  113 + public boolean deleteObject(final String key)
  114 + {
  115 + return redisTemplate.delete(key);
  116 + }
  117 +
  118 + /**
  119 + * 删除集合对象
  120 + *
  121 + * @param collection 多个对象
  122 + * @return
  123 + */
  124 + public boolean deleteObject(final Collection collection)
  125 + {
  126 + return redisTemplate.delete(collection) > 0;
  127 + }
  128 +
  129 + /**
  130 + * 缓存List数据
  131 + *
  132 + * @param key 缓存的键值
  133 + * @param dataList 待缓存的List数据
  134 + * @return 缓存的对象
  135 + */
  136 + public <T> long setCacheList(final String key, final List<T> dataList)
  137 + {
  138 + Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
  139 + return count == null ? 0 : count;
  140 + }
  141 +
  142 + /**
  143 + * 获得缓存的list对象
  144 + *
  145 + * @param key 缓存的键值
  146 + * @return 缓存键值对应的数据
  147 + */
  148 + public <T> List<T> getCacheList(final String key)
  149 + {
  150 + return redisTemplate.opsForList().range(key, 0, -1);
  151 + }
  152 +
  153 + /**
  154 + * 缓存Set
  155 + *
  156 + * @param key 缓存键值
  157 + * @param dataSet 缓存的数据
  158 + * @return 缓存数据的对象
  159 + */
  160 + public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
  161 + {
  162 + BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
  163 + Iterator<T> it = dataSet.iterator();
  164 + while (it.hasNext())
  165 + {
  166 + setOperation.add(it.next());
  167 + }
  168 + return setOperation;
  169 + }
  170 +
  171 + /**
  172 + * 获得缓存的set
  173 + *
  174 + * @param key
  175 + * @return
  176 + */
  177 + public <T> Set<T> getCacheSet(final String key)
  178 + {
  179 + return redisTemplate.opsForSet().members(key);
  180 + }
  181 +
  182 + /**
  183 + * 缓存Map
  184 + *
  185 + * @param key
  186 + * @param dataMap
  187 + */
  188 + public <T> void setCacheMap(final String key, final Map<String, T> dataMap)
  189 + {
  190 + if (dataMap != null) {
  191 + redisTemplate.opsForHash().putAll(key, dataMap);
  192 + }
  193 + }
  194 +
  195 + /**
  196 + * 获得缓存的Map
  197 + *
  198 + * @param key
  199 + * @return
  200 + */
  201 + public <T> Map<String, T> getCacheMap(final String key)
  202 + {
  203 + return redisTemplate.opsForHash().entries(key);
  204 + }
  205 +
  206 + /**
  207 + * 往Hash中存入数据
  208 + *
  209 + * @param key Redis键
  210 + * @param hKey Hash键
  211 + * @param value 值
  212 + */
  213 + public <T> void setCacheMapValue(final String key, final String hKey, final T value)
  214 + {
  215 + redisTemplate.opsForHash().put(key, hKey, value);
  216 + }
  217 +
  218 + /**
  219 + * 获取Hash中的数据
  220 + *
  221 + * @param key Redis键
  222 + * @param hKey Hash键
  223 + * @return Hash中的对象
  224 + */
  225 + public <T> T getCacheMapValue(final String key, final String hKey)
  226 + {
  227 + HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
  228 + return opsForHash.get(key, hKey);
  229 + }
  230 +
  231 + /**
  232 + * 获取多个Hash中的数据
  233 + *
  234 + * @param key Redis键
  235 + * @param hKeys Hash键集合
  236 + * @return Hash对象集合
  237 + */
  238 + public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys)
  239 + {
  240 + return redisTemplate.opsForHash().multiGet(key, hKeys);
  241 + }
  242 +
  243 + /**
  244 + * 删除Hash中的某条数据
  245 + *
  246 + * @param key Redis键
  247 + * @param hKey Hash键
  248 + * @return 是否成功
  249 + */
  250 + public boolean deleteCacheMapValue(final String key, final String hKey)
  251 + {
  252 + return redisTemplate.opsForHash().delete(key, hKey) > 0;
  253 + }
  254 +
  255 + /**
  256 + * 获得缓存的基本对象列表
  257 + *
  258 + * @param pattern 字符串前缀
  259 + * @return 对象列表
  260 + */
  261 + public Collection<String> keys(final String pattern)
  262 + {
  263 + return redisTemplate.keys(pattern);
  264 + }
  265 +}
@@ -19,5 +19,6 @@ @@ -19,5 +19,6 @@
19 <module>lh-common-util</module> 19 <module>lh-common-util</module>
20 <module>lh-jedis-redis</module> 20 <module>lh-jedis-redis</module>
21 <module>lh-springboot-common</module> 21 <module>lh-springboot-common</module>
  22 + <module>lh-springboot-redis</module>
22 </modules> 23 </modules>
23 </project> 24 </project>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <modelVersion>4.0.0</modelVersion>
  6 + <parent>
  7 + <groupId>com.zhonglai.luhui</groupId>
  8 + <artifactId>lh-jar</artifactId>
  9 + <version>1.0.0</version>
  10 + </parent>
  11 +
  12 + <artifactId>lh-admin-security</artifactId>
  13 +
  14 + <properties>
  15 + <maven.compiler.source>8</maven.compiler.source>
  16 + <maven.compiler.target>8</maven.compiler.target>
  17 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  18 + </properties>
  19 +
  20 + <dependencies>
  21 + <dependency>
  22 + <groupId>com.zhonglai.luhui</groupId>
  23 + <artifactId>lh-domain</artifactId>
  24 + </dependency>
  25 + <dependency>
  26 + <groupId>com.zhonglai.luhui</groupId>
  27 + <artifactId>lh-springboot-log</artifactId>
  28 + </dependency>
  29 + <dependency>
  30 + <groupId>com.zhonglai.luhui</groupId>
  31 + <artifactId>lh-jedis-redis</artifactId>
  32 + </dependency>
  33 +
  34 + <!-- spring security 安全认证 -->
  35 + <dependency>
  36 + <groupId>org.springframework.boot</groupId>
  37 + <artifactId>spring-boot-starter-security</artifactId>
  38 + </dependency>
  39 + <!-- 自定义验证注解 -->
  40 + <dependency>
  41 + <groupId>org.springframework.boot</groupId>
  42 + <artifactId>spring-boot-starter-validation</artifactId>
  43 + </dependency>
  44 +
  45 + <!-- 解析客户端操作系统、浏览器等 -->
  46 + <dependency>
  47 + <groupId>eu.bitwalker</groupId>
  48 + <artifactId>UserAgentUtils</artifactId>
  49 + </dependency>
  50 +
  51 + </dependencies>
  52 +</project>
  1 +package com.zhonglai.luhui.admin.security.constant;
  2 +
  3 +/**
  4 + * 缓存的key 常量
  5 + *
  6 + * @author ruoyi
  7 + */
  8 +public class CacheConstants
  9 +{
  10 + /**
  11 + * 登录用户 redis key
  12 + */
  13 + public static final String LOGIN_TOKEN_KEY = "login_tokens:";
  14 +
  15 + /**
  16 + * 验证码 redis key
  17 + */
  18 + public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
  19 +
  20 + /**
  21 + * 参数管理 cache key
  22 + */
  23 + public static final String SYS_CONFIG_KEY = "sys_config:";
  24 +
  25 + /**
  26 + * 字典管理 cache key
  27 + */
  28 + public static final String SYS_DICT_KEY = "sys_dict:";
  29 +
  30 + /**
  31 + * 防重提交 redis key
  32 + */
  33 + public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
  34 +
  35 + /**
  36 + * 限流 redis key
  37 + */
  38 + public static final String RATE_LIMIT_KEY = "rate_limit:";
  39 +
  40 + /**
  41 + * 登录账户密码错误次数 redis key
  42 + */
  43 + public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
  44 +}
  1 +package com.zhonglai.luhui.admin.security.context;
  2 +
  3 +import org.springframework.security.core.Authentication;
  4 +
  5 +/**
  6 + * 身份验证信息
  7 + *
  8 + * @author ruoyi
  9 + */
  10 +public class AuthenticationContextHolder
  11 +{
  12 + private static final ThreadLocal<Authentication> contextHolder = new ThreadLocal<>();
  13 +
  14 + public static Authentication getContext()
  15 + {
  16 + return contextHolder.get();
  17 + }
  18 +
  19 + public static void setContext(Authentication context)
  20 + {
  21 + contextHolder.set(context);
  22 + }
  23 +
  24 + public static void clearContext()
  25 + {
  26 + contextHolder.remove();
  27 + }
  28 +}
  1 +package com.zhonglai.luhui.admin.security.context;
  2 +
  3 +import cn.hutool.core.convert.Convert;
  4 +import org.springframework.web.context.request.RequestAttributes;
  5 +import org.springframework.web.context.request.RequestContextHolder;
  6 +
  7 +/**
  8 + * 权限信息
  9 + *
  10 + * @author ruoyi
  11 + */
  12 +public class PermissionContextHolder
  13 +{
  14 + private static final String PERMISSION_CONTEXT_ATTRIBUTES = "PERMISSION_CONTEXT";
  15 +
  16 + public static void setContext(String permission)
  17 + {
  18 + RequestContextHolder.currentRequestAttributes().setAttribute(PERMISSION_CONTEXT_ATTRIBUTES, permission,
  19 + RequestAttributes.SCOPE_REQUEST);
  20 + }
  21 +
  22 + public static String getContext()
  23 + {
  24 + return Convert.toStr(RequestContextHolder.currentRequestAttributes().getAttribute(PERMISSION_CONTEXT_ATTRIBUTES,
  25 + RequestAttributes.SCOPE_REQUEST));
  26 + }
  27 +}
  1 +package com.zhonglai.luhui.admin.security.filter;
  2 +
  3 +import com.zhonglai.luhui.admin.security.model.LoginUser;
  4 +import com.zhonglai.luhui.admin.security.service.TokenService;
  5 +import com.zhonglai.luhui.admin.security.utils.SecurityUtils;
  6 +import com.zhonglai.luhui.util.StringUtils;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
  9 +import org.springframework.security.core.context.SecurityContextHolder;
  10 +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
  11 +import org.springframework.stereotype.Component;
  12 +import org.springframework.web.filter.OncePerRequestFilter;
  13 +
  14 +import javax.servlet.FilterChain;
  15 +import javax.servlet.ServletException;
  16 +import javax.servlet.http.HttpServletRequest;
  17 +import javax.servlet.http.HttpServletResponse;
  18 +import java.io.IOException;
  19 +
  20 +/**
  21 + * token过滤器 验证token有效性
  22 + *
  23 + * @author ruoyi
  24 + */
  25 +@Component
  26 +public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
  27 +{
  28 + @Autowired
  29 + private TokenService tokenService;
  30 +
  31 + @Override
  32 + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
  33 + throws ServletException, IOException
  34 + {
  35 + LoginUser loginUser = tokenService.getLoginUser(request);
  36 + if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
  37 + {
  38 + tokenService.verifyToken(loginUser);
  39 + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
  40 + authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
  41 + SecurityContextHolder.getContext().setAuthentication(authenticationToken);
  42 + }
  43 + chain.doFilter(request, response);
  44 + }
  45 +}
  1 +package com.zhonglai.luhui.admin.security.handle;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.zhonglai.luhui.springboot.util.ServletUtils;
  5 +import com.zhonglai.luhui.sprngboot.common.constant.HttpStatus;
  6 +import com.zhonglai.luhui.sprngboot.common.core.domain.AjaxResult;
  7 +import com.zhonglai.luhui.util.StringUtils;
  8 +import org.springframework.security.core.AuthenticationException;
  9 +import org.springframework.security.web.AuthenticationEntryPoint;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import javax.servlet.http.HttpServletRequest;
  13 +import javax.servlet.http.HttpServletResponse;
  14 +import java.io.IOException;
  15 +import java.io.Serializable;
  16 +
  17 +/**
  18 + * 认证失败处理类 返回未授权
  19 + *
  20 + * @author ruoyi
  21 + */
  22 +@Component
  23 +public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable
  24 +{
  25 + private static final long serialVersionUID = -8970718410437077606L;
  26 +
  27 + @Override
  28 + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e)
  29 + throws IOException
  30 + {
  31 + int code = HttpStatus.UNAUTHORIZED;
  32 + String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
  33 + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
  34 + }
  35 +}
  1 +package com.zhonglai.luhui.admin.security.handle;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.zhonglai.luhui.admin.security.model.LoginUser;
  5 +import com.zhonglai.luhui.admin.security.service.TokenService;
  6 +import com.zhonglai.luhui.springboot.log.manager.AsyncManager;
  7 +import com.zhonglai.luhui.springboot.log.manager.factory.AsyncFactory;
  8 +import com.zhonglai.luhui.springboot.util.ServletUtils;
  9 +import com.zhonglai.luhui.sprngboot.common.constant.Constants;
  10 +import com.zhonglai.luhui.sprngboot.common.core.domain.AjaxResult;
  11 +import com.zhonglai.luhui.util.StringUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.context.annotation.Configuration;
  14 +import org.springframework.security.core.Authentication;
  15 +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
  16 +
  17 +import javax.servlet.ServletException;
  18 +import javax.servlet.http.HttpServletRequest;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import java.io.IOException;
  21 +
  22 +/**
  23 + * 自定义退出处理类 返回成功
  24 + *
  25 + * @author ruoyi
  26 + */
  27 +@Configuration
  28 +public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
  29 +{
  30 + @Autowired
  31 + private TokenService tokenService;
  32 +
  33 + /**
  34 + * 退出处理
  35 + *
  36 + * @return
  37 + */
  38 + @Override
  39 + public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
  40 + throws IOException, ServletException
  41 + {
  42 + LoginUser loginUser = tokenService.getLoginUser(request);
  43 + if (StringUtils.isNotNull(loginUser))
  44 + {
  45 + String userName = loginUser.getUsername();
  46 + // 删除用户缓存记录
  47 + tokenService.delLoginUser(loginUser.getToken());
  48 + // 记录用户退出日志
  49 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
  50 + }
  51 + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("退出成功")));
  52 + }
  53 +}
  1 +package com.zhonglai.luhui.admin.security.model;
  2 +
  3 +/**
  4 + * 用户登录对象
  5 + *
  6 + * @author ruoyi
  7 + */
  8 +public class LoginBody
  9 +{
  10 + /**
  11 + * 用户名
  12 + */
  13 + private String username;
  14 +
  15 + /**
  16 + * 用户密码
  17 + */
  18 + private String password;
  19 +
  20 + /**
  21 + * 验证码
  22 + */
  23 + private String code;
  24 +
  25 + /**
  26 + * 唯一标识
  27 + */
  28 + private String uuid;
  29 +
  30 + public String getUsername()
  31 + {
  32 + return username;
  33 + }
  34 +
  35 + public void setUsername(String username)
  36 + {
  37 + this.username = username;
  38 + }
  39 +
  40 + public String getPassword()
  41 + {
  42 + return password;
  43 + }
  44 +
  45 + public void setPassword(String password)
  46 + {
  47 + this.password = password;
  48 + }
  49 +
  50 + public String getCode()
  51 + {
  52 + return code;
  53 + }
  54 +
  55 + public void setCode(String code)
  56 + {
  57 + this.code = code;
  58 + }
  59 +
  60 + public String getUuid()
  61 + {
  62 + return uuid;
  63 + }
  64 +
  65 + public void setUuid(String uuid)
  66 + {
  67 + this.uuid = uuid;
  68 + }
  69 +}
  1 +package com.zhonglai.luhui.admin.security.model;
  2 +
  3 +import com.alibaba.fastjson.annotation.JSONField;
  4 +import org.springframework.security.core.GrantedAuthority;
  5 +import org.springframework.security.core.userdetails.UserDetails;
  6 +
  7 +import java.util.Collection;
  8 +import java.util.Set;
  9 +
  10 +/**
  11 + * 登录用户身份权限
  12 + *
  13 + * @author ruoyi
  14 + */
  15 +public class LoginUser implements UserDetails
  16 +{
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /**
  20 + * 用户ID
  21 + */
  22 + private Long userId;
  23 +
  24 + /**
  25 + * 部门ID
  26 + */
  27 + private Long deptId;
  28 +
  29 + /**
  30 + * 用户唯一标识
  31 + */
  32 + private String token;
  33 +
  34 + /**
  35 + * 登录时间
  36 + */
  37 + private Long loginTime;
  38 +
  39 + /**
  40 + * 过期时间
  41 + */
  42 + private Long expireTime;
  43 +
  44 + /**
  45 + * 登录IP地址
  46 + */
  47 + private String ipaddr;
  48 +
  49 + /**
  50 + * 登录地点
  51 + */
  52 + private String loginLocation;
  53 +
  54 + /**
  55 + * 浏览器类型
  56 + */
  57 + private String browser;
  58 +
  59 + /**
  60 + * 操作系统
  61 + */
  62 + private String os;
  63 +
  64 + /**
  65 + * 权限列表
  66 + */
  67 + private Set<String> permissions;
  68 +
  69 + /**
  70 + * 用户信息
  71 + */
  72 + private SecurityUserInfo user;
  73 +
  74 + public Long getUserId()
  75 + {
  76 + return userId;
  77 + }
  78 +
  79 + public void setUserId(Long userId)
  80 + {
  81 + this.userId = userId;
  82 + }
  83 +
  84 + public Long getDeptId()
  85 + {
  86 + return deptId;
  87 + }
  88 +
  89 + public void setDeptId(Long deptId)
  90 + {
  91 + this.deptId = deptId;
  92 + }
  93 +
  94 + public String getToken()
  95 + {
  96 + return token;
  97 + }
  98 +
  99 + public void setToken(String token)
  100 + {
  101 + this.token = token;
  102 + }
  103 +
  104 + public LoginUser()
  105 + {
  106 + }
  107 +
  108 + public LoginUser(SecurityUserInfo user, Set<String> permissions)
  109 + {
  110 + this.user = user;
  111 + this.permissions = permissions;
  112 + }
  113 +
  114 + public LoginUser(Long userId, Long deptId, SecurityUserInfo user, Set<String> permissions)
  115 + {
  116 + this.userId = userId;
  117 + this.deptId = deptId;
  118 + this.user = user;
  119 + this.permissions = permissions;
  120 + }
  121 +
  122 + @JSONField(serialize = false)
  123 + @Override
  124 + public String getPassword()
  125 + {
  126 + return user.getPassword();
  127 + }
  128 +
  129 + @Override
  130 + public String getUsername()
  131 + {
  132 + return user.getUserName();
  133 + }
  134 +
  135 + /**
  136 + * 账户是否未过期,过期无法验证
  137 + */
  138 + @JSONField(serialize = false)
  139 + @Override
  140 + public boolean isAccountNonExpired()
  141 + {
  142 + return true;
  143 + }
  144 +
  145 + /**
  146 + * 指定用户是否解锁,锁定的用户无法进行身份验证
  147 + *
  148 + * @return
  149 + */
  150 + @JSONField(serialize = false)
  151 + @Override
  152 + public boolean isAccountNonLocked()
  153 + {
  154 + return true;
  155 + }
  156 +
  157 + /**
  158 + * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
  159 + *
  160 + * @return
  161 + */
  162 + @JSONField(serialize = false)
  163 + @Override
  164 + public boolean isCredentialsNonExpired()
  165 + {
  166 + return true;
  167 + }
  168 +
  169 + /**
  170 + * 是否可用 ,禁用的用户不能身份验证
  171 + *
  172 + * @return
  173 + */
  174 + @JSONField(serialize = false)
  175 + @Override
  176 + public boolean isEnabled()
  177 + {
  178 + return true;
  179 + }
  180 +
  181 + public Long getLoginTime()
  182 + {
  183 + return loginTime;
  184 + }
  185 +
  186 + public void setLoginTime(Long loginTime)
  187 + {
  188 + this.loginTime = loginTime;
  189 + }
  190 +
  191 + public String getIpaddr()
  192 + {
  193 + return ipaddr;
  194 + }
  195 +
  196 + public void setIpaddr(String ipaddr)
  197 + {
  198 + this.ipaddr = ipaddr;
  199 + }
  200 +
  201 + public String getLoginLocation()
  202 + {
  203 + return loginLocation;
  204 + }
  205 +
  206 + public void setLoginLocation(String loginLocation)
  207 + {
  208 + this.loginLocation = loginLocation;
  209 + }
  210 +
  211 + public String getBrowser()
  212 + {
  213 + return browser;
  214 + }
  215 +
  216 + public void setBrowser(String browser)
  217 + {
  218 + this.browser = browser;
  219 + }
  220 +
  221 + public String getOs()
  222 + {
  223 + return os;
  224 + }
  225 +
  226 + public void setOs(String os)
  227 + {
  228 + this.os = os;
  229 + }
  230 +
  231 + public Long getExpireTime()
  232 + {
  233 + return expireTime;
  234 + }
  235 +
  236 + public void setExpireTime(Long expireTime)
  237 + {
  238 + this.expireTime = expireTime;
  239 + }
  240 +
  241 + public Set<String> getPermissions()
  242 + {
  243 + return permissions;
  244 + }
  245 +
  246 + public void setPermissions(Set<String> permissions)
  247 + {
  248 + this.permissions = permissions;
  249 + }
  250 +
  251 + public SecurityUserInfo getUser()
  252 + {
  253 + return user;
  254 + }
  255 +
  256 + public void setUser(SecurityUserInfo user)
  257 + {
  258 + this.user = user;
  259 + }
  260 +
  261 + @Override
  262 + public Collection<? extends GrantedAuthority> getAuthorities()
  263 + {
  264 + return null;
  265 + }
  266 +}
  1 +package com.zhonglai.luhui.admin.security.model;
  2 +
  3 +/**
  4 + * 用户注册对象
  5 + *
  6 + * @author ruoyi
  7 + */
  8 +public class RegisterBody extends LoginBody
  9 +{
  10 +
  11 +}
  1 +package com.zhonglai.luhui.admin.security.model;
  2 +
  3 +public interface SecurityUserInfo {
  4 + String getPassword();
  5 + String getUserName();
  6 +}
  1 +package com.zhonglai.luhui.admin.security.service;
  2 +
  3 +import com.zhonglai.luhui.admin.security.constant.CacheConstants;
  4 +import com.zhonglai.luhui.admin.security.model.LoginUser;
  5 +import com.zhonglai.luhui.springboot.redis.service.RedisCache;
  6 +import com.zhonglai.luhui.springboot.util.ServletUtils;
  7 +import com.zhonglai.luhui.springboot.util.ip.AddressUtils;
  8 +import com.zhonglai.luhui.springboot.util.ip.IpUtils;
  9 +import com.zhonglai.luhui.sprngboot.common.constant.Constants;
  10 +import com.zhonglai.luhui.util.StringUtils;
  11 +import com.zhonglai.luhui.util.uuid.IdUtils;
  12 +import eu.bitwalker.useragentutils.UserAgent;
  13 +import io.jsonwebtoken.Claims;
  14 +import io.jsonwebtoken.Jwts;
  15 +import io.jsonwebtoken.SignatureAlgorithm;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.beans.factory.annotation.Value;
  18 +import org.springframework.stereotype.Component;
  19 +
  20 +import javax.servlet.http.HttpServletRequest;
  21 +import java.util.HashMap;
  22 +import java.util.Map;
  23 +import java.util.concurrent.TimeUnit;
  24 +
  25 +/**
  26 + * token验证处理
  27 + *
  28 + * @author ruoyi
  29 + */
  30 +@Component
  31 +public class TokenService
  32 +{
  33 + // 令牌自定义标识
  34 + @Value("${token.header}")
  35 + private String header;
  36 +
  37 + // 令牌秘钥
  38 + @Value("${token.secret}")
  39 + private String secret;
  40 +
  41 + // 令牌有效期(默认30分钟)
  42 + @Value("${token.expireTime}")
  43 + private int expireTime;
  44 +
  45 + protected static final long MILLIS_SECOND = 1000;
  46 +
  47 + protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
  48 +
  49 + private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L;
  50 +
  51 + @Autowired
  52 + private RedisCache redisCache;
  53 +
  54 + /**
  55 + * 获取用户身份信息
  56 + *
  57 + * @return 用户信息
  58 + */
  59 + public LoginUser getLoginUser(HttpServletRequest request)
  60 + {
  61 + // 获取请求携带的令牌
  62 + String token = getToken(request);
  63 + if (StringUtils.isNotEmpty(token))
  64 + {
  65 + try
  66 + {
  67 + Claims claims = parseToken(token);
  68 + // 解析对应的权限以及用户信息
  69 + String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
  70 + String userKey = getTokenKey(uuid);
  71 + LoginUser user = redisCache.getCacheObject(userKey);
  72 + return user;
  73 + }
  74 + catch (Exception e)
  75 + {
  76 + }
  77 + }
  78 + return null;
  79 + }
  80 +
  81 + /**
  82 + * 设置用户身份信息
  83 + */
  84 + public void setLoginUser(LoginUser loginUser)
  85 + {
  86 + if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken()))
  87 + {
  88 + refreshToken(loginUser);
  89 + }
  90 + }
  91 +
  92 + /**
  93 + * 删除用户身份信息
  94 + */
  95 + public void delLoginUser(String token)
  96 + {
  97 + if (StringUtils.isNotEmpty(token))
  98 + {
  99 + String userKey = getTokenKey(token);
  100 + redisCache.deleteObject(userKey);
  101 + }
  102 + }
  103 +
  104 + /**
  105 + * 创建令牌
  106 + *
  107 + * @param loginUser 用户信息
  108 + * @return 令牌
  109 + */
  110 + public String createToken(LoginUser loginUser)
  111 + {
  112 + String token = IdUtils.fastUUID();
  113 + loginUser.setToken(token);
  114 + setUserAgent(loginUser);
  115 + refreshToken(loginUser);
  116 +
  117 + Map<String, Object> claims = new HashMap<>();
  118 + claims.put(Constants.LOGIN_USER_KEY, token);
  119 + return createToken(claims);
  120 + }
  121 +
  122 + /**
  123 + * 验证令牌有效期,相差不足20分钟,自动刷新缓存
  124 + *
  125 + * @param loginUser
  126 + * @return 令牌
  127 + */
  128 + public void verifyToken(LoginUser loginUser)
  129 + {
  130 + long expireTime = loginUser.getExpireTime();
  131 + long currentTime = System.currentTimeMillis();
  132 + if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
  133 + {
  134 + refreshToken(loginUser);
  135 + }
  136 + }
  137 +
  138 + /**
  139 + * 刷新令牌有效期
  140 + *
  141 + * @param loginUser 登录信息
  142 + */
  143 + public void refreshToken(LoginUser loginUser)
  144 + {
  145 + loginUser.setLoginTime(System.currentTimeMillis());
  146 + loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
  147 + // 根据uuid将loginUser缓存
  148 + String userKey = getTokenKey(loginUser.getToken());
  149 + redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
  150 + }
  151 +
  152 + /**
  153 + * 设置用户代理信息
  154 + *
  155 + * @param loginUser 登录信息
  156 + */
  157 + public void setUserAgent(LoginUser loginUser)
  158 + {
  159 + UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
  160 + String ip = IpUtils.getIpAddr();
  161 + loginUser.setIpaddr(ip);
  162 + loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
  163 + loginUser.setBrowser(userAgent.getBrowser().getName());
  164 + loginUser.setOs(userAgent.getOperatingSystem().getName());
  165 + }
  166 +
  167 + /**
  168 + * 从数据声明生成令牌
  169 + *
  170 + * @param claims 数据声明
  171 + * @return 令牌
  172 + */
  173 + private String createToken(Map<String, Object> claims)
  174 + {
  175 + String token = Jwts.builder()
  176 + .setClaims(claims)
  177 + .signWith(SignatureAlgorithm.HS512, secret).compact();
  178 + return token;
  179 + }
  180 +
  181 + /**
  182 + * 从令牌中获取数据声明
  183 + *
  184 + * @param token 令牌
  185 + * @return 数据声明
  186 + */
  187 + private Claims parseToken(String token)
  188 + {
  189 + return Jwts.parser()
  190 + .setSigningKey(secret)
  191 + .parseClaimsJws(token)
  192 + .getBody();
  193 + }
  194 +
  195 + /**
  196 + * 从令牌中获取用户名
  197 + *
  198 + * @param token 令牌
  199 + * @return 用户名
  200 + */
  201 + public String getUsernameFromToken(String token)
  202 + {
  203 + Claims claims = parseToken(token);
  204 + return claims.getSubject();
  205 + }
  206 +
  207 + /**
  208 + * 获取请求token
  209 + *
  210 + * @param request
  211 + * @return token
  212 + */
  213 + private String getToken(HttpServletRequest request)
  214 + {
  215 + String token = request.getHeader(header);
  216 + if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
  217 + {
  218 + token = token.replace(Constants.TOKEN_PREFIX, "");
  219 + }
  220 + return token;
  221 + }
  222 +
  223 + private String getTokenKey(String uuid)
  224 + {
  225 + return CacheConstants.LOGIN_TOKEN_KEY + uuid;
  226 + }
  227 +}
  1 +package com.zhonglai.luhui.admin.security.utils;
  2 +
  3 +import com.zhonglai.luhui.admin.security.model.LoginUser;
  4 +import com.zhonglai.luhui.springboot.exception.ServiceException;
  5 +import com.zhonglai.luhui.sprngboot.common.constant.HttpStatus;
  6 +import org.springframework.security.core.Authentication;
  7 +import org.springframework.security.core.context.SecurityContextHolder;
  8 +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
  9 +
  10 +/**
  11 + * 安全服务工具类
  12 + *
  13 + * @author ruoyi
  14 + */
  15 +public class SecurityUtils
  16 +{
  17 + /**
  18 + * 用户ID
  19 + **/
  20 + public static Long getUserId()
  21 + {
  22 + try
  23 + {
  24 + return getLoginUser().getUserId();
  25 + }
  26 + catch (Exception e)
  27 + {
  28 + throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
  29 + }
  30 + }
  31 +
  32 + /**
  33 + * 获取部门ID
  34 + **/
  35 + public static Long getDeptId()
  36 + {
  37 + try
  38 + {
  39 + return getLoginUser().getDeptId();
  40 + }
  41 + catch (Exception e)
  42 + {
  43 + throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
  44 + }
  45 + }
  46 +
  47 + /**
  48 + * 获取用户账户
  49 + **/
  50 + public static String getUsername()
  51 + {
  52 + try
  53 + {
  54 + return getLoginUser().getUsername();
  55 + }
  56 + catch (Exception e)
  57 + {
  58 + throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
  59 + }
  60 + }
  61 +
  62 + /**
  63 + * 获取用户
  64 + **/
  65 + public static LoginUser getLoginUser()
  66 + {
  67 + try
  68 + {
  69 + return (LoginUser) getAuthentication().getPrincipal();
  70 + }
  71 + catch (Exception e)
  72 + {
  73 + throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
  74 + }
  75 + }
  76 +
  77 + /**
  78 + * 获取Authentication
  79 + */
  80 + public static Authentication getAuthentication()
  81 + {
  82 + return SecurityContextHolder.getContext().getAuthentication();
  83 + }
  84 +
  85 + /**
  86 + * 生成BCryptPasswordEncoder密码
  87 + *
  88 + * @param password 密码
  89 + * @return 加密字符串
  90 + */
  91 + public static String encryptPassword(String password)
  92 + {
  93 + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
  94 + return passwordEncoder.encode(password);
  95 + }
  96 +
  97 + /**
  98 + * 判断密码是否相同
  99 + *
  100 + * @param rawPassword 真实密码
  101 + * @param encodedPassword 加密后字符
  102 + * @return 结果
  103 + */
  104 + public static boolean matchesPassword(String rawPassword, String encodedPassword)
  105 + {
  106 + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
  107 + return passwordEncoder.matches(rawPassword, encodedPassword);
  108 + }
  109 +
  110 + /**
  111 + * 是否为管理员
  112 + *
  113 + * @param userId 用户ID
  114 + * @return 结果
  115 + */
  116 + public static boolean isAdmin(Long userId)
  117 + {
  118 + return userId != null && 1L == userId;
  119 + }
  120 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <modelVersion>4.0.0</modelVersion>
  6 + <parent>
  7 + <groupId>com.zhonglai.luhui</groupId>
  8 + <artifactId>lh-jar</artifactId>
  9 + <version>1.0.0</version>
  10 + </parent>
  11 +
  12 + <artifactId>lh-springboot-log</artifactId>
  13 +
  14 + <properties>
  15 + <maven.compiler.source>8</maven.compiler.source>
  16 + <maven.compiler.target>8</maven.compiler.target>
  17 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  18 + </properties>
  19 +
  20 + <dependencies>
  21 + <dependency>
  22 + <groupId>com.zhonglai.luhui</groupId>
  23 + <artifactId>lh-springboot</artifactId>
  24 + </dependency>
  25 + <dependency>
  26 + <groupId>com.zhonglai.luhui</groupId>
  27 + <artifactId>lh-domain</artifactId>
  28 + </dependency>
  29 + <dependency>
  30 + <groupId>com.zhonglai.luhui</groupId>
  31 + <artifactId>lh-public-dao</artifactId>
  32 + </dependency>
  33 + <!-- 解析客户端操作系统、浏览器等 -->
  34 + <dependency>
  35 + <groupId>eu.bitwalker</groupId>
  36 + <artifactId>UserAgentUtils</artifactId>
  37 + </dependency>
  38 + </dependencies>
  39 +</project>
  1 +package com.zhonglai.luhui.springboot.log.annotation;
  2 +
  3 +
  4 +import com.zhonglai.luhui.sprngboot.common.enums.BusinessType;
  5 +import com.zhonglai.luhui.sprngboot.common.enums.OperatorType;
  6 +
  7 +import java.lang.annotation.*;
  8 +
  9 +/**
  10 + * 自定义操作日志记录注解
  11 + *
  12 + * @author ruoyi
  13 + *
  14 + */
  15 +@Target({ ElementType.PARAMETER, ElementType.METHOD })
  16 +@Retention(RetentionPolicy.RUNTIME)
  17 +@Documented
  18 +public @interface Log
  19 +{
  20 + /**
  21 + * 模块
  22 + */
  23 + public String title() default "";
  24 +
  25 + /**
  26 + * 功能
  27 + */
  28 + public BusinessType businessType() default BusinessType.OTHER;
  29 +
  30 + /**
  31 + * 操作人类别
  32 + */
  33 + public OperatorType operatorType() default OperatorType.MANAGE;
  34 +
  35 + /**
  36 + * 是否保存请求的参数
  37 + */
  38 + public boolean isSaveRequestData() default true;
  39 +
  40 + /**
  41 + * 是否保存响应的参数
  42 + */
  43 + public boolean isSaveResponseData() default true;
  44 +
  45 + /**
  46 + * 排除指定的请求参数
  47 + */
  48 + public String[] excludeParamNames() default {};
  49 +}
  1 +package com.zhonglai.luhui.springboot.log.manager;
  2 +
  3 +
  4 +import com.zhonglai.luhui.springboot.util.spring.SpringUtils;
  5 +import com.zhonglai.luhui.util.Threads;
  6 +
  7 +import java.util.TimerTask;
  8 +import java.util.concurrent.ScheduledExecutorService;
  9 +import java.util.concurrent.TimeUnit;
  10 +
  11 +/**
  12 + * 异步任务管理器
  13 + *
  14 + * @author ruoyi
  15 + */
  16 +public class AsyncManager
  17 +{
  18 + /**
  19 + * 操作延迟10毫秒
  20 + */
  21 + private final int OPERATE_DELAY_TIME = 10;
  22 +
  23 + /**
  24 + * 异步操作任务调度线程池
  25 + */
  26 + private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService");
  27 +
  28 + /**
  29 + * 单例模式
  30 + */
  31 + private AsyncManager(){}
  32 +
  33 + private static AsyncManager me = new AsyncManager();
  34 +
  35 + public static AsyncManager me()
  36 + {
  37 + return me;
  38 + }
  39 +
  40 + /**
  41 + * 执行任务
  42 + *
  43 + * @param task 任务
  44 + */
  45 + public void execute(TimerTask task)
  46 + {
  47 + executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
  48 + }
  49 +
  50 + /**
  51 + * 停止任务线程池
  52 + */
  53 + public void shutdown()
  54 + {
  55 + Threads.shutdownAndAwaitTermination(executor);
  56 + }
  57 +}
  1 +package com.zhonglai.luhui.springboot.log.manager;
  2 +
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
  5 +import org.springframework.stereotype.Component;
  6 +
  7 +import javax.annotation.PreDestroy;
  8 +
  9 +/**
  10 + * 确保应用退出时能关闭后台线程
  11 + *
  12 + * @author ruoyi
  13 + */
  14 +@Component
  15 +public class ShutdownManager
  16 +{
  17 + private static final Logger logger = LoggerFactory.getLogger("sys-user");
  18 +
  19 + @PreDestroy
  20 + public void destroy()
  21 + {
  22 + shutdownAsyncManager();
  23 + }
  24 +
  25 + /**
  26 + * 停止异步执行任务
  27 + */
  28 + private void shutdownAsyncManager()
  29 + {
  30 + try
  31 + {
  32 + logger.info("====关闭后台任务任务线程池====");
  33 + AsyncManager.me().shutdown();
  34 + }
  35 + catch (Exception e)
  36 + {
  37 + logger.error(e.getMessage(), e);
  38 + }
  39 + }
  40 +}
  1 +package com.zhonglai.luhui.springboot.log.manager.factory;
  2 +
  3 +import com.zhonglai.luhui.dao.service.PublicService;
  4 +import com.zhonglai.luhui.domain.sys.SysLogininfor;
  5 +import com.zhonglai.luhui.springboot.util.ServletUtils;
  6 +import com.zhonglai.luhui.springboot.util.ip.AddressUtils;
  7 +import com.zhonglai.luhui.springboot.util.ip.IpUtils;
  8 +import com.zhonglai.luhui.springboot.util.spring.SpringUtils;
  9 +import com.zhonglai.luhui.sprngboot.common.constant.Constants;
  10 +import com.zhonglai.luhui.util.LogUtils;
  11 +import com.zhonglai.luhui.util.StringUtils;
  12 +import eu.bitwalker.useragentutils.UserAgent;
  13 +import org.slf4j.Logger;
  14 +import org.slf4j.LoggerFactory;
  15 +
  16 +import java.util.TimerTask;
  17 +
  18 +/**
  19 + * 异步工厂(产生任务用)
  20 + *
  21 + * @author ruoyi
  22 + */
  23 +public class AsyncFactory
  24 +{
  25 + private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
  26 +
  27 + /**
  28 + * 记录登录信息
  29 + *
  30 + * @param username 用户名
  31 + * @param status 状态
  32 + * @param message 消息
  33 + * @param args 列表
  34 + * @return 任务task
  35 + */
  36 + public static TimerTask recordLogininfor(final String username, final String status, final String message,
  37 + final Object... args)
  38 + {
  39 + final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
  40 + final String ip = IpUtils.getIpAddr();
  41 + return new TimerTask()
  42 + {
  43 + @Override
  44 + public void run()
  45 + {
  46 + String address = AddressUtils.getRealAddressByIP(ip);
  47 + StringBuilder s = new StringBuilder();
  48 + s.append(LogUtils.getBlock(ip));
  49 + s.append(address);
  50 + s.append(LogUtils.getBlock(username));
  51 + s.append(LogUtils.getBlock(status));
  52 + s.append(LogUtils.getBlock(message));
  53 + // 打印信息到日志
  54 + sys_user_logger.info(s.toString(), args);
  55 + // 获取客户端操作系统
  56 + String os = userAgent.getOperatingSystem().getName();
  57 + // 获取客户端浏览器
  58 + String browser = userAgent.getBrowser().getName();
  59 + // 封装对象
  60 + SysLogininfor logininfor = new SysLogininfor();
  61 + logininfor.setUser_name(username);
  62 + logininfor.setIpaddr(ip);
  63 + logininfor.setLogin_location(address);
  64 + logininfor.setBrowser(browser);
  65 + logininfor.setOs(os);
  66 + logininfor.setMsg(message);
  67 + // 日志状态
  68 + if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
  69 + {
  70 + logininfor.setStatus(Constants.SUCCESS);
  71 + }
  72 + else if (Constants.LOGIN_FAIL.equals(status))
  73 + {
  74 + logininfor.setStatus(Constants.FAIL);
  75 + }
  76 + // 插入数据
  77 + SpringUtils.getBean(PublicService.class).insert(logininfor);
  78 + }
  79 + };
  80 + }
  81 +
  82 + /**
  83 + * 操作日志记录
  84 + *
  85 + * @param operLog 操作日志信息
  86 + * @return 任务task
  87 + */
  88 + public static TimerTask recordOper(final com.zhonglai.luhui.domain.sys.SysOperLog operLog)
  89 + {
  90 + return new TimerTask()
  91 + {
  92 + @Override
  93 + public void run()
  94 + {
  95 + // 远程查询操作地点
  96 + operLog.setOper_location(AddressUtils.getRealAddressByIP(operLog.getOper_ip()));
  97 + SpringUtils.getBean(PublicService.class).insert(operLog);
  98 + }
  99 + };
  100 + }
  101 +}
@@ -70,6 +70,13 @@ @@ -70,6 +70,13 @@
70 <groupId>com.zhonglai.luhui</groupId> 70 <groupId>com.zhonglai.luhui</groupId>
71 <artifactId>lh-springboot-common</artifactId> 71 <artifactId>lh-springboot-common</artifactId>
72 </dependency> 72 </dependency>
73 - 73 + <dependency>
  74 + <groupId>com.zhonglai.luhui</groupId>
  75 + <artifactId>lh-springboot-redis</artifactId>
  76 + </dependency>
  77 + <dependency>
  78 + <groupId>com.zhonglai.luhui</groupId>
  79 + <artifactId>lh-domain</artifactId>
  80 + </dependency>
74 </dependencies> 81 </dependencies>
75 </project> 82 </project>
1 package com.zhonglai.luhui.springboot.util.ip; 1 package com.zhonglai.luhui.springboot.util.ip;
2 2
3 3
  4 +import com.zhonglai.luhui.springboot.util.ServletUtils;
4 import com.zhonglai.luhui.util.StringUtils; 5 import com.zhonglai.luhui.util.StringUtils;
5 6
6 import javax.servlet.http.HttpServletRequest; 7 import javax.servlet.http.HttpServletRequest;
@@ -20,6 +21,15 @@ public class IpUtils @@ -20,6 +21,15 @@ public class IpUtils
20 /** 21 /**
21 * 获取客户端IP 22 * 获取客户端IP
22 * 23 *
  24 + * @return IP地址
  25 + */
  26 + public static String getIpAddr()
  27 + {
  28 + return getIpAddr(ServletUtils.getRequest());
  29 + }
  30 + /**
  31 + * 获取客户端IP
  32 + *
23 * @param request 请求对象 33 * @param request 请求对象
24 * @return IP地址 34 * @return IP地址
25 */ 35 */
@@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
15 <module>lh-springboot</module> 15 <module>lh-springboot</module>
16 <module>lh-swagger</module> 16 <module>lh-swagger</module>
17 <module>lh-springboot-druid-dbconfig</module> 17 <module>lh-springboot-druid-dbconfig</module>
  18 + <module>lh-admin-security</module>
  19 + <module>lh-springboot-log</module>
18 </modules> 20 </modules>
19 21
20 <properties> 22 <properties>
1 -# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 1.0.0 # 版权年份 copyrightYear: 2024 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8080 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.zhonglai: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-admin # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.zhonglai.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/*  
  1 +# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 1.0.0 # 版权年份 copyrightYear: 2024 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8080 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.zhonglai: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: config-path: "jedis.properties" # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-admin # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.zhonglai.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/*
  1 +# jedis.properties
  2 +jedis.pool.maxTotal=100
  3 +jedis.pool.maxIdle=50
  4 +jedis.pool.minIdle=10
  5 +jedis.pool.testOnBorrow=true
  6 +jedis.pool.testOnReturn=true
  7 +jedis.pool.testWhileIdle=true
  8 +jedis.pool.minEvictableIdleTimeMillis=60000
  9 +jedis.pool.timeBetweenEvictionRunsMillis=30000
  10 +jedis.pool.numTestsPerEvictionRun=3
  11 +jedis.pool.blockWhenExhausted=true
  12 +jedis.host=47.112.163.61
  13 +jedis.port=9527
  14 +jedis.timeout=2000
  15 +jedis.password=Luhui586
  16 +jedis.database=3
@@ -29,23 +29,15 @@ @@ -29,23 +29,15 @@
29 <commons.fileupload.version>1.4</commons.fileupload.version> 29 <commons.fileupload.version>1.4</commons.fileupload.version>
30 <lombok.version>1.18.12</lombok.version> 30 <lombok.version>1.18.12</lombok.version>
31 <poi.version>4.1.2</poi.version> 31 <poi.version>4.1.2</poi.version>
32 - <fastjson.version>1.2.80</fastjson.version>  
33 <druid.version>1.2.16</druid.version> 32 <druid.version>1.2.16</druid.version>
34 <aspectj.version>1.9.7</aspectj.version> 33 <aspectj.version>1.9.7</aspectj.version>
  34 + <fastjson.version>1.2.80</fastjson.version>
35 </properties> 35 </properties>
36 36
37 <!-- 依赖声明 --> 37 <!-- 依赖声明 -->
38 <dependencyManagement> 38 <dependencyManagement>
39 39
40 <dependencies> 40 <dependencies>
41 -<!-- &lt;!&ndash; spring-boot-devtools &ndash;&gt;-->  
42 -<!-- <dependency>-->  
43 -<!-- <groupId>org.springframework.boot</groupId>-->  
44 -<!-- <artifactId>spring-boot-devtools</artifactId>-->  
45 -<!-- <version>${springboot.version}</version>-->  
46 -<!-- <optional>true</optional> &lt;!&ndash; 表示依赖不会传递 &ndash;&gt;-->  
47 -<!-- </dependency>-->  
48 -  
49 <!-- SpringBoot的依赖配置--> 41 <!-- SpringBoot的依赖配置-->
50 <dependency> 42 <dependency>
51 <groupId>org.springframework.boot</groupId> 43 <groupId>org.springframework.boot</groupId>
@@ -108,6 +100,11 @@ @@ -108,6 +100,11 @@
108 <artifactId>commons-text</artifactId> 100 <artifactId>commons-text</artifactId>
109 <version>1.8</version> 101 <version>1.8</version>
110 </dependency> 102 </dependency>
  103 + <dependency>
  104 + <groupId>org.mybatis.spring.boot</groupId>
  105 + <artifactId>mybatis-spring-boot-starter</artifactId>
  106 + <version>2.3.1</version>
  107 + </dependency>
111 108
112 <!-- 内部包 --> 109 <!-- 内部包 -->
113 <dependency> 110 <dependency>
@@ -160,12 +157,20 @@ @@ -160,12 +157,20 @@
160 <artifactId>lh-spring-service</artifactId> 157 <artifactId>lh-spring-service</artifactId>
161 <version>${project.version}</version> 158 <version>${project.version}</version>
162 </dependency> 159 </dependency>
163 -  
164 -  
165 <dependency> 160 <dependency>
166 - <groupId>org.mybatis.spring.boot</groupId>  
167 - <artifactId>mybatis-spring-boot-starter</artifactId>  
168 - <version>2.3.1</version> 161 + <groupId>com.zhonglai.luhui</groupId>
  162 + <artifactId>lh-admin-security</artifactId>
  163 + <version>${project.version}</version>
  164 + </dependency>
  165 + <dependency>
  166 + <groupId>com.zhonglai.luhui</groupId>
  167 + <artifactId>lh-springboot-redis</artifactId>
  168 + <version>${project.version}</version>
  169 + </dependency>
  170 + <dependency>
  171 + <groupId>com.zhonglai.luhui</groupId>
  172 + <artifactId>lh-springboot-log</artifactId>
  173 + <version>${project.version}</version>
169 </dependency> 174 </dependency>
170 175
171 <!--常用工具类 --> 176 <!--常用工具类 -->
@@ -334,6 +339,20 @@ @@ -334,6 +339,20 @@
334 <version>${aspectj.version}</version> 339 <version>${aspectj.version}</version>
335 </dependency> 340 </dependency>
336 341
  342 + <!-- 解析客户端操作系统、浏览器等 -->
  343 + <dependency>
  344 + <groupId>eu.bitwalker</groupId>
  345 + <artifactId>UserAgentUtils</artifactId>
  346 + <version>1.21</version>
  347 + </dependency>
  348 +
  349 + <!-- pool 对象池 -->
  350 + <dependency>
  351 + <groupId>org.apache.commons</groupId>
  352 + <artifactId>commons-pool2</artifactId>
  353 + <version>2.9.0</version>
  354 + </dependency>
  355 +
337 </dependencies> 356 </dependencies>
338 </dependencyManagement> 357 </dependencyManagement>
339 358