Commit 499f2004 by 王召彬

Merge branch 'master' of http://git.2b3.cn/tencent/services

parents b0152a0b 2dcfecae
......@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* @method ResultInterface deferGetListByOrderId(int $storeId, int $orderId)
* Interface AgencyInterface
* @package App\Lib
*/
......@@ -36,5 +37,7 @@ interface BillInterface{
int $money
);
public function getListByOrderId(int $storeId, int $orderId);
}
\ No newline at end of file
......@@ -29,7 +29,8 @@ interface BuyerInterface
["storeId"]=>int(0)//店铺id
["referId"]=>int(0)//推荐人ID
["state"]=>int(0)//买家状态
["nickName"]=>string(0) ""买家昵称
["nickName"]=>string(0) ""//买家昵称
["openId"]=>string(0) ""//买家openId
["profile"]=>
array(4) {
["realName"]=>string(12) "真实姓名"
......@@ -56,11 +57,11 @@ interface BuyerInterface
"phoneNumber" => "手机号",
"birthday" => "生日"
];
* @param string $token
* @param int $storeId
* @param array $data
* @return mixed
*/
public function updateProfile(string $token, array $data);
public function updateProfile(int $storeId, array $data);
/**
* 是否已经注册用户
......
......@@ -22,10 +22,9 @@ interface CommissionInterface
* @return bool
*/
public function reduceBalanceCommission($storeId, $buyerId, $money);
/**
* 增加可提现金额
*
*
* @param $storeId
* @param $buyerId
* @param $money
......@@ -34,6 +33,16 @@ interface CommissionInterface
public function addBalanceCommission($storeId, $buyerId, $money);
/**
* 增加可提现金额(仅限于对账服务使用,切记!!!)
*
* @param $storeId
* @param $buyerId
* @param $money
* @return bool
*/
public function addBalanceCommissionCompare($storeId, $buyerId, $money);
/**
* 增加累计现金额
*
* @param $storeId
......
......@@ -90,7 +90,6 @@ class CommonEntity extends Model
}
$request = RequestContext::getRequest();
$testFlag = $request->query('flag');
//获取注解里的table
$res = new \ReflectionClass(static::class);
......
......@@ -12,14 +12,31 @@ use Swoft\Redis\Operator\Processor\PrefixProcessor;
class Redis extends \Swoft\Redis\Redis
{
private $prefix;
/**
* 设置redis前缀
* @param $prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
public function call(string $method, array $params)
{
$config = App::getBean(PrefixProcessor::class);
$config->setPrefix($prefix);
$config->setPrefix($this->prefix);
$res = parent::call($method, $params);
$config->setPrefix(config("redis.prefix",''));
return $res;
}
public function __destruct()
{
$config = App::getBean(PrefixProcessor::class);
$config->setPrefix(config("redis.prefix",''));
}
......
......@@ -25,7 +25,7 @@ class AuthPoolConfig extends PoolProperties
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'auth:8099'));
$this->uri = explode(',', env('RPC_AUTH_URI', 'auth:8099'));
}
......
......@@ -20,6 +20,13 @@ use Swoft\Bean\Annotation\Value;
*/
class BargainPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_BARGAIN_URI', 'bargain:8099'));
}
protected $name = 'bargain';
/**
......
......@@ -25,7 +25,7 @@ class BuyerPoolConfig extends PoolProperties
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'buyer:8099'));
$this->uri = explode(',', env('RPC_AUTH_URI', 'buyer:8099'));
}
/**
......
<?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;
/**
* the config of service user
*
* @Bean()
*/
class NoticePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_NOTICE_URI', 'notice:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'pay';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 50;
/**
* 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 = '';
}
......@@ -22,7 +22,7 @@ class OrderPoolConfig extends PoolProperties
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'order:8099'));
$this->uri = explode(',', env('RPC_ORDER_URI', 'order:8099'));
}
......
......@@ -21,12 +21,12 @@ use Swoft\Pool\PoolProperties;
*/
class PayPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'pay:8099'));
}
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_PAY_URI', 'pay:8099'));
}
/**
* the name of pool
*
......@@ -67,7 +67,7 @@ class PayPoolConfig extends PoolProperties
* the time of connect timeout
*
*/
protected $timeout = 5;
protected $timeout = 50;
/**
* the addresses of connection
......@@ -81,7 +81,7 @@ class PayPoolConfig extends PoolProperties
*
*/
protected $uri = [
"pay:8099",
"192.168.3.100:8102",
];
/**
......
......@@ -84,8 +84,7 @@ class SellerPoolConfig extends PoolProperties
* @var array
*/
protected $uri = [
"172.21.0.46:8099",
// "seller:8099"
'192.168.3.39:8099'
];
/**
......
......@@ -19,6 +19,12 @@ use Swoft\Bean\Annotation\Value;
*/
class TimeLimitBuyPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_TIMELIMITBUY_URI', 'timelimitbuy:8099'));
}
protected $name = 'bargain';
/**
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 11:09
*/
namespace Hdll\Services\Notice\Enum;
class FormIdEnum
{
const TYPE_FORM = 0;
const TYPE_PAY = 1;
}
\ No newline at end of file
......@@ -7,18 +7,26 @@
*/
namespace Hdll\Services\Notice\Enum;
class NoticeEnum
{
const WX_SEND = 1;
//商家小程序发送
const TYPE_MINI_BACKEND_SEND= 1;
const SMS_SEND = 2;
//腾讯sms发送
const TYPE_TENCENT_SMS = 2;
//买家小程序消息推送
const TYPE_MINI_FRONTEND_SEND= 3;
const SEND_TYPES = [
self::WX_SEND,
self::SMS_SEND
const SEND_TYPES = [
self::TYPE_MINI_BACKEND_SEND,
self::TYPE_TENCENT_SMS,
self::TYPE_MINI_FRONTEND_SEND
];
}
\ 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\Notice\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferSend(int $sendType, array $data, int $sendTime)
*/
interface NoticeInterface
{
/**
* 参数说明
*
* 微信发送消息数据结构
* $data[NoticeEnum::TYPE_MINI_BACKEND_SEND] = [
"uid" => 1, //用户的id
"template_id" => "1kZ_RkkWfRrpufXNdmJYBpIhgk7ccCtPrypeJQ9WRwM",//消息模板id
"page" => "index", //消息模板页面
"data" => [ //消息模板数据
"keyword1" => [
"value" => "商品名称",
],
"keyword2" => [
"value" => "A8204427546131350100",
],
"keyword3" => [
"value" => "¥30",
],
"keyword4" => [
"value" => date('Y-m-d'),
]
]
];
*
* 短信发送消息数据结构
$data[NoticeEnum::TENCENT_SMS] = [
"templateId" => "178822", //模板id
"phoneNumber" => "18812345678",
"param" => [ //模板变量名
"1580",
"5"
]
];
*
* @param array $sendTypes
* @param array $data
* @param int $sendTime //发送时间,立即返送填0
* @return mixed
*/
public function send(array $sendTypes, array $data, int $sendTime) : bool ;
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/23
* Time: 13:42
*/
namespace Hdll\Services\Order\Enum;
class ConsigneeEnum
{
const DEFAULT_ENABLE = 1;
const DEFAULT_DISABLE = 0;
const DEFAULT_ALLOW_VALUE = [
self::DEFAULT_DISABLE,
self::DEFAULT_ENABLE
];
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 15:28
*/
namespace Hdll\Services\Order\Enum;
class OrderCate
{
const TYPE_BUYER = 1;
const TYPE_SELLER = 2;
}
\ No newline at end of file
......@@ -21,20 +21,26 @@ class OrderEnum
const STATUS_CANCEL = 0; //已取消
const STATUS_CLOSED = 70; //已关闭
const STATUS_REFUNDING = 80; //退款中
const STATUS_EVALUATION = 90; //已评价
//订单类型
const TYPE_GOODS = 0; //商品订单
const TYPE_CUT_PRICE = 1; //砍价订单
const TYPE_LIMIT = 2; //限时购订单
const TYPE_COLLECTION = 3; //拼团
const TYPE_VALUE_ADDED_SERVICE = 4; //增值服务
const ORDER_TYPES = [
self::TYPE_GOODS,
self::TYPE_CUT_PRICE,
self::TYPE_LIMIT,
self::TYPE_COLLECTION,
self::TYPE_VALUE_ADDED_SERVICE,
];
const PAID_STATUS = [
self::STATUS_PAID,
self::STATUS_DELIVERY,
self::STATUS_DELIVERED,
self::STATUS_EVALUATION
];
//对账状态
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 13:56
*/
namespace Hdll\Services\Order\Enum;
class SellerOrderEnum
{
const TYPE_VALUE_ADDED_SERVICE = 1; //增值服务
//订单状态
const STATUS_UNPAID = 10; //待支付
const STATUS_PAID = 20; //已支付
}
\ No newline at end of file
......@@ -15,9 +15,10 @@ use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferCreateOrder( string $token,int $consignee_id,int $activity_id,int $selected_num,int $order_type,float $total,float $goods_price,string $goods_name,string $goods_image,string $activity_name,string $reservation_time = '')
* @method ResultInterface deferCreateOrder( string $token,int $consignee_id,int $activity_id,int $selected_num,int $order_type,float $total,float $goods_price,string $goods_name,string $goods_image,string $activity_name,int $goodsId,string $reservation_time = '')
* @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn)
* @method ResultInterface deferGetOrderInfo(int $storeId,int $orderId)
* @method ResultInterface deferUpdateInfoById(int $storeId,int $orderId, array $updateInfo)
*/
interface OrderInterface
{
......@@ -34,6 +35,7 @@ interface OrderInterface
* @param string $goods_name
* @param string $goods_image
* @param string $activity_name
* @param int $goodsId,
* @param string $reservation_time
* @return mixed
*/
......@@ -49,23 +51,12 @@ interface OrderInterface
string $goods_name,
string $goods_image,
string $activity_name,
int $goodsId,
string $reservation_time = '');
public function sellerCreateOrder(
int $sellerId,
int $storeId,
int $itemId,
int $selectedNum,
int $orderType,
float $total,
float $goodsPrice,
string $goodsName
);
public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn);
public function updateInfoById(int $orderId, array $updateInfo);
public function updateInfoById(int $storeId,int $orderId, array $updateInfo);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 13:57
*/
namespace Hdll\Services\Order\Lib;
interface SellerOrderInterface
{
public function sellerCreateOrder(
int $sellerId,
int $storeId,
int $itemId,
int $selectedNum,
int $orderType,
float $total,
float $goodsPrice,
string $goodsName
);
public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn);
public function updateInfoById(int $storeId,int $orderId, array $updateInfo);
}
\ No newline at end of file
......@@ -11,10 +11,14 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferCreateOrder(int $storeId, int $orderId, int $openId)
* @method ResultInterface deferGenerateSellerSign(int $storeId, int $orderId, string $openId)
*
* Interface PayInterface
* @package Hdll\Services\Pay\Lib
*/
interface PayInterface
{
public function generateSign(int $storeId, int $orderId, string $openId);
public function generateSellerSign(int $storeId, int $orderId, string $openId);
}
......@@ -12,11 +12,13 @@ use Swoft\Core\ResultInterface;
/**
*
* @method ResultInterface deferGetFund($sellerId)
* @method ResultInterface deferAddBalance($sellerId)
* @method ResultInterface deferReduceBalance($sellerId)
* @method ResultInterface deferAddTotal($sellerId)
* @method ResultInterface deferReduceTotal($sellerId)
* @method ResultInterface deferGetFund($seller)
* @method ResultInterface deferAddBalance($seller, $money)
* @method ResultInterface deferReduceBalance($seller, $money)
* @method ResultInterface deferAddTotal($seller, $money)
* @method ResultInterface deferReduceTotal($seller, $money)
* @method ResultInterface deferAddExpectFund($seller, $money)
* @method ResultInterface deferAddFund($seller, $money)
* Interface SellerInterface
* @package App\Lib
*/
......@@ -73,4 +75,22 @@ interface SellerFundInterface
*/
public function getFund($sellerId);
/**
* 增加冻结金额
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function addExpectFund($sellerId,$money);
/**
* 增加金额
* @param $sellerId
* @param $balanceFund 可提现金额
* @param $commissionFund 佣金
* @return mixed
* @author Administrator
*/
public function addFund($sellerId, $balanceFund, $commissionFund);
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ use Swoft\Core\ResultInterface;
* method ResultInterface deferReduceBalance($sellerId, $money)
* method ResultInterface deferAddTotal($sellerId, $money)
* method ResultInterface deferReduceTotal($sellerId, $money)
* method ResultInterface deferListByOrderId($storeId, $orderId)
* Interface SellerDistributionInterface
* @package App\Lib
*/
......@@ -79,4 +80,13 @@ interface SellerDistributionInterface{
* @author Administrator
*/
public function reduceTotal($sellerId, $money);
/**
* 获取分销记录
* @param $storeId
* @param $orderId
* @return mixed
* @author Administrator
*/
public function listByOrderId($storeId, $orderId);
}
\ No newline at end of file
<?php
/**
* 买家佣金提现接口
*
* @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\WithdrawCash\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of BuyerCnDrawInterface service
*
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message)
*/
interface BuyerCnDrawInterface{
/**
* 支付成功接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $wxOrderSn 微信支付订单号
* @param integer $fee 手续费
* @return void
*/
public function paySuccess(int $storeId,int $id,string $wxOrderSn,int $fee);
/**
* 支付失败接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $message 失败信息
* @return void
*/
public function payFailed(int $storeId,int $id,string $message);
}
\ No newline at end of file
<?php
/**
* 买家营业额提现接口
*
* @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\WithdrawCash\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of SellerFundDrawInterface service
*
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message)
*/
interface SellerFundDrawInterface{
/**
* 支付成功接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $wxOrderSn 微信支付订单号
* @param integer $fee 手续费
* @return boolean
*/
public function paySuccess(int $storeId,int $id,string $wxOrderSn,int $fee);
/**
* 支付失败接口
*
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $message 失败信息
* @return boolean
*/
public function payFailed(int $storeId,int $id,string $message);
}
\ No newline at end of file
<?php
/**
* 家佣金提现接口
* 家佣金提现接口
*
* @link https://swoft.org
* @document https://doc.swoft.org
......@@ -11,30 +11,32 @@ namespace Hdll\Services\WithdrawCash\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of SellerCnDrawInterface service
* The interface of WithdrawCashInterface service
*
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message)
* @method ResultInterface deferPaySuccess(int $type,int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $type,int $storeId,int $id,string $message)
*/
interface SellerCnDrawInterface{
interface WithdrawCashInterface{
/**
* 支付成功接口
*
* @param integer $type 提现类型
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $wxOrderSn 微信支付订单号
* @param integer $fee 手续费
* @return boolean
*/
public function paySuccess(int $storeId,int $id,string $wxOrderSn,int $fee);
public function paySuccess(int $type,int $storeId,int $id,string $wxOrderSn,int $fee);
/**
* 支付失败接口
*
* @param integer $type 提现类型
* @param integer $storeId 店铺ID
* @param integer $id 提现记录ID
* @param string $message 失败信息
* @return boolean
*/
public function payFailed(int $storeId,int $id,string $message);
public function payFailed(int $type,int $storeId,int $id,string $message);
}
\ 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