|
@@ -12,10 +12,11 @@ class StudentController extends Controller {
|
|
|
this.service = this.ctx.service.student;
|
|
|
}
|
|
|
|
|
|
- // async index() {
|
|
|
- // const data = await this.service.query(this.ctx.query);
|
|
|
- // this.ctx.ok({ ...data });
|
|
|
- // }
|
|
|
+ async index() {
|
|
|
+ const { data } = await this.service.query(this.ctx.query);
|
|
|
+ const count = await this.service.count(this.ctx.query);
|
|
|
+ this.ctx.ok({ ...data, total: count });
|
|
|
+ }
|
|
|
|
|
|
// GET
|
|
|
// 查询
|