package com.thhy.materials.modules.biz.gpsdevice.controller; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import com.thhy.materials.modules.biz.gpsdevice.entity.GpsDevice; import com.thhy.materials.modules.biz.gpsdevice.entity.GpsDeviceDto; import com.thhy.materials.modules.biz.gpsdevice.entity.GpsDto; import com.thhy.materials.modules.biz.gpsdevice.service.GpsDeviceService; import com.thhy.materials.modules.biz.gpshis.entity.GpsHistory; 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-08-25 11:22:58 */ @RestController @RequestMapping("gpsDevice") public class GpsDeviceController { @Autowired private GpsDeviceService gpsDeviceService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) GpsDevice gpsDevice,HttpServletRequest req){ PagingUtils.setPageParam(req); List gpsDeviceList = gpsDeviceService.findList(gpsDevice); PageInfo pageInfo = new PageInfo<>(gpsDeviceList); return BasicResult.success(pageInfo); } @RequestMapping("findAll") public BasicResult findAll(@RequestBody(required = false)GpsDeviceDto gpsDeviceDto){ List gpsDeviceList = gpsDeviceService.findAll(gpsDeviceDto); return BasicResult.success(gpsDeviceList); } @RequestMapping("addGpsDevice") public BasicResult addGpsDevice(@RequestBody GpsDevice gpsDevice){ gpsDeviceService.addGpsDevice(gpsDevice); return BasicResult.success(); } @RequestMapping("gpsView") public BasicResult gpsView(@RequestBody GpsDto gpsDto){ List historyList = gpsDeviceService.gpsView(gpsDto); return BasicResult.success(historyList); } /** @RequestMapping("update") public BasicResult update(@RequestBody GpsDevice gpsDevice){ gpsDeviceService.update(gpsDevice); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody GpsDevice gpsDevice){ gpsDeviceService.delete(gpsDevice.getGdId()); return BasicResult.success(); } }