Commit c68aec28 by dzhang

Merge branch 'test' of http://git.dev.2b3.cn/tencent/services into test

parents f398bd6e 5acfbb22
# 2.0.44
- VIP保赚服务上线
# 2.0.43
- 优惠券上线
# 2.0.42
- 活动方案+实物订单上线
......
......@@ -12,6 +12,7 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferGetInfo(int $id)
* @method ResultInterface deferGetBatch(array $ids)
* Interface VisitorInterface
* @package App\Lib
*/
......@@ -24,4 +25,16 @@ interface ActivityPlanInterface
*/
public function getInfo(int $id);
/**
* 根据ids批量获取活动方案信息
* @param array $ids
* @return mixed
* 返回示例:
* [
* "id" => ["id" => 1, "title" => "方案名称"], // 键值对返回,下标是方案id
* ... ...
* ]
*/
public function getBatch(array $ids);
}
\ No newline at end of file
......@@ -18,8 +18,9 @@ use Swoft\Core\ResultInterface;
*
* @method ResultInterface deferGetgoodsInfo(int $storeId, int $bargain_id)
* @method ResultInterface deferGetBargainInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $storeId,int $bargainbranchId,int $status, int $orderId)
* @method ResultInterface deferPayStatus(string $storeId,int $bargainbranchId,int $status, int $orderId)
* @method ResultInterface deferGetBargainCounts(int $storeId)
* @method ResultInterface deferGetNotEndedActivityList($storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/
interface BargainInterface
......@@ -64,6 +65,13 @@ interface BargainInterface
*/
public function getBargainCounts(int $storeId);
/**
* 获取店铺尚未结束的活动列表
*
* @return mixed
*/
public function getNotEndedActivityList($storeId);
/**
*获取自上次时间以来产生的新订单数
*
......
<?php
namespace Hdll\Services\Buyer\Lib;
interface FansInterface
{
public function get(string $unionId);
public function get(string $unionId);
public function getByUnionIds(array $unionIds, array $fields = ['*']);
}
\ No newline at end of file
......@@ -37,6 +37,11 @@ class User
return $this->getValue('id');
}
public function getOemId()
{
return $this->getValue('oemId');
}
public function setTestFlag()
{
$this->setValue('testFlag', TestEnum::TEST_STORE_ID);
......
......@@ -8,9 +8,6 @@ use Swoft\Redis\Redis;
class Xcrypt
{
const CRYPT = 'cryptKey';
public static function encrypt(string $str, $key = '')
{
$str = serialize($str);
......@@ -42,10 +39,10 @@ class Xcrypt
}
private static function getKey(){
$key = CfgCenter::get(self::CRYPT);
$key = CfgCenter::getByOemId(CfgCenter::ENCRYPT_KEY, 0);
if (empty($key)){
throw new \Exception('加密密钥获取失败!');
}
return $key;
}
}
\ No newline at end of file
}
\ 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\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties;
/**
*
* @Bean()
*/
class InsurancePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_INSURANCE_URI', 'insurance:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'insurance';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 400;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 200;
/**
* 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 = '';
}
......@@ -14,6 +14,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferAdd(int $storeId, array $data)
* @method ResultInterface deferBrowseAndShare(int $storeId, int $type, array $itemIds)
* @method ResultInterface deferNewVisitor(int $storeId, int $type, array $itemIds = null)
* @method ResultInterface deferVisitorCount(array $storeIds, int $beginDate, int $endDate)
* Interface VisitorInterface
* @package App\Lib
*/
......@@ -74,4 +75,14 @@ interface VisitorInterface
*/
public function newVisitor(int $storeId, int $type, array $itemIds = null);
/**
* 根据日期访问统计访客数
* @param array $storeIds 店铺id列表
* @param int $beginDate 开始日期,格式:20191212
* @param int $endDate 开始日期,格式:20191212
* @return mixed
* 响应参数:数字
*/
public function visitorCount(array $storeIds, int $beginDate, int $endDate);
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ use Swoft\Core\ResultInterface;
* @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 deferGetNotEndedActivityList($storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/
interface FrontMoneyInterface
......@@ -80,6 +81,13 @@ interface FrontMoneyInterface
*/
public function getFrontCounts(int $storeId);
/**
* 获取店铺尚未结束的活动列表
*
* @return mixed
*/
public function getNotEndedActivityList($storeId);
/**
*获取自上次时间以来产生的新订单数
......
<?php
namespace Hdll\Services\Insurance\Enum;
class InsuranceCmqEnum
{
const TOPIC = 'insurance';
const ACTIVITY_CREATE = 'activityCreate'; // 使用活动方案创建活动时通知
}
\ 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\Insurance\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of insurance service
*
* @method ResultInterface deferGetOrderInfo(int $storeId, int $orderId)
* @method ResultInterface deferGetOrderBySn(int $storeId, $orderSn)
* @method ResultInterface deferPaySuccess(int $storeId, $orderSn)
*/
interface InsuranceInterface
{
/**
* 获取指定订单数据
*
* @param integer $storeId
* @param integer $orderId
* @return array
*/
public function getOrderInfo(int $storeId, int $orderId);
/**
* 获取指定订单数据
*
* @param integer $storeId
* @param string $orderSn
* @return array
*/
public function getOrderBySn(int $storeId, $orderSn);
/**
* 支付成功回调
*
* @param integer $storeId
* @param string $orderSn
* @return void
*/
public function paySuccess(int $storeId, $orderSn);
}
\ No newline at end of file
<?php
namespace Hdll\Services\MemberCard\Enum;
class UpBonusEvent {
const CONSUME_ADD = 1; //消费产生积分(确认收货)
const CONSUME_PAY = 2; //下单减积分
const CLOSE_ORDER = 3; //关闭订单返还积分
}
\ No newline at end of file
......@@ -23,7 +23,10 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferIfUserGetCard(int $storeId,int $userId,int $escrow)
* @method ResultInterface deferGetUserCouponDetail(int $storeId ,int $couponId)
* @method ResultInterface deferSetUserCouponStatus(int $storeId,int $couponId,int $status)
* @method ResultInterface deferGetUserValidCouponNum(int $storeId,int $escrow,int $userId)
* @method ResultInterface deferGetUserValidCouponNum(int $storeId,int $escrow,int $userId)
* @method ResultInterface deferIfCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods)
* @method ResultInterface deferUpMembercardBonus(int $storeId,int $escrow,int $userId,int $orderId,int $type,int $money=0,int $bonus=0)
* @method ResultInterface deferUpMembercardBalance(int $storeId,int $escrow,int $userId,int $balance)
*/
/**
* The interface of demo service
......@@ -107,4 +110,40 @@ interface MemberCardInterface
* @return int
*/
public function getUserValidCouponNum(int $storeId,int $escrow,int $userId);
}
\ No newline at end of file
/**
* 判断优惠券是否适用于订单(下单的时候调用)
*
* @param integer $storeId
* @param integer $userId
* @param integer $couponId
* @param array $goods [{goodsId:totalPrice},...]
* @return bool
*/
public function ifCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods);
/**
* 改变用户积分
*
* @param integer $storeId
* @param integer $escrow
* @param integer $userId
* @param integer $orderId
* @param integer $type //类型 1 消费产生积分 2 积分抵扣 3订单关闭 (这里只要传1-3)【4 - 消费后订单关闭,原来增加积分的记录状态为4(1->4)】
* @param integer $money //类型1 只要传money,bonus不传; 类型2 money,bonus 都传; 类型3 积分,金额都不传
* @param integer $bonus
* @return bool
*/
public function upMembercardBonus(int $storeId,int $escrow,int $userId,int $orderId,int $type,int $money=0,int $bonus=0);
/**
* 用户储值卡余额 通知会员卡(显示在卡包 余额)
*
* @param integer $storeId
* @param integer $escrow
* @param integer $userId
* @param integer $balance
* @return bool
*/
public function upMembercardBalance(int $storeId,int $escrow,int $userId,int $balance);
}
......@@ -34,5 +34,14 @@ class NoticeEnum
self::TYPE_SYSTEM_SEND,
];
const PAGE_TYPE_BACKEND = 1;//后台 蓝猫
const PAGE_TYPE_FRONT = 2;//前台 橙猫
const PAGE_TYPE_MP = 3;//公众号
const TEMPLATE_GROUP_BOOKING_SUCCESS = "GROUP_BOOKING_SUCCESS";//拼团结果通知
const TEMPLATE_BARGAIN_OVERDUE = "BARGAIN_OVERDUE"; //砍价活动过期通知
const TEMPLATE_BARGAIN_COMPLETE = "BARGAIN_COMPLETE";//砍到底价通知
const TEMPLATE_TIMESCARD_PADDLE = "TIMESCARD_PADDLE";//次卡划卡通知
const TEMPLATE_RECHARGE_PADDLE = "RECHARGE_PADDLE";//储值卡划卡通知
}
\ No newline at end of file
......@@ -17,27 +17,40 @@ use Swoft\Core\ResultInterface;
*
* @method ResultInterface deferSend(int $storeId, array $sendTypes, array $data, $sendTime, string $redisKey) :bool
* @method ResultInterface deferCancelSend(string $redisKey):bool
* @method ResultInterface deferCostumerSend(string $openId);
* @method ResultInterface deferCostumerSend(string $openId, int $oemId = 0);
*/
interface NoticeInterface
{
/**
* 参数说明
*
* thing.DATA 事物 20个以内字符 可汉字、数字、字母或符号组合
number.DATA 数字 32位以内数字 只能数字,可带小数
letter.DATA 字母 32位以内字母 只能字母
symbol.DATA 符号 5位以内符号 只能符号
character_string.DATA 字符串 32位以内数字、字母或符号 可数字、字母或符号组合
time.DATA 时间 24小时制时间格式(支持+年月日) 例如:15:01,或:2019年10月1日 15:01
date.DATA 日期 年月日格式(支持+24小时制时间) 例如:2019年10月1日,或:2019年10月1日 15:01
amount.DATA 金额 1个币种符号+10位以内纯数字,可带小数,结尾可带“元” 可带小数
phone_number.DATA 电话 17位以内,数字、符号 电话号码,例:+86-0766-66888866
car_number.DATA 车牌 8位以内,第一位与最后一位可为汉字,其余为字母或数字 车牌号码:粤A8Z888挂
name.DATA 姓名 10个以内纯汉字或20个以内纯字母或符号 中文名10个汉字内;纯英文名20个字母内;中文和字母混合按中文名算,10个字内
phrase.DATA 汉字 5个以内汉字 5个以内纯汉字,例如:配送中
*
* 微信发送消息数据结构
* $data[NoticeEnum::TYPE_MINI_BACKEND_SEND] = [
"uid" => 1, //用户的id
* "storeId" => 1, //店铺id
"template_id" => "1kZ_RkkWfRrpufXNdmJYBpIhgk7ccCtPrypeJQ9WRwM",//消息模板id
"page" => "index", //消息模板页面
"tplName" => ''//订阅模版枚举
"params" => [a=>'b'], //跳转页面参数
"data" => [ //消息模板数据
"keyword1" => [
"number01" => [
"value" => "商品名称",
],
"keyword2" => [
"date01" => [
"value" => "A8204427546131350100",
],
"keyword3" => [
"site01" => [
"value" => "¥30",
],
"keyword4" => [
......@@ -64,11 +77,8 @@ interface NoticeInterface
* 微信公众号发送实例
$data[NoticeEnum::TYPE_MP_SEND] = [
'unionId' => 'o3lFcs8xoWfQUlhzTiP5uZI6A7Hc', //填写用户的unionId
'template_id' => 'zwUBuoKVRJkumLwGkippA46XfmLsmwJD906HC-wqOks',
'miniprogram' => [
'appid' => 'wx3b3b2df942634cdd', //小程序appid
'pagepath' => 'pages/start/start'//小程序页面
],
'tplName' => 模版KEY,
'params' => [],//小程序或url地址参数(不用传地址)array
'data' => [
'first' => 'first',
'keyword1' => '姓名',
......@@ -101,13 +111,14 @@ interface NoticeInterface
public function send(array $sendTypes, array $data, $sendTime, string $redisKey='') :bool;
/**
* 公众号客服消息
*
* @param string $openId
* @return void
*/
public function costumerSend(string $openId);
/**
* 公众号客服消息
*
* @param string $openId
* @param int $oemId
* @return void
*/
public function costumerSend(string $openId, int $oemId = 0);
/**
......
......@@ -20,6 +20,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferReturnCardMoney(int $storeId,int $buyerId,int $itemOrderId,string $itemTitle,int $payMoney, int $parentOrderId)
* @method ResultInterface deferStatisNum(int $storeId)
* @method ResultInterface deferGetRecharge(int $storeId, int $buyerId)
* @method ResultInterface deferDeductMoney($storeId, $buyerId, $name, $phone, $money, $message)
*/
interface RechargeInterface
{
......@@ -88,6 +89,18 @@ interface RechargeInterface
* @return mixed
*/
public function getRecharge(int $storeId, int $buyerId);
/**
* 线下扣款(划卡)
* @param int $storeId
* @param int $buyerId
* @param $name
* @param $phone
* @param $money
* @param $message
* @return mixed
*/
public function deductMoney($storeId, $buyerId, $name, $phone, $money, $message);
}
......
<?php
namespace Hdll\Services\Seller\Lib;
interface OemInterface
{
public function oemConfigByStoreId($storeId);
public function oemConfigBySeller($sellerId);
}
\ No newline at end of file
......@@ -32,16 +32,18 @@ interface SellerInterface
{
/**
* @param $referId
* @param $unionId
* @param $openId
* @param $nickName
* @param $headImgUrl
* @param int $gender
* @param $referId
* @param $unionId
* @param $openId
* @param $nickName
* @param $headImgUrl
* @param int $gender
* @param string $mpOpenId
* @param int $oemId
* @return mixed
* @author work
*/
public function save($referId, $unionId, $openId, $nickName, $headImgUrl, $gender = 2);
public function save($referId, $unionId, $openId, $nickName, $headImgUrl, $gender = 2, $mpOpenId = '', $oemId = 0);
/**
* @param $id
......
......@@ -22,6 +22,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface defergetTimesCardUserCardInfo(int $storeId, int $goodsId)
* @method ResultInterface deferStatisNum(int $storeId)
* @method ResultInterface deferValidNum(int $storeId, int $buyerId)
* @method ResultInterface deferDeductCard($storeId, $buyerId, $items)
*/
interface TimesCardInterface
{
......@@ -86,6 +87,17 @@ interface TimesCardInterface
* @return mixed
*/
public function validNum(int $storeId, int $buyerId);
/**
* 线下扣卡次数(划卡)
* @param $storeId
* @param $buyerId
* @param $name
* @param $phone
* @param $items
* @return mixed
*/
public function deductCard($storeId, $buyerId, $name, $phone, $items);
}
......
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