package com.xiaopeng.operation.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions;
|
import com.xiaopeng.api.model.operation.XpSystemSetting;
|
import com.xiaopeng.common.core.domain.R;
|
import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService;
|
import com.xiaopeng.operation.service.XpSystemSettingService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* <p>
|
* 常见问题 前端控制器
|
* </p>
|
*
|
* @author mitao
|
* @since 2026-02-03
|
*/
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/base/v1/mini-program")
|
@Api(tags = "常见问题")
|
public class XpFrequentlyAskedQuestionsController {
|
|
private final IXpFrequentlyAskedQuestionsService xpFrequentlyAskedQuestionsService;
|
private final XpSystemSettingService xpSystemSettingService;
|
|
public XpFrequentlyAskedQuestionsController(IXpFrequentlyAskedQuestionsService xpFrequentlyAskedQuestionsService, XpSystemSettingService xpSystemSettingService) {
|
this.xpFrequentlyAskedQuestionsService = xpFrequentlyAskedQuestionsService;
|
this.xpSystemSettingService = xpSystemSettingService;
|
}
|
|
|
@GetMapping("/frequently-asked-questions/getList")
|
@ApiOperation(value = "获取常见问题列表",tags = {"常见问题列表"},response = XpFrequentlyAskedQuestions.class)
|
public R<List<XpFrequentlyAskedQuestions>> getList() {
|
XpSystemSetting systemSetting = xpSystemSettingService.getOne(null);
|
List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(new LambdaQueryWrapper<XpFrequentlyAskedQuestions>().last("limit "+systemSetting.getHeadShowCount()));
|
return R.ok(list);
|
}
|
}
|