落地并存测服全端:智能体 Graph/路由、后台切 8180、主账与部署脚本齐备,便于线上重发与验收。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+67
@@ -0,0 +1,67 @@
|
||||
package org.jeecg.modules.inquiry.tms;
|
||||
|
||||
/**
|
||||
* TMS 出站客户端壳。
|
||||
* <p>
|
||||
* 职责:将来封装 token(client_credentials)、查询 Bearer、锁舱 HMAC。
|
||||
* 当前:所有方法标记未实现,避免半可用打到真实 TMS。
|
||||
* 禁止:在智能体侧复制本类去直连 TMS。
|
||||
*/
|
||||
public class TmsAdapterClient {
|
||||
|
||||
/**
|
||||
* 探测配置是否齐全(不访问外网)。
|
||||
*
|
||||
* @return true 表示环境变量/配置看起来可组装;不代表 TMS 可达
|
||||
*/
|
||||
public boolean isConfigured() {
|
||||
// 框架壳:正式从 Environment 读 TMS_V2_*;此处固定 false 防误用
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 健康检查壳:未实现。
|
||||
*
|
||||
* @return 永远失败,带 not_implemented
|
||||
*/
|
||||
public TmsShellResult health() {
|
||||
return TmsShellResult.notImplemented("health");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报价壳:未实现。
|
||||
*
|
||||
* @param requestBody 查询体(不解析)
|
||||
* @return not_implemented
|
||||
*/
|
||||
public TmsShellResult query(String requestBody) {
|
||||
return TmsShellResult.notImplemented("query");
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典同步壳:未实现。
|
||||
*
|
||||
* @return not_implemented
|
||||
*/
|
||||
public TmsShellResult syncDictionary() {
|
||||
return TmsShellResult.notImplemented("syncDictionary");
|
||||
}
|
||||
|
||||
/**
|
||||
* 锁舱壳:默认关闭;未实现。
|
||||
*
|
||||
* @return not_implemented
|
||||
*/
|
||||
public TmsShellResult lockCabin(String requestBody) {
|
||||
return TmsShellResult.notImplemented("lockCabin");
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放舱壳:默认关闭;未实现。
|
||||
*
|
||||
* @return not_implemented
|
||||
*/
|
||||
public TmsShellResult releaseCabin(String requestBody) {
|
||||
return TmsShellResult.notImplemented("releaseCabin");
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package org.jeecg.modules.inquiry.tms;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* TMS 适配 HTTP 壳。
|
||||
* <p>
|
||||
* 路径:/inquiry/tms/*;当前全部 501/未实现,供后台与联调探测包是否挂载。
|
||||
* 禁止:在本控制器同步等 Python Graph。
|
||||
*/
|
||||
@Api(tags = "询价-TMS适配壳")
|
||||
@RestController
|
||||
@RequestMapping("/inquiry/tms")
|
||||
public class TmsAdapterController {
|
||||
|
||||
private final TmsAdapterClient client = new TmsAdapterClient();
|
||||
|
||||
/**
|
||||
* 健康壳:返回未实现说明,不打真实 TMS。
|
||||
*
|
||||
* @return Result 包装
|
||||
*/
|
||||
@ApiOperation("TMS 健康壳(未实现)")
|
||||
@GetMapping("/health")
|
||||
public Result<?> health() {
|
||||
TmsShellResult r = client.health();
|
||||
return Result.error(r.getHttpStatus(), "TMS adapter shell: " + r.getError() + ":" + r.getOperation());
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置探测:是否已配齐(壳阶段恒 false)。
|
||||
*
|
||||
* @return configured=false
|
||||
*/
|
||||
@ApiOperation("TMS 配置探测壳")
|
||||
@GetMapping("/configured")
|
||||
public Result<?> configured() {
|
||||
return Result.OK(java.util.Collections.singletonMap("configured", client.isConfigured()));
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package org.jeecg.modules.inquiry.tms;
|
||||
|
||||
/**
|
||||
* TMS 适配空结果。
|
||||
* <p>
|
||||
* 不含业务码映射;正式实现再区分 1002/1003/技术失败。
|
||||
*/
|
||||
public final class TmsShellResult {
|
||||
|
||||
private final boolean ok;
|
||||
private final int httpStatus;
|
||||
private final String error;
|
||||
private final String operation;
|
||||
|
||||
private TmsShellResult(boolean ok, int httpStatus, String error, String operation) {
|
||||
this.ok = ok;
|
||||
this.httpStatus = httpStatus;
|
||||
this.error = error;
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造未实现结果(HTTP 501 语义)。
|
||||
*
|
||||
* @param operation 操作名
|
||||
* @return 结果对象
|
||||
*/
|
||||
public static TmsShellResult notImplemented(String operation) {
|
||||
return new TmsShellResult(false, 501, "not_implemented", operation);
|
||||
}
|
||||
|
||||
public boolean isOk() {
|
||||
return ok;
|
||||
}
|
||||
|
||||
public int getHttpStatus() {
|
||||
return httpStatus;
|
||||
}
|
||||
|
||||
public String getError() {
|
||||
return error;
|
||||
}
|
||||
|
||||
public String getOperation() {
|
||||
return operation;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* TMS 适配空包:智能体不直连 TMS,仅主账本包出站。
|
||||
* <p>
|
||||
* 本包当前只提供健康探测与未实现占位;token / query / 字典 sync / 锁舱
|
||||
* 正式实现前一律返回未启用,禁止半可用 LOCK/RELEASE。
|
||||
* <p>
|
||||
* 禁止:按企微 userid 伪造 TMS 结果;禁止模糊字典匹配。
|
||||
*/
|
||||
package org.jeecg.modules.inquiry.tms;
|
||||
+1
@@ -82,6 +82,7 @@ spring:
|
||||
database: ${YTD_REDIS_DB:1}
|
||||
host: ${YTD_REDIS_HOST:10.206.0.14}
|
||||
port: ${YTD_REDIS_PORT:6379}
|
||||
username: ${YTD_REDIS_USERNAME:}
|
||||
password: ${YTD_REDIS_PASSWORD:}
|
||||
|
||||
mybatis-plus:
|
||||
|
||||
Reference in New Issue
Block a user