package cn.gistack.sm.materials.controller;
|
|
import cn.gistack.sm.materials.entity.RescueTeamManage;
|
import cn.gistack.sm.materials.service.IRescueTeamManageService;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.utils.Func;
|
import org.springframework.web.bind.annotation.*;
|
import springfox.documentation.annotations.ApiIgnore;
|
|
import java.util.Map;
|
|
/**
|
* @PROJECT_NAME: skjcmanager
|
* @DESCRIPTION: 抢险队伍管理controller
|
* @USER: aix
|
* @DATE: 2023/5/30 15:13
|
*/
|
@Slf4j
|
@Api(tags="抢险队伍管理")
|
@RestController
|
@RequestMapping("/materials/rescueTeam")
|
@AllArgsConstructor
|
public class RescueTeamManageController {
|
|
private IRescueTeamManageService rescueTeamManageService;
|
|
/**
|
* 详情
|
*/
|
@GetMapping("/detail")
|
@ApiOperation(value = "详情", notes = "传入materialsManage")
|
public R<RescueTeamManage> detail(RescueTeamManage rescueTeamManage) {
|
RescueTeamManage detail = rescueTeamManageService.getOne(Condition.getQueryWrapper(rescueTeamManage));
|
return R.data(detail);
|
}
|
|
/**
|
* 分页列表查询
|
*
|
* @param rescueTeamManage
|
* @return
|
*/
|
@ApiOperation(value = "分页列表查询", notes = "分页列表查询")
|
@GetMapping(value = "/page")
|
public R queryPageList(@ApiIgnore @RequestParam Map<String, Object> rescueTeamManage, Query query) {
|
IPage<RescueTeamManage> pageList = rescueTeamManageService.page(Condition.getPage(query), Condition.getQueryWrapper(rescueTeamManage,RescueTeamManage.class));
|
return R.data(pageList);
|
}
|
|
/**
|
* 添加
|
* @param rescueTeamManage
|
* @return
|
*/
|
@ApiOperation(value = "添加", notes = "添加")
|
@PostMapping(value = "/add")
|
public R add(@RequestBody RescueTeamManage rescueTeamManage) {
|
return R.data(rescueTeamManageService.save(rescueTeamManage));
|
}
|
|
/**
|
* 编辑
|
*
|
* @param rescueTeamManage
|
* @return
|
*/
|
@ApiOperation(value = "编辑", notes = "编辑")
|
@PostMapping(value = "/edit")
|
public R edit(@RequestBody RescueTeamManage rescueTeamManage) {
|
return R.data(rescueTeamManageService.updateById(rescueTeamManage));
|
}
|
|
/**
|
* 通过id删除
|
*
|
* @param ids id集合
|
* @return
|
*/
|
@PostMapping(value = "/delete")
|
@ApiOperation(value = "删除", notes = "传入ids")
|
public R<?> delete(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
return R.data(rescueTeamManageService.removeByIds(Func.toLongList(ids)));
|
}
|
|
}
|