We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dwsy/magic-api-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
---
title: "自定义单表API拦截器"
date: "2022-01-30T10:14:05.000Z"
permalink: "/pages/senior/table-interceptor/"
---
/**
* 拦截请求
*/
@Component
public class MyNamedTableInterceptor implements NamedTableInterceptor {
/*
* 执行单表操作之前
*/
@Override
public void preHandle(SqlMode sqlMode, NamedTable namedTable) {
if (sqlMode == SqlMode.INSERT) {
// 插入时注入create_by列
namedTable.column("create_by", UserUtils.getId());
}
}
}