TXinyiAgentAssistantController.java 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.slibra.web.controller.business;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import org.springframework.security.access.prepost.PreAuthorize;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.PutMapping;
  9. import org.springframework.web.bind.annotation.DeleteMapping;
  10. import org.springframework.web.bind.annotation.PathVariable;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import com.slibra.common.annotation.Log;
  15. import com.slibra.common.core.controller.BaseController;
  16. import com.slibra.common.core.domain.AjaxResult;
  17. import com.slibra.common.enums.BusinessType;
  18. import com.slibra.business.domain.TXinyiAgentAssistant;
  19. import com.slibra.business.service.ITXinyiAgentAssistantService;
  20. import com.slibra.common.utils.poi.ExcelUtil;
  21. import com.slibra.common.core.page.TableDataInfo;
  22. /**
  23. * 信义智能体助手配置Controller
  24. *
  25. * @author slibra
  26. * @date 2024-05-17
  27. */
  28. @RestController
  29. @RequestMapping("/business/assistant")
  30. public class TXinyiAgentAssistantController extends BaseController
  31. {
  32. @Autowired
  33. private ITXinyiAgentAssistantService tXinyiAgentAssistantService;
  34. /**
  35. * 查询信义智能体助手配置列表
  36. */
  37. @PreAuthorize("@ss.hasPermi('business:assistant:list')")
  38. @GetMapping("/list")
  39. public TableDataInfo list(TXinyiAgentAssistant tXinyiAgentAssistant)
  40. {
  41. startPage();
  42. List<TXinyiAgentAssistant> list = tXinyiAgentAssistantService.selectTXinyiAgentAssistantList(tXinyiAgentAssistant);
  43. return getDataTable(list);
  44. }
  45. /**
  46. * 导出信义智能体助手配置列表
  47. */
  48. @PreAuthorize("@ss.hasPermi('business:assistant:export')")
  49. @Log(title = "信义智能体助手配置", businessType = BusinessType.EXPORT)
  50. @PostMapping("/export")
  51. public void export(HttpServletResponse response, TXinyiAgentAssistant tXinyiAgentAssistant)
  52. {
  53. List<TXinyiAgentAssistant> list = tXinyiAgentAssistantService.selectTXinyiAgentAssistantList(tXinyiAgentAssistant);
  54. ExcelUtil<TXinyiAgentAssistant> util = new ExcelUtil<TXinyiAgentAssistant>(TXinyiAgentAssistant.class);
  55. util.exportExcel(response, list, "信义智能体助手配置数据");
  56. }
  57. /**
  58. * 获取信义智能体助手配置详细信息
  59. */
  60. @PreAuthorize("@ss.hasPermi('business:assistant:query')")
  61. @GetMapping(value = "/{id}")
  62. public AjaxResult getInfo(@PathVariable("id") Long id)
  63. {
  64. return success(tXinyiAgentAssistantService.selectTXinyiAgentAssistantById(id));
  65. }
  66. /**
  67. * 新增信义智能体助手配置
  68. */
  69. @PreAuthorize("@ss.hasPermi('business:assistant:add')")
  70. @Log(title = "信义智能体助手配置", businessType = BusinessType.INSERT)
  71. @PostMapping
  72. public AjaxResult add(@RequestBody TXinyiAgentAssistant tXinyiAgentAssistant)
  73. {
  74. tXinyiAgentAssistant.setCreateBy(getUsername());
  75. return toAjax(tXinyiAgentAssistantService.insertTXinyiAgentAssistant(tXinyiAgentAssistant));
  76. }
  77. /**
  78. * 修改信义智能体助手配置
  79. */
  80. @PreAuthorize("@ss.hasPermi('business:assistant:edit')")
  81. @Log(title = "信义智能体助手配置", businessType = BusinessType.UPDATE)
  82. @PutMapping
  83. public AjaxResult edit(@RequestBody TXinyiAgentAssistant tXinyiAgentAssistant)
  84. {
  85. tXinyiAgentAssistant.setUpdateBy(getUsername());
  86. return toAjax(tXinyiAgentAssistantService.updateTXinyiAgentAssistant(tXinyiAgentAssistant));
  87. }
  88. /**
  89. * 删除信义智能体助手配置
  90. */
  91. @PreAuthorize("@ss.hasPermi('business:assistant:remove')")
  92. @Log(title = "信义智能体助手配置", businessType = BusinessType.DELETE)
  93. @DeleteMapping("/{ids}")
  94. public AjaxResult remove(@PathVariable Long[] ids)
  95. {
  96. return toAjax(tXinyiAgentAssistantService.deleteTXinyiAgentAssistantByIds(ids));
  97. }
  98. }