package com.kym.miniapp.controller;

import com.kym.common.R;
import com.kym.common.annotation.SysLog;
import com.kym.common.controller.IController;
import com.kym.entity.queryParams.FaqQueryParam;
import com.kym.service.FaqService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 常见问题 前端控制器
 * </p>
 *
 * @since 2024-11-12
 */
@RestController
@RequestMapping("/faq")
public class FaqController extends IController {

    @Resource
    private FaqService faqService;

    /**
     * 纠错反馈查询接口
     *
     * @return Res
     */
    @PostMapping("list")
    @SysLog(value = "纠错反馈列表查询接口")
    public R<?> list(@RequestBody FaqQueryParam query) {
        return resp(() -> faqService.list(query));
    }


    /**
     * 纠错反馈查询详情接口
     *
     * @return Res
     */
    @GetMapping("detail/{id}")
    @SysLog(value = "纠错反馈详情查询接口")
    public R<?> detail(@PathVariable long id) {
        return resp(() -> faqService.detail(id));
    }

}
