package com.thhy.materials.modules.biz.pipeplanmonth.controller; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import com.thhy.materials.modules.biz.pipeplanmonth.entity.PipePlanMonth; import com.thhy.materials.modules.biz.pipeplanmonth.service.PipePlanMonthService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.List; /** * @author zhang_xiao_bo * @since 2023-04-18 09:10:58 */ @RestController @RequestMapping("pipePlanMonth") public class PipePlanMonthController { @Autowired private PipePlanMonthService pipePlanMonthService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) PipePlanMonth pipePlanMonth,HttpServletRequest req){ PagingUtils.setPageParam(req); List pipePlanMonthList = pipePlanMonthService.findList(pipePlanMonth); PageInfo pageInfo = new PageInfo<>(pipePlanMonthList); return BasicResult.success(pageInfo); } @RequestMapping("addPipePlanMonth") public BasicResult addPipePlanMonth(@RequestBody PipePlanMonth pipePlanMonth){ pipePlanMonthService.addPipePlanMonth(pipePlanMonth); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody PipePlanMonth pipePlanMonth){ pipePlanMonthService.update(pipePlanMonth); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody PipePlanMonth pipePlanMonth){ pipePlanMonthService.delete(pipePlanMonth.getId()); return BasicResult.success(); } }