package com.takai.web.controller.system; import com.takai.common.annotation.Log; import com.takai.common.core.controller.BaseController; import com.takai.common.core.domain.AjaxResult; import com.takai.common.core.page.TableDataInfo; import com.takai.common.enums.BusinessType; import com.takai.common.utils.poi.ExcelUtil; import com.takai.system.domain.SysProjectStaff; import com.takai.system.service.ISysProjectStaffService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 【请填写功能名称】Controller * * @author takai * @date 2025-05-28 */ @RestController @RequestMapping("/system/staff") public class SysProjectStaffController extends BaseController { @Autowired private ISysProjectStaffService sysProjectStaffService; /** * 查询【请填写功能名称】列表 */ @PreAuthorize("@ss.hasPermi('system:staff:list')") @GetMapping("/list") public TableDataInfo list(SysProjectStaff sysProjectStaff) { startPage(); List list = sysProjectStaffService.selectSysProjectStaffList(sysProjectStaff); return getDataTable(list); } /** * 导出【请填写功能名称】列表 */ @PreAuthorize("@ss.hasPermi('system:staff:export')") @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysProjectStaff sysProjectStaff) { List list = sysProjectStaffService.selectSysProjectStaffList(sysProjectStaff); ExcelUtil util = new ExcelUtil(SysProjectStaff.class); util.exportExcel(response, list, "【请填写功能名称】数据"); } /** * 获取【请填写功能名称】详细信息 */ @PreAuthorize("@ss.hasPermi('system:staff:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(sysProjectStaffService.selectSysProjectStaffById(id)); } /** * 新增【请填写功能名称】 */ @PreAuthorize("@ss.hasPermi('system:staff:add')") @Log(title = "【添加项目成员】", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysProjectStaff sysProjectStaff) { return toAjax(sysProjectStaffService.insertSysProjectStaff(sysProjectStaff)); } /** * 修改【请填写功能名称】 */ @PreAuthorize("@ss.hasPermi('system:staff:edit')") @Log(title = "【修改项目成员】", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysProjectStaff sysProjectStaff) { return toAjax(sysProjectStaffService.updateSysProjectStaff(sysProjectStaff)); } /** * 删除【请填写功能名称】 */ @PreAuthorize("@ss.hasPermi('system:staff:remove')") @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(sysProjectStaffService.deleteSysProjectStaffByIds(ids)); } }