| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IAutomessageCommonProblemService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | private IAutomessageCommonProblemService iAutomessageCommonProblemService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页) |
| | | * 获取常见问题列表(分页) |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据指南id获取所属地区",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectList") |
| | | public ResultData selectList(){ |
| | | return ResultData.success(iAutomessageCommonProblemService.selectList()); |
| | | @ApiOperation(value = "获取常见问题列表(分页)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectConfigList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "title",required = false) String title, |
| | | @RequestParam(value = "content",required = false) String content){ |
| | | Page<AutomessageCommonProblem> pageParam = new Page<>(pageNum,pageSize); |
| | | List<AutomessageCommonProblem> list = iAutomessageCommonProblemService.selectConfigList(pageParam,pageSize,title,content); |
| | | int num=iAutomessageCommonProblemService.countAutomessageCommonProblem(title,content); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 添加常见问题数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "添加常见问题数据)",response = AutomessageCommonProblem.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | ResultData add(@RequestBody AutomessageCommonProblem automessageCommonProblem,@CurrentUser SysUser sysUser){ |
| | | automessageCommonProblem.setCreateUserId(sysUser.getUserId().toString()); |
| | | automessageCommonProblem.setUpdateUserId(sysUser.getUserId().toString()); |
| | | return iAutomessageCommonProblemService.add(automessageCommonProblem); |
| | | } |
| | | |
| | | /** |
| | | * 修改常见问题数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改常见问题数据)",response = AutomessageCommonProblem.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | ResultData update(@RequestBody AutomessageCommonProblem automessageCommonProblem,@CurrentUser SysUser sysUser){ |
| | | automessageCommonProblem.setUpdateUserId(sysUser.getUserId().toString()); |
| | | return iAutomessageCommonProblemService.update(automessageCommonProblem); |
| | | } |
| | | |
| | | /** |
| | | * 删除常见问题数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除常见问题数据)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/delete") |
| | | @Authorization |
| | | ResultData delete( @RequestParam(value = "id") Integer id){ |
| | | return iAutomessageCommonProblemService.delete(id); |
| | | } |
| | | } |