Commit c2004a11 by zhufx

Merge remote-tracking branch 'origin/master'

parents 528c45d3 5a473685
......@@ -8,7 +8,7 @@
namespace Hdll\Services\Order\Enum;
class BuyerDistributionEnum
class BuyerDistributionError
{
const E101 = ['101', '金额不能小于0'];
......
......@@ -93,7 +93,7 @@ class Smscode
private function getKey($mobile)
{
return 'smscode-' . md5($this->sellerId . '|' . $mobile);
return 'smscode:' . md5($this->sellerId . '|' . $mobile);
}
}
\ 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\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class SellerDistributionPoolConfig extends PoolProperties
{
protected $name = 'sellerDistribution';
/**
* 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 = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected $uri = [
'192.168.3.39:8100',
];
/**
* 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 = '';
}
......@@ -78,7 +78,7 @@ class SellerPoolConfig extends PoolProperties
* @var array
*/
protected $uri = [
'192.168.3.100:8101',
'192.168.3.39: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\FlowMetering\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferOrderMark(string $token, int $orderType, int $orderId, float $money)
*/
interface FlowMeteringInterface
{
/**
* @param string $token
* @param int $orderType
* @param int $orderId
* @param float $money
* @return mixed
*/
public function OrderMark(
string $token,
int $orderType,
int $orderId,
float $money);
}
\ No newline at end of file
......@@ -6,12 +6,12 @@
* Time: 14:19
*/
namespace Hdll\Services\Order\Enum;
namespace Hdll\Services\Seller\Enum;
class SellerDistributionEnum
class SellerError
{
const E101 = ['101', '金额不能小于0'];
const E101 = [101, '金额不能小于0'];
const E102 = [102, '该数据不属于您', 403];
const E103 = [103, '请勿重复创建', 403];
const E104 = [104, '该用户不存在或属于您的团队', 403];
......
......@@ -6,13 +6,14 @@
* Time: 16:28
*/
namespace Hdll\Services\Store\Lib;
namespace Hdll\Services\Seller\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSave($referId, $unionId, $openId, $nickName, $headImgUrl, $realName, $phoneNumber)
* @method ResultInterface deferGet($id)
* @method ResultInterface deferGet($id,$fields=['*'])
* @method ResultInterface deferUpdate($id)
* Interface SellerInterface
* @package App\Lib
*/
......@@ -33,10 +34,26 @@ interface SellerInterface
public function save($referId, $unionId, $openId, $nickName, $headImgUrl, $realName = '', $phoneNumber = '');
/**
* @param $id
* @param $id
* @param array $fields
* @return mixed
* @author Administrator
*/
public function get($id);
public function get($id,$fields=['*']);
/**
* @param $condition
* @param $data
* $data['referId']=>'来源ID'
* $data['unionId']=>'unionId'
* $data['openId']=>'openId'
* $data['nickName']=>'昵称'
* $data['headImgUrl']=>'头像URL'
* $data['realName']=>'真实姓名'
* $data['phoneNumber']=>'手机号'
* @return mixed
* @author Administrator
*/
public function update($condition,$data);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/17
* Time: 14:19
*/
namespace Hdll\Services\SellerDistribution\Enum;
class SellerDistributionError
{
const E001 = [001, '参数非法',400];
const E002 = [002, '无效的Token',403];
const E003 = [003, '无权限操作',403];
const E004 = [004, '数据不存在',404];
const E101 = [101, '微信支付错误', 500];
const E102 = [102, '订单不存在或状态异常', 404];
const E103 = [103, '升级VIP失败,没有找到对应的店铺', 404];
public function getError($code)
{
$reflect = new \ReflectionClass(self::class);
$arr = $reflect->getConstant('E' . substr($code, -3));
if (!is_array($arr)) {
return false;
}
return [
'code' => $arr[0],
'msg' => $arr[1],
'errorCode' => $arr[2],
];
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/25
* Time: 14:00
*/
namespace Hdll\Services\SellerDistribution\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money, $level, $memo = '')
* @method ResultInterface deferSaveCommission($sellerId, $orderId, $money)
* Interface SellerDistributionInterface
* @package App\Lib
*/
interface SellerDistributionInterface{
/**
* 保存账单
* @param $orderId
* @param $sellerId
* @param $money
* @param $level
* @param string $memo
* @return mixed
* @author Administrator
*/
public function saveBill($orderId, $sellerId, $money, $level, $memo = '');
/**
* 保存佣金记录
* @param $sellerId
* @param $orderId
* @param $money
* @return mixed
* @author Administrator
*/
public function saveCommission($sellerId, $orderId, $money);
}
\ No newline at end of file
......@@ -34,7 +34,7 @@ interface StoreInterface
* 根据店铺ID获取店铺信息
*
* @param integer $storeId
* @return null|array
* @return array 空数组表示没有查询到记录
*/
public function getStore(int $storeId);
......
<?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\Store\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of store-template service
*
* @method ResultInterface deferGetTemplateList(int $onshelf = 1)
* @method ResultInterface deferGetTemplate(int $tplId)
* @method ResultInterface deferDelTemplate(int $tplId)
* @method ResultInterface deferUpdateTemplate(int $tplId, array $data)
* @method ResultInterface deferAddTemplate($data)
*/
interface TemplateInterface
{
/**
* 获取所有可用的个性模板列表
* onshelf=1表示查询已上架的模板
* onshelf=2表示查询已下架的模板
*
* @Number(name="onshelf")
* @param int $onshelf
* @return array
*/
public function getTemplateList(int $onshelf = 1);
/**
* 根据模板ID获取单个模板信息
*
* @Number(name="tplId")
* @param integer $tplId
* @return array
*/
public function getTemplate(int $tplId);
/**
* 根据模板id删除一个模板
*
* @Number(name="tplId")
* @param integer $tplId
* @return int 返回删除成功的条数
*/
public function delTemplate(int $tplId);
/**
* 根据模板id更新一个模板
* $data 字段说明:
* ['tplThumb'] => 模板缩略图地址
* ['title'] => 模板标题
* ['onshelf'] => 是否上架,1上架,2下架,下架的模板用户看不到
* ['memo'] => 备注信息,此信息用户看不到
* ['orderby'] => 排序值,值越大,越靠前
*
* @Number(name="tplId")
* @param integer $tplId
* @param array $data
* @return int 返回更新成功的条数
*/
public function updateTemplate(int $tplId, array $data);
/**
* 添加一个模板
* $data 字段说明:
* ['tplThumb'] => 模板缩略图地址
* ['title'] => 模板标题
* ['onshelf'] => 是否上架,1上架,2下架,下架的模板用户看不到
* ['memo'] => 备注信息,此信息用户看不到
* ['orderby'] => 排序值,值越大,越靠前
*
* @param array $data
* @return int 返回新建模板id
*/
public function addTemplate($data);
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/30
* Time: 10:32
*/
namespace Hdll\Services\Vip\Enum;
class VipEnum{
const VIP_TOTAL_FEE = 10;//价格
const PAY_NOTIFY = 'http://www.baidu.com';
const STATUS_UNPAID = 10;//未支付
const STATUS_PAID = 20;//已支付
}
\ 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