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.
85 lines
2.8 KiB
85 lines
2.8 KiB
<?php
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| is assigned the "api" middleware group. Enjoy building your API!
|
|
|
|
|
*/
|
|
|
|
Route::middleware('auth:api')->get('/user', function (Request $request) {
|
|
return $request->user();
|
|
});
|
|
|
|
# 登录
|
|
Route::post('login', 'App\Http\Controllers\Api\LoginController@login');
|
|
|
|
Route::namespace('App\Http\Controllers\Api')
|
|
->middleware(App\Http\Middleware\AuthApi::class)
|
|
->group(function () {
|
|
# 首页
|
|
Route::post('index', 'IndexController@index');
|
|
|
|
# 频道
|
|
Route::prefix('channel')->group(function () {
|
|
Route::post('list', 'ChannelController@index'); //频道列表
|
|
// Route::post('my', 'ChannelController@my'); //我的频道列表
|
|
});
|
|
|
|
# 我的频道
|
|
Route::prefix('user_channel')->group(function () {
|
|
Route::post('update', 'UserChannelController@update'); //编辑我的频道
|
|
});
|
|
|
|
# 产品
|
|
Route::prefix('agent_product')->group(function () {
|
|
Route::post('list', 'AgentProductController@index'); //产品列表
|
|
Route::post('guess', 'AgentProductController@guessLike'); //猜你喜欢
|
|
Route::post('show', 'AgentProductController@show'); //产品详情
|
|
});
|
|
|
|
# 公告
|
|
Route::prefix('notice')->group(function () {
|
|
Route::post('list', 'NoticeController@index'); //公告列表
|
|
Route::post('show', 'NoticeController@show'); //公告详情
|
|
});
|
|
|
|
# 订单
|
|
Route::prefix('order')->group(function () {
|
|
Route::post('list', 'OrderController@index'); //订单列表
|
|
Route::post('create', 'OrderController@create'); //创建订单
|
|
Route::post('save', 'OrderController@save'); //修改订单
|
|
Route::post('price', 'OrderController@getPrice'); //获取订单价格
|
|
});
|
|
|
|
# 文章
|
|
Route::prefix('article')->group(function () {
|
|
Route::post('list', 'ArticleController@index'); //文章列表
|
|
Route::post('show', 'ArticleController@show'); //文章详情
|
|
});
|
|
|
|
# 代理商信息
|
|
Route::prefix('agent_info')->group(function () {
|
|
Route::post('about', 'AgentInfoController@about'); //关于我们
|
|
});
|
|
|
|
# 短信息
|
|
Route::prefix('message')->group(function () {
|
|
Route::post('list', 'MessageController@index'); //消息列表
|
|
Route::post('show', 'MessageController@show'); //消息列表
|
|
Route::post('read', 'MessageController@setRead'); //设置为已读
|
|
});
|
|
|
|
# 收藏
|
|
Route::prefix('fav')->group(function () {
|
|
Route::post('list', 'UserFavController@index'); //收藏列表
|
|
Route::post('create', 'UserFavController@create'); //添加收藏
|
|
});
|
|
});
|