| | |
| | | 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.dto.XpFrequentlyAskedQuestionsDTO; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @Api(tags = "常见问题") |
| | | public class XpFrequentlyAskedQuestionsController { |
| | | |
| | | private final IXpFrequentlyAskedQuestionsService xpFrequentlyAskedQuestionsService; |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/frequently-asked-questions/getList") |
| | | @GetMapping("/base/v1/mini-program/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); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表",tags = {"管理后台-内容中心"},response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getQuestionList() { |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存常见问题") |
| | | @PostMapping("/api/v1/frequently-asked-questions/save") |
| | | public R<?> saveQuestion(@RequestBody XpFrequentlyAskedQuestionsDTO dto) { |
| | | xpFrequentlyAskedQuestionsService.saveQuestion(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除常见问题") |
| | | @DeleteMapping("/api/v1/frequently-asked-questions/delete/{id}") |
| | | public R<?> deleteQuestion(@PathVariable Long id) { |
| | | xpFrequentlyAskedQuestionsService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |