Commit 54c8c14e by fly

first commit

parents
.idea
/vendor/
{
"name": "hdll/services",
"description": "test",
"authors": [
{
"name": "fly",
"email": "fly@qq.com"
}
],
"require": {
},
"autoload": {
"psr-4": {
"Hdll\\Services\\": "src/"
}
}
}
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/5
* Time: 15:47
*/
namespace Hdll\Services\Buyer;
class Test {
public function test() {
echo 'buyer_test';
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/6
* Time: 10:16
*/
namespace Hdll\Services\Common\Exception;
class ExceptionParseData
{
public static function parseData(\Exception $e)
{
$exception = $e->getMessage();
$pos = strpos($exception,"the return status of rpc is incorrected,data");
if ( false !== $pos ) {
$exception = str_replace("the return status of rpc is incorrected,data=","",$exception);
$throw_data = json_decode($exception,true);
$parse_data = explode(' ',$throw_data['msg']);
$data = ['msg' => $parse_data[0], 'file' => $parse_data[1], 'line' => $parse_data[2], 'code' => $throw_data['status']];
} else {
$file = $e->getFile();
$line = $e->getLine();
$code = $e->getCode();
$exception = $e->getMessage();
$data = ['msg' => $exception, 'file' => $file, 'line' => $line, 'code' => $code];
}
return $data;
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/5
* Time: 13:15
*/
namespace Hdll\Services\Order\Enum;
class OrderEnum
{
//订单状态
const STATUS_UNPAID = 10; //待支付
const STATUS_PAID = 20; //已支付
const STATUS_DELIVERY = 30; //已发货/已预约
const STATUS_DELIVERED = 40; //已收获/已核销
const STATUS_REFUND = 50; //申请退款
const STATUS_REFUNDED = 60; //已退款
const STATUS_CANCEL = 0; //已取消
const STATUS_CLOSED = 70; //已关闭
const STATUS_REFUNDING = 80; //退款中
//订单类型
const TYPE_GOODS = 0; //商品订单
const TYPE_ACTIVITY = 1; //活动订单
}
\ 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\Order\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferCreateOrder( string $token,int $consignee_id,int $item_id,int $selected_num,int $order_type,string $reservation_time = '')
*/
interface OrderInterface
{
/**
* 创建订单
* @param string $token
* @param int $consignee_id
* @param int $item_id
* @param int $selected_num
* @param int $order_type
* @param string $reservation_time
* @return mixed
*/
public function createOrder(
string $token,
int $consignee_id,
int $item_id,
int $selected_num,
int $order_type,
string $reservation_time = '');
}
\ 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