You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
950 B
35 lines
950 B
<?php
|
|
|
|
|
|
|
|
$attributes = [
|
|
'prefix' => 'v1',
|
|
'namespace' => 'Api\V1'
|
|
];
|
|
Route::group($attributes, function () {
|
|
|
|
// 这里的接口都必须登录
|
|
Route::group(['middleware' => ['auth.api.refresh', 'auth.login.score']], function () {
|
|
|
|
|
|
// 获取分类
|
|
// 分类下的所有商品
|
|
Route::get('categories', 'CategoryController@index');
|
|
Route::get('categories/{category}/products', 'CategoryController@getProducts');
|
|
// 获取商品详情
|
|
Route::get('products/{uuid}', 'ProductController@show');
|
|
|
|
// 个人基本信息
|
|
Route::get('own/me', 'OwnController@me');
|
|
// 个人基本记录
|
|
Route::get('own/score_logs', 'OwnController@scoreLogs');
|
|
|
|
Route::delete('tokens', 'AuthController@logout');
|
|
});
|
|
|
|
// 登录接口
|
|
Route::post('tokens', 'AuthController@login');
|
|
// 注册的接口
|
|
Route::post('users', 'AuthController@register');
|
|
});
|