| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace App\Http\Controllers\Api\v1;
- use App\Http\Controllers\Api\BaseController;
- use App\Http\Validator\ActivityValidator;
- use App\Services\ActivityBooksService;
- use App\Services\ActivityService;
- use App\Services\GoodsCatesService;
- use App\Services\GoodsService;
- use Illuminate\Http\Request;
- /**
- * 商城商品控制器类
- * @author wesmiler
- * @since 2020/11/10
- * Class GoodsController
- * @package App\Http\Controllers
- */
- class GoodsController extends BaseController
- {
- /**
- * 构造函数
- * @author wesmiler
- * @since 2020/11/11
- * GoodsController constructor.
- */
- public function __construct()
- {
- parent::__construct();
- $this->service = new GoodsService();
- $this->cateService = new GoodsCatesService();
- }
- /**
- * 列表
- * @return array
- */
- public function index(){
- return $this->service->getDataList();
- }
- /**
- * 详情
- * @return array|mixed
- */
- public function info(){
- $id = request()->get('id', 0);
- return $this->service->getDetail($id);
- }
- /**
- * 获取分类
- * @return mixed
- */
- public function cates(){
- return $this->cateService->getOptions();
- }
- }
|