package com.thhy.mobile.modules.biz.steelstock.controller; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import com.thhy.mobile.modules.biz.steelstock.entity.SteelStock; import com.thhy.mobile.modules.biz.steelstock.entity.SteelStockListVo; import com.thhy.mobile.modules.biz.steelstock.service.SteelStockService; 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-05-06 14:00:33 */ @RestController @RequestMapping("steelStock") public class SteelStockController { @Autowired private SteelStockService steelStockService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) SteelStock steelStock,HttpServletRequest req){ PagingUtils.setPageParam(req); List steelStockList = steelStockService.querySteelStock(steelStock); PageInfo pageInfo = new PageInfo<>(steelStockList); return BasicResult.success(pageInfo); } @RequestMapping("addSteelStock") public BasicResult addSteelStock(@RequestBody SteelStock steelStock){ steelStockService.addSteelStock(steelStock); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody SteelStock steelStock){ steelStockService.update(steelStock); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody SteelStock steelStock){ steelStockService.delete(steelStock.getSteelStockId()); return BasicResult.success(); } }