package com.thhy.staff.modules.biz.area.controller; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import com.thhy.staff.modules.biz.area.entity.Area; import com.thhy.staff.modules.biz.area.entity.AreaDto; import com.thhy.staff.modules.biz.area.entity.AreaInfoVo; import com.thhy.staff.modules.biz.area.entity.AreaListVo; import com.thhy.staff.modules.biz.area.service.AreaService; 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-03 13:28:52 */ @RestController @RequestMapping("area") public class AreaController { @Autowired private AreaService areaService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) AreaDto areaDto,HttpServletRequest req){ PagingUtils.setPageParam(req); List areaList = areaService.findList(areaDto); PageInfo pageInfo = new PageInfo<>(areaList); return BasicResult.success(pageInfo); } @RequestMapping("getAreaInfo") public BasicResult getAreaInfo(@RequestBody(required = false) Area area,HttpServletRequest req){ AreaInfoVo areaInfoVo = areaService.queryAreaInfo(area); return BasicResult.success(areaInfoVo); } @RequestMapping("addArea") public BasicResult addArea(@RequestBody AreaDto areaDto){ areaService.addArea(areaDto); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody Area area){ areaService.update(area); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody Area area){ areaService.delete(area.getId()); return BasicResult.success(); } }