package com.ruoyi.web.app;

import com.ruoyi.bst.article.domain.ArticleQuery;
import com.ruoyi.bst.article.service.ArticleService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/app/article")
public class AppArticleController extends BaseController {


    @Autowired
    private ArticleService articleService;

    @ApiOperation("租/用车指南")
    @GetMapping("/guide")
    @Anonymous
    public AjaxResult getGuide(ArticleQuery articleQuery) {
        startPage();
        if (articleQuery.getCode() == null){
            return AjaxResult.error("指南类型不能为空");
        }
        return AjaxResult.success(articleService.selectArticleByCode(articleQuery.getCode()));
    }

}
