<?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 uKNnI; mXtl1: return Response::generateSuccess(); goto S3ke9; uKNnI: $tBuXm = InputPackage::buildFromInput(); goto SpN1i; UeYOX: BizException::throwsIfEmpty('categoryId为空', $QgB_Y); goto sA5xt; YsLSA: $QgB_Y = $tBuXm->getTrimString('categoryId'); goto fqdjJ; SpN1i: $zmsn6 = $tBuXm->getTrimString('category'); goto YsLSA; fqdjJ: BizException::throwsIfEmpty('category为空', $zmsn6); goto UeYOX; InFDK: if ($yTnoO = $tBuXm->getTrimString('redirect')) { return Response::generate(0, null, null, $yTnoO); } goto mXtl1; spp8K: MemberFavoriteUtil::add(MemberUser::id(), $zmsn6, $QgB_Y); goto InFDK; sA5xt: if (MemberFavoriteUtil::exists(MemberUser::id(), $zmsn6, $QgB_Y)) { return Response::generateError('已经收藏'); } goto spp8K; S3ke9: } public function unfavorite() { goto KtuoZ; m2jQV: return Response::generateSuccess(); goto XfdOL; HPyrp: if (!MemberFavoriteUtil::exists(MemberUser::id(), $zmsn6, $QgB_Y)) { return Response::generateError('未收藏'); } goto Fi863; Fi863: MemberFavoriteUtil::delete(MemberUser::id(), $zmsn6, $QgB_Y); goto rS_o0; rS_o0: if ($yTnoO = $tBuXm->getTrimString('redirect')) { return Response::generate(0, null, null, $yTnoO); } goto m2jQV; FDGV0: BizException::throwsIfEmpty('category为空', $zmsn6); goto CCtph; KtuoZ: $tBuXm = InputPackage::buildFromInput(); goto EeVwr; CCtph: BizException::throwsIfEmpty('categoryId为空', $QgB_Y); goto HPyrp; Tj8Sx: $QgB_Y = $tBuXm->getTrimString('categoryId'); goto FDGV0; EeVwr: $zmsn6 = $tBuXm->getTrimString('category'); goto Tj8Sx; XfdOL: } }