城市查询列表
轮播图 首页图标
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\server\CityService;
|
||||
|
||||
class City extends ApiBase
|
||||
{
|
||||
public $like_not_need_login = ['index'];
|
||||
|
||||
// 类型属性声明
|
||||
protected CityService $cityService;
|
||||
|
||||
/**
|
||||
* 构造函数 - 必须初始化类型属性
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// 初始化服务
|
||||
$this->cityService = new CityService();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$array = $this->cityService->list();
|
||||
return $this->_success($array);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user