package com.panzhihua.service_community.api;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import com.panzhihua.common.model.dtos.community.dpc.AddDpcDTO;
|
import com.panzhihua.common.model.dtos.community.dpc.EditDpcDTO;
|
import com.panzhihua.common.model.dtos.community.dpc.PageDpcDTO;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.service_community.service.ComActDpcService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
/**
|
* @title: ComActDpcApi
|
* @projectName: 成都呐喊信息技术有限公司-智慧社区项目
|
* @description: 人大代表
|
* @author: hans
|
* @date: 2022/06/07 10:57
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/dpc")
|
public class ComActDpcApi {
|
|
@Resource
|
private ComActDpcService comActDpcService;
|
|
/**
|
* 新增人大代表
|
* @param addDpcDTO
|
* @return
|
*/
|
@PostMapping("/add")
|
public R addDpc(@RequestBody AddDpcDTO addDpcDTO) {
|
return comActDpcService.addDpc(addDpcDTO);
|
}
|
|
/**
|
* 修改人大代表
|
* @param editDpcDTO
|
* @return
|
*/
|
@PostMapping("/edit")
|
public R editDpc(@RequestBody EditDpcDTO editDpcDTO) {
|
return comActDpcService.editDpc(editDpcDTO);
|
}
|
|
/**
|
* 删除人大代表
|
* @param id
|
* @return
|
*/
|
@DeleteMapping("/delete")
|
public R deleteDpc(@RequestParam("id") Long id) {
|
return comActDpcService.deleteDpc(id);
|
}
|
|
/**
|
* 获取人大代表详情
|
* @param id
|
* @return
|
*/
|
@GetMapping("/detail")
|
public R detailDpc(@RequestParam("id") Long id) {
|
return comActDpcService.detailDpc(id);
|
}
|
|
/**
|
* 分页查询人大代表
|
* @param pageDpcDTO
|
* @return
|
*/
|
@PostMapping("/page")
|
public R pageDpc(@RequestBody PageDpcDTO pageDpcDTO) {
|
return comActDpcService.pageDpc(pageDpcDTO);
|
}
|
}
|