From 393ef2ddd586951e15de329987642a4c0630b3bc Mon Sep 17 00:00:00 2001 From: limqhz Date: Thu, 30 Jul 2020 01:08:01 +0800 Subject: [PATCH] =?UTF-8?q?api-=E6=9F=A5=E8=AF=A2=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=9C=BA=E9=A6=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppVenueLessonController.java | 24 +++++++++++++++ .../main/java/com/sv/dto/app/VenueItem.java | 29 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 entity/src/main/java/com/sv/dto/app/VenueItem.java diff --git a/api/src/main/java/com/sv/netty/controller/AppVenueLessonController.java b/api/src/main/java/com/sv/netty/controller/AppVenueLessonController.java index 0f0cdc3..568a77f 100644 --- a/api/src/main/java/com/sv/netty/controller/AppVenueLessonController.java +++ b/api/src/main/java/com/sv/netty/controller/AppVenueLessonController.java @@ -1,18 +1,26 @@ package com.sv.netty.controller; +import com.sv.dto.app.VenueItem; import com.sv.dto.app.VenueLessonStatus; +import com.sv.entity.Venue; import com.sv.service.api.VenueLessonService; +import com.sv.service.oms.VenueService; +import com.ydd.framework.core.common.dto.ResponseDTO; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.time.LocalDate; +import java.util.ArrayList; import java.util.List; @RestController public class AppVenueLessonController { + @Resource + private VenueService venueService; @Resource private VenueLessonService venueLessonService; @@ -82,4 +90,20 @@ public class AppVenueLessonController { return sb.toString(); } + + /** + * 分页查询场馆 + */ + @RequestMapping(value = "/getVenueList", method = {RequestMethod.GET,RequestMethod.POST}) + public List getVenueList() { + List venueItems = new ArrayList<>(); + List alls = venueService.findAlls(); + if (alls!=null){ + for (Venue venue : alls){ + venueItems.add(new VenueItem(venue.getId(),venue.getName())); + } + } + return venueItems; + } + } diff --git a/entity/src/main/java/com/sv/dto/app/VenueItem.java b/entity/src/main/java/com/sv/dto/app/VenueItem.java new file mode 100644 index 0000000..a27602c --- /dev/null +++ b/entity/src/main/java/com/sv/dto/app/VenueItem.java @@ -0,0 +1,29 @@ +package com.sv.dto.app; + +import java.io.Serializable; + +public class VenueItem implements Serializable { + private Integer venueId; + private String venueName; + + public VenueItem(Integer venueId, String venueName) { + this.venueId = venueId; + this.venueName = venueName; + } + + public Integer getVenueId() { + return venueId; + } + + public void setVenueId(Integer venueId) { + this.venueId = venueId; + } + + public String getVenueName() { + return venueName; + } + + public void setVenueName(String venueName) { + this.venueName = venueName; + } +}