浏览代码

分页查询参数修改

weifanli 3 年之前
父节点
当前提交
facbd59d78

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/StudentController.java

@@ -36,7 +36,7 @@ public class StudentController extends BaseController {
      */
     @PostMapping("/page")
     @ApiOperation(value = "查询分页", notes = "传入student")
-    public HttpResponseResult<PageInfo<StudentVo>> page(StudentSearch query) {
+    public HttpResponseResult<PageInfo<StudentVo>> page(@RequestBody StudentSearch query) {
 		IPage<StudentVo> pages = studentService.selectPage(Condition.getPage(query), query);
         return succeed(Condition.pageInfo(pages));
 	}

+ 9 - 8
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthEntryRecordController.java

@@ -13,9 +13,7 @@ import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.page.PageInfo;
 import com.yonge.toolset.utils.string.StringUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -33,9 +31,12 @@ public class TeacherAuthEntryRecordController extends BaseController {
     /**
      * 查询单条详情
      */
-    @GetMapping("/detail")
-    @ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
-    public HttpResponseResult<TeacherAuthEntryRecordVo> detail(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
+    @GetMapping("/detail/{id}")
+    @ApiOperation(value = "详情", notes = "传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", paramType = "path", dataType = "long", required = true),
+    })
+    public HttpResponseResult<TeacherAuthEntryRecordVo> detail(@PathVariable("id") Long id) {
         TeacherAuthEntryRecordVo detail = teacherAuthEntryRecordService.detail(id);
         return succeed(detail);
     }
@@ -45,8 +46,8 @@ public class TeacherAuthEntryRecordController extends BaseController {
      */
     @PostMapping("/page")
     @ApiOperation(value = "查询分页", notes = "传入teacherAuthEntryRecord")
-    public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> page(AuthEntryRecordSearch search, Query query) {
-        IPage<TeacherAuthEntryRecordVo> pages = teacherAuthEntryRecordService.selectPage(Condition.getPage(query), search);
+    public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> page(@RequestBody AuthEntryRecordSearch search) {
+        IPage<TeacherAuthEntryRecordVo> pages = teacherAuthEntryRecordService.selectPage(Condition.getPage(search), search);
         return succeed(Condition.pageInfo(pages));
     }
 

+ 8 - 7
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthMusicianRecordController.java

@@ -15,9 +15,7 @@ import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.page.PageInfo;
 import com.yonge.toolset.utils.string.StringUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -38,8 +36,11 @@ public class TeacherAuthMusicianRecordController extends BaseController {
 	 * 查询单条详情
 	 */
 	@GetMapping("/detail")
-	@ApiOperation(value = "详情", notes = "传入teacherAuthEntryRecord")
-	public HttpResponseResult<MusicianAuthEntryRecordVo> detail(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
+	@ApiOperation(value = "详情", notes = "传入id")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "id", value = "id", paramType = "path", dataType = "long", required = true),
+	})
+	public HttpResponseResult<MusicianAuthEntryRecordVo> detail(@PathVariable("id") Long id) {
 		MusicianAuthEntryRecordVo detail = teacherAuthMusicianRecordService.detail(id);
 		return succeed(detail);
 	}
@@ -49,8 +50,8 @@ public class TeacherAuthMusicianRecordController extends BaseController {
 	 */
 	@PostMapping("/page")
 	@ApiOperation(value = "查询分页", notes = "传入AuthEntryRecordSearch")
-	public HttpResponseResult<PageInfo<MusicianAuthEntryRecordVo>> page(AuthEntryRecordSearch search, Query query) {
-		IPage<MusicianAuthEntryRecordVo> pages = teacherAuthMusicianRecordService.selectPage(Condition.getPage(query), search);
+	public HttpResponseResult<PageInfo<MusicianAuthEntryRecordVo>> page(@RequestBody AuthEntryRecordSearch query) {
+		IPage<MusicianAuthEntryRecordVo> pages = teacherAuthMusicianRecordService.selectPage(Condition.getPage(query), query);
 		return succeed(Condition.pageInfo(pages));
 	}
 

+ 5 - 5
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherController.java

@@ -34,12 +34,12 @@ public class TeacherController extends BaseController {
     /**
      * 查询单条
      */
-    @GetMapping("/detail/{userId}")
-    @ApiOperation(value = "详情", notes = "传入teacher")
+    @GetMapping("/detail/{id}")
+    @ApiOperation(value = "详情", notes = "传入id")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "userId", value = "userId", paramType = "path", dataType = "long", required = true),
+            @ApiImplicitParam(name = "id", value = "id", paramType = "path", dataType = "long", required = true),
     })
-    public HttpResponseResult<TeacherVo> detail(Long userId) {
+    public HttpResponseResult<TeacherVo> detail(@PathVariable("id") Long userId) {
         TeacherVo detail = teacherService.detail(userId);
         return succeed(detail);
     }
@@ -49,7 +49,7 @@ public class TeacherController extends BaseController {
      */
     @PostMapping("/page")
     @ApiOperation(value = "查询分页", notes = "传入teacher")
-    public HttpResponseResult<IPage<TeacherVo>> page(TeacherSearch query) {
+    public HttpResponseResult<IPage<TeacherVo>> page(@RequestBody TeacherSearch query) {
         IPage<TeacherVo> pages = teacherService.selectPage(Condition.getPage(query), query);
         return succeed(pages);
     }