Giter Club home page Giter Club logo

jstan's Introduction

聚水潭 sdk(2.0)

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

介绍

时隔一年,没有怎么维护旧版本,并且有很多问题,代码如屎山,这次进行了重构,2.0 版本(虽然代码还是屎山)

聚水潭php-sdk

遇到问题先去查阅官方文档 聚水潭文档

要求

  • php >= 8.1(其他 php 版本理论支持,但是未经过测试,请自行修改 php 版本号)

安装

composer require zmoyi/jstan

laravel 使用移步至 laravel-jsTan

配置

如果下面的示例比较晦涩,请查看测试用例

config全局配置

private array $config = [
  // 授权地址
  'authUrl' => 'https://openweb.jushuitan.com/auth',
  // 接口地址
  'baseUrl' => 'https://dev-api.jushuitan.com/',
  // 授权接口地址
  'apiUrl' => 'https://openapi.jushuitan.com/',
  // 授权token
  'accessToken' => 'b7e3b1e24e174593af8ca5c397e53dad',
  // 应用key
  'appKey' => 'b0b7d1db226d4216a3d58df9ffa2dde5',
  // 应用secret
  'appSecret' => '99c4cef262f34ca882975a7064de0b87',
  // 版本号
  'version' => '2',
  // 时间戳
  'timestamp' => time(),
  // 字符集
  'charset' => 'utf-8',
  // 是否验证证书
  'verify' => false,
  // 超时时间
  'timeout' => 0
];

api调用

use JsTan\Client;
use JsTan\Route;

/****/

$client = Client::getInstance($this->config);
$route = Route::getInstance();


//路由可使用 Route::QUERY_SHOPS || $route->getRoute('QUERY_SHOPS') || 'open/logisticscompany/query'
// 常量传入,getRoute 传入,字符串传入,看自己喜好

/**
* 查询门店列表(请求示例)
*/
$response = $client->request($route->getRoute('QUERY_SHOPS'), [
  'page_index' => 1,
  'page_size' => 10
]);


/**
* 获取access_token (请求示例)
*/
$response = $client->getAccessToken('001');


/**
* 刷新access_token (请求示例)
*/
$response = $client->refreshToken('001');


print_r($response);

License

JsTan is made available under the MIT License (MIT). Please see License File for more information.

交流

点击链接加入群聊【聚水潭phpsdk使用交流Q】

jstan's People

Contributors

fangmuke avatar zmoyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jstan's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.