Commit ab1f8647 by xmy

Merge remote-tracking branch 'origin/master'

parents 5b6a3b62 7f23a6de
......@@ -129,25 +129,7 @@ class User
public function setToken($value)
{
if ( empty($value) ) {
return [false,AuthError::GET_TOKEN_ERROR];
}
/**
* @var Redis $redis
*/
$redis = App::getBean(Redis::class);
$info = $redis->get('AUTH:'.$value);
if ( empty($info) ) {
return [false,AuthError::NOT_FOUND_USER];
}
$info = json_decode($info, true);
$this->fill($info);
$this->token = $value;
return true;
}
public function setCmId($value)
......@@ -199,6 +181,29 @@ class User
}
public function initUser($token)
{
if ( empty($token) ) {
return [false,AuthError::GET_TOKEN_ERROR];
}
/**
* @var Redis $redis
*/
$redis = App::getBean(Redis::class);
$info = $redis->get('AUTH:'.$token);
if ( empty($info) ) {
return [false,AuthError::NOT_FOUND_USER];
}
$info = json_decode($info, true);
$this->fill($info);
return true;
}
}
......@@ -20,8 +20,14 @@ use Swoft\Pool\PoolProperties;
*/
class GoodsPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_GOODS_URI', '172.21.0.47:8099,172.16.255.235:8099'));
}
protected $name = 'seller';
protected $name = 'seller';
/**
* Minimum active number of connections
......
<?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 PayPoolConfig extends PoolProperties
{
/**
* 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 = 5;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
*/
protected $uri = [
"172.21.0.39:8099",
"172.16.255.167:8099"
];
/**
* 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 = '';
}
......@@ -12,7 +12,6 @@ namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
use Swoft\Bean\Annotation\Value;
/**
* the config of service user
......@@ -21,6 +20,11 @@ use Swoft\Bean\Annotation\Value;
*/
class ReservationPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', '172.21.0.11:8099,172.16.255.6:8099'));
}
protected $name = 'reservation';
......@@ -75,10 +79,9 @@ class ReservationPoolConfig extends PoolProperties
* '127.0.0.1:88'
* ]
* </pre>
* @Value(name="", env="${RPC_RESERVATION_URI}")
* @var array
*/
protected $uri = ['172.21.0.11:8099','172.16.255.6:8099'];
protected $uri = [];
/**
* whether to user provider(consul/etcd/zookeeper)
......
......@@ -12,7 +12,6 @@ namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
use Swoft\Bean\Annotation\Value;
/**
* the config of service user
......@@ -21,6 +20,11 @@ use Swoft\Bean\Annotation\Value;
*/
class SchedulePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_SCHEDULE_URI', '172.21.0.23:8099,172.16.255.197:8099'));
}
protected $name = 'schedule';
......@@ -75,10 +79,9 @@ class SchedulePoolConfig extends PoolProperties
* '127.0.0.1:88'
* ]
* </pre>
* @Value(name="", env="${RPC_SCHEDULE_URI}")
* @var array
*/
protected $uri = ['172.21.0.23:8099','172.16.255.197:8099'];
protected $uri = [];
/**
* whether to user provider(consul/etcd/zookeeper)
......
......@@ -21,6 +21,12 @@ use Swoft\Pool\PoolProperties;
class SellerDistributionPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_SELLER_DISTRIBUTION_URI', '172.21.0.17:8099,172.16.255.34:8099'));
}
protected $name = 'sellerDistribution';
/**
......
......@@ -21,6 +21,12 @@ use Swoft\Pool\PoolProperties;
class SellerPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_SELLER_URI', '172.21.0.10:8099,172.16.255.196:8099'));
}
protected $name = 'seller';
/**
......
......@@ -12,7 +12,6 @@ namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
use Swoft\Bean\Annotation\Value;
/**
* the config of service user
......@@ -21,6 +20,11 @@ use Swoft\Bean\Annotation\Value;
*/
class StorePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_STORE_URI', '172.21.0.44:8099,172.16.255.190:8099'));
}
protected $name = 'storeId';
......@@ -75,10 +79,9 @@ class StorePoolConfig extends PoolProperties
* '127.0.0.1:88'
* ]
* </pre>
* @Value(name="", env="${RPC_STORE_URI}")
* @var array
*/
protected $uri = ['172.21.0.44:8099','172.16.255.190:8099'];
protected $uri = [];
/**
* whether to user provider(consul/etcd/zookeeper)
......
......@@ -21,6 +21,10 @@ use Swoft\Pool\PoolProperties;
class WithdrawCashPoolConfig extends PoolProperties
{
public function __construct()
{
$this->uri=explode(',',env('RPC_WITHDRAWCASH_URI','172.21.0.33:8099,172.16.255.12:8099'));
}
protected $name = 'withdrawCash';
/**
......
......@@ -20,4 +20,6 @@ interface GroupBookingInterface{
public function paySuccess($orderId);
public function hasActivity($storeId,$goodsId);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/5
* Time: 13:15
*/
namespace Hdll\Services\Notice\Enum;
class NoticeEnum
{
const WX_SEND = 1;
const SMS_SEND = 2;
const SEND_TYPES = [
self::WX_SEND,
self::SMS_SEND
];
}
\ No newline at end of file
......@@ -27,6 +27,15 @@ class OrderEnum
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 BALANCE_STATE_FALSE = 0; //未对账
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/17
* Time: 16:23
*/
namespace Hdll\Services\Order\Enum;
class OrderItemEnum
{
const NORMAL = 1; //正常
const CLOSED = 2;//关闭
const DELIVERED = 3;//核销
const LOCKED = 4;//锁定
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/17
* Time: 9:37
*/
namespace Hdll\Services\Order\Enum;
class ValueAddedServiceEnum
{
const VIP = 1; //vip服务
}
\ No newline at end of file
......@@ -51,7 +51,21 @@ interface OrderInterface
string $activity_name,
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);
}
\ 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 SellerCnDrawInterface service
*
* @method ResultInterface deferPaySuccess(int $storeId,int $id,string $wxOrderSn,int $fee)
* @method ResultInterface deferPayFailed(int $storeId,int $id,string $message)
*/
interface SellerCnDrawInterface{
/**
* 支付成功接口
*
* @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
* @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
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