Exemplo n.º 1
0
        $productComment = new ProductComment($app);
        echo $productComment->getUserCommentList($ConsumerId);
    });
    #
    # 查询商品评论—详细信息
    #
    # GET	https://<endpoint>/ProductComment/[CommentId]
    #
    $app->get('/:CommentId', function ($CommentId) use($app) {
        $productComment = new ProductComment($app);
        echo $productComment->getCommentId($CommentId);
    });
    #
    # 删除商品评论
    #
    # DELETE	https://<endpoint>/ProductComment/[CommendId]
    #
    $app->delete('/:CommentId', function ($CommentId) use($app) {
        $productComment = new ProductComment($app);
        echo $productComment->delete($CommentId);
    });
    #
    # 查询用户商品评论—总数
    #
    # GET	https://<endpoint>/ProductComment/[ConsumerId]/Count/
    #
    $app->get('/:ConsumerId/Count/', function ($ConsumerId) use($app) {
        $productComment = new ProductComment($app);
        echo $productComment->getConsumerCommentCount($ConsumerId);
    });
});