Merge pull request #165 from Code-Mr-Jiu/main

MCP相关功能----进程管理及mcp_info  CRUD
This commit is contained in:
ageerle
2025-10-12 19:06:27 +08:00
committed by GitHub
21 changed files with 2159 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
package org.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ruoyi.annotation.DataColumn;
import org.ruoyi.core.domain.BaseEntity;
import java.util.Date;
/**
* MCP对象 mcp_info
*
* @author ageerle
* @date Sat Aug 09 16:50:58 CST 2025
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("mcp_info")
public class McpInfo extends BaseEntity {
/**
* id
*/
@TableId(value = "mcp_id", type = IdType.AUTO)
private Integer mcpId;
/**
* 服务器名称
*/
private String serverName;
/**
* 链接方式
*/
private String transportType;
/**
* Command
*/
private String command;
/**
* Args
*/
private String arguments;
private String description;
/**
* Env
*/
private String env;
/**
* 是否启用
*/
private Boolean status;
}

View File

@@ -0,0 +1,59 @@
package org.ruoyi.domain.bo;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.ruoyi.domain.McpInfo;
import java.io.Serializable;
/**
* MCP业务对象 mcp_info
*
* @author ageerle
* @date Sat Aug 09 16:50:58 CST 2025
*/
@Data
@AutoMapper(target = McpInfo.class, reverseConvertGenerate = false)
public class McpInfoBo implements Serializable {
/**
* id
*/
@NotNull(message = "id不能为空" )
private Integer mcpId;
/**
* 服务器名称
*/
private String serverName;
/**
* 链接方式
*/
private String transportType;
/**
* Command
*/
private String command;
/**
* Args
*/
private String arguments;
private String description;
/**
* Env
*/
private String env;
/**
* 是否启用
*/
private Boolean status;
}

View File

@@ -0,0 +1,65 @@
package org.ruoyi.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
import org.ruoyi.common.excel.convert.ExcelDictConvert;
import org.ruoyi.domain.McpInfo;
import java.io.Serializable;
/**
* MCP视图对象 mcp_info
*
* @author jiyi
* @date Sat Aug 09 16:50:58 CST 2025
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = McpInfo.class)
public class McpInfoVo implements Serializable {
private Integer mcpId;
/**
* 服务器名称
*/
@ExcelProperty(value = "服务器名称")
private String serverName;
/**
* 链接方式
*/
@ExcelProperty(value = "链接方式", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mcp_transport_type")
private String transportType;
/**
* Command
*/
@ExcelProperty(value = "Command")
private String command;
/**
* Args
*/
@ExcelProperty(value = "Args")
private String arguments;
@ExcelProperty(value = "Description")
private String description;
/**
* Env
*/
@ExcelProperty(value = "Env")
private String env;
/**
* 是否启用
*/
@ExcelProperty(value = "是否启用")
private Boolean status;
}

View File

@@ -0,0 +1,33 @@
package org.ruoyi.mapper;
import org.apache.ibatis.annotations.*;
import org.ruoyi.core.mapper.BaseMapperPlus;
import org.ruoyi.domain.McpInfo;
import org.ruoyi.domain.vo.McpInfoVo;
import java.util.List;
/**
* MCPMapper接口
*
* @author jiuyi
* @date Sat Aug 09 16:50:58 CST 2025
*/
@Mapper
public interface McpInfoMapper extends BaseMapperPlus<McpInfo, McpInfoVo> {
@Select("SELECT * FROM mcp_info WHERE server_name = #{serverName}")
McpInfo selectByServerName(@Param("serverName") String serverName);
@Select("SELECT * FROM mcp_info WHERE status = 1")
List<McpInfo> selectActiveServers();
@Select("SELECT server_name FROM mcp_info WHERE status = 1")
List<String> selectActiveServerNames();
@Update("UPDATE mcp_info SET status = #{status} WHERE server_name = #{serverName}")
int updateActiveStatus(@Param("serverName") String serverName, @Param("status") Boolean status);
@Delete("DELETE FROM mcp_info WHERE server_name = #{serverName}")
int deleteByServerName(@Param("serverName") String serverName);
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.ruoyi.mapper.McpInfoMapper">
</mapper>