<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Api\Controller; use Illuminate\Routing\Controller; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Response; use Module\Member\Auth\MemberUser; use Module\Member\Support\MemberLoginCheck; use Module\Member\Util\MemberFavoriteUtil; class MemberFavoriteController extends Controller implements MemberLoginCheck { public function favorite() { goto tLMQx; XaH9z: return Response::generateSuccess(); goto B9LrO; gFt8E: MemberFavoriteUtil::add(MemberUser::id(), $WDJxG, $tKN9l); goto kpOpN; b2jz5: BizException::throwsIfEmpty('category为空', $WDJxG); goto XWScX; obZWh: $tKN9l = $WZ8dY->getTrimString('categoryId'); goto b2jz5; hfjj3: if (MemberFavoriteUtil::exists(MemberUser::id(), $WDJxG, $tKN9l)) { return Response::generateError('已经收藏'); } goto gFt8E; PJySQ: $WDJxG = $WZ8dY->getTrimString('category'); goto obZWh; XWScX: BizException::throwsIfEmpty('categoryId为空', $tKN9l); goto hfjj3; tLMQx: $WZ8dY = InputPackage::buildFromInput(); goto PJySQ; kpOpN: if ($C30Ed = $WZ8dY->getTrimString('redirect')) { return Response::generate(0, null, null, $C30Ed); } goto XaH9z; B9LrO: } public function unfavorite() { goto VXkiK; JuKZr: $tKN9l = $WZ8dY->getTrimString('categoryId'); goto Vn5lP; NeyTh: BizException::throwsIfEmpty('categoryId为空', $tKN9l); goto L6KvA; VXkiK: $WZ8dY = InputPackage::buildFromInput(); goto i6GRr; W4asN: MemberFavoriteUtil::delete(MemberUser::id(), $WDJxG, $tKN9l); goto lhl4o; lhl4o: if ($C30Ed = $WZ8dY->getTrimString('redirect')) { return Response::generate(0, null, null, $C30Ed); } goto nXlH1; i6GRr: $WDJxG = $WZ8dY->getTrimString('category'); goto JuKZr; nXlH1: return Response::generateSuccess(); goto dmSO2; L6KvA: if (!MemberFavoriteUtil::exists(MemberUser::id(), $WDJxG, $tKN9l)) { return Response::generateError('未收藏'); } goto W4asN; Vn5lP: BizException::throwsIfEmpty('category为空', $WDJxG); goto NeyTh; dmSO2: } }