示例#1
0
文件: Favorite.php 项目: WTer/NJB
 # 消费者新增商品收藏
 #
 # POST https://<endpoint>/Favorite/Consumer/[ConsumerId]/Product/[ProductId]
 #
 $app->post('/Consumer/:ConsumerId/Product/:ProductId', function ($ConsumerId, $ProductId) use($app) {
     $favorite = new Favorite($app);
     echo $favorite->post_ConsumerId_ProductId($ConsumerId, $ProductId);
 });
 #
 # 查询消费者商品收藏列表
 #
 # GET https://<endpoint>/Favorite/Consumer/[ConsumerId]/Product/?offset=0&limit=15
 #
 $app->get('/Consumer/:ConsumerId/Product/', function ($ConsumerId) use($app) {
     $favorite = new Favorite($app);
     echo $favorite->get_ConsumerId($ConsumerId);
 });
 #
 # 消费者商品收藏总数查询
 #
 # GET https://<endpoint>/Favorite/Consumer/[ConsumerId]/Count/
 #
 $app->get('/Consumer/:ConsumerId/Count/', function ($ConsumerId) use($app) {
     $favorite = new Favorite($app);
     echo $favorite->getConsumerFavoriteCount($ConsumerId);
 });
 #
 # 消费者新增对农场主的收藏
 #
 # POST https://<endpoint>/Favorite/Consumer/[ConsumerId]/Producer/[ProducerId]
 #