PvModuleModelController.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.jiayue.biz.controller;
  2. import com.jiayue.biz.domain.PvModuleModel;
  3. import com.jiayue.biz.service.PvModuleModelService;
  4. import com.jiayue.common.annotation.Log;
  5. import com.jiayue.common.core.controller.BaseController;
  6. import com.jiayue.common.core.domain.AjaxResult;
  7. import com.jiayue.common.core.page.TableDataInfo;
  8. import com.jiayue.common.enums.BusinessType;
  9. import lombok.RequiredArgsConstructor;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.*;
  12. import java.util.List;
  13. /**
  14. * 光伏组件信息Controller
  15. *
  16. * @author L.ym
  17. * @date 2022-05-11
  18. */
  19. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  20. @RestController
  21. @RequestMapping("/dataQuery/pvModuleModel")
  22. public class PvModuleModelController extends BaseController {
  23. private final PvModuleModelService pvModuleModelService;
  24. /**
  25. * 查询光伏组件信息列表
  26. */
  27. @GetMapping("/list")
  28. public TableDataInfo list() {
  29. List<PvModuleModel> pvModuleModels = pvModuleModelService.list();
  30. return getDataTable(pvModuleModels);
  31. }
  32. /**
  33. * 新增光伏组件信息
  34. */
  35. @Log(title = "光伏组件信息", businessType = BusinessType.INSERT)
  36. @PostMapping
  37. public AjaxResult add(@RequestBody PvModuleModel pvModuleModel) {
  38. return toAjax(pvModuleModelService.save(pvModuleModel) ? 1 : 0);
  39. }
  40. /**
  41. * 修改光伏组件信息
  42. */
  43. @Log(title = "光伏组件信息", businessType = BusinessType.UPDATE)
  44. @PutMapping
  45. public AjaxResult edit(@RequestBody PvModuleModel pvModuleModel) {
  46. return toAjax(pvModuleModelService.updateById(pvModuleModel) ? 1 : 0);
  47. }
  48. /**
  49. * 删除光伏组件信息
  50. */
  51. @Log(title = "光伏组件信息", businessType = BusinessType.DELETE)
  52. @DeleteMapping("/{ids}")
  53. public AjaxResult remove(@PathVariable String ids) {
  54. return toAjax(pvModuleModelService.removeById(ids) ? 1 : 0);
  55. }
  56. }