Browse Source

v3初始化

master
weigang 5 years ago
parent
commit
1327bb5ea2
  1. 30
      app/Constants/v3/ErrorCode.php
  2. 74
      app/Constants/v3/OrderState.php
  3. 20
      app/Constants/v3/OrderType.php
  4. 18
      app/Constants/v3/Payment.php
  5. 10
      app/Controller/v3/ExampleController.php
  6. 10
      app/Model/v3/Example.php
  7. 10
      app/Request/v3/ExampleRequest.php
  8. 10
      app/Service/v3/Implementations/ExampleService.php
  9. 8
      app/Service/v3/Interfaces/ExampleServiceInterface.php

30
app/Constants/v3/ErrorCode.php

@ -0,0 +1,30 @@
<?php
namespace App\Constants\v3;
use Hyperf\Constants\AbstractConstants;
class ErrorCode extends AbstractConstants
{
/************************************/
/* 应用或系统相关,参考HTTP STATUS */
/************************************/
/**
* @Message("服务器内部错误")
*/
const SERVER_ERROR=500;
/************************************/
/* 订单相关 601-650 */
/************************************/
/************************************/
/* 支付相关 651-700 */
/************************************/
/************************************/
/* 用户相关 701-750 */
/************************************/
}

74
app/Constants/v3/OrderState.php

@ -0,0 +1,74 @@
<?php
namespace App\Constants\v3;
use Hyperf\Constants\AbstractConstants;
class OrderState extends AbstractConstants
{
/**
* @Message("待付款")
*/
const UNPAID = 1;
/**
* @Message("待接单")
*/
const PAID = 2;
/**
* @Message("待送达")
*/
const DELIVERY = 3;
/**
* @Message("已完成")
*/
const COMPLETED = 4;
/**
* @Message("已评价")
*/
const EVALUATED = 5;
/**
* @Message("已取消")
*/
const CANCELED = 6;
/**
* @Message("已拒单")
*/
const REJECTION = 7;
/**
* @Message("退款中")
*/
const REFUNDING = 8;
/**
* @Message("已退款")
*/
const REFUNDED = 9;
/**
* @Message("拒绝退款")
*/
const REFUND_REFUSE = 10;
/**
* @Message("订单完成")
*/
const FINISH = [self::COMPLETED, self::EVALUATED, self::REFUND_REFUSE];
/**
* @Message("已删除")
*/
const DELETED = 1;
/**
* @Message("未删除")
*/
const NOT_DELETED = 2;
}

20
app/Constants/v3/OrderType.php

@ -0,0 +1,20 @@
<?php
namespace App\Constants\v3;
use Hyperf\Constants\AbstractConstants;
class OrderType extends AbstractConstants
{
/**
* 外卖订单(线上订单)
* @Message("线上订单")
*/
const ONLINE = 1;
/**
* 当面付订单(线下订单)
* @Message("线下订单")
*/
const OFFLINE = 4;
}

18
app/Constants/v3/Payment.php

@ -0,0 +1,18 @@
<?php
namespace App\Constants\v3;
use Hyperf\Constants\AbstractConstants;
class Payment extends AbstractConstants
{
/**
* @Message("微信支付")
*/
const WECHAT = 1;
/**
* @Message("余额支付")
*/
const BALANCE = 2;
}

10
app/Controller/v3/ExampleController.php

@ -0,0 +1,10 @@
<?php
namespace App\Controller\v3;
use App\Controller\BaseController;
class ExampleController extends BaseController
{
}

10
app/Model/v3/Example.php

@ -0,0 +1,10 @@
<?php
namespace App\Model\v3;
use App\Model\Model;
class Example extends Model
{
}

10
app/Request/v3/ExampleRequest.php

@ -0,0 +1,10 @@
<?php
namespace App\Request\v3;
use App\Request\BaseFormRequest;
class ExampleRequest extends BaseFormRequest
{
}

10
app/Service/v3/Implementations/ExampleService.php

@ -0,0 +1,10 @@
<?php
namespace App\Service\v3\Implementations;
use App\Service\v3\Interfaces\ExampleServiceInterface;
class ExampleService implements ExampleServiceInterface
{
}

8
app/Service/v3/Interfaces/ExampleServiceInterface.php

@ -0,0 +1,8 @@
<?php
namespace App\Service\v3\Interfaces;
interface ExampleServiceInterface
{
}
Loading…
Cancel
Save