package com.panzhihua.service_community.api; import com.panzhihua.common.model.dtos.common.*; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.service.ComMngVolunteerSkillService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * 志愿者技能表(ComMngVolunteerSkill)表控制层 * * @author lyq * @since 2021-10-30 16:47:36 */ @RestController @RequestMapping("comMngVolunteerSkill") public class ComMngVolunteerSkillApi { /** * 服务对象 */ @Resource private ComMngVolunteerSkillService comMngVolunteerSkillService; /** * 分页查询 * * @param comMngVolunteerSkill 筛选条件 * @return 查询结果 */ @PostMapping("/page") public R queryByPage(@RequestBody PageComMngVolunteerSkillDto comMngVolunteerSkill) { return this.comMngVolunteerSkillService.queryByPage(comMngVolunteerSkill); } /** * 通过主键查询单条数据 * * @param id 主键 * @return 单条数据 */ @GetMapping("{id}") public R queryById(@PathVariable("id") Long id) { return this.comMngVolunteerSkillService.queryById(id); } /** * 新增数据 * * @param comMngVolunteerSkill 实体 * @return 新增结果 */ @PostMapping("/add") public R add(@RequestBody AddComMngVolunteerSkillDto comMngVolunteerSkill) { return this.comMngVolunteerSkillService.insert(comMngVolunteerSkill); } /** * 编辑数据 * * @param comMngVolunteerSkill 实体 * @return 编辑结果 */ @PutMapping("/edit") public R edit(@RequestBody EditComMngVolunteerSkillDto comMngVolunteerSkill) { return this.comMngVolunteerSkillService.update(comMngVolunteerSkill); } /** * 删除数据 * * @param id 主键 * @return 删除是否成功 */ @GetMapping("/delete") public R deleteById(Long id) { return this.comMngVolunteerSkillService.deleteById(id); } /** * 社区后台-查询志愿者技能列表 * @param comMngVolunteerSkill 请求参数 * @return 志愿者技能列表 */ @PostMapping("/list") public R queryByList(@RequestBody PageComMngVolunteerSkillDto comMngVolunteerSkill) { return this.comMngVolunteerSkillService.queryByList(comMngVolunteerSkill); } }