<?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 SN59I; FzqBL: $midJh = $Nw6ws->getTrimString('category'); goto jPkMi; Fd2Ur: BizException::throwsIfEmpty('category为空', $midJh); goto i9iaF; jPkMi: $Rfywh = $Nw6ws->getTrimString('categoryId'); goto Fd2Ur; nkaXb: return Response::generateSuccess(); goto WffbA; o93bl: MemberFavoriteUtil::add(MemberUser::id(), $midJh, $Rfywh); goto HtCcj; djm3a: if (MemberFavoriteUtil::exists(MemberUser::id(), $midJh, $Rfywh)) { return Response::generateError('已经收藏'); } goto o93bl; HtCcj: if ($j1j5n = $Nw6ws->getTrimString('redirect')) { return Response::generate(0, null, null, $j1j5n); } goto nkaXb; SN59I: $Nw6ws = InputPackage::buildFromInput(); goto FzqBL; i9iaF: BizException::throwsIfEmpty('categoryId为空', $Rfywh); goto djm3a; WffbA: } public function unfavorite() { goto IXiou; n4gCo: $Rfywh = $Nw6ws->getTrimString('categoryId'); goto pPXL0; gPPio: return Response::generateSuccess(); goto pRTRP; c2u_3: if (!MemberFavoriteUtil::exists(MemberUser::id(), $midJh, $Rfywh)) { return Response::generateError('未收藏'); } goto aBBOs; pPXL0: BizException::throwsIfEmpty('category为空', $midJh); goto lNhkM; Faf5B: $midJh = $Nw6ws->getTrimString('category'); goto n4gCo; aBBOs: MemberFavoriteUtil::delete(MemberUser::id(), $midJh, $Rfywh); goto Q67k4; Q67k4: if ($j1j5n = $Nw6ws->getTrimString('redirect')) { return Response::generate(0, null, null, $j1j5n); } goto gPPio; lNhkM: BizException::throwsIfEmpty('categoryId为空', $Rfywh); goto c2u_3; IXiou: $Nw6ws = InputPackage::buildFromInput(); goto Faf5B; pRTRP: } }