package com.gqy.web.controller.document; import com.gqy.common.core.controller.BaseController; import com.gqy.common.core.domain.AjaxResult; import com.gqy.common.core.page.TableDataInfo; import com.gqy.common.enums.BusinessType; import com.gqy.document.domain.DcSpec; import com.gqy.document.service.IDcSpecService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 产品规格Controller */ @RestController @RequestMapping("/spec") public class DcSpecController extends BaseController { @Autowired private IDcSpecService iDcSpecService; /** * 查询产品规格列表 */ @GetMapping("/list") public TableDataInfo list(@RequestParam Map maps) { startPage(); List> list = iDcSpecService.selectDcPsParamAndSpec(maps); return getDataTable(list); } /** * 获取产品规格详细信息 */ @GetMapping(value = "/{psId}") public AjaxResult getInfo(@PathVariable("psId") Integer psId) { return success(iDcSpecService.selectDcSpecById(psId)); } /** * 新增产品规格 */ @PostMapping(value = "/add") public AjaxResult add(@RequestBody Map dcSpec) { return toAjax(iDcSpecService.insertDcSpecParam(dcSpec)); } /** * 修改产品规格 */ @PostMapping("/update") public AjaxResult update(@RequestBody Map maps) { return toAjax(iDcSpecService.updateDcSpecMaps(maps)); } @GetMapping(value = "/delete/{psId}") public AjaxResult del(@PathVariable("psId") Integer psId) { return success(iDcSpecService.deleteDcPsParam(psId)); } /** * 查询产品规格为全部 * @return */ @GetMapping(value = "/getDcSpecList") public List> getDcSpecList(){ Map maps = new HashMap(); maps.put("ps_category","全部"); maps.put("ps_p_id",0); List> list = iDcSpecService.selectDcPsParamAndSpec(maps); return list; } }