package com.thhy.mobile.modules.biz.steelrecord.controller; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import com.thhy.mobile.modules.biz.steelrecord.entity.SteelRecord; import com.thhy.mobile.modules.biz.steelrecord.service.SteelRecordService; 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:55:16 */ @RestController @RequestMapping("steelRecord") public class SteelRecordController { @Autowired private SteelRecordService steelRecordService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) SteelRecord steelRecord,HttpServletRequest req){ PagingUtils.setPageParam(req); List steelRecordList = steelRecordService.findList(steelRecord); PageInfo pageInfo = new PageInfo<>(steelRecordList); return BasicResult.success(pageInfo); } @RequestMapping("addSteelRecord") public BasicResult addSteelRecord(@RequestBody SteelRecord steelRecord){ steelRecordService.addSteelRecord(steelRecord); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody SteelRecord steelRecord){ steelRecordService.update(steelRecord); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody SteelRecord steelRecord){ steelRecordService.delete(steelRecord.getId()); return BasicResult.success(); } }