Commit f803e56a by 王洁

Merge branch 'frontmoney'

parents c515a066 2f4bf048
<?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\Pool\PoolProperties;
use Swoft\Bean\Annotation\Value;
/**
* @Bean()
* the config of service frontmoney
*/
class FrontMoneyPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_FRONTMONEY_URI', 'frontmoney:8099'));
}
protected $name = 'frontmoney';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 400;
/**
* Maximum waiting time
*
* @var int
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
* @var int
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
* @var int
*/
protected $timeout = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
* @Value(name="", env="${RPC_FRONTMONEY_URI}")
* @var array
*/
protected $uri = [
'frontmoney:8099'
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
* @var string
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
* @var string
*/
protected $provider = '';
}
<?php
namespace Hdll\Services\FrontMoney\Enum;
class FrontCmqEnum
{
const TOPIC = 'frontMoney';
const UP_ORDER_STATUS = 'upOrderStatus'; //更新订单状态
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: lwt
* Date: 2018/7/10
* Time: 13:15
*/
namespace Hdll\Services\FrontMoney\Enum;
class FrontMoneyEnum
{
//订单状态
const STATUS_NORMAL = 10; //待支付
}
\ No newline at end of file
<?php
namespace Hdll\Services\FrontMoney\Enum;
class FrontOrderEnum
{
//订单状态
const STATUS_NORMAL = 1; //待支付 1未支付2已经支付3异常 //=未付款
const STATUS_HAVE_PAY =2; // 已经支付 //=已下单
const STATUS_PAY_EXCEPTION =3; // 支付异常或过期未付 //=关闭订单
const STATUS_PAY_REFUND =4 ; // 退款 //=已过期
const ORDER_DELETED = 5; //订单删除
//------------状态转换-----------------------
const NOT_PAY = 3;//未付款
const HAVE_PAID_ORDER = 4;//已下单
const CLOSED = 7;//关闭订单
const OVERDUE =8;//已过期
}
\ 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\FrontMoney\Lib;
use Hdll\Services\FrontMoney\Enum\FrontOrderEnum;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferBackNum(string $token, int $consigneeId, int $frontId, int $selectedNum, int $orderType, int $goodsId, string $reservationTime = '')
* @method ResultInterface deferGetFrontGoods(int $storeId, int $frontId)
* @method ResultInterface deferGetFrontInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $storeId,int $frontId, int $status, int $orderId)
* @method ResultInterface deferGetFrontCounts(int $storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/
interface FrontMoneyInterface
{
/**
*
* 补回 未支付 定金活动 库存
* @param string $token
* @param int $consignee_id
* @param int $front_id
* @param int $selected_num
* @param int $order_type
* @param int $goods_id
* @param string $reservation_time
* @return mixed
*/
public function backNum(string $token, int $consigneeId, int $frontId, int $selectedNum, int $orderType, int $goodsId, string $reservationTime = '');
/**
* 获取定金商品的 商品信息
* @param int $front_id
* @return {
* "name" 名称
* "image" 图片
* "price" 价格
* "activityName" 活动名称
* }
*/
public function getFrontGoods(int $storeId, int $frontId);
/**
* 通过商品id 获取是否 有定金活动
* @param int $storeId
* @param int $goodsId
* @return bool
*
*/
public function getFrontInfo(int $storeId, int $goodsId);
/**
* 支付 状态 回馈接口
* @param string $store_id
* @param int $front_id
* @param int $status // 2.FrontOrderEnum::STATUS_HAVE_PAY 成功支付 3:FrontOrderEnum::STATUS_PAY_EXCEPTION 未支付 (已经过期或者支付异常)4 FrontOrderEnum::STATUS_PAY_REFUND 退款
* @param int $orderId
* @return bool|mixed
* @throws ConException
*/
public function payStatus(string $storeId,int $frontId, int $status, int $orderId);
/**
* 获取定金活动总个数 和正在进行的个数
*
* @return mixed
*/
public function getFrontCounts(int $storeId);
/**
*获取自上次时间以来产生的新订单数
*
* @param [int] $storeId
* @param [int] $lastTime
* @return int
*/
public function getNewOrderNum(int $storeId,int $lastTime);
}
\ 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