api-查询所有场馆信息

This commit is contained in:
limqhz
2020-07-30 01:08:01 +08:00
parent a4ff3a966d
commit 393ef2ddd5
2 changed files with 53 additions and 0 deletions

View File

@@ -1,18 +1,26 @@
package com.sv.netty.controller; package com.sv.netty.controller;
import com.sv.dto.app.VenueItem;
import com.sv.dto.app.VenueLessonStatus; import com.sv.dto.app.VenueLessonStatus;
import com.sv.entity.Venue;
import com.sv.service.api.VenueLessonService; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@RestController @RestController
public class AppVenueLessonController { public class AppVenueLessonController {
@Resource
private VenueService venueService;
@Resource @Resource
private VenueLessonService venueLessonService; private VenueLessonService venueLessonService;
@@ -82,4 +90,20 @@ public class AppVenueLessonController {
return sb.toString(); return sb.toString();
} }
/**
* 分页查询场馆
*/
@RequestMapping(value = "/getVenueList", method = {RequestMethod.GET,RequestMethod.POST})
public List<VenueItem> getVenueList() {
List<VenueItem> venueItems = new ArrayList<>();
List<Venue> alls = venueService.findAlls();
if (alls!=null){
for (Venue venue : alls){
venueItems.add(new VenueItem(venue.getId(),venue.getName()));
}
}
return venueItems;
}
} }

View File

@@ -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;
}
}