Example #1
0
$app->group('/ProductComment', function () use($app) {
    #
    # 新增商品论评
    #
    # POST	https://<endpoint>/ProductComment/
    #
    # Request Body
    # {
    #  "ProductId":"商品ID",
    #  "Comment":"评论内容",
    #  "ConsumerId":"评论用户"
    # }
    #
    $app->post('/', function () use($app) {
        $productComment = new ProductComment($app);
        echo $productComment->post();
    });
    #
    # 查询商品评论—总数
    #
    # GET	https://<endpoint>/ProductComment/Count/[ProductId]
    #
    $app->get('/Count/:ProductId', function ($ProductId) use($app) {
        $productComment = new ProductComment($app);
        echo $productComment->getCount($ProductId);
    });
    #
    # 查询商品评论列表
    #
    # GET	https://<endpoint>/ProductComment/List/[ProductId]/?offset=0&limit=15
    #