初始化

This commit is contained in:
2026-02-22 18:56:10 +08:00
commit 26677972a6
3112 changed files with 255972 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.config;
import tech.easyflow.common.util.SpringContextUtil;
import tech.easyflow.common.dict.DictManager;
import tech.easyflow.common.dict.loader.DbDataLoader;
import tech.easyflow.system.entity.SysDict;
import tech.easyflow.system.mapper.*;
import tech.easyflow.system.service.SysDictService;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import javax.annotation.Resource;
import java.util.List;
@Configuration
public class SysDictAutoConfig {
private SysDictService service;
@Resource
private SysMenuMapper sysMenuMapper;
@Resource
private SysDeptMapper sysDeptMapper;
@Resource
private SysRoleMapper sysRoleMapper;
@Resource
private SysPositionMapper sysPositionMapper;
@Resource
private SysAccountMapper sysAccountMapper;
public SysDictAutoConfig(SysDictService service) {
this.service = service;
}
@EventListener(ApplicationReadyEvent.class)
public void onApplicationStartup() {
DictManager dictManager = SpringContextUtil.getBean(DictManager.class);
// 菜单表字典
dictManager.putLoader(new DbDataLoader<>("sysMenu", sysMenuMapper, "id", "menu_title", "parent_id", "sort_no asc", false));
// 部门表字典
dictManager.putLoader(new DbDataLoader<>("sysDept", sysDeptMapper, "id", "dept_name", "parent_id", "sort_no asc", false));
// 角色表字典
dictManager.putLoader(new DbDataLoader<>("sysRole", sysRoleMapper, "id", "role_name", null, null, true));
// 职位字典
dictManager.putLoader(new DbDataLoader<>("sysPosition", sysPositionMapper, "id", "position_name", null, null, true));
// 用户字典
dictManager.putLoader(new DbDataLoader<>("sysAccount", sysAccountMapper, "id", "login_name", null, null, true));
List<SysDict> sysDicts = service.list();
if (sysDicts != null) {
sysDicts.forEach(sysDict -> dictManager.putLoader(sysDict.buildLoader()));
}
}
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.config;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@MapperScan("tech.easyflow.system.mapper")
@AutoConfiguration
public class SysModuleConfig {
public SysModuleConfig() {
System.out.println("启用模块 >>>>>>>>>> module-system");
}
}

View File

@@ -0,0 +1,71 @@
package tech.easyflow.system.entity;
import cn.hutool.core.bean.BeanUtil;
import tech.easyflow.common.entity.LoginAccount;
import tech.easyflow.system.entity.base.SysAccountBase;
import com.alibaba.fastjson.annotation.JSONField;
import com.mybatisflex.annotation.RelationManyToMany;
import com.mybatisflex.annotation.Table;
import java.math.BigInteger;
import java.util.List;
/**
* 用户表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_account", comment = "用户表")
public class SysAccount extends SysAccountBase {
@RelationManyToMany(joinTable = "tb_sys_account_role"
, joinSelfColumn = "account_id"
, joinTargetColumn = "role_id"
, targetTable = "tb_sys_role"
, targetField = "id"
, valueField = "id"
)
private List<BigInteger> roleIds;
@RelationManyToMany(joinTable = "tb_sys_account_position"
, joinSelfColumn = "account_id"
, joinTargetColumn = "position_id"
, targetTable = "tb_sys_position"
, targetField = "id"
, valueField = "id"
)
private List<BigInteger> positionIds;
public List<BigInteger> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<BigInteger> roleIds) {
this.roleIds = roleIds;
}
public List<BigInteger> getPositionIds() {
return positionIds;
}
public void setPositionIds(List<BigInteger> positionIds) {
this.positionIds = positionIds;
}
@Override
@JSONField(serialize = false)
public String getPassword() {
return super.getPassword();
}
/**
* 转为登录用户
*/
public LoginAccount toLoginAccount() {
LoginAccount loginAccount = new LoginAccount();
BeanUtil.copyProperties(this, loginAccount);
return loginAccount;
}
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysAccountPositionBase;
import com.mybatisflex.annotation.Table;
/**
* 用户-职位表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_account_position", comment = "用户-职位表")
public class SysAccountPosition extends SysAccountPositionBase {
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysAccountRoleBase;
import com.mybatisflex.annotation.Table;
/**
* 用户-角色表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_account_role", comment = "用户-角色表")
public class SysAccountRole extends SysAccountRoleBase {
}

View File

@@ -0,0 +1,44 @@
package tech.easyflow.system.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.Table;
import tech.easyflow.system.entity.base.SysApiKeyBase;
import java.math.BigInteger;
import java.util.List;
/**
* 实体类。
*
* @author Administrator
* @since 2025-04-18
*/
@Table("tb_sys_api_key")
public class SysApiKey extends SysApiKeyBase {
public static final String KEY_Apikey = "Apikey";
@Column(ignore = true)
List<BigInteger> permissionIds;
@RelationOneToMany(selfField = "id", targetField = "apiKeyId", targetTable = "tb_sys_api_key_resource_mapping")
private List<SysApiKeyResourceMapping> resourcePermissions;
public List<SysApiKeyResourceMapping> getResourcePermissions() {
return resourcePermissions;
}
public void setResourcePermissions(List<SysApiKeyResourceMapping> resourcePermissions) {
this.resourcePermissions = resourcePermissions;
}
public List<BigInteger> getPermissionIds() {
return permissionIds;
}
public void setPermissionIds(List<BigInteger> permissionIds) {
this.permissionIds = permissionIds;
}
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import com.mybatisflex.annotation.Table;
import tech.easyflow.system.entity.base.SysApiKeyResourceBase;
/**
* 请求接口表 实体类。
*
* @author 12076
* @since 2025-12-01
*/
@Table(value = "tb_sys_api_key_resource", comment = "请求接口表")
public class SysApiKeyResource extends SysApiKeyResourceBase {
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import com.mybatisflex.annotation.Table;
import tech.easyflow.system.entity.base.SysApiKeyResourceMappingBase;
/**
* apikey-请求接口表 实体类。
*
* @author 12076
* @since 2025-12-01
*/
@Table(value = "tb_sys_api_key_resource_mapping", comment = "apikey-请求接口表")
public class SysApiKeyResourceMapping extends SysApiKeyResourceMappingBase {
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysDeptBase;
import com.mybatisflex.annotation.Table;
/**
* 部门表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_dept", comment = "部门表")
public class SysDept extends SysDeptBase {
}

View File

@@ -0,0 +1,96 @@
package tech.easyflow.system.entity;
import tech.easyflow.common.util.SpringContextUtil;
import tech.easyflow.common.dict.Dict;
import tech.easyflow.common.dict.DictItem;
import tech.easyflow.common.dict.DictLoader;
import tech.easyflow.common.dict.DictType;
import tech.easyflow.common.dict.loader.DatabaseDictLoader;
import tech.easyflow.common.dict.loader.EnumDictLoader;
import tech.easyflow.system.entity.base.SysDictBase;
import tech.easyflow.system.service.SysDictItemService;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.query.QueryWrapper;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
/**
* 系统配置表 实体类。
*
* @author michael
* @since 2024-03-04
*/
@Table(value = "tb_sys_dict",comment = "系统字典表")
public class SysDict extends SysDictBase {
public DictLoader buildLoader() {
Integer dictType = getDictType();
if (dictType == null) {
return null;
}
if (dictType == DictType.TABLE.getValue()) {
String tableName = (String) this.getOptions().get("tableName");
String keyColumn = (String) this.getOptions().get("keyColumn");
String labelColumn = (String) this.getOptions().get("labelColumn");
String parentColumn = (String) this.getOptions().get("parentColumn");
return new DatabaseDictLoader(this.getCode(), tableName, keyColumn, labelColumn, parentColumn, null);
} else if (dictType == DictType.ENUM.getValue()) {
String enumClassString = (String) this.getOptions().get("enumClass");
String keyField = (String) this.getOptions().get("keyField");
String labelField = (String) this.getOptions().get("labelField");
//noinspection rawtypes
Class enumClass = null;
try {
enumClass = Class.forName(enumClassString);
} catch (ClassNotFoundException e) {
//ignore
return null;
}
return new EnumDictLoader<>(this.getName(), this.getCode(), enumClass, keyField, labelField);
} else if (dictType == DictType.CUSTOM.getValue()) {
return new DictItemsLoader(this.getCode(), this.getId());
}
return null;
}
public static class DictItemsLoader implements DictLoader {
private final String code;
private final BigInteger dictId;
private final SysDictItemService itemService;
public DictItemsLoader(String code, BigInteger dictId) {
this.code = code;
this.dictId = dictId;
this.itemService = SpringContextUtil.getBean(SysDictItemService.class);
}
@Override
public String code() {
return code;
}
@Override
public Dict load(String keyword, Map<String, String[]> parameters) {
QueryWrapper qw = QueryWrapper.create()
.eq(SysDictItem::getDictId, this.dictId)
.eq(SysDictItem::getStatus, 0)
.like(SysDictItem::getText, keyword);
List<SysDictItem> sysDictItems = itemService.list(qw);
Dict dict = new Dict();
if (sysDictItems != null) {
for (SysDictItem sysDictItem : sysDictItems) {
dict.addItem(new DictItem(sysDictItem.getValue(), sysDictItem.getText()));
}
}
return dict;
}
}
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysDictItemBase;
import com.mybatisflex.annotation.Table;
/**
* 数据字典内容 实体类。
*
* @author michael
* @since 2024-03-04
*/
@Table(value = "tb_sys_dict_item", comment = "数据字典内容")
public class SysDictItem extends SysDictItemBase {
}

View File

@@ -0,0 +1,27 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysLogBase;
import com.mybatisflex.annotation.RelationManyToOne;
import com.mybatisflex.annotation.Table;
/**
* 操作日志表 实体类。
*
* @author michael
* @since 2024-03-04
*/
@Table(value = "tb_sys_log", comment = "操作日志表")
public class SysLog extends SysLogBase {
@RelationManyToOne(selfField = "accountId")
private SysAccount account;
public SysAccount getAccount() {
return account;
}
public void setAccount(SysAccount account) {
this.account = account;
}
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysMenuBase;
import com.mybatisflex.annotation.Table;
/**
* 菜单表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_menu", comment = "菜单表")
public class SysMenu extends SysMenuBase {
}

View File

@@ -0,0 +1,24 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysOptionBase;
import com.mybatisflex.annotation.Table;
/**
* 系统配置信息表。 实体类。
*
* @author michael
* @since 2024-03-13
*/
@Table(value = "tb_sys_option", comment = "系统配置信息表")
public class SysOption extends SysOptionBase {
public SysOption() {
}
public SysOption(String key, String value) {
setKey(key);
setValue(value);
}
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysPositionBase;
import com.mybatisflex.annotation.Table;
/**
* 职位表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_position", comment = "职位表")
public class SysPosition extends SysPositionBase {
}

View File

@@ -0,0 +1,40 @@
package tech.easyflow.system.entity;
import com.mybatisflex.annotation.Column;
import tech.easyflow.system.entity.base.SysRoleBase;
import com.mybatisflex.annotation.Table;
import java.math.BigInteger;
import java.util.List;
/**
* 系统角色 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_role", comment = "系统角色")
public class SysRole extends SysRoleBase {
@Column(ignore = true)
private List<BigInteger> menuIds;
@Column(ignore = true)
private List<BigInteger> deptIds;
public List<BigInteger> getMenuIds() {
return menuIds;
}
public void setMenuIds(List<BigInteger> menuIds) {
this.menuIds = menuIds;
}
public List<BigInteger> getDeptIds() {
return deptIds;
}
public void setDeptIds(List<BigInteger> deptIds) {
this.deptIds = deptIds;
}
}

View File

@@ -0,0 +1,16 @@
package tech.easyflow.system.entity;
import com.mybatisflex.annotation.Table;
import tech.easyflow.system.entity.base.SysRoleDeptBase;
/**
* 角色-部门表 实体类。
*
* @author ArkLight
* @since 2025-11-19
*/
@Table(value = "tb_sys_role_dept", comment = "角色-部门表")
public class SysRoleDept extends SysRoleDeptBase {
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import tech.easyflow.system.entity.base.SysRoleMenuBase;
import com.mybatisflex.annotation.Table;
/**
* 角色-菜单表 实体类。
*
* @author ArkLight
* @since 2025-03-14
*/
@Table(value = "tb_sys_role_menu", comment = "角色-菜单表")
public class SysRoleMenu extends SysRoleMenuBase {
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.entity;
import com.mybatisflex.annotation.Table;
import tech.easyflow.system.entity.base.SysUserFeedbackBase;
/**
* 实体类。
*
* @author 12076
* @since 2025-12-30
*/
@Table("tb_sys_user_feedback")
public class SysUserFeedback extends SysUserFeedbackBase {
}

View File

@@ -0,0 +1,240 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateEntity;
public class SysAccountBase extends DateEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 部门ID
*/
@Column(comment = "部门ID")
private BigInteger deptId;
/**
* 租户ID
*/
@Column(tenantId = true, comment = "租户ID")
private BigInteger tenantId;
/**
* 登录账号
*/
@Column(comment = "登录账号")
private String loginName;
/**
* 密码
*/
@Column(comment = "密码")
private String password;
/**
* 账户类型
*/
@Column(comment = "账户类型")
private Integer accountType;
/**
* 昵称
*/
@Column(comment = "昵称")
private String nickname;
/**
* 手机电话
*/
@Column(comment = "手机电话")
private String mobile;
/**
* 邮件
*/
@Column(comment = "邮件")
private String email;
/**
* 账户头像
*/
@Column(comment = "账户头像")
private String avatar;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 创建者
*/
@Column(comment = "创建者")
private BigInteger createdBy;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
/**
* 修改者
*/
@Column(comment = "修改者")
private BigInteger modifiedBy;
/**
* 备注
*/
@Column(comment = "备注")
private String remark;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getDeptId() {
return deptId;
}
public void setDeptId(BigInteger deptId) {
this.deptId = deptId;
}
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getAccountType() {
return accountType;
}
public void setAccountType(Integer accountType) {
this.accountType = accountType;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public BigInteger getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(BigInteger modifiedBy) {
this.modifiedBy = modifiedBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
public class SysAccountPositionBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 用户ID
*/
@Column(comment = "用户ID")
private BigInteger accountId;
/**
* 职位ID
*/
@Column(comment = "职位ID")
private BigInteger positionId;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getAccountId() {
return accountId;
}
public void setAccountId(BigInteger accountId) {
this.accountId = accountId;
}
public BigInteger getPositionId() {
return positionId;
}
public void setPositionId(BigInteger positionId) {
this.positionId = positionId;
}
}

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
public class SysAccountRoleBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 用户ID
*/
@Column(comment = "用户ID")
private BigInteger accountId;
/**
* 角色ID
*/
@Column(comment = "角色ID")
private BigInteger roleId;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getAccountId() {
return accountId;
}
public void setAccountId(BigInteger accountId) {
this.accountId = accountId;
}
public BigInteger getRoleId() {
return roleId;
}
public void setRoleId(BigInteger roleId) {
this.roleId = roleId;
}
}

View File

@@ -0,0 +1,127 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
public class SysApiKeyBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "id")
private BigInteger id;
/**
* apiKey
*/
@Column(comment = "apiKey")
private String apiKey;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 部门id
*/
@Column(comment = "部门id")
private BigInteger deptId;
/**
* 租户id
*/
@Column(tenantId = true, comment = "租户id")
private BigInteger tenantId;
/**
* 失效时间
*/
@Column(comment = "失效时间")
private Date expiredAt;
/**
* 创建人
*/
@Column(comment = "创建人")
private BigInteger createdBy;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public BigInteger getDeptId() {
return deptId;
}
public void setDeptId(BigInteger deptId) {
this.deptId = deptId;
}
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public Date getExpiredAt() {
return expiredAt;
}
public void setExpiredAt(Date expiredAt) {
this.expiredAt = expiredAt;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
}

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
public class SysApiKeyResourceBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "id")
private BigInteger id;
/**
* 请求接口
*/
@Column(comment = "请求接口")
private String requestInterface;
/**
* 标题
*/
@Column(comment = "标题")
private String title;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public String getRequestInterface() {
return requestInterface;
}
public void setRequestInterface(String requestInterface) {
this.requestInterface = requestInterface;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
public class SysApiKeyResourceMappingBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "id")
private BigInteger id;
/**
* api_key_id
*/
@Column(comment = "api_key_id")
private BigInteger apiKeyId;
/**
* 请求接口资源访问id
*/
@Column(comment = "请求接口资源访问id")
private BigInteger apiKeyResourceId;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getApiKeyId() {
return apiKeyId;
}
public void setApiKeyId(BigInteger apiKeyId) {
this.apiKeyId = apiKeyId;
}
public BigInteger getApiKeyResourceId() {
return apiKeyResourceId;
}
public void setApiKeyResourceId(BigInteger apiKeyResourceId) {
this.apiKeyResourceId = apiKeyResourceId;
}
}

View File

@@ -0,0 +1,198 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateTreeEntity;
public class SysDeptBase extends DateTreeEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 租户ID
*/
@Column(tenantId = true, comment = "租户ID")
private BigInteger tenantId;
/**
* 父级ID
*/
@Column(comment = "父级ID")
private BigInteger parentId;
/**
* 父级部门ID集合
*/
@Column(comment = "父级部门ID集合")
private String ancestors;
/**
* 部门名称
*/
@Column(comment = "部门名称")
private String deptName;
/**
* 部门编码
*/
@Column(comment = "部门编码")
private String deptCode;
/**
* 排序
*/
@Column(comment = "排序")
private Integer sortNo;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 创建者
*/
@Column(comment = "创建者")
private BigInteger createdBy;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
/**
* 修改者
*/
@Column(comment = "修改者")
private BigInteger modifiedBy;
/**
* 备注
*/
@Column(comment = "备注")
private String remark;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public BigInteger getParentId() {
return parentId;
}
public void setParentId(BigInteger parentId) {
this.parentId = parentId;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public BigInteger getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(BigInteger modifiedBy) {
this.modifiedBy = modifiedBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@@ -0,0 +1,158 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.core.handler.FastjsonTypeHandler;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.Map;
import tech.easyflow.common.entity.DateEntity;
public class SysDictBase extends DateEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 数据字典名称
*/
@Column(comment = "数据字典名称")
private String name;
/**
* 字典编码
*/
@Column(comment = "字典编码")
private String code;
/**
* 字典描述或备注
*/
@Column(comment = "字典描述或备注")
private String description;
/**
* 字典类型 1 自定义字典、2 数据表字典、 3 枚举类字典、 4 系统字典(自定义 DictLoader
*/
@Column(comment = "字典类型 1 自定义字典、2 数据表字典、 3 枚举类字典、 4 系统字典(自定义 DictLoader")
private Integer dictType;
/**
* 排序编号
*/
@Column(comment = "排序编号")
private Integer sortNo;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 扩展字典 存放 json
*/
@Column(typeHandler = FastjsonTypeHandler.class, comment = "扩展字典 存放 json")
private Map<String, Object> options;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getDictType() {
return dictType;
}
public void setDictType(Integer dictType) {
this.dictType = dictType;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Map<String, Object> getOptions() {
return options;
}
public void setOptions(Map<String, Object> options) {
this.options = options;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
}

View File

@@ -0,0 +1,184 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateEntity;
public class SysDictItemBase extends DateEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 归属哪个字典
*/
@Column(comment = "归属哪个字典")
private BigInteger dictId;
/**
* 名称或内容
*/
@Column(comment = "名称或内容")
private String text;
/**
* 值
*/
@Column(comment = "")
private String value;
/**
* 描述
*/
@Column(comment = "描述")
private String description;
/**
* 排序
*/
@Column(comment = "排序")
private Integer sortNo;
/**
* css样式内容
*/
@Column(comment = "css样式内容")
private String cssContent;
/**
* css样式类名
*/
@Column(comment = "css样式类名")
private String cssClass;
/**
* 备注
*/
@Column(comment = "备注")
private String remark;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getDictId() {
return dictId;
}
public void setDictId(BigInteger dictId) {
this.dictId = dictId;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
public String getCssContent() {
return cssContent;
}
public void setCssContent(String cssContent) {
this.cssContent = cssContent;
}
public String getCssClass() {
return cssClass;
}
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
}

View File

@@ -0,0 +1,183 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
public class SysLogBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "ID")
private BigInteger id;
/**
* 操作人
*/
@Column(comment = "操作人")
private BigInteger accountId;
/**
* 操作名称
*/
@Column(comment = "操作名称")
private String actionName;
/**
* 操作的类型
*/
@Column(comment = "操作的类型")
private String actionType;
/**
* 操作涉及的类
*/
@Column(comment = "操作涉及的类")
private String actionClass;
/**
* 操作涉及的方法
*/
@Column(comment = "操作涉及的方法")
private String actionMethod;
/**
* 操作涉及的 URL 地址
*/
@Column(comment = "操作涉及的 URL 地址")
private String actionUrl;
/**
* 操作涉及的用户 IP 地址
*/
@Column(comment = "操作涉及的用户 IP 地址")
private String actionIp;
/**
* 操作请求参数
*/
@Column(comment = "操作请求参数")
private String actionParams;
/**
* 操作请求body
*/
@Column(comment = "操作请求body")
private String actionBody;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 操作时间
*/
@Column(comment = "操作时间")
private Date created;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getAccountId() {
return accountId;
}
public void setAccountId(BigInteger accountId) {
this.accountId = accountId;
}
public String getActionName() {
return actionName;
}
public void setActionName(String actionName) {
this.actionName = actionName;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getActionClass() {
return actionClass;
}
public void setActionClass(String actionClass) {
this.actionClass = actionClass;
}
public String getActionMethod() {
return actionMethod;
}
public void setActionMethod(String actionMethod) {
this.actionMethod = actionMethod;
}
public String getActionUrl() {
return actionUrl;
}
public void setActionUrl(String actionUrl) {
this.actionUrl = actionUrl;
}
public String getActionIp() {
return actionIp;
}
public void setActionIp(String actionIp) {
this.actionIp = actionIp;
}
public String getActionParams() {
return actionParams;
}
public void setActionParams(String actionParams) {
this.actionParams = actionParams;
}
public String getActionBody() {
return actionBody;
}
public void setActionBody(String actionBody) {
this.actionBody = actionBody;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
}

View File

@@ -0,0 +1,240 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateTreeEntity;
public class SysMenuBase extends DateTreeEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 父菜单id
*/
@Column(comment = "父菜单id")
private BigInteger parentId;
/**
* 菜单类型
*/
@Column(comment = "菜单类型")
private Integer menuType;
/**
* 菜单标题
*/
@Column(comment = "菜单标题")
private String menuTitle;
/**
* 菜单url
*/
@Column(comment = "菜单url")
private String menuUrl;
/**
* 组件路径
*/
@Column(comment = "组件路径")
private String component;
/**
* 图标/图片地址
*/
@Column(comment = "图标/图片地址")
private String menuIcon;
/**
* 是否显示
*/
@Column(comment = "是否显示")
private Integer isShow;
/**
* 权限标识
*/
@Column(comment = "权限标识")
private String permissionTag;
/**
* 排序
*/
@Column(comment = "排序")
private Integer sortNo;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 创建者
*/
@Column(comment = "创建者")
private BigInteger createdBy;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
/**
* 修改者
*/
@Column(comment = "修改者")
private BigInteger modifiedBy;
/**
* 备注
*/
@Column(comment = "备注")
private String remark;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getParentId() {
return parentId;
}
public void setParentId(BigInteger parentId) {
this.parentId = parentId;
}
public Integer getMenuType() {
return menuType;
}
public void setMenuType(Integer menuType) {
this.menuType = menuType;
}
public String getMenuTitle() {
return menuTitle;
}
public void setMenuTitle(String menuTitle) {
this.menuTitle = menuTitle;
}
public String getMenuUrl() {
return menuUrl;
}
public void setMenuUrl(String menuUrl) {
this.menuUrl = menuUrl;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getMenuIcon() {
return menuIcon;
}
public void setMenuIcon(String menuIcon) {
this.menuIcon = menuIcon;
}
public Integer getIsShow() {
return isShow;
}
public void setIsShow(Integer isShow) {
this.isShow = isShow;
}
public String getPermissionTag() {
return permissionTag;
}
public void setPermissionTag(String permissionTag) {
this.permissionTag = permissionTag;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public BigInteger getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(BigInteger modifiedBy) {
this.modifiedBy = modifiedBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@@ -0,0 +1,54 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import java.io.Serializable;
import java.math.BigInteger;
public class SysOptionBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
@Column(tenantId = true, comment = "租户ID")
private BigInteger tenantId;
/**
* 配置KEY
*/
@Column(comment = "配置KEY")
private String key;
/**
* 配置内容
*/
@Column(comment = "配置内容")
private String value;
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@@ -0,0 +1,184 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateEntity;
public class SysPositionBase extends DateEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 租户ID
*/
@Column(tenantId = true, comment = "租户ID")
private BigInteger tenantId;
/**
* 部门ID
*/
@Column(comment = "部门ID")
private BigInteger deptId;
/**
* 岗位名称
*/
@Column(comment = "岗位名称")
private String positionName;
/**
* 岗位编码
*/
@Column(comment = "岗位编码")
private String positionCode;
/**
* 排序
*/
@Column(comment = "排序")
private Integer sortNo;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 创建者
*/
@Column(comment = "创建者")
private BigInteger createdBy;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
/**
* 修改者
*/
@Column(comment = "修改者")
private BigInteger modifiedBy;
/**
* 备注
*/
@Column(comment = "备注")
private String remark;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public BigInteger getDeptId() {
return deptId;
}
public void setDeptId(BigInteger deptId) {
this.deptId = deptId;
}
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
public String getPositionCode() {
return positionCode;
}
public void setPositionCode(String positionCode) {
this.positionCode = positionCode;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public BigInteger getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(BigInteger modifiedBy) {
this.modifiedBy = modifiedBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@@ -0,0 +1,198 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateEntity;
public class SysRoleBase extends DateEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 租户ID
*/
@Column(tenantId = true, comment = "租户ID")
private BigInteger tenantId;
/**
* 角色名称
*/
@Column(comment = "角色名称")
private String roleName;
/**
* 角色标识
*/
@Column(comment = "角色标识")
private String roleKey;
/**
* 数据状态
*/
@Column(comment = "数据状态")
private Integer status;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 创建者
*/
@Column(comment = "创建者")
private BigInteger createdBy;
/**
* 修改时间
*/
@Column(comment = "修改时间")
private Date modified;
/**
* 修改者
*/
@Column(comment = "修改者")
private BigInteger modifiedBy;
/**
* 备注
*/
@Column(comment = "备注")
private String remark;
/**
* 数据权限(EnumDataScope)
*/
@Column(comment = "数据权限(EnumDataScope)")
private Integer dataScope;
/**
* 菜单树选择项是否关联显示
*/
@Column(comment = "菜单树选择项是否关联显示")
private Boolean menuCheckStrictly;
/**
* 部门树选择项是否关联显示
*/
@Column(comment = "部门树选择项是否关联显示")
private Boolean deptCheckStrictly;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getRoleKey() {
return roleKey;
}
public void setRoleKey(String roleKey) {
this.roleKey = roleKey;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public BigInteger getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(BigInteger modifiedBy) {
this.modifiedBy = modifiedBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getDataScope() {
return dataScope;
}
public void setDataScope(Integer dataScope) {
this.dataScope = dataScope;
}
public Boolean getMenuCheckStrictly() {
return menuCheckStrictly;
}
public void setMenuCheckStrictly(Boolean menuCheckStrictly) {
this.menuCheckStrictly = menuCheckStrictly;
}
public Boolean getDeptCheckStrictly() {
return deptCheckStrictly;
}
public void setDeptCheckStrictly(Boolean deptCheckStrictly) {
this.deptCheckStrictly = deptCheckStrictly;
}
}

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
public class SysRoleDeptBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 角色ID
*/
@Column(comment = "角色ID")
private BigInteger roleId;
/**
* 部门ID
*/
@Column(comment = "部门ID")
private BigInteger deptId;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getRoleId() {
return roleId;
}
public void setRoleId(BigInteger roleId) {
this.roleId = roleId;
}
public BigInteger getDeptId() {
return deptId;
}
public void setDeptId(BigInteger deptId) {
this.deptId = deptId;
}
}

View File

@@ -0,0 +1,56 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
public class SysRoleMenuBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键")
private BigInteger id;
/**
* 角色ID
*/
@Column(comment = "角色ID")
private BigInteger roleId;
/**
* 菜单ID
*/
@Column(comment = "菜单ID")
private BigInteger menuId;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getRoleId() {
return roleId;
}
public void setRoleId(BigInteger roleId) {
this.roleId = roleId;
}
public BigInteger getMenuId() {
return menuId;
}
public void setMenuId(BigInteger menuId) {
this.menuId = menuId;
}
}

View File

@@ -0,0 +1,212 @@
package tech.easyflow.system.entity.base;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import tech.easyflow.common.entity.DateEntity;
public class SysUserFeedbackBase extends DateEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Id(keyType = KeyType.Generator, value = "snowFlakeId", comment = "主键id")
private BigInteger id;
/**
* 问题摘要
*/
@Column(comment = "问题摘要")
private String feedbackContent;
/**
* 问题类型1-功能故障 2-优化建议 3-账号问题 4-其他)
*/
@Column(comment = "问题类型1-功能故障 2-优化建议 3-账号问题 4-其他)")
private Integer feedbackType;
/**
* 联系方式【手机号/邮箱】
*/
@Column(comment = "联系方式【手机号/邮箱】")
private String contactInfo;
/**
* 附件url
*/
@Column(comment = "附件url")
private String attachmentUrl;
/**
* 反馈处理状态0-未查看 1-已查看 2-已处理)
*/
@Column(comment = "反馈处理状态0-未查看 1-已查看 2-已处理)")
private Integer status;
/**
* 处理人id
*/
@Column(comment = "处理人id")
private BigInteger handlerId;
/**
* 处理时间
*/
@Column(comment = "处理时间")
private Date handleTime;
/**
* 部门ID
*/
@Column(comment = "部门ID")
private BigInteger deptId;
/**
* 租户ID
*/
@Column(tenantId = true, comment = "租户ID")
private BigInteger tenantId;
/**
* 创建时间
*/
@Column(comment = "创建时间")
private Date created;
/**
* 创建人
*/
@Column(comment = "创建人")
private BigInteger createdBy;
/**
* 最后修改时间
*/
@Column(comment = "最后修改时间")
private Date modified;
/**
* 最后修改的人
*/
@Column(comment = "最后修改的人")
private BigInteger modifiedBy;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public String getFeedbackContent() {
return feedbackContent;
}
public void setFeedbackContent(String feedbackContent) {
this.feedbackContent = feedbackContent;
}
public Integer getFeedbackType() {
return feedbackType;
}
public void setFeedbackType(Integer feedbackType) {
this.feedbackType = feedbackType;
}
public String getContactInfo() {
return contactInfo;
}
public void setContactInfo(String contactInfo) {
this.contactInfo = contactInfo;
}
public String getAttachmentUrl() {
return attachmentUrl;
}
public void setAttachmentUrl(String attachmentUrl) {
this.attachmentUrl = attachmentUrl;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public BigInteger getHandlerId() {
return handlerId;
}
public void setHandlerId(BigInteger handlerId) {
this.handlerId = handlerId;
}
public Date getHandleTime() {
return handleTime;
}
public void setHandleTime(Date handleTime) {
this.handleTime = handleTime;
}
public BigInteger getDeptId() {
return deptId;
}
public void setDeptId(BigInteger deptId) {
this.deptId = deptId;
}
public BigInteger getTenantId() {
return tenantId;
}
public void setTenantId(BigInteger tenantId) {
this.tenantId = tenantId;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public BigInteger getCreatedBy() {
return createdBy;
}
public void setCreatedBy(BigInteger createdBy) {
this.createdBy = createdBy;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public BigInteger getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(BigInteger modifiedBy) {
this.modifiedBy = modifiedBy;
}
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysAccount;
import com.mybatisflex.core.BaseMapper;
/**
* 用户表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysAccountMapper extends BaseMapper<SysAccount> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysAccountPosition;
import com.mybatisflex.core.BaseMapper;
/**
* 用户-职位表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysAccountPositionMapper extends BaseMapper<SysAccountPosition> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysAccountRole;
import com.mybatisflex.core.BaseMapper;
/**
* 用户-角色表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysAccountRoleMapper extends BaseMapper<SysAccountRole> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import com.mybatisflex.core.BaseMapper;
import tech.easyflow.system.entity.SysApiKey;
/**
* 映射层。
*
* @author Administrator
* @since 2025-04-18
*/
public interface SysApiKeyMapper extends BaseMapper<SysApiKey> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import com.mybatisflex.core.BaseMapper;
import tech.easyflow.system.entity.SysApiKeyResource;
/**
* 请求接口表 映射层。
*
* @author 12076
* @since 2025-12-01
*/
public interface SysApiKeyResourceMapper extends BaseMapper<SysApiKeyResource> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import com.mybatisflex.core.BaseMapper;
import tech.easyflow.system.entity.SysApiKeyResourceMapping;
/**
* apikey-请求接口表 映射层。
*
* @author 12076
* @since 2025-12-01
*/
public interface SysApiKeyResourceMappingMapper extends BaseMapper<SysApiKeyResourceMapping> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysDept;
import com.mybatisflex.core.BaseMapper;
/**
* 部门表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysDeptMapper extends BaseMapper<SysDept> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysDictItem;
import com.mybatisflex.core.BaseMapper;
/**
* 数据字典内容 映射层。
*
* @author michael
* @since 2024-03-03
*/
public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysDict;
import com.mybatisflex.core.BaseMapper;
/**
* 系统配置表 映射层。
*
* @author michael
* @since 2024-03-03
*/
public interface SysDictMapper extends BaseMapper<SysDict> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysLog;
import com.mybatisflex.core.BaseMapper;
/**
* 映射层。
*
* @author michael
* @since 2024-01-28
*/
public interface SysLogMapper extends BaseMapper<SysLog> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysMenu;
import com.mybatisflex.core.BaseMapper;
/**
* 菜单表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysMenuMapper extends BaseMapper<SysMenu> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysOption;
import com.mybatisflex.core.BaseMapper;
/**
* 系统配置信息表。 映射层。
*
* @author michael
* @since 2024-03-13
*/
public interface SysOptionMapper extends BaseMapper<SysOption> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysPosition;
import com.mybatisflex.core.BaseMapper;
/**
* 职位表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysPositionMapper extends BaseMapper<SysPosition> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import com.mybatisflex.core.BaseMapper;
import tech.easyflow.system.entity.SysRoleDept;
/**
* 角色-部门表 映射层。
*
* @author ArkLight
* @since 2025-11-19
*/
public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysRole;
import com.mybatisflex.core.BaseMapper;
/**
* 系统角色 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysRoleMapper extends BaseMapper<SysRole> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import tech.easyflow.system.entity.SysRoleMenu;
import com.mybatisflex.core.BaseMapper;
/**
* 角色-菜单表 映射层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.mapper;
import com.mybatisflex.core.BaseMapper;
import tech.easyflow.system.entity.SysUserFeedback;
/**
* 映射层。
*
* @author 12076
* @since 2025-12-30
*/
public interface SysUserFeedbackMapper extends BaseMapper<SysUserFeedback> {
}

View File

@@ -0,0 +1,47 @@
package tech.easyflow.system.options;
import com.mybatisflex.core.query.QueryWrapper;
import tech.easyflow.common.entity.LoginAccount;
import tech.easyflow.common.options.SysOptionStore;
import tech.easyflow.common.satoken.util.SaTokenUtil;
import tech.easyflow.common.util.StringUtil;
import tech.easyflow.system.entity.SysOption;
import tech.easyflow.system.service.SysOptionService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class DefaultOptionStore implements SysOptionStore {
@Resource
private SysOptionService optionService;
@Override
public void save(String key, Object value) {
if (value == null || !StringUtil.hasText(value.toString())) {
optionService.remove(QueryWrapper.create().eq(SysOption::getKey, key));
return;
}
String newValue = value.toString().trim();
SysOption option = optionService.getByOptionKey(key);
LoginAccount loginAccount = SaTokenUtil.getLoginAccount();
if (option == null) {
option = new SysOption(key, newValue);
option.setTenantId(loginAccount.getTenantId());
optionService.save(option);
} else {
option.setValue(newValue);
QueryWrapper queryWrapper = QueryWrapper.create().eq(SysOption::getKey, key);
optionService.update(option, queryWrapper);
}
}
@Override
public String get(String key) {
SysOption option = optionService.getById(key);
return option != null ? option.getValue() : null;
}
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysAccountPosition;
import com.mybatisflex.core.service.IService;
/**
* 用户-职位表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysAccountPositionService extends IService<SysAccountPosition> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysAccountRole;
import com.mybatisflex.core.service.IService;
/**
* 用户-角色表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysAccountRoleService extends IService<SysAccountRole> {
}

View File

@@ -0,0 +1,17 @@
package tech.easyflow.system.service;
import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysAccount;
/**
* 用户表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysAccountService extends IService<SysAccount> {
void syncRelations(SysAccount entity);
SysAccount getByUsername(String userKey);
}

View File

@@ -0,0 +1,16 @@
package tech.easyflow.system.service;
import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysApiKey;
import tech.easyflow.system.entity.SysApiKeyResourceMapping;
/**
* apikey-请求接口表 服务层。
*
* @author 12076
* @since 2025-12-01
*/
public interface SysApiKeyResourceMappingService extends IService<SysApiKeyResourceMapping> {
void authInterface(SysApiKey entity);
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysApiKeyResource;
/**
* 请求接口表 服务层。
*
* @author 12076
* @since 2025-12-01
*/
public interface SysApiKeyResourceService extends IService<SysApiKeyResource> {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service;
import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysApiKey;
/**
* 服务层。
*
* @author Administrator
* @since 2025-04-18
*/
public interface SysApiKeyService extends IService<SysApiKey> {
void checkApikeyPermission(String apiKey, String requestURI);
SysApiKey getSysApiKey(String apiKey);
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysDept;
import com.mybatisflex.core.service.IService;
/**
* 部门表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysDeptService extends IService<SysDept> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysDictItem;
import com.mybatisflex.core.service.IService;
/**
* 数据字典内容 服务层。
*
* @author michael
* @since 2024-03-03
*/
public interface SysDictItemService extends IService<SysDictItem> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysDict;
import com.mybatisflex.core.service.IService;
/**
* 系统配置表 服务层。
*
* @author michael
* @since 2024-03-03
*/
public interface SysDictService extends IService<SysDict> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysLog;
import com.mybatisflex.core.service.IService;
/**
* 操作日志表 服务层。
*
* @author michael
* @since 2024-01-28
*/
public interface SysLogService extends IService<SysLog> {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysMenu;
import com.mybatisflex.core.service.IService;
import java.math.BigInteger;
import java.util.List;
/**
* 菜单表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysMenuService extends IService<SysMenu> {
List<SysMenu> getMenusByAccountId(SysMenu entity, BigInteger accountId);
}

View File

@@ -0,0 +1,15 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysOption;
import com.mybatisflex.core.service.IService;
/**
* 系统配置信息表。 服务层。
*
* @author michael
* @since 2024-03-13
*/
public interface SysOptionService extends IService<SysOption> {
SysOption getByOptionKey(String key);
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysPosition;
import com.mybatisflex.core.service.IService;
/**
* 职位表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysPositionService extends IService<SysPosition> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysRoleDept;
/**
* 角色-部门表 服务层。
*
* @author ArkLight
* @since 2025-11-19
*/
public interface SysRoleDeptService extends IService<SysRoleDept> {
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysRoleMenu;
import com.mybatisflex.core.service.IService;
/**
* 角色-菜单表 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysRoleMenuService extends IService<SysRoleMenu> {
}

View File

@@ -0,0 +1,22 @@
package tech.easyflow.system.service;
import tech.easyflow.system.entity.SysRole;
import com.mybatisflex.core.service.IService;
import java.math.BigInteger;
import java.util.List;
/**
* 系统角色 服务层。
*
* @author ArkLight
* @since 2025-03-14
*/
public interface SysRoleService extends IService<SysRole> {
void saveRoleMenu(BigInteger roleId, List<String> keys);
List<SysRole> getRolesByAccountId(BigInteger accountId);
void saveRole(SysRole sysRole);
}

View File

@@ -0,0 +1,14 @@
package tech.easyflow.system.service;
import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysUserFeedback;
/**
* 服务层。
*
* @author 12076
* @since 2025-12-30
*/
public interface SysUserFeedbackService extends IService<SysUserFeedback> {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysAccountPosition;
import tech.easyflow.system.mapper.SysAccountPositionMapper;
import tech.easyflow.system.service.SysAccountPositionService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 用户-职位表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysAccountPositionServiceImpl extends ServiceImpl<SysAccountPositionMapper, SysAccountPosition> implements SysAccountPositionService {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysAccountRole;
import tech.easyflow.system.mapper.SysAccountRoleMapper;
import tech.easyflow.system.service.SysAccountRoleService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 用户-角色表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysAccountRoleServiceImpl extends ServiceImpl<SysAccountRoleMapper, SysAccountRole> implements SysAccountRoleService {
}

View File

@@ -0,0 +1,84 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tech.easyflow.system.entity.SysAccount;
import tech.easyflow.system.entity.SysAccountPosition;
import tech.easyflow.system.entity.SysAccountRole;
import tech.easyflow.system.mapper.SysAccountMapper;
import tech.easyflow.system.mapper.SysAccountPositionMapper;
import tech.easyflow.system.mapper.SysAccountRoleMapper;
import tech.easyflow.system.mapper.SysRoleMapper;
import tech.easyflow.system.service.SysAccountService;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* 用户表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysAccountServiceImpl extends ServiceImpl<SysAccountMapper, SysAccount> implements SysAccountService {
@Resource
private SysAccountRoleMapper sysAccountRoleMapper;
@Resource
private SysAccountPositionMapper sysAccountPositionMapper;
@Resource
private SysRoleMapper sysRoleMapper;
@Override
public void syncRelations(SysAccount entity) {
if (entity == null || entity.getId() == null) {
return;
}
//sync roleIds
List<BigInteger> roleIds = entity.getRoleIds();
if (roleIds != null) {
QueryWrapper delW = QueryWrapper.create();
delW.eq(SysAccountRole::getAccountId, entity.getId());
sysAccountRoleMapper.deleteByQuery(delW);
if (!roleIds.isEmpty()) {
List<SysAccountRole> rows = new ArrayList<>(roleIds.size());
roleIds.forEach(roleId -> {
SysAccountRole row = new SysAccountRole();
row.setAccountId(entity.getId());
row.setRoleId(roleId);
rows.add(row);
});
sysAccountRoleMapper.insertBatch(rows);
}
}
//sync positionIds
List<BigInteger> positionIds = entity.getPositionIds();
if (positionIds != null) {
QueryWrapper delW = QueryWrapper.create();
delW.eq(SysAccountPosition::getAccountId, entity.getId());
sysAccountPositionMapper.deleteByQuery(delW);
if (!positionIds.isEmpty()) {
List<SysAccountPosition> rows = new ArrayList<>(positionIds.size());
positionIds.forEach(positionId -> {
SysAccountPosition row = new SysAccountPosition();
row.setAccountId(entity.getId());
row.setPositionId(positionId);
rows.add(row);
});
sysAccountPositionMapper.insertBatch(rows);
}
}
}
@Override
public SysAccount getByUsername(String userKey) {
QueryWrapper w = QueryWrapper.create();
w.eq(SysAccount::getLoginName, userKey);
return getOne(w);
}
}

View File

@@ -0,0 +1,41 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tech.easyflow.system.entity.SysApiKey;
import tech.easyflow.system.entity.SysApiKeyResourceMapping;
import tech.easyflow.system.mapper.SysApiKeyResourceMappingMapper;
import tech.easyflow.system.service.SysApiKeyResourceMappingService;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* apikey-请求接口表 服务层实现。
*
* @author 12076
* @since 2025-12-01
*/
@Service
public class SysApiKeyResourceMappingServiceImpl extends ServiceImpl<SysApiKeyResourceMappingMapper, SysApiKeyResourceMapping> implements SysApiKeyResourceMappingService {
/**
* 批量授权apiKey接口
* @param entity
*/
@Override
public void authInterface(SysApiKey entity) {
this.remove(QueryWrapper.create().eq(SysApiKeyResourceMapping::getApiKeyId, entity.getId()));
List<SysApiKeyResourceMapping> rows = new ArrayList<>(entity.getPermissionIds().size());
BigInteger apiKeyId = entity.getId();
for (BigInteger resourceId : entity.getPermissionIds()) {
SysApiKeyResourceMapping sysApiKeyResourcePermissionRelationship = new SysApiKeyResourceMapping();
sysApiKeyResourcePermissionRelationship.setApiKeyId(apiKeyId);
sysApiKeyResourcePermissionRelationship.setApiKeyResourceId(resourceId);
rows.add(sysApiKeyResourcePermissionRelationship);
}
this.saveBatch(rows);
}
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tech.easyflow.system.entity.SysApiKeyResource;
import tech.easyflow.system.mapper.SysApiKeyResourceMapper;
import tech.easyflow.system.service.SysApiKeyResourceService;
/**
* 请求接口表 服务层实现。
*
* @author 12076
* @since 2025-12-01
*/
@Service
public class SysApiKeyResourceServiceImpl extends ServiceImpl<SysApiKeyResourceMapper, SysApiKeyResource> implements SysApiKeyResourceService {
}

View File

@@ -0,0 +1,66 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tech.easyflow.common.web.exceptions.BusinessException;
import tech.easyflow.system.entity.SysApiKey;
import tech.easyflow.system.entity.SysApiKeyResource;
import tech.easyflow.system.entity.SysApiKeyResourceMapping;
import tech.easyflow.system.mapper.SysApiKeyMapper;
import tech.easyflow.system.service.SysApiKeyResourceMappingService;
import tech.easyflow.system.service.SysApiKeyResourceService;
import tech.easyflow.system.service.SysApiKeyService;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
/**
* 服务层实现。
*
* @author Administrator
* @since 2025-04-18
*/
@Service
public class SysApiKeyServiceImpl extends ServiceImpl<SysApiKeyMapper, SysApiKey> implements SysApiKeyService {
@Resource
private SysApiKeyResourceMappingService mappingService;
@Resource
private SysApiKeyResourceService resourceService;
@Override
public void checkApikeyPermission(String apiKey, String requestURI) {
SysApiKey sysApiKey = getSysApiKey(apiKey);
QueryWrapper w = QueryWrapper.create();
w.eq(SysApiKeyResource::getRequestInterface, requestURI);
SysApiKeyResource resource = resourceService.getOne(w);
if (resource == null) {
throw new BusinessException("该接口不存在");
}
QueryWrapper wm = QueryWrapper.create();
wm.eq(SysApiKeyResourceMapping::getApiKeyId, sysApiKey.getId());
wm.eq(SysApiKeyResourceMapping::getApiKeyResourceId, resource.getId());
long count = mappingService.count(wm);
if (count == 0) {
throw new BusinessException("该apiKey无权限访问该接口");
}
}
@Override
public SysApiKey getSysApiKey(String apiKey) {
QueryWrapper w = QueryWrapper.create();
w.eq(SysApiKey::getApiKey, apiKey);
SysApiKey one = getOne(w);
if (one == null || one.getStatus() == 0) {
throw new BusinessException("apiKey 不存在或已禁用");
}
if (one.getExpiredAt() != null && one.getExpiredAt().getTime() < new Date().getTime()) {
throw new BusinessException("apiKey 已过期");
}
return one;
}
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysDept;
import tech.easyflow.system.mapper.SysDeptMapper;
import tech.easyflow.system.service.SysDeptService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 部门表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysDictItem;
import tech.easyflow.system.mapper.SysDictItemMapper;
import tech.easyflow.system.service.SysDictItemService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 数据字典内容 服务层实现。
*
* @author michael
* @since 2024-03-03
*/
@Service
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItem> implements SysDictItemService {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysDict;
import tech.easyflow.system.mapper.SysDictMapper;
import tech.easyflow.system.service.SysDictService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 系统配置表 服务层实现。
*
* @author michael
* @since 2024-03-03
*/
@Service
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> implements SysDictService {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysLog;
import tech.easyflow.system.mapper.SysLogMapper;
import tech.easyflow.system.service.SysLogService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 操作日志表 服务层实现。
*
* @author michael
* @since 2024-01-28
*/
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
}

View File

@@ -0,0 +1,58 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.common.util.SqlOperatorsUtil;
import tech.easyflow.system.entity.*;
import tech.easyflow.system.mapper.SysMenuMapper;
import tech.easyflow.system.service.SysAccountRoleService;
import tech.easyflow.system.service.SysMenuService;
import tech.easyflow.system.service.SysRoleMenuService;
import cn.hutool.core.collection.CollectionUtil;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.query.SqlOperators;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 菜单表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
@Resource
private SysRoleMenuService sysRoleMenuService;
@Resource
private SysAccountRoleService sysAccountRoleService;
@Override
public List<SysMenu> getMenusByAccountId(SysMenu entity, BigInteger accountId) {
// 查询用户对应角色id集合
QueryWrapper am = QueryWrapper.create();
am.eq(SysAccountRole::getAccountId, accountId);
List<BigInteger> roleIds = sysAccountRoleService.list(am).stream().map(SysAccountRole::getRoleId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(roleIds)) {
return new ArrayList<>();
}
// 查询角色对应的菜单id集合
QueryWrapper rm = QueryWrapper.create();
rm.in(SysRoleMenu::getRoleId, roleIds);
List<BigInteger> menuIds = sysRoleMenuService.list(rm).stream().map(SysRoleMenu::getMenuId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(menuIds)) {
return new ArrayList<>();
}
// 查询当前用户拥有的菜单
SqlOperators ops = SqlOperatorsUtil.build(SysMenu.class);
QueryWrapper queryWrapper = QueryWrapper.create(entity, ops);
queryWrapper.in(SysMenu::getId, menuIds);
queryWrapper.orderBy("sort_no asc");
return list(queryWrapper);
}
}

View File

@@ -0,0 +1,25 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.core.query.QueryWrapper;
import tech.easyflow.system.entity.SysOption;
import tech.easyflow.system.mapper.SysOptionMapper;
import tech.easyflow.system.service.SysOptionService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 系统配置信息表。 服务层实现。
*
* @author michael
* @since 2024-03-13
*/
@Service
public class SysOptionServiceImpl extends ServiceImpl<SysOptionMapper, SysOption> implements SysOptionService {
@Override
public SysOption getByOptionKey(String key) {
QueryWrapper w = QueryWrapper.create();
w.eq(SysOption::getKey, key);
return getOne(w);
}
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysPosition;
import tech.easyflow.system.mapper.SysPositionMapper;
import tech.easyflow.system.service.SysPositionService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 职位表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysPositionServiceImpl extends ServiceImpl<SysPositionMapper, SysPosition> implements SysPositionService {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tech.easyflow.system.entity.SysRoleDept;
import tech.easyflow.system.mapper.SysRoleDeptMapper;
import tech.easyflow.system.service.SysRoleDeptService;
/**
* 角色-部门表 服务层实现。
*
* @author ArkLight
* @since 2025-11-19
*/
@Service
public class SysRoleDeptServiceImpl extends ServiceImpl<SysRoleDeptMapper, SysRoleDept> implements SysRoleDeptService {
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import tech.easyflow.system.entity.SysRoleMenu;
import tech.easyflow.system.mapper.SysRoleMenuMapper;
import tech.easyflow.system.service.SysRoleMenuService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 角色-菜单表 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRoleMenu> implements SysRoleMenuService {
}

View File

@@ -0,0 +1,110 @@
package tech.easyflow.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.easyflow.common.constant.enums.EnumDataScope;
import tech.easyflow.system.entity.SysAccountRole;
import tech.easyflow.system.entity.SysRole;
import tech.easyflow.system.entity.SysRoleDept;
import tech.easyflow.system.entity.SysRoleMenu;
import tech.easyflow.system.mapper.SysRoleDeptMapper;
import tech.easyflow.system.mapper.SysRoleMapper;
import tech.easyflow.system.mapper.SysRoleMenuMapper;
import tech.easyflow.system.service.SysAccountRoleService;
import tech.easyflow.system.service.SysRoleService;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 系统角色 服务层实现。
*
* @author ArkLight
* @since 2025-03-14
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
@Resource
private SysAccountRoleService sysAccountRoleService;
@Resource
private SysRoleMenuMapper sysRoleMenuMapper;
@Resource
private SysRoleDeptMapper sysRoleDeptMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveRoleMenu(BigInteger roleId, List<String> keys) {
QueryWrapper delW = QueryWrapper.create();
delW.eq(SysRoleMenu::getRoleId, roleId);
sysRoleMenuMapper.deleteByQuery(delW);
List<SysRoleMenu> rows = new ArrayList<>(keys.size());
keys.forEach(string -> {
SysRoleMenu row = new SysRoleMenu();
row.setRoleId(roleId);
row.setMenuId(new BigInteger(string));
rows.add(row);
});
sysRoleMenuMapper.insertBatch(rows);
}
@Override
public List<SysRole> getRolesByAccountId(BigInteger accountId) {
// 查询用户对应角色id集合
QueryWrapper am = QueryWrapper.create();
am.eq(SysAccountRole::getAccountId, accountId);
List<BigInteger> roleIds = sysAccountRoleService.list(am).stream().map(SysAccountRole::getRoleId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(roleIds)) {
return new ArrayList<>();
}
return listByIds(roleIds);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveRole(SysRole sysRole) {
saveOrUpdate(sysRole);
// 非自定义数据权限则部门id集合为空
if (!EnumDataScope.CUSTOM.getCode().equals(sysRole.getDataScope())) {
sysRole.setDeptIds(new ArrayList<>());
}
List<BigInteger> menuIds = sysRole.getMenuIds();
List<BigInteger> deptIds = sysRole.getDeptIds();
QueryWrapper wrm = QueryWrapper.create();
wrm.eq(SysRoleMenu::getRoleId, sysRole.getId());
sysRoleMenuMapper.deleteByQuery(wrm);
QueryWrapper wrd = QueryWrapper.create();
wrd.eq(SysRoleDept::getRoleId, sysRole.getId());
sysRoleDeptMapper.deleteByQuery(wrd);
if (CollectionUtil.isNotEmpty(menuIds)) {
for (BigInteger menuId : menuIds) {
SysRoleMenu roleMenu = new SysRoleMenu();
roleMenu.setRoleId(sysRole.getId());
roleMenu.setMenuId(menuId);
sysRoleMenuMapper.insert(roleMenu);
}
}
if (CollectionUtil.isNotEmpty(deptIds)) {
for (BigInteger deptId : deptIds) {
SysRoleDept roleDept = new SysRoleDept();
roleDept.setRoleId(sysRole.getId());
roleDept.setDeptId(deptId);
sysRoleDeptMapper.insert(roleDept);
}
}
}
}

View File

@@ -0,0 +1,18 @@
package tech.easyflow.system.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import tech.easyflow.system.entity.SysUserFeedback;
import tech.easyflow.system.mapper.SysUserFeedbackMapper;
import tech.easyflow.system.service.SysUserFeedbackService;
import org.springframework.stereotype.Service;
/**
* 服务层实现。
*
* @author 12076
* @since 2025-12-30
*/
@Service
public class SysUserFeedbackServiceImpl extends ServiceImpl<SysUserFeedbackMapper, SysUserFeedback> implements SysUserFeedbackService{
}