chore: initialize qiming workspace repository
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.xspaceagi.system.infra.dao;
|
||||
|
||||
/**
|
||||
* model 和 entity 之间转换
|
||||
*
|
||||
* @param <T> model
|
||||
* @param <R> entity
|
||||
*/
|
||||
public interface ICommonTranslator<T, R> {
|
||||
|
||||
/**
|
||||
* 将Entity转换为Model
|
||||
*/
|
||||
T convertToModel(R entity);
|
||||
|
||||
/**
|
||||
* 将Model转换为Entity
|
||||
*/
|
||||
R convertToEntity(T model);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.xspaceagi.system.spec.annotation.I18n;
|
||||
import com.xspaceagi.system.spec.annotation.I18nField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 分类管理
|
||||
*/
|
||||
@I18n(module = "Category")
|
||||
@Data
|
||||
@TableName(value = "category", autoResultMap = true)
|
||||
public class Category {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@I18nField(field = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
@I18nField(field = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
@I18nField(field = "code", keyPrefix = true)
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 分类类型:Agent、PageApp、Component
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("i18n_config")
|
||||
public class I18nConfig {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
private String type;
|
||||
|
||||
private String module;
|
||||
|
||||
private String side;
|
||||
|
||||
private String dataId;
|
||||
|
||||
private String lang;
|
||||
|
||||
private String fieldKey;
|
||||
|
||||
private String fieldValue;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 语言表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "i18n_lang", autoResultMap = true)
|
||||
public class I18nLang {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户 ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 语言名称,例如 简体中文
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 语言,中文:zh-cn,英文:en-us 等等
|
||||
*/
|
||||
private String lang;
|
||||
|
||||
/**
|
||||
* 语言状态,0 停用;1 启用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否为默认语言,0 否;1 是
|
||||
*/
|
||||
private Integer isDefault;
|
||||
|
||||
/**
|
||||
* 排序,值越小越靠前
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("notify_message")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class NotifyMessage {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long senderId;
|
||||
private MessageScope scope;
|
||||
private String content;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
|
||||
//消息范围 Broadcast 广播消息;Private 私对私消息
|
||||
public enum MessageScope {
|
||||
Broadcast,
|
||||
Private,
|
||||
|
||||
System,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("notify_message_user")
|
||||
public class NotifyMessageUser {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long notifyId;
|
||||
private Long userId;
|
||||
private ReadStatus readStatus;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
|
||||
public enum ReadStatus {
|
||||
Unread,
|
||||
Read
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.xspaceagi.system.spec.annotation.I18n;
|
||||
import com.xspaceagi.system.spec.annotation.I18nField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@I18n(module = "OpenApi")
|
||||
@Data
|
||||
public class OpenApiDefinition {
|
||||
private String name;
|
||||
@I18nField(keyPrefix = true)
|
||||
private String key;
|
||||
private User.Role role;
|
||||
private String path;
|
||||
private List<OpenApiDefinition> apiList;
|
||||
@Schema(description = "每分钟请求次数,-1 表示不限制")
|
||||
private Integer rpm;
|
||||
@Schema(description = "每天请求次数,-1 表示不限制")
|
||||
private Integer rpd;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("pf_retry_data")
|
||||
public class RetryData {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目代码(系统编码,对应AMP系统编码)
|
||||
*/
|
||||
private String projectCode;
|
||||
|
||||
/**
|
||||
* app代码(应用编码对应AMP应用编码)
|
||||
*/
|
||||
private String appCode;
|
||||
|
||||
/**
|
||||
* 服务接口
|
||||
*/
|
||||
private String beanName;
|
||||
|
||||
/**
|
||||
* 接口方法
|
||||
*/
|
||||
private String methodName;
|
||||
|
||||
/**
|
||||
* tid
|
||||
*/
|
||||
private String tid;
|
||||
|
||||
/**
|
||||
* 状态,1待重试,2重试成功,3重试失败,4禁止重试
|
||||
*/
|
||||
private int status;
|
||||
|
||||
/**
|
||||
* 最大重试次数
|
||||
*/
|
||||
private Integer maxRetryCnt;
|
||||
|
||||
/**
|
||||
* 已重试次数
|
||||
*/
|
||||
private Integer retryCnt;
|
||||
|
||||
/**
|
||||
* 参数类型名称组
|
||||
*/
|
||||
private String argClassNames;
|
||||
|
||||
/**
|
||||
* 参数数组JSONString格式
|
||||
*/
|
||||
private String argStr;
|
||||
|
||||
/**
|
||||
* 方法响应
|
||||
*/
|
||||
private String result;
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
private String ext;
|
||||
|
||||
/**
|
||||
* 重试锁定时间
|
||||
*/
|
||||
private Date lockTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.xspaceagi.system.sdk.service.dto.ScheduleTaskDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@TableName(value = "schedule_task", autoResultMap = true)
|
||||
@Data
|
||||
public class ScheduleTask {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
@TableField(value = "space_id")
|
||||
private Long spaceId;
|
||||
|
||||
@TableField(value = "creator_id")
|
||||
private Long creatorId;
|
||||
|
||||
@TableField(value = "target_type")
|
||||
private String targetType;
|
||||
|
||||
@TableField(value = "task_name")
|
||||
private String taskName;
|
||||
|
||||
private String targetId;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private String beanId;
|
||||
|
||||
/**
|
||||
* 执行周期
|
||||
*/
|
||||
private String cron;
|
||||
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Object params;
|
||||
|
||||
private ScheduleTaskDto.Status status;
|
||||
|
||||
private Date latestExecTime;
|
||||
|
||||
private Date lockTime;
|
||||
|
||||
private Long execTimes;
|
||||
|
||||
private Long maxExecTimes;
|
||||
|
||||
private String error;
|
||||
|
||||
private String serverInfo;
|
||||
|
||||
@Schema(description = "任务修改时间")
|
||||
private Date modified;
|
||||
|
||||
@Schema(description = "任务创建时间")
|
||||
private Date created;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("space")
|
||||
public class Space {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private String name;
|
||||
private String description;
|
||||
private String icon;
|
||||
private Type type;
|
||||
private Long creatorId;
|
||||
private Integer yn;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
private Integer receivePublish;
|
||||
private Integer allowDevelop;
|
||||
public enum Type {
|
||||
Personal,
|
||||
Team,
|
||||
Class
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TableName("space_user")
|
||||
public class SpaceUser {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long spaceId;
|
||||
private Long userId;
|
||||
private Role role;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
|
||||
public enum Role {
|
||||
Owner,
|
||||
Admin,
|
||||
User
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.infra.dao.typehandler.TokenLimitTypeHandler;
|
||||
import com.xspaceagi.system.spec.enums.PermissionTargetTypeEnum;
|
||||
import com.xspaceagi.system.sdk.service.dto.TokenLimit;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据权限
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_data_permission", autoResultMap = true)
|
||||
public class SysDataPermission {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 目标类型
|
||||
* @see PermissionTargetTypeEnum
|
||||
*/
|
||||
private Integer targetType;
|
||||
|
||||
/**
|
||||
* 目标ID
|
||||
*/
|
||||
private Long targetId;
|
||||
|
||||
|
||||
/**
|
||||
* 模型ID列表(不落库,仅用于绑定入参透传)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<Long> modelIds;
|
||||
|
||||
/**
|
||||
* 可访问的智能体id列表(不落库,仅用于绑定入参透传)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<Long> agentIds;
|
||||
|
||||
/**
|
||||
* 可访问的应用页面id列表(不落库,仅用于绑定入参透传)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<Long> pageAgentIds;
|
||||
|
||||
/**
|
||||
* 开放API配置(不落库,仅用于绑定入参透传)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Map<String, String> openApiConfigMap;
|
||||
|
||||
/**
|
||||
* 可访问的知识库id列表(不落库,仅用于绑定入参透传)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<Long> knowledgeIds;
|
||||
|
||||
// ========== 配额限制配置 ==========
|
||||
|
||||
/**
|
||||
* token限制
|
||||
*/
|
||||
@TableField(value = "token_limit", typeHandler = TokenLimitTypeHandler.class)
|
||||
private TokenLimit tokenLimit;
|
||||
|
||||
/**
|
||||
* 可创建工作空间数量,-1 表示不限制
|
||||
*/
|
||||
private Integer maxSpaceCount;
|
||||
|
||||
/**
|
||||
* 可创建智能体数量,-1 表示不限制
|
||||
*/
|
||||
private Integer maxAgentCount;
|
||||
|
||||
/**
|
||||
* 可创建网页应用数量,-1 表示不限制
|
||||
*/
|
||||
private Integer maxPageAppCount;
|
||||
|
||||
/**
|
||||
* 可创建知识库数量,-1 表示不限制
|
||||
*/
|
||||
private Integer maxKnowledgeCount;
|
||||
|
||||
/**
|
||||
* 知识库存储空间上限(GB,保留三位小数),-1 表示不限制
|
||||
*/
|
||||
private BigDecimal knowledgeStorageLimitGb;
|
||||
|
||||
/**
|
||||
* 可创建数据表数量,-1 表示不限制
|
||||
*/
|
||||
private Integer maxDataTableCount;
|
||||
|
||||
/**
|
||||
* 可创建定时任务数量,-1 表示不限制
|
||||
*/
|
||||
private Integer maxScheduledTaskCount;
|
||||
|
||||
// /**
|
||||
// * 是否允许API外部调用,1-允许,0-不允许,null 表示不允许
|
||||
// */
|
||||
// private Integer allowApiExternalCall;
|
||||
|
||||
/**
|
||||
* 智能体电脑CPU核心数
|
||||
*/
|
||||
private Integer agentComputerCpuCores;
|
||||
|
||||
/**
|
||||
* 智能体电脑内存(GB)
|
||||
*/
|
||||
private Integer agentComputerMemoryGb;
|
||||
|
||||
/**
|
||||
* 智能体电脑交换分区(GB)
|
||||
*/
|
||||
private Integer agentComputerSwapGb;
|
||||
|
||||
/**
|
||||
* 通用智能体执行结果文件存储天数(仅云端电脑受限),-1 表示不限制
|
||||
*/
|
||||
private Integer agentFileStorageDays;
|
||||
|
||||
/**
|
||||
* 通用智能体每天对话次数(含编排调试,问答智能体不限),-1 表示不限制
|
||||
*/
|
||||
private Integer agentDailyPromptLimit;
|
||||
|
||||
/**
|
||||
* 网页应用每天对话次数,-1 表示不限制
|
||||
*/
|
||||
private Integer pageDailyPromptLimit;
|
||||
|
||||
// ========== 审计字段 ==========
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.SourceEnum;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户组
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_group", autoResultMap = true)
|
||||
public class SysGroup {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 最大用户数
|
||||
*/
|
||||
private Integer maxUserCount;
|
||||
|
||||
/**
|
||||
* 来源:1-系统内置,2-用户自定义
|
||||
* @see SourceEnum
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 状态:1-启用,0-禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortIndex;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.BindTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户组和菜单关联
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_group_menu", autoResultMap = true)
|
||||
public class SysGroupMenu {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户组ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 子菜单绑定类型 0:未绑定 1:全部绑定 2:部分绑定
|
||||
* @see BindTypeEnum
|
||||
*/
|
||||
private Integer menuBindType;
|
||||
|
||||
/**
|
||||
* 资源树JSON(包含每个节点的绑定类型)
|
||||
*/
|
||||
@TableField(value = "resource_tree_json")
|
||||
private String resourceTreeJson;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.OpenTypeEnum;
|
||||
import com.xspaceagi.system.spec.enums.SourceEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_menu", autoResultMap = true)
|
||||
public class SysMenu {
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 资源码,唯一标识
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 来源
|
||||
* @see SourceEnum
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 访问路径/路由地址
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 打开方式
|
||||
* @see OpenTypeEnum
|
||||
*/
|
||||
private Integer openType;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortIndex;
|
||||
|
||||
/**
|
||||
* 状态 1:启用 0:禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.BindTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 菜单资源关联
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_menu_resource", autoResultMap = true)
|
||||
public class SysMenuResource {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 资源ID
|
||||
*/
|
||||
private Long resourceId;
|
||||
|
||||
/**
|
||||
* 资源绑定类型 0:未绑定 1:全部绑定 2:部分绑定
|
||||
* @see BindTypeEnum
|
||||
*/
|
||||
private Integer resourceBindType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 操作日志(SysOperatorLog)实体类
|
||||
*
|
||||
* @author p1
|
||||
* @since 2024-11-01 11:16:02
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_operator_log")
|
||||
public class SysOperatorLog {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 1:操作类型;2:访问日志
|
||||
*/
|
||||
private Long operateType;
|
||||
/**
|
||||
* 系统编码
|
||||
*/
|
||||
private String systemCode;
|
||||
/**
|
||||
* 系统名称
|
||||
*/
|
||||
private String systemName;
|
||||
/**
|
||||
* 操作对象,比如:用户表,角色表,菜单表
|
||||
*/
|
||||
private String objectOp;
|
||||
/**
|
||||
* 操作动作,比如:新增,删除,修改,查看
|
||||
*/
|
||||
private String action;
|
||||
/**
|
||||
* 操作内容,比如评估页面
|
||||
*/
|
||||
private String operateContent;
|
||||
/**
|
||||
* 额外的操作内容信息记录,比如:更新提交的数据内容
|
||||
*/
|
||||
private String extraContent;
|
||||
/**
|
||||
* 操作人所属机构id
|
||||
*/
|
||||
private Long orgId;
|
||||
/**
|
||||
* 操作人所属机构名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creatorId;
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
private String creator;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime created;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime modified;
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Long yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.ResourceTypeEnum;
|
||||
import com.xspaceagi.system.spec.enums.SourceEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 资源
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_resource", autoResultMap = true)
|
||||
public class SysResource {
|
||||
|
||||
/**
|
||||
* 资源ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 来源
|
||||
* @see SourceEnum
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* @see ResourceTypeEnum
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 访问路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortIndex;
|
||||
|
||||
/**
|
||||
* 状态 1:启用 0:禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.SourceEnum;
|
||||
import com.xspaceagi.system.spec.enums.StatusEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_role", autoResultMap = true)
|
||||
public class SysRole {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 来源
|
||||
* @see SourceEnum
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* @see StatusEnum
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortIndex;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.BindTypeEnum;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 角色和菜单关联
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_role_menu", autoResultMap = true)
|
||||
public class SysRoleMenu {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 子菜单绑定类型 0:未绑定 1:全部绑定 2:部分绑定
|
||||
* @see BindTypeEnum
|
||||
*/
|
||||
private Integer menuBindType;
|
||||
|
||||
/**
|
||||
* 资源树JSON(包含每个节点的绑定类型)
|
||||
*/
|
||||
@TableField(value = "resource_tree_json")
|
||||
private String resourceTreeJson;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.PermissionSubjectTypeEnum;
|
||||
import com.xspaceagi.system.spec.enums.PermissionTargetTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 主体访问权限
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_subject_permission", autoResultMap = true)
|
||||
public class SysSubjectPermission {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主体类型
|
||||
* @see PermissionSubjectTypeEnum
|
||||
*/
|
||||
private Integer subjectType;
|
||||
|
||||
/**
|
||||
* 主体ID
|
||||
*/
|
||||
private Long subjectId;
|
||||
|
||||
/**
|
||||
* 主体Key
|
||||
*/
|
||||
private String subjectKey;
|
||||
|
||||
/**
|
||||
* 目标类型
|
||||
* @see PermissionTargetTypeEnum
|
||||
*/
|
||||
private Integer targetType;
|
||||
|
||||
/**
|
||||
* 目标ID列表
|
||||
*/
|
||||
private Long targetId;
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户和组关联
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_user_group", autoResultMap = true)
|
||||
public class SysUserGroup {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 组ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户和角色关联
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "sys_user_role", autoResultMap = true)
|
||||
public class SysUserRole {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long creatorId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改人ID
|
||||
*/
|
||||
private Long modifierId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String modifier;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 是否有效;1:有效,-1:无效
|
||||
*/
|
||||
private Integer yn;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.xspaceagi.system.spec.enums.TenantStatus;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Tenant {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private TenantStatus status;
|
||||
|
||||
private String domain;
|
||||
|
||||
private String version;
|
||||
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TableName(value = "tenant_config", autoResultMap = true)
|
||||
public class TenantConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
private String name;
|
||||
|
||||
private Object value;
|
||||
|
||||
private String description;
|
||||
|
||||
private ConfigCategory category;
|
||||
|
||||
private InputType inputType;
|
||||
|
||||
private DataType dataType;
|
||||
|
||||
private String notice;
|
||||
|
||||
private String placeholder;
|
||||
|
||||
private Integer minHeight;
|
||||
|
||||
private boolean required;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
public enum ConfigCategory {
|
||||
BaseConfig, ModelSetting, AgentSetting, DomainBind, TemplateConfig, Payment, Subscription, Credit
|
||||
}
|
||||
|
||||
public enum DataType {
|
||||
String, Number, Array
|
||||
}
|
||||
|
||||
public enum InputType {
|
||||
Input, MultiInput, Select, MultiSelect, Textarea, File
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用量统计表
|
||||
* 支持按用户、租户、资源类型、时间等维度统计用量
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "usage_statistics", autoResultMap = true)
|
||||
public class UsageStatistics {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 资源类型:Agent、PageApp、Component、Mcp等
|
||||
*/
|
||||
@TableField(value = "resource_type")
|
||||
private String resourceType;
|
||||
|
||||
/**
|
||||
* 资源ID:具体的资源ID(如agent_id、page_app_id等)
|
||||
*/
|
||||
@TableField(value = "resource_id")
|
||||
private String resourceId;
|
||||
|
||||
/**
|
||||
* 用量类型
|
||||
* @see UsageType
|
||||
*/
|
||||
@TableField(value = "usage_type")
|
||||
private String usageType;
|
||||
|
||||
/**
|
||||
* 用量值
|
||||
*/
|
||||
@TableField(value = "usage_value")
|
||||
private Long usageValue;
|
||||
|
||||
/**
|
||||
* 统计日期(精确到天)
|
||||
*/
|
||||
@TableField(value = "usage_date")
|
||||
private Date usageDate;
|
||||
|
||||
/**
|
||||
* 统计年月(格式:YYYYMM,用于快速按月查询)
|
||||
*/
|
||||
@TableField(value = "usage_month")
|
||||
private String usageMonth;
|
||||
|
||||
/**
|
||||
* 统计年份(用于快速按年查询)
|
||||
*/
|
||||
@TableField(value = "usage_year")
|
||||
private Integer usageYear;
|
||||
|
||||
/**
|
||||
* 扩展信息(JSON格式,存储额外的维度信息)
|
||||
*/
|
||||
@TableField(value = "extra_info")
|
||||
private String extraInfo;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
* 用量类型枚举
|
||||
*/
|
||||
public enum UsageType {
|
||||
|
||||
// === 调用次数类 ===
|
||||
API_CALL_COUNT("apiCallCount", "API调用次数"),
|
||||
AGENT_CALL_COUNT("agentCallCount", "智能体调用次数"),
|
||||
PAGE_APP_CALL_COUNT("pageAppCallCount", "网页应用调用次数"),
|
||||
MCP_CALL_COUNT("mcpCallCount", "MCP调用次数"),
|
||||
|
||||
// === Token消耗类 ===
|
||||
TOKEN_INPUT("tokenInput", "输入Token数"),
|
||||
TOKEN_OUTPUT("tokenOutput", "输出Token数"),
|
||||
TOKEN_TOTAL("tokenTotal", "总Token数"),
|
||||
|
||||
// === 时长类 ===
|
||||
CALL_DURATION("callDuration", "调用时长(秒)"),
|
||||
TOTAL_DURATION("totalDuration", "总时长(秒)"),
|
||||
|
||||
// === 用户行为类 ===
|
||||
USER_COUNT("userCount", "用户数"),
|
||||
VISIT_COUNT("visitCount", "访问次数"),
|
||||
LIKE_COUNT("likeCount", "点赞次数"),
|
||||
DISLIKE_COUNT("dislikeCount", "踩次数"),
|
||||
COLLECT_COUNT("collectCount", "收藏次数"),
|
||||
SHARE_COUNT("shareCount", "分享次数"),
|
||||
|
||||
// === 消息类 ===
|
||||
MESSAGE_COUNT("messageCount", "消息数"),
|
||||
MESSAGE_USER("messageUser", "用户消息数"),
|
||||
MESSAGE_ASSISTANT("messageAssistant", "助手消息数"),
|
||||
|
||||
// === 存储类 ===
|
||||
STORAGE_SIZE("storageSize", "存储大小(字节)"),
|
||||
FILE_COUNT("fileCount", "文件数量"),
|
||||
|
||||
// === 错误类 ===
|
||||
ERROR_COUNT("errorCount", "错误次数"),
|
||||
FAIL_COUNT("failCount", "失败次数");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
UsageType(String code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static UsageType fromCode(String code) {
|
||||
for (UsageType type : values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源类型枚举
|
||||
*/
|
||||
public enum ResourceType {
|
||||
|
||||
AGENT("Agent", "智能体"),
|
||||
PAGE_APP("PageApp", "网页应用"),
|
||||
COMPONENT("Component", "组件"),
|
||||
MCP("Mcp", "MCP服务"),
|
||||
WORKFLOW("Workflow", "工作流"),
|
||||
KNOWLEDGE_BASE("KnowledgeBase", "知识库"),
|
||||
DATASET("Dataset", "数据集");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
ResourceType(String code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static ResourceType fromCode(String code) {
|
||||
for (ResourceType type : values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("user")
|
||||
public class User {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String uid;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private String userName;
|
||||
private String nickName;
|
||||
private String avatar;
|
||||
private Status status;
|
||||
private Role role;
|
||||
private String password;
|
||||
private Integer resetPass;
|
||||
private String email;
|
||||
private String phone;
|
||||
private Date lastLoginTime;
|
||||
private String lang;
|
||||
private Date created;
|
||||
private Date modified;
|
||||
|
||||
// Enum for role column
|
||||
public enum Role {
|
||||
Admin, User
|
||||
}
|
||||
|
||||
public enum Status {
|
||||
Enabled, Disabled, Deleted
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.sdk.service.dto.UserAccessKeyDto;
|
||||
import com.xspaceagi.system.spec.common.JsonTypeHandler;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName(value = "user_access_key", autoResultMap = true)
|
||||
public class UserAccessKey {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
@TableField(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
private String name;
|
||||
|
||||
private UserAccessKeyDto.AKTargetType targetType;
|
||||
|
||||
private String targetId;
|
||||
|
||||
private String accessKey;
|
||||
|
||||
@TableField(value = "config", typeHandler = JsonTypeHandler.class)
|
||||
private UserAccessKeyDto.UserAccessKeyConfig config;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Date expire;
|
||||
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.spec.enums.PeriodTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("user_metric")
|
||||
public class UserMetric {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
@TableField(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@TableField(value = "biz_type")
|
||||
private String bizType;
|
||||
|
||||
@TableField(value = "period_type")
|
||||
private String periodType;
|
||||
|
||||
@TableField(value = "period")
|
||||
private String period;
|
||||
|
||||
@TableField(value = "value")
|
||||
private BigDecimal value;
|
||||
|
||||
private Date modified;
|
||||
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserReq {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long userId;
|
||||
private String dt;
|
||||
private Long reqCount;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Deprecated
|
||||
public class UserRequest {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long userId;
|
||||
private String uri;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.xspaceagi.system.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xspaceagi.system.sdk.service.dto.UserShareDto;
|
||||
import com.xspaceagi.system.spec.common.JsonTypeHandler;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName(value = "user_share", autoResultMap = true)
|
||||
public class UserShare {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String shareKey;
|
||||
@TableField(value = "_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long userId;
|
||||
private UserShareDto.UserShareType type;
|
||||
private String targetId;
|
||||
|
||||
@TableField(value = "content", typeHandler = JsonTypeHandler.class)
|
||||
private Object content;
|
||||
//有效期
|
||||
private Date expire;
|
||||
private Date modified;
|
||||
private Date created;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.Category;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 分类Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface CategoryMapper extends BaseMapper<Category> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.I18nLang;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 语言表 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface I18nLangMapper extends BaseMapper<I18nLang> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.I18nConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface I18nMapper extends BaseMapper<I18nConfig> {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.NotifyMessage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface NotifyMessageMapper extends BaseMapper<NotifyMessage> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.NotifyMessageUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface NotifyMessageUserMapper extends BaseMapper<NotifyMessageUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.RetryData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RetryDataMapper extends BaseMapper<RetryData> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.ScheduleTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ScheduleTaskMapper extends BaseMapper<ScheduleTask> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.Space;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SpaceMapper extends BaseMapper<Space> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SpaceUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SpaceUserMapper extends BaseMapper<SpaceUser> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysDataPermission;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 数据权限Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDataPermissionMapper extends BaseMapper<SysDataPermission> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户组Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysGroupMapper extends BaseMapper<SysGroup> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysGroupMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户组与菜单关联Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysGroupMenuMapper extends BaseMapper<SysGroupMenu> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 菜单Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysMenuResource;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 菜单资源关联Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysMenuResourceMapper extends BaseMapper<SysMenuResource> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysOperatorLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 操作日志(SysOperatorLog)数据库访问层
|
||||
*
|
||||
* @author p1
|
||||
* @since 2024-11-01 11:16:02
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysOperatorLogMapper extends BaseMapper<SysOperatorLog> {
|
||||
|
||||
|
||||
/**
|
||||
* 总条数查询
|
||||
*
|
||||
* @param queryMap 筛选条件
|
||||
* @return 总条数
|
||||
*/
|
||||
Long queryTotal(@Param("queryMap") Map<String, Object> queryMap);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param queryMap 筛选条件
|
||||
* @param orderColumns 排序
|
||||
* @param startIndex 索引开始位置
|
||||
* @param pageSize 业务大小
|
||||
* @return 列表
|
||||
*/
|
||||
List<SysOperatorLog> queryList(@Param("queryMap") Map<String, Object> queryMap,
|
||||
@Param("orderColumns") List<OrderItem> orderColumns,
|
||||
@Param("startIndex") Long startIndex, @Param("pageSize") Long pageSize);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysResource;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统资源Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysResourceMapper extends BaseMapper<SysResource> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysRole;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统角色Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysRoleMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 角色菜单关联Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysSubjectPermission;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SysSubjectPermissionMapper extends BaseMapper<SysSubjectPermission> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysUserGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户与用户组关联Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserGroupMapper extends BaseMapper<SysUserGroup> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysUserRole;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户角色关联Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.TenantConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TenantConfigMapper extends BaseMapper<TenantConfig> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.Tenant;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TenantMapper extends BaseMapper<Tenant> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserAccessKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UserAccessKeyMapper extends BaseMapper<UserAccessKey> {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface UserMapper extends BaseMapper<User> {
|
||||
|
||||
@Select("SELECT COUNT(*) FROM user")
|
||||
Long countTotalUsers();
|
||||
|
||||
@Select("SELECT COUNT(*) FROM user WHERE created >= CURDATE() AND created < CURDATE() + INTERVAL 1 DAY")
|
||||
Long countTodayNewUsers();
|
||||
|
||||
@Select("SELECT DATE(created) as date, COUNT(*) as user_count " +
|
||||
"FROM user " +
|
||||
"WHERE created >= CURDATE() - INTERVAL 7 DAY " +
|
||||
"GROUP BY DATE(created) " +
|
||||
"ORDER BY date")
|
||||
List<Map<String, Object>> getLast7DaysNewUserTrend();
|
||||
|
||||
@Select("SELECT DATE(created) as date, COUNT(*) as user_count " +
|
||||
"FROM user " +
|
||||
"WHERE created >= CURDATE() - INTERVAL 30 DAY " +
|
||||
"GROUP BY DATE(created) " +
|
||||
"ORDER BY date")
|
||||
List<Map<String, Object>> getLast30DaysNewUserTrend();
|
||||
|
||||
@Select("SELECT DATE_FORMAT(created, '%Y-%m') as month, COUNT(*) as user_count " +
|
||||
"FROM user " +
|
||||
"WHERE created >= DATE_SUB(CURDATE(), INTERVAL 12 MONTH) " +
|
||||
"GROUP BY DATE_FORMAT(created, '%Y-%m') " +
|
||||
"ORDER BY month")
|
||||
List<Map<String, Object>> getMonthlyNewUserTrend();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserMetric;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UserMetricMapper extends BaseMapper<UserMetric> {
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface UserReqMapper extends BaseMapper<UserReq> {
|
||||
|
||||
@Select("${sql}")
|
||||
List<Map<String, Object>> select(@Param("sql") String sql);
|
||||
|
||||
@Select("SELECT COUNT(DISTINCT user_id) FROM user_req " +
|
||||
"WHERE `dt` = DATE_FORMAT(NOW(), '%Y%m%d')")
|
||||
Long countTodayUsers();
|
||||
|
||||
@Select("SELECT COUNT(DISTINCT user_id) FROM user_req " +
|
||||
"WHERE `dt` >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), '%Y%m%d')")
|
||||
Long countLast7DaysUsers();
|
||||
|
||||
@Select("SELECT COUNT(DISTINCT user_id) FROM user_req " +
|
||||
"WHERE `dt` >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 30 DAY), '%Y%m%d')")
|
||||
Long countLast30DaysUsers();
|
||||
|
||||
@Select("SELECT dt as date, COUNT(DISTINCT user_id) as user_count " +
|
||||
"FROM user_req " +
|
||||
"WHERE `dt` >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), '%Y%m%d')" +
|
||||
"GROUP BY dt " +
|
||||
"ORDER BY dt")
|
||||
List<Map<String, Object>> getLast7DaysTrend();
|
||||
|
||||
/**
|
||||
* 插入或更新用户每日请求统计
|
||||
* 不存在则插入,存在则请求次数+1
|
||||
*
|
||||
* @param tenantId 商户ID
|
||||
* @param userId 用户ID
|
||||
* @param dt 日期 YYYYMMDD
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertOrUpdate(@Param("tenantId") Long tenantId,
|
||||
@Param("userId") Long userId,
|
||||
@Param("dt") String dt);
|
||||
|
||||
/**
|
||||
* 插入或更新用户每日请求统计(使用当前日期)
|
||||
* 不存在则插入,存在则请求次数+1
|
||||
*
|
||||
* @param tenantId 商户ID
|
||||
* @param userId 用户ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertOrUpdateToday(@Param("tenantId") Long tenantId,
|
||||
@Param("userId") Long userId);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.system.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserShare;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UserShareMapper extends BaseMapper<UserShare> {
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.xspaceagi.system.infra.dao.model;
|
||||
|
||||
import com.xspaceagi.system.spec.common.OperatorLogContext;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 操作日志(SysOperatorLog)实体类
|
||||
*
|
||||
* @author p1
|
||||
* @since 2024-11-01 11:16:02
|
||||
*/
|
||||
@Schema(description = "操作日志")
|
||||
@Getter
|
||||
@Setter
|
||||
public class OperatorLogModel {
|
||||
|
||||
@Schema(description = "自增主键")
|
||||
private Long id;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "1:操作类型;2:访问日志")
|
||||
private Long operateType;
|
||||
|
||||
@Schema(description = "系统编码")
|
||||
private String systemCode;
|
||||
|
||||
@Schema(description = "系统名称")
|
||||
private String systemName;
|
||||
|
||||
@Schema(description = "操作对象,比如:用户表,角色表,菜单表")
|
||||
private String objectOp;
|
||||
|
||||
@Schema(description = "操作动作,比如:新增,删除,修改,查看")
|
||||
private String action;
|
||||
|
||||
@Schema(description = "操作内容,比如评估页面")
|
||||
private String operateContent;
|
||||
|
||||
@Schema(description = "额外的操作内容信息记录,比如:更新提交的数据内容")
|
||||
private String extraContent;
|
||||
|
||||
@Schema(description = "操作人所属机构id")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "操作人所属机构名称")
|
||||
private String orgName;
|
||||
|
||||
@Schema(description = "创建人id")
|
||||
private Long creatorId;
|
||||
|
||||
@Schema(description = "创建人名称")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime created;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime modified;
|
||||
|
||||
|
||||
public static OperatorLogModel convertToModel(OperatorLogContext operatorLogContext) {
|
||||
OperatorLogModel operatorLogModel = new OperatorLogModel();
|
||||
operatorLogModel.setId(null);
|
||||
operatorLogModel.setTenantId(operatorLogContext.getTenantId());
|
||||
operatorLogModel.setOperateType(operatorLogContext.getOperateType());
|
||||
operatorLogModel.setSystemCode(operatorLogContext.getSystemCode());
|
||||
operatorLogModel.setSystemName(operatorLogContext.getSystemName());
|
||||
operatorLogModel.setObjectOp(operatorLogContext.getObject());
|
||||
operatorLogModel.setAction(operatorLogContext.getAction());
|
||||
operatorLogModel.setOperateContent(operatorLogContext.getOperateContent());
|
||||
operatorLogModel.setExtraContent(operatorLogContext.getExtraContent());
|
||||
operatorLogModel.setOrgId(operatorLogContext.getOrgId());
|
||||
operatorLogModel.setOrgName(operatorLogContext.getOrgName());
|
||||
operatorLogModel.setCreatorId(operatorLogContext.getUserId());
|
||||
operatorLogModel.setCreator(operatorLogContext.getCreator());
|
||||
operatorLogModel.setCreated(LocalDateTime.now());
|
||||
operatorLogModel.setModified(LocalDateTime.now());
|
||||
return operatorLogModel;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.Category;
|
||||
|
||||
/**
|
||||
* 分类服务
|
||||
*/
|
||||
public interface CategoryService extends IService<Category> {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.I18nLang;
|
||||
|
||||
/**
|
||||
* 语言表服务
|
||||
*/
|
||||
public interface I18nLangService extends IService<I18nLang> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.I18nConfig;
|
||||
|
||||
public interface I18nService extends IService<I18nConfig> {
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysOperatorLog;
|
||||
|
||||
/**
|
||||
* 操作日志(SysOperatorLog)服务接口
|
||||
*
|
||||
* @author p1
|
||||
* @since 2024-11-01 11:16:02
|
||||
*/
|
||||
public interface ISysOperatorLogService extends IService<SysOperatorLog> {
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param id id
|
||||
* @return 用户信息
|
||||
*/
|
||||
SysOperatorLog queryOneById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
Long addInfo(SysOperatorLog sysOperatorLog);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.NotifyMessage;
|
||||
|
||||
public interface NotifyMessageService extends IService<NotifyMessage> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.NotifyMessageUser;
|
||||
|
||||
public interface NotifyMessageUserService extends IService<NotifyMessageUser> {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.xspaceagi.system.infra.dao.entity.OpenApiDefinition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OpenApiDefinitionService {
|
||||
|
||||
List<OpenApiDefinition> queryAll();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.RetryData;
|
||||
|
||||
public interface RetryDataService extends IService<RetryData> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.ScheduleTask;
|
||||
|
||||
public interface ScheduleTaskService extends IService<ScheduleTask> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.Space;
|
||||
|
||||
|
||||
public interface SpaceService extends IService<Space> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SpaceUser;
|
||||
|
||||
|
||||
public interface SpaceUserService extends IService<SpaceUser> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysDataPermission;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysRole;
|
||||
|
||||
/**
|
||||
* 数据权限角色Service
|
||||
*/
|
||||
public interface SysDataPermissionService extends IService<SysDataPermission> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysGroupMenu;
|
||||
|
||||
/**
|
||||
* 用户组与菜单关联Service
|
||||
*/
|
||||
public interface SysGroupMenuService extends IService<SysGroupMenu> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysGroup;
|
||||
|
||||
/**
|
||||
* 用户组Service
|
||||
*/
|
||||
public interface SysGroupService extends IService<SysGroup> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysMenuResource;
|
||||
|
||||
/**
|
||||
* 菜单资源关联Service
|
||||
*/
|
||||
public interface SysMenuResourceService extends IService<SysMenuResource> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysMenu;
|
||||
|
||||
/**
|
||||
* 菜单Service
|
||||
*/
|
||||
public interface SysMenuService extends IService<SysMenu> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysResource;
|
||||
|
||||
/**
|
||||
* 系统资源Service
|
||||
*/
|
||||
public interface SysResourceService extends IService<SysResource> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysRoleMenu;
|
||||
|
||||
/**
|
||||
* 角色菜单关联Service
|
||||
*/
|
||||
public interface SysRoleMenuService extends IService<SysRoleMenu> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysRole;
|
||||
|
||||
/**
|
||||
* 系统角色Service
|
||||
*/
|
||||
public interface SysRoleService extends IService<SysRole> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysSubjectPermission;
|
||||
|
||||
public interface SysSubjectPermissionService extends IService<SysSubjectPermission> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysUserGroup;
|
||||
|
||||
/**
|
||||
* 用户与用户组关联Service
|
||||
*/
|
||||
public interface SysUserGroupService extends IService<SysUserGroup> {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.SysUserRole;
|
||||
|
||||
/**
|
||||
* 用户角色关联Service
|
||||
*/
|
||||
public interface SysUserRoleService extends IService<SysUserRole> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.TenantConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TenantConfigService extends IService<TenantConfig> {
|
||||
|
||||
List<TenantConfig> getTenantConfigList();
|
||||
|
||||
Map<String, String> getAllTenantDomainConfigMap();
|
||||
|
||||
void updateConfig(Map<String, Object> config);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.Tenant;
|
||||
|
||||
public interface TenantService extends IService<Tenant> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserAccessKey;
|
||||
|
||||
|
||||
public interface UserAccessKeyService extends IService<UserAccessKey> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserMetric;
|
||||
|
||||
public interface UserMetricService extends IService<UserMetric> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface UserRequestService extends IService<UserReq> {
|
||||
void addUserRequest(List<UserReq> userRequestList);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.User;
|
||||
|
||||
|
||||
public interface UserService extends IService<User> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xspaceagi.system.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.system.infra.dao.entity.UserShare;
|
||||
|
||||
|
||||
public interface UserShareService extends IService<UserShare> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.Category;
|
||||
import com.xspaceagi.system.infra.dao.mapper.CategoryMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.CategoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 分类服务实现
|
||||
*/
|
||||
@Service
|
||||
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.I18nLang;
|
||||
import com.xspaceagi.system.infra.dao.mapper.I18nLangMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.I18nLangService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 语言表服务实现
|
||||
*/
|
||||
@Service
|
||||
public class I18nLangServiceImpl extends ServiceImpl<I18nLangMapper, I18nLang> implements I18nLangService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.I18nConfig;
|
||||
import com.xspaceagi.system.infra.dao.mapper.I18nMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.I18nService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18nConfig> implements I18nService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.NotifyMessage;
|
||||
import com.xspaceagi.system.infra.dao.mapper.NotifyMessageMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.NotifyMessageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class NotifyMessageServiceImpl extends ServiceImpl<NotifyMessageMapper, NotifyMessage> implements NotifyMessageService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.NotifyMessageUser;
|
||||
import com.xspaceagi.system.infra.dao.mapper.NotifyMessageUserMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.NotifyMessageUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class NotifyMessageUserServiceImpl extends ServiceImpl<NotifyMessageUserMapper, NotifyMessageUser> implements NotifyMessageUserService {
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xspaceagi.system.infra.dao.entity.OpenApiDefinition;
|
||||
import com.xspaceagi.system.infra.dao.service.OpenApiDefinitionService;
|
||||
import com.xspaceagi.system.spec.utils.I18nUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class OpenApiDefinitionServiceImpl implements OpenApiDefinitionService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OpenApiDefinitionServiceImpl.class);
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String JSON_PATH = "open-api-definition.json";
|
||||
|
||||
private static final List<OpenApiDefinition> openApiDefinitions;
|
||||
|
||||
static {
|
||||
try {
|
||||
// 从 classpath 读取 JSON 文件
|
||||
ClassPathResource resource = new ClassPathResource(JSON_PATH);
|
||||
InputStream inputStream = resource.getInputStream();
|
||||
|
||||
// 使用 Jackson 将 JSON 转换为 Java 对象
|
||||
openApiDefinitions = objectMapper.readValue(
|
||||
inputStream,
|
||||
new TypeReference<List<OpenApiDefinition>>() {
|
||||
}
|
||||
);
|
||||
|
||||
logger.info("成功加载 {} 个 OpenAPI 定义组", openApiDefinitions.size());
|
||||
|
||||
// 输出加载的 API 定义信息
|
||||
for (OpenApiDefinition definition : openApiDefinitions) {
|
||||
int apiCount = definition.getApiList() != null ? definition.getApiList().size() : 0;
|
||||
logger.info(" - [{}] {} (包含 {} 个 API)", definition.getKey(), definition.getName(), apiCount);
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.error("加载 OpenAPI 定义文件失败:{}", JSON_PATH, e);
|
||||
throw new RuntimeException("加载 OpenAPI 定义文件失败:" + JSON_PATH, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OpenApiDefinition> queryAll() {
|
||||
return openApiDefinitions.stream()
|
||||
.map(this::cloneDefinition)
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
private OpenApiDefinition cloneDefinition(OpenApiDefinition src) {
|
||||
OpenApiDefinition target = new OpenApiDefinition();
|
||||
// 简单字段
|
||||
target.setKey(src.getKey());
|
||||
target.setName(src.getName());
|
||||
target.setRole(src.getRole());
|
||||
target.setPath(src.getPath());
|
||||
// 深拷贝 apiList
|
||||
if (src.getApiList() != null) {
|
||||
target.setApiList(src.getApiList().stream()
|
||||
.map(this::cloneDefinition)
|
||||
.collect(Collectors.toCollection(ArrayList::new)));
|
||||
}
|
||||
I18nUtil.replaceSystemMessage(target);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.RetryData;
|
||||
import com.xspaceagi.system.infra.dao.mapper.RetryDataMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.RetryDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class RetryDataServiceImpl extends ServiceImpl<RetryDataMapper, RetryData> implements RetryDataService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.ScheduleTask;
|
||||
import com.xspaceagi.system.infra.dao.mapper.ScheduleTaskMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.ScheduleTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ScheduleTaskServiceImpl extends ServiceImpl<ScheduleTaskMapper, ScheduleTask> implements ScheduleTaskService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.Space;
|
||||
import com.xspaceagi.system.infra.dao.mapper.SpaceMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.SpaceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SpaceServiceImpl extends ServiceImpl<SpaceMapper, Space> implements SpaceService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.system.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.system.infra.dao.entity.SpaceUser;
|
||||
import com.xspaceagi.system.infra.dao.mapper.SpaceUserMapper;
|
||||
import com.xspaceagi.system.infra.dao.service.SpaceUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SpaceUserServiceImpl extends ServiceImpl<SpaceUserMapper, SpaceUser> implements SpaceUserService {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user