Commit 08e80224 by 王召彬

Merge branch 'ft-insurance'

parents cd118fd1 12c473c0
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties;
/**
*
* @Bean()
*/
class InsurancePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_INSURANCE_URI', 'insurance:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'insurance';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 400;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
*/
protected $uri = [
"192.168.3.100:8102",
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
*/
protected $provider = '';
}
<?php
namespace Hdll\Services\Insurance\Enum;
class InsuranceCmqEnum
{
const TOPIC = 'insurance';
const ACTIVITY_CREATE = 'activityCreate'; // 使用活动方案创建活动时通知
}
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Insurance\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of insurance service
*
* @method ResultInterface deferGetOrderInfo(int $storeId, int $orderId)
* @method ResultInterface deferGetOrderBySn(int $storeId, $orderSn)
* @method ResultInterface deferPaySuccess(int $storeId, $orderSn)
*/
interface InsuranceInterface
{
/**
* 获取指定订单数据
*
* @param integer $storeId
* @param integer $orderId
* @return array
*/
public function getOrderInfo(int $storeId, int $orderId);
/**
* 获取指定订单数据
*
* @param integer $storeId
* @param string $orderSn
* @return array
*/
public function getOrderBySn(int $storeId, $orderSn);
/**
* 支付成功回调
*
* @param integer $storeId
* @param string $orderSn
* @return void
*/
public function paySuccess(int $storeId, $orderSn);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment