10 changed files with 126 additions and 15 deletions
-
8app/Controller/v3/HomeController.php
-
22app/Controller/v3/HorsemanController.php
-
22app/Model/v3/Employees.php
-
27app/Service/v3/Implementations/HorsemanService.php
-
36app/Service/v3/Implementations/UserCenterBlockService.php
-
9app/Service/v3/Implementations/UserInfoService.php
-
13app/Service/v3/Interfaces/HorsemanServiceInterface.php
-
2app/Service/v3/Interfaces/UserInfoServiceInterface.php
-
1config/autoload/dependencies.php
-
1config/routes.php
@ -0,0 +1,22 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Controller\v3; |
||||
|
|
||||
|
use App\Controller\BaseController; |
||||
|
use App\Service\v3\Interfaces\HorsemanServiceInterface; |
||||
|
use Hyperf\Di\Annotation\Inject; |
||||
|
|
||||
|
class HorsemanController extends BaseController |
||||
|
{ |
||||
|
/** |
||||
|
* @Inject |
||||
|
* @var HorsemanServiceInterface |
||||
|
*/ |
||||
|
protected $horsemanService; |
||||
|
|
||||
|
public function getOrderList() |
||||
|
{ |
||||
|
return $this->success($this->horsemanService->getOrderList()); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Model\v3; |
||||
|
use App\Model\Model; |
||||
|
use Hyperf\Database\Model\Builder; |
||||
|
class Employees extends Model |
||||
|
{ |
||||
|
protected $table = 'lanzu_employees'; |
||||
|
|
||||
|
protected $casts = [ |
||||
|
'position' => 'array' |
||||
|
]; |
||||
|
|
||||
|
protected function boot(): void |
||||
|
{ |
||||
|
parent::boot(); |
||||
|
self::addGlobalScope('normal', function (Builder $builder) { |
||||
|
$builder->where([$this->getTable().'.status' => 1]); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Service\v3\Implementations; |
||||
|
use Hyperf\Di\Annotation\Inject; |
||||
|
use App\Service\v3\Interfaces\HorsemanServiceInterface; |
||||
|
class HorsemanService implements HorsemanServiceInterface |
||||
|
{ |
||||
|
public function do() |
||||
|
{ |
||||
|
// TODO: Implement do() method.
|
||||
|
} |
||||
|
|
||||
|
public function check() |
||||
|
{ |
||||
|
// TODO: Implement check() method.
|
||||
|
} |
||||
|
|
||||
|
public function undo() |
||||
|
{ |
||||
|
// TODO: Implement undo() method.
|
||||
|
} |
||||
|
public function getOrderList() |
||||
|
{ |
||||
|
return '接入成功'; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Service\v3\Interfaces; |
||||
|
|
||||
|
|
||||
|
interface HorsemanServiceInterface |
||||
|
{ |
||||
|
public function do(); |
||||
|
public function check(); |
||||
|
public function undo(); |
||||
|
public function getOrderList(); |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue