创建评查点分组的API文件
This commit is contained in:
@@ -25,10 +25,14 @@ export interface PostgrestParams {
|
||||
function logPostgrestQuery(endpoint: string, params?: QueryParams): void {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// const baseUrl = 'http://172.16.0.119:9000/admin';
|
||||
const baseUrl = 'http://172.18.0.100:3000';
|
||||
// const baseUrl = 'http://172.18.0.100:3000';
|
||||
const baseUrl = 'http://nas.7bm.co:3000';
|
||||
|
||||
// 确保 endpoint 格式正确
|
||||
const normalizedEndpoint = endpoint.startsWith('/') ? endpoint.substring(1) : endpoint;
|
||||
|
||||
console.log('\n📦 PostgREST 查询日志 ========================');
|
||||
console.log(`📦 API 端点: ${baseUrl}/${endpoint}`);
|
||||
console.log(`📦 API 端点: ${baseUrl}/${normalizedEndpoint}`);
|
||||
|
||||
if (params && Object.keys(params).length > 0) {
|
||||
console.log('📦 查询参数:');
|
||||
@@ -67,7 +71,7 @@ function logPostgrestQuery(endpoint: string, params?: QueryParams): void {
|
||||
})
|
||||
.join('&');
|
||||
|
||||
console.log(`\n📦 可读URL: ${baseUrl}/${endpoint}${readableQueryString ? '?' + readableQueryString : ''}`);
|
||||
console.log(`\n📦 可读URL: ${baseUrl}/${normalizedEndpoint}${readableQueryString ? '?' + readableQueryString : ''}`);
|
||||
|
||||
// 格式化查询为 PostgreSQL 风格的查询
|
||||
let postgrestQuery = `SELECT `;
|
||||
@@ -78,7 +82,7 @@ function logPostgrestQuery(endpoint: string, params?: QueryParams): void {
|
||||
postgrestQuery += '*';
|
||||
}
|
||||
|
||||
postgrestQuery += ` FROM ${endpoint}`;
|
||||
postgrestQuery += ` FROM ${normalizedEndpoint}`;
|
||||
|
||||
const conditions: string[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user