123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package com.jiayue.biz.controller;
- import com.jiayue.biz.domain.PvModuleModel;
- import com.jiayue.biz.service.PvModuleModelService;
- import com.jiayue.common.annotation.Log;
- import com.jiayue.common.core.controller.BaseController;
- import com.jiayue.common.core.domain.AjaxResult;
- import com.jiayue.common.core.page.TableDataInfo;
- import com.jiayue.common.enums.BusinessType;
- import lombok.RequiredArgsConstructor;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * 光伏组件信息Controller
- *
- * @author L.ym
- * @date 2022-05-11
- */
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/dataQuery/pvModuleModel")
- public class PvModuleModelController extends BaseController {
- private final PvModuleModelService pvModuleModelService;
- /**
- * 查询光伏组件信息列表
- */
- @GetMapping("/list")
- public TableDataInfo list() {
- List<PvModuleModel> pvModuleModels = pvModuleModelService.list();
- return getDataTable(pvModuleModels);
- }
- /**
- * 新增光伏组件信息
- */
- @Log(title = "光伏组件信息", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody PvModuleModel pvModuleModel) {
- return toAjax(pvModuleModelService.save(pvModuleModel) ? 1 : 0);
- }
- /**
- * 修改光伏组件信息
- */
- @Log(title = "光伏组件信息", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody PvModuleModel pvModuleModel) {
- return toAjax(pvModuleModelService.updateById(pvModuleModel) ? 1 : 0);
- }
- /**
- * 删除光伏组件信息
- */
- @Log(title = "光伏组件信息", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable String ids) {
- return toAjax(pvModuleModelService.removeById(ids) ? 1 : 0);
- }
- }
|