Example #1
0
 # 查询消费者商品收藏列表
 #
 # 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]
 #
 #
 $app->post('/Consumer/:ConsumerId/Producer/:ProducerId', function ($ConsumerId, $ProducerId) use($app) {
     $favorite = new Favorite($app);
     echo $favorite->post_ConsumerId_ProducerId($ConsumerId, $ProducerId);
 });
 #
 # 查询消费者对农场主的收藏列表
 #
 # GET https://<endpoint>/Favorite/Consumer/[ConsumerId]/Producer/