mtl-api-create
摩天轮开放接口二次封装技能。当用户需要对接摩天轮(MTL)开放平台接口、创建MTL HTTP接口、封装摩天轮API时触发。支持自动检测并添加mtl-open-sdk-consumer依赖、初始化ApiClient Bean、创建MtlRestController、根据原生接口定义生成HTTP接口代码。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/1688aiinfra/chuyao-aa摩天轮接口封装
将摩天轮开放原生接口封装为 HTTP 接口,基于 Spring Boot + mtl-open-sdk-consumer。
执行流程
步骤1:检测并添加 Maven 依赖
检测 pom.xml 是否已引入 mtl-open-sdk-consumer,若无则添加:
<dependency>
<groupId>com.alibaba.mtl</groupId>
<artifactId>mtl-open-sdk-consumer</artifactId>
<version>2.0</version>
</dependency>
步骤2:初始化 ApiClient Bean
检测项目中是否已存在 ApiClient Bean 配置,若无则在配置类中添加:
@Bean(name = "mtlClient")
public ApiClient mtlClient() throws URISyntaxException {
return new ApiClient(
"{clientIdentifier}", // 需在摩天轮申请
new URI("https://open.mtl4.alibaba-inc.com"),
EntryToken.builder()
.identifier("{clientIdentifier}")
.token("{token}") // 需在摩天轮申请
.build(),
new ClientConfiguration());
}
注意:clientIdentifier 和 token 需在摩天轮平台申请,URI 固定为 https://open.mtl4.alibaba-inc.com。
步骤3:创建 rest 包
检测项目中是否存在 rest package,若无则创建。
步骤4:创建 MtlRestController
检测 rest 包下是否存在 MtlRestController 类,若无则创建:
@RestController
@RequestMapping("/mtl")
public class MtlRestController {
@Autowired
private ApiClient mtlClient;
// 若项目存在 MtlLogProducer 日志类,还需注入:
// @Autowired
// private GetEnv getEnv;
}
步骤5:确认原生接口定义
必须向用户确认原生接口信息,完整定义示例:
接口路径(path):/dev/api/v1/alterSheet/detail
方法类型:GET/POST
描述:查询变更单明细
Parameters(query参数):{
"id": "integer类型,必传"
}
RequestBody(body参数):{
"targetReleaseId": "integer类型",
"testers": "string类型"
}
步骤6:生成 HTTP 接口
根据原生接口定义在 MtlRestController 中创建接口方法。
GET 请求示例(原生接口:/dev/api/v1/alterSheet/detail):
@GetMapping("/api/v1/alterSheet/detail")
public Map<String, Object> getAlterSheet(@RequestParam("id") String id) {
Map<String, Object> result = MapBuilder.of("success", true).build();
RequestMessage request = RequestMessage.builder()
.method(HttpMethod.GET)
.path("/dev/api/v1/alterSheet/detail")
.json(null)
.parameters(MapBuilder.ofAssignType("id", id).build())
.build();
try {
ResponseMessage responseMessage = mtlClient.sendRequest(request);
if (null == responseMessage) {
throw new RuntimeException("response is null");
}
result.put("data", LubanTypeUtil.toJSON(responseMessage.getJson()));
} catch (Exception e) {
result.put("success", false);
result.put("msg", e.getMessage());
}
return result;
}
POST 请求示例(带 RequestBody):
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-1688aiinfra-chuyao-aa": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
alphaclaw
AlphaClaw 是 SkillHub 技能商店的 CLI 工具,用于搜索、安装、发布和管理 Claude Code 技能。支持 AK/SK 登录、关键词搜索技能、一键安装/发布技能包、收藏和评论等完整功能。
1688-88syt
线下B2B交易的得力帮手,一句话搞定全流程操作!无论您是卖家还是买家,只需一句指令,即可轻松完成电子合约(采购单/合同)创建、签署、确认收货、退款等核心操作,全面支持账号状态查询、实名认证、绑卡及交易,让每一步交易流程更清晰、更可控。通过智能化交互,实现交易流程数字化,提升协作效率,保障资金流转安全,助力企业高效运营。专注每一次B2B交易,让生意更稳、更快、更省心!。用户提到 88 生意通、采购单、签署、退款、确认收货、大额、批量、实名、绑卡、主账号、卖家或买家问题时使用。
ozon-product-selection
Ozon电商选品工具:根据用户指定的品类,自动搜索市场趋势、提取热门细分关键词、 调用1688搜索API逐一选品,按筛选条件过滤后输出每个细分市场的最优商品推荐。 触发词:寻找Ozon蓝海商品、Ozon潜力爆品、Ozon可铺货商品、Ozon可卖的货盘、 Ozon选品、帮我选品、找Ozon能卖的商品、Ozon热门商品推荐。
newton-quotation-pdf-extraction
从PDF报价单中提取产品信息(型号、数量、价格、币种、图片)。当用户需要从PDF报价单或产品目录中提取结构化产品数据时使用,特别适用于电商产品列表或价格表。
1688-product-find
1688智能找商品能力。理解用户找商品、找同款等需求,通过文本、图片或链接搜索匹配商品。 触发词:找商品、找同款、搜商品、想要 XX、帮我找、图片找货、链接找货、以图搜图。