gongchunyi
5 天以前 e7a970151c40925eefa1fe837ac06e93594fcf82
src/main/java/com/ruoyi/collaborativeApproval/controller/StaffContactsPersonalController.java
@@ -4,8 +4,9 @@
import com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO;
import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal;
import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
@@ -13,27 +14,29 @@
@RestController
@RequestMapping("/staffContactsPersonal")
@AllArgsConstructor
public class StaffContactsPersonalController extends BaseController {
public class StaffContactsPersonalController {
    private StaffContactsPersonalService staffContactsPersonalService;
    @GetMapping("/getList")
    @Operation(summary = "分页查询")
    public R<?> listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) {
        return R.ok(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO));
    public AjaxResult listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) {
        return AjaxResult.success(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO));
    }
    @Log(title = "新增员工通讯录", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @Operation(summary = "新增")
    public R<?> add(@RequestBody StaffContactsPersonal staffContactsPersonal) {
        return R.ok(staffContactsPersonalService.save(staffContactsPersonal));
    public AjaxResult add(@RequestBody StaffContactsPersonal staffContactsPersonal) {
        return AjaxResult.success(staffContactsPersonalService.save(staffContactsPersonal));
    }
    @Log(title = "删除员工通讯录", businessType = BusinessType.DELETE)
    @DeleteMapping("/delete/{id}")
    @Operation(summary = "删除")
    public R<?> delete(@PathVariable("id") Long id) {
    public AjaxResult delete(@PathVariable("id") Long id) {
//        if (CollectionUtils.isEmpty(id)) {
//            throw new RuntimeException("请传入要删除的ID");
//        }
        return R.ok(staffContactsPersonalService.removeById(id));
        return AjaxResult.success(staffContactsPersonalService.removeById(id));
    }
}