package com.ltkj.web.controller.system; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.core.page.TableDataInfo; import com.ltkj.common.enums.BusinessType; import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.hosp.domain.ApiJcycpdgjz; import com.ltkj.hosp.service.ApiJcycpdgjzService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 关键字Controller * * @author ltkj_赵佳豪&李格 * @date 2025-07-03 */ @RestController @RequestMapping("/system/jcycpdgjz") public class ApiJcycpdgjzController extends BaseController { @Autowired private ApiJcycpdgjzService apiJcycpdgjzService; /** * 查询关键字列表 */ @GetMapping("/list") public TableDataInfo list(ApiJcycpdgjz apiJcycpdgjz) { startPage(); List list = apiJcycpdgjzService.selectApiJcycpdgjzList(apiJcycpdgjz); return getDataTable(list); } /** * 导出关键字列表 */ @Log(title = "关键字", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ApiJcycpdgjz apiJcycpdgjz) { List list = apiJcycpdgjzService.selectApiJcycpdgjzList(apiJcycpdgjz); ExcelUtil util = new ExcelUtil(ApiJcycpdgjz. class); util.exportExcel(response, list, "关键字数据"); } /** * 获取关键字详细信息 */ @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(apiJcycpdgjzService.selectApiJcycpdgjzById(id)); } /** * 新增关键字 */ @Log(title = "关键字", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ApiJcycpdgjz apiJcycpdgjz) { return toAjax(apiJcycpdgjzService.save(apiJcycpdgjz)); } /** * 修改关键字 */ @Log(title = "关键字", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ApiJcycpdgjz apiJcycpdgjz) { return toAjax(apiJcycpdgjzService.updateById(apiJcycpdgjz)); } /** * 删除关键字 */ @Log(title = "关键字", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(apiJcycpdgjzService.deleteApiJcycpdgjzByIds(ids)); } }