定制 mmtech/mmt-risk-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mmtech/mmt-risk-sdk

最新稳定版本:1.1.1

Composer 安装命令:

composer require mmtech/mmt-risk-sdk

包简介

PHP SDK for MMT Risk Management Service API (Guzzle transport, typed commands and responses). Laravel 11–13 compatible.

README 文档

README

HTTP SDK for the MMT Risk Management Service REST API. Architecture mirrors mmt/laravel-trading-service-sdk: Guzzle transport, typed Commands, ActionResultInterface envelope parsing ({ "code", "message", "data" }), and optional WireHydration via getMappedData(FQCN::class).

  • HTTP: guzzlehttp/guzzle (direct Client, same transport style as the Trading SDK).
  • Laravel: auto-discovery for MmtRiskSdk\MmtRiskSdkServiceProvider, publishable config.
  • Entry point: MmtRiskSdk\RiskService (accounts(), brokers(), rules(), ingress(), health()).
  • Contract: OpenAPI snapshot at repo root — openapi.json.

Requirements

  • PHP 8.3+
  • guzzlehttp/guzzle ^7.2
  • illuminate/support ^11 | ^12 | ^13

Install

Package name: mmtech/mmt-risk-sdk.

composer require mmtech/mmt-risk-sdk:^1.1

Release notes: CHANGELOG.md.

Environment

Variable Description
RISK_SERVICE_URL Base URL of the Risk API (no trailing slash required; normalized internally).

Publish config (optional):

php artisan vendor:publish --tag=mmt-risk-sdk-config

Quick usage (Laravel)

use MmtRiskSdk\Domains\Accounts\Commands\CreateAccountCommand;
use MmtRiskSdk\Domains\Accounts\ObjectResponses\AccountResponseItem;
use MmtRiskSdk\RiskService;

$risk = app(RiskService::class);

$result = $risk->accounts()->listAccounts();

if ($result->isSuccess()) {
    /** @var AccountResponseItem[] $rows */
    $rows = $result->getMappedData(AccountResponseItem::class);
}

$health = $risk->health(); // plain array JSON from GET /health

$created = $risk->accounts()->createAccount(
    new CreateAccountCommand(login: '1001', broker_id: $brokerUuid),
);

if ($created->isSuccess()) {
    $account = $created->getMappedData(AccountResponseItem::class);
}

Use getData(FQCN::class) for flat list/object constructor spread (same as Trading SDK), and getMappedData(FQCN::class) when nested DTOs or #[WireMapped] shapes are needed.

OpenAPI

Regenerate the snapshot when the service contract changes:

curl -sS "http://<host>:<port>/openapi.json" -o openapi.json

License

Proprietary — see LICENSE and composer.json (license: proprietary).

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固