package com.thhy.engineering.modules.biz.mould.controller; import com.github.pagehelper.PageInfo; import com.thhy.engineering.modules.biz.mould.entity.Mould; import com.thhy.engineering.modules.biz.mould.entity.MouldListVo; import com.thhy.engineering.modules.biz.mould.service.MouldService; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; 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-11 16:33:56 */ @RestController @RequestMapping("mould") public class MouldController { @Autowired private MouldService mouldService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) Mould mould,HttpServletRequest req){ PagingUtils.setPageParam(req); List mouldList = mouldService.findList(mould); PageInfo pageInfo = new PageInfo<>(mouldList); return BasicResult.success(pageInfo); } @RequestMapping("addMould") public BasicResult addMould(@RequestBody Mould mould){ mouldService.addMould(mould); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody Mould mould){ mouldService.update(mould); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody Mould mould){ mouldService.delete(mould.getMouldId()); return BasicResult.success(); } }