package com.ruoyi.collaborativeApproval.controller;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO;
|
import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal;
|
import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
import io.swagger.v3.oas.annotations.Operation;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
@RestController
|
@RequestMapping("/staffContactsPersonal")
|
@AllArgsConstructor
|
public class StaffContactsPersonalController {
|
private StaffContactsPersonalService staffContactsPersonalService;
|
|
@GetMapping("/getList")
|
@Operation(summary = "分页查询")
|
public AjaxResult listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) {
|
return AjaxResult.success(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO));
|
}
|
|
@PostMapping("/add")
|
@Operation(summary = "新增")
|
public AjaxResult add(@RequestBody StaffContactsPersonal staffContactsPersonal) {
|
return AjaxResult.success(staffContactsPersonalService.save(staffContactsPersonal));
|
}
|
|
@DeleteMapping("/delete/{id}")
|
@Operation(summary = "删除")
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
// if (CollectionUtils.isEmpty(id)) {
|
// throw new RuntimeException("请传入要删除的ID");
|
// }
|
return AjaxResult.success(staffContactsPersonalService.removeById(id));
|
}
|
}
|