| | |
| | | import com.boying.entity.OutPark; |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.OutParkService; |
| | | import com.boying.service.ParkService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("barrier") |
| | | @RequestMapping("ffzf/barrier") |
| | | @RequiredArgsConstructor |
| | | public class BarrierController { |
| | | |
| | | private final BarrierService barrierService; |
| | | private final OutParkService outParkService; |
| | | private final ParkService parkService; |
| | | |
| | | @PostMapping("findPage") |
| | | public Object findPage(Page page, String parkId) { |
| | |
| | | return R.ok("请求成功"); |
| | | } |
| | | |
| | | @PostMapping("getByCode") |
| | | public Object getByCode(String code) { |
| | | Barrier b= barrierService.findByCode2(code); |
| | | if (b==null) { |
| | | return R.failed("未找到该道闸"); |
| | | } |
| | | b.setParkName(parkService.getById(b.getParkId()).getName()); |
| | | return R.ok(b,"请求成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("openBarrier") |
| | | public Object openBarrier(Long barrierId,Integer type) { |
| | | Barrier b= barrierService.getById(barrierId); |