zoilomora/ocean-smart-client

此库帮助与 OceanSmart 软件进行通信。

1.2.0 2024-07-11 13:56 UTC

This package is auto-updated.

Last update: 2024-09-11 14:21:14 UTC


README

此库帮助与 OceanSmart 软件进行通信。

测试于 Ocean Smart 1.4.0603.1

使用方法

为了方便多个用户使用,包含了一个用于启动会话的工厂。

以下是一个使用示例

<?php
require __DIR__ . '/../vendor/autoload.php';

$factory = new \ZoiloMora\OceanSmartClient\ClientFactory(
    new \GuzzleHttp\Client(
        [
            'base_uri' => BASE_URI,
            // ... specific user settings
        ]
    )
);

$client = $factory->build(USER, PASSWORD);

$markings = $client->markings(
    new DateTime('2019-06-01'), // from
    new DateTime('2019-07-01')  // to
);

注意

目前,API 响应的原始数组被返回,它们没有被转换为映射对象。