You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.2 KiB

package cn.com.v2.controller;
import cn.com.v2.common.base.BaseController;
import cn.com.v2.common.domain.AjaxResult;
import cn.com.v2.model.HistoricalReply;
import cn.com.v2.service.HistoricalReplyService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* (THistoricalReply)表控制层
*
* @author wu
* @since 2025-04-18 09:34:27
*/
@RestController
@RequestMapping("/api/goview/tHistoricalReply")
@Transactional(rollbackFor = Exception.class)
public class HistoricalReplyController extends BaseController {
/**
* 服务对象
*/
@Resource
private HistoricalReplyService historicalReplyService;
/**
* 分页条件查询所有数据
*
* @param page 分页条件
* @param historicalReply 查询条件
* @return 所有数据
*/
@GetMapping
@ApiOperation(value = "分页条件查询", response = HistoricalReply.class)
public AjaxResult page(Page<HistoricalReply> page, HistoricalReply historicalReply) {
return successData(200, historicalReplyService.page(page, new QueryWrapper<>(historicalReply)));
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条", response = HistoricalReply.class)
public AjaxResult getById(@PathVariable Serializable id) {
return successData(200, historicalReplyService.getById(id));
}
/**
* 新增数据
*
* @param historicalReply 实体对象
* @return 新增结果
*/
@PostMapping
@ApiOperation(value = "新增", response = HistoricalReply.class)
public AjaxResult insert(@RequestBody HistoricalReply historicalReply) {
return successData(200, historicalReplyService.save(historicalReply));
}
/**
* 修改数据
*
* @param historicalReply 实体对象
* @return 修改结果
*/
@PutMapping
@ApiOperation(value = "修改")
public AjaxResult update(@RequestBody HistoricalReply historicalReply) {
return successData(200, historicalReplyService.updateById(historicalReply));
}
/**commonProblem
* 删除数据
*
* @param id 主键集合
* @return 删除结果
*/
@DeleteMapping("{id}")
@ApiOperation(value = "删除")
public AjaxResult delete(@PathVariable Serializable id) {
return successData(200, historicalReplyService.removeById(id));
}
}