Commit c9c97300 by 王召彬

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

parents 7e551523 12be5616
......@@ -16,19 +16,42 @@ use Swoft\Core\ResultInterface;
* The interface of demo service
*
* @method ResultInterface deferGetgoodsinfo( int $limit_id)
* @method ResultInterface deferGetBargainInfo( int $limit_id)
*/
interface BargainInterface
{
/**
* 获取砍价商品的 商品信息
* @param int $bargain_id
* @return mixed
* @return {
"name" 名称
"image" 图片
"price" 价格
"activityName" 活动名称
* }
*/
public function getGoodsInfo(
int $stordId,int $bargain_id
);
}
\ No newline at end of file
/**
* 通过商品id 获取是否 有砍价活动
* @param int $storeId
* @param int $goodsId
* @return bool
*
*/
public function getBargainInfo(
int $storeId,int $goodsId
);
}
\ No newline at end of file
......@@ -11,11 +11,8 @@
namespace Hdll\Services\Common\Entity;
use Hdll\Services\Auth\Enum\AuthError;
use Hdll\Services\Auth\Exception\AuthException;
use Swoft\App;
use Hdll\Services\Common\Lib\Redis;
use Swoft\Bean\Annotation\Bean;
use Swoft\Cache\Cache;
use Swoft\Redis\Redis;
/**
* 用户实体
......@@ -28,7 +25,7 @@ use Swoft\Redis\Redis;
*/
class User
{
private $id=2;
private $id;
private $nickname;
......@@ -36,9 +33,7 @@ class User
private $headImg;
private $token="3333E";
private $cmId;
private $token;
private $sessionKey;
......@@ -132,16 +127,6 @@ class User
$this->token = $value;
}
public function setCmId($value)
{
$this->cmId = $value;
}
public function getCmId()
{
return $this->cmId;
}
public function fill($arr)
{
......@@ -190,8 +175,10 @@ class User
/**
* @var Redis $redis
*/
$redis = App::getBean(Redis::class);
$info = $redis->get('AUTH:'.$token);
$redis = new Redis();
$redis->setPrefix("AUTH:");
$info = $redis->get($token);
if ( empty($info) ) {
return [false,AuthError::NOT_FOUND_USER];
}
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/20
* Time: 16:34
*/
namespace Hdll\Services\Common\Lib;
use Swoft\App;
use Swoft\Redis\Operator\Processor\PrefixProcessor;
class Redis extends \Swoft\Redis\Redis
{
/**
* 设置redis前缀
* @param $prefix
*/
public function setPrefix($prefix)
{
$config = App::getBean(PrefixProcessor::class);
$config->setPrefix($prefix);
}
}
\ No newline at end of file
......@@ -75,8 +75,9 @@ class AuthPoolConfig extends PoolProperties
*
*/
protected $uri = [
"172.21.0.19:8099",
"172.16.255.39:8099"
"auth:8099",
// "172.21.0.19:8099",
// "172.16.255.39:8099"
];
/**
......
......@@ -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\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class GroupBookingPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_GROUPBOOKING_URI', '172.21.0.38:8099,172.16.255.27:8099'));
}
protected $name = 'groupBooking';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 100;
/**
* 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 = 5;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected $uri = [
'192.168.3.39:8200',
];
/**
* 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 = '';
}
......@@ -77,7 +77,8 @@ class OrderPoolConfig extends PoolProperties
* @var array
*/
protected $uri = [
'192.168.3.100:8084',
'172.21.0.20:8099',
'172.16.255.2: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 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 = '';
}
......@@ -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', 'seller:8099'));
}
protected $name = 'seller';
/**
......@@ -78,8 +84,8 @@ class SellerPoolConfig extends PoolProperties
* @var array
*/
protected $uri = [
'172.21.0.10:8099',
'172.16.255.196:8099',
"172.21.0.46:8099",
// "seller:8099"
];
/**
......
......@@ -21,6 +21,12 @@ use Swoft\Pool\PoolProperties;
class VipPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_VIP_URI', '172.21.0.10:8099,172.16.255.196:8099'));
}
protected $name = 'seller';
/**
......
......@@ -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';
/**
......
......@@ -12,6 +12,7 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferPaySuccess($orderId)
* @method ResultInterface deferHasActivity($storeId,$goodsId)
* Interface GoodsInterface
* @package Hdll\Services\Goods\Lib
*/
......@@ -20,4 +21,6 @@ interface GroupBookingInterface{
public function paySuccess($orderId);
public function hasActivity($storeId,$goodsId);
}
\ No newline at end of file
......@@ -16,7 +16,6 @@ use Swoft\Core\ResultInterface;
* The interface of demo service
*
* @method ResultInterface deferBackNum(string $token, int $consignee_id, int $limit_id, int $selected_num, int $order_type, int $goods_id, string $reservation_time = '')
*/
interface LimitTimeBuyInterface
{
......@@ -39,13 +38,32 @@ interface LimitTimeBuyInterface
int $selected_num,
int $order_type,
int $goods_id,
string $reservation_time );
string $reservation_time);
/**
* 获取限时购商品的 商品信息
* @param int $limit_id
* @return mixed
* @return {
"name" 名称
"image" 图片
"price" 价格
"activityName" 活动名称
* }
*/
public function getLimitGoods(
int $sellerId,int $limitId
);}
\ No newline at end of file
int $storeId, int $limitId
);
/**
* 通过商品id 获取是否 有限时购活动
* @param int $storeId
* @param int $goodsId
* @return bool
*
*/
public function getLimitInfo(
int $storeId, int $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,6 +51,18 @@ 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);
......
......@@ -16,5 +16,5 @@ use Swoft\Core\ResultInterface;
*/
interface PayInterface
{
public function generateSign(int $storeId, int $orderId, int $openId);
public function generateSign(int $storeId, int $orderId, string $openId);
}
<?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