|
@@ -9,14 +9,13 @@ import cn.efunbox.audio.utils.ApiCode;
|
|
|
import cn.efunbox.audio.utils.HttpUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
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.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.math.BigInteger;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* AlbumController
|
|
@@ -69,9 +68,22 @@ public class AlbumController {
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
public void list(HttpServletRequest request, HttpServletResponse response,Album album, Integer pageNo, Integer pageSize){
|
|
|
|
|
|
+ if (Objects.nonNull(pageSize) && pageSize > 100) {
|
|
|
+ pageSize = 100;
|
|
|
+ }
|
|
|
+
|
|
|
OnePage<Album> albumPage = albumService.SearchAll(album,pageNo,pageSize);
|
|
|
|
|
|
HttpUtil.responseOkData(request, response, albumPage);
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("{albumId}")
|
|
|
+ public void list(HttpServletRequest request, HttpServletResponse response,@PathVariable(name = "albumId") BigInteger albumId){
|
|
|
+
|
|
|
+ Album album = albumService.GetOne(albumId);
|
|
|
+
|
|
|
+ HttpUtil.responseOkData(request, response, album);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|