Browse Source
Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix
master
Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix
master
17 changed files with 274 additions and 6 deletions
-
6app/Constants/v3/ErrorCode.php
-
3app/Controller/v3/GoodsController.php
-
39app/Controller/v3/HomeController.php
-
14app/Controller/v3/OrderListController.php
-
25app/Controller/v3/StoreLoginController.php
-
15app/Model/v3/Order.php
-
5app/Model/v3/OrderMain.php
-
4app/Service/v3/Implementations/GoodsService.php
-
72app/Service/v3/Implementations/OrderListService.php
-
30app/Service/v3/Implementations/StoreInfoService.php
-
29app/Service/v3/Implementations/StoreLoginService.php
-
2app/Service/v3/Interfaces/GoodsServiceInterface.php
-
2app/Service/v3/Interfaces/OrderListServiceInterface.php
-
16app/Service/v3/Interfaces/StoreInfoServiceInterface.php
-
12app/Service/v3/Interfaces/StoreLoginServiceInterface.php
-
2config/autoload/dependencies.php
-
4config/routes.php
@ -0,0 +1,25 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Controller\v3; |
||||
|
|
||||
|
|
||||
|
use App\Controller\BaseController; |
||||
|
use App\Service\v3\Interfaces\StoreLoginServiceInterface; |
||||
|
use Hyperf\Di\Annotation\Inject; |
||||
|
|
||||
|
|
||||
|
class StoreLoginController extends BaseController |
||||
|
{ |
||||
|
/** |
||||
|
* @Inject |
||||
|
* @var StoreLoginServiceInterface |
||||
|
*/ |
||||
|
protected $storeLoginServicce; |
||||
|
public function login() |
||||
|
{ |
||||
|
$params = $this->request->all(); |
||||
|
$res = $this->storeLoginServicce->do($params['account'],$params['password']); |
||||
|
return $this->success($res); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Service\v3\Implementations; |
||||
|
|
||||
|
use App\Service\v3\Interfaces\StoreInfoServiceInterface; |
||||
|
use App\Model\v3\Store; |
||||
|
class StoreInfoService implements StoreInfoServiceInterface |
||||
|
{ |
||||
|
|
||||
|
public function do() |
||||
|
{ |
||||
|
// TODO: Implement do() method.
|
||||
|
} |
||||
|
|
||||
|
public function check() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public function undo() |
||||
|
{ |
||||
|
// TODO: Implement undo() method.
|
||||
|
} |
||||
|
|
||||
|
public function detail() |
||||
|
{ |
||||
|
return Store::query()->where('id',1)->first()->toArray(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Service\v3\Implementations; |
||||
|
use App\Constants\v3\ErrorCode; |
||||
|
use App\Exception\ErrorCodeException; |
||||
|
use App\Service\v3\Interfaces\StoreLoginServiceInterface; |
||||
|
|
||||
|
class StoreLoginService implements StoreLoginServiceInterface |
||||
|
{ |
||||
|
public function do($account,$password) |
||||
|
{ |
||||
|
if($account == $password){ |
||||
|
return true; |
||||
|
}else{ |
||||
|
throw new ErrorCodeException(ErrorCode::STORE_LOGIN_ERROR); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public function check() |
||||
|
{ |
||||
|
// TODO: Implement check() method.
|
||||
|
} |
||||
|
|
||||
|
public function undo() |
||||
|
{ |
||||
|
// TODO: Implement undo() method.
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Service\v3\Interfaces; |
||||
|
|
||||
|
|
||||
|
interface StoreInfoServiceInterface |
||||
|
{ |
||||
|
public function do(); |
||||
|
|
||||
|
public function check(); |
||||
|
|
||||
|
public function undo(); |
||||
|
|
||||
|
public function detail(); |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Service\v3\Interfaces; |
||||
|
|
||||
|
|
||||
|
interface StoreLoginServiceInterface |
||||
|
{ |
||||
|
public function do($account,$password); |
||||
|
public function check(); |
||||
|
public function undo(); |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue