feat: 添加国家列表接口

This commit is contained in:
2025-03-14 14:07:46 +08:00
parent 02820f6b2f
commit 289d9afcc5
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller\v1;
use app\admin\model\v1\CountryModel;
/**
* 国家列表控制器
*/
class Country
{
// 获取国家列表
public function list()
{
$country = CountryModel::field([
'id',
'name',
'en_name',
])
->order(['sort' => 'asc', 'id' => 'asc'])
->select();
return success('获取成功', $country);
}
}

View File

@@ -29,6 +29,9 @@ Route::group('v1', function () {
Route::get('{id}/menu', 'User/menu');
});
// 国家模块
Route::get('country/list', 'Country/list');
// 语言模块
Route::group('language', function () {
// 语言列表