chore: initialize qiming workspace repository
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-im</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>app-platform-im-infra</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-file-sdk</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.xspaceagi.im.infra.dao.enitity;
|
||||
|
||||
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.im.infra.enums.ImChannelEnum;
|
||||
import com.xspaceagi.im.infra.enums.ImOutputModeEnum;
|
||||
import com.xspaceagi.im.infra.enums.ImTargetTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* IM 渠道机器人/应用配置实体
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("im_channel_config")
|
||||
public class ImChannelConfig {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 平台
|
||||
* @see ImChannelEnum
|
||||
*/
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 渠道目标类型
|
||||
* @see ImTargetTypeEnum
|
||||
*/
|
||||
private String targetType;
|
||||
|
||||
/**
|
||||
* 渠道目标唯一标识
|
||||
*/
|
||||
private String targetId;
|
||||
|
||||
/**
|
||||
* 关联系统用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 关联智能体ID
|
||||
*/
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 渠道专有配置(JSON 字符串)
|
||||
*/
|
||||
private String configData;
|
||||
|
||||
/**
|
||||
* 输出方式
|
||||
* @see ImOutputModeEnum
|
||||
*/
|
||||
private String outputMode;
|
||||
|
||||
/**
|
||||
* 配置名称备注
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField("_tenant_id")
|
||||
private Long tenantId;
|
||||
private Long spaceId;
|
||||
private Date created;
|
||||
private Long creatorId;
|
||||
private String creatorName;
|
||||
private Date modified;
|
||||
private Long modifiedId;
|
||||
private String modifiedName;
|
||||
private Integer yn;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.xspaceagi.im.infra.dao.enitity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.xspaceagi.im.infra.enums.ImChannelEnum;
|
||||
import com.xspaceagi.im.infra.enums.ImChatTypeEnum;
|
||||
import com.xspaceagi.im.infra.enums.ImTargetTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* IM会话实体
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ImSession {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 渠道类型
|
||||
* @see ImChannelEnum
|
||||
*/
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 渠道目标类型
|
||||
* @see ImTargetTypeEnum
|
||||
*/
|
||||
private String targetType;
|
||||
|
||||
/**
|
||||
* 会话类型
|
||||
* @see ImChatTypeEnum
|
||||
*/
|
||||
private String chatType;
|
||||
|
||||
/**
|
||||
* 会话标识:单聊为用户ID,群聊为群ID
|
||||
*/
|
||||
private String sessionKey;
|
||||
|
||||
/**
|
||||
* 会话展示名:单聊为用户名/昵称,群聊为群名
|
||||
*/
|
||||
private String sessionName;
|
||||
|
||||
/**
|
||||
* 系统用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 智能体ID
|
||||
*/
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 系统会话ID
|
||||
*/
|
||||
private Long conversationId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@TableField("_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.im.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.im.infra.dao.enitity.ImChannelConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ImChannelConfigMapper extends BaseMapper<ImChannelConfig> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.im.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.im.infra.dao.enitity.ImSession;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ImSessionMapper extends BaseMapper<ImSession> {
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xspaceagi.im.infra.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* IM 渠道类型
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ImChannelEnum {
|
||||
|
||||
FEISHU("feishu", "飞书"),
|
||||
DINGTALK("dingtalk", "钉钉"),
|
||||
WEWORK("wework", "企业微信"),
|
||||
/** 个人微信 iLink 机器人(非公众号/非企微回调) */
|
||||
WECHAT_ILINK("wechat_ilink", "微信");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
public static ImChannelEnum fromCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ImChannelEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.xspaceagi.im.infra.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* IM 会话类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ImChatTypeEnum {
|
||||
|
||||
PRIVATE("private", "私聊"),
|
||||
GROUP("group", "群聊");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
public static ImChatTypeEnum fromCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ImChatTypeEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.xspaceagi.im.infra.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* IM 输出方式枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ImOutputModeEnum {
|
||||
|
||||
STREAM("stream", "流式输出"),
|
||||
ONCE("once", "一次性输出");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
public static ImOutputModeEnum fromCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ImOutputModeEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isValid(String code) {
|
||||
return fromCode(code) != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.xspaceagi.im.infra.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* IM 目标类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ImTargetTypeEnum {
|
||||
|
||||
BOT("bot", "机器人"),
|
||||
APP("app", "应用");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
public static ImTargetTypeEnum fromCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ImTargetTypeEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user