This repository was archived by the owner on Mar 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathopenapi.yaml
More file actions
3111 lines (3111 loc) · 89.1 KB
/
openapi.yaml
File metadata and controls
3111 lines (3111 loc) · 89.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
description: |
厦门大学 *2017~18上* **面向对象分析与设计** 课堂管理系统 `RESTful API` 标准
version: "1.0.0-beta.3"
title: 课堂管理系统
contact:
url: 'https://github.com/Librazy/ControllerWorkingGroup-Public'
tags:
- name: me
description: 用户个人信息
- name: course
description: 课程信息
- name: class
description: 班级信息
- name: seminar
description: 讨论课信息
- name: topic
description: 话题信息
- name: group
description: 分组信息
paths:
'/me':
get:
tags:
- me
summary: 获取当前用户
operationId: getCurrentUser
responses:
'200':
description: 成功
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/User'
- required:
- id
- type
- name
- number
- phone
- email
- gender
- school
- title
- avatar
- properties:
school:
allOf:
- $ref: '#/components/schemas/School'
- required:
- id
- name
example: {"id": 3486, "type": "student", "name": "张三", "number": "23320152202333", "phone": "18911114514", "email": "23320152202333@stu.xmu.edu.cn", "gender": "male", "school": {"id": 32, "name": "厦门大学"}, "title": "", "avatar": "/avatar/3486.png"}
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
put:
tags:
- me
summary: 修改当前用户
description: .Net 解绑为置空 `phone`,J2EE 解绑为置空 `unionId`
operationId: updateCurrentUser
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/User'
example: {"name": "张三", "number": "23320152202333", "email": "23320152202333@stu.xmu.edu.cn", "gender": "female", "title": "", "avatar": "/avatar/3486.png"}
responses:
'204':
description: 成功
'400':
description: 信息不合法(邮箱格式错误、学校不存在、头像不存在、在设置了`type`后重新设置等)
security:
- wechat_auth:
- 'snsapi_login'
- http_pwd: []
- mp_code: []
'/signin':
get:
tags:
- me
summary: 微信小程序/OAuth2登录
description: |
`state` 为 `MiniProgram` 时返回 `text/html` (作为微信登录的 `redirect_uri`),否则返回 `application/json` (作为小程序上传 Code 的接口)。
**若该微信用户是第一次登录,则后台执行注册流程并返回新生成的用户。**
operationId: signinWechat
parameters:
- name: code
in: query
description: 微信小程序/OAuth2授权的Code
schema:
type: string
- name: state
in: query
required: true
description: 微信OAuth2授权的state。对于小程序,值恒为 `MiniProgram`
schema:
type: string
- name: success_url
in: query
description: 微信OAuth2授权后跳转到的网址
schema:
type: string
format: url
responses:
'200':
description: 登录成功
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/User'
- required:
- id
- type
- jwt
- properties:
jwt:
type: string
format: password
description: Json Web Token, 用于维护用户登录状态,接收后小程序使用 `wx.setStorage` 存储
example: {"id": 3486, "type": "student", "name": "张三", "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaWQiOiJPQTAwMDEiLCJpYXQiOjE0ODI2NTcyODQyMjF9.TeJpy936w610Vrrm+c3+RXouCA9k1AX0Bk8qURkYkdo="}
text/html:
schema:
allOf:
- $ref: '#/components/schemas/User'
- required:
- id
- type
- name
- jwt
- properties:
jwt:
type: string
format: password
- description: Json Web Token,用于维护用户登录状态,接收后小程序使用 `wx.setStorage` 存储
example: |
<!doctype html><html lang=zh><head><meta charset=utf-8><title>blah</title><script>window.localStorage.setItem("user", '{"id": 3486, "type": "student", "name": "张三", "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaWQiOiJPQTAwMDEiLCJpYXQiOjE0ODI2NTcyODQyMjF9.TeJpy936w610Vrrm+c3+RXouCA9k1AX0Bk8qURkYkdo="}');window.location.href="/";</script></head></html>
'401':
description: 登录失败。对小程序返回 401 的通用JSON,对网页微信登录返回一个 401 错误页HTML。
post:
tags:
- me
summary: .Net 手机号密码登录
operationId: signinPassword
requestBody:
required: true
content:
application/json:
schema:
properties:
phone:
type: string
password:
type: string
format: password
required:
- phone
- password
example: {"phone": "18911114514", "password": "qwer2345!"}
responses:
'200':
description: 登录成功
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/User'
- required:
- id
- type
- name
- jwt
- properties:
jwt:
type: string
format: password
description: Json Web Token, 用于维护用户登录状态,接收后存储于 `localStorage` (对应小程序 `wx.setStorage`)
example: {"id": 3486, "type": "student", "name": "张三", "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaWQiOiJPQTAwMDEiLCJpYXQiOjE0ODI2NTcyODQyMjF9.TeJpy936w610Vrrm+c3+RXouCA9k1AX0Bk8qURkYkdo="}
'401':
description: 手机号密码错误
'/register':
post:
tags:
- me
summary: .Net 手机号密码注册
operationId: registerPassword
requestBody:
required: true
content:
application/json:
schema:
properties:
phone:
type: string
password:
type: string
format: password
required:
- phone
- password
example: {"phone": "18911114514", "password": "qwer2345!"}
responses:
'200':
description: 注册成功
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/User'
- required:
- id
- type
- name
- jwt
- properties:
jwt:
type: string
format: password
description: Json Web Token,用于维护用户登录状态,接收后小程序使用 `wx.setStorage` 存储
example: {"id": 3486, "type": "unbinded", "name": "", "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaWQiOiJPQTAwMDEiLCJpYXQiOjE0ODI2NTcyODQyMjF9.TeJpy936w610Vrrm+c3+RXouCA9k1AX0Bk8qURkYkdo="}
'/school?city={city}':
get:
tags:
- school
summary: 获取学校列表(按照城市查找学校)
operationId: getSchools
parameters:
- name: city
in: query
required: true
description: 学校的城市
schema:
type: string
responses:
'200':
description: 成功
content:
application/json:
schema:
type: array
uniqueItems: true
items:
allOf:
- $ref: '#/components/schemas/School'
- required:
- id
- name
- province
- city
example: [{"id": 32, "name": "厦门大学", "province": "福建", "city": "厦门"}, {"id": 37, "name": "厦门软件学院", "province": "福建", "city": "厦门"},]
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/school':
post:
tags:
- school
summary: 添加学校
operationId: createSchool
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/School'
- required:
- name
- province
- city
example: {"name": "厦门市人民公园", "province": "福建", "city": "厦门"}
responses:
'201':
description: 创建成功,返回学校的ID
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/School'
- required:
- id
example: {"id": 38}
'409':
description: 与其他学校重复(在同地区由重名学校)
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/school/province':
get:
tags:
- school
summary: 获取省份列表
operationId: getProvinces
responses:
'200':
description: 成功
content:
application/json:
schema:
type: array
uniqueItems: true
items:
type: string
example: ["北京", "天津", "河北省", "……", "澳门特别行政区"]
'/school/city?province={province}':
get:
tags:
- school
summary: 获取城市列表
operationId: getCities
parameters:
- name: province
in: query
required: true
description: 省份
schema:
type: string
responses:
'200':
description: 成功
content:
application/json:
schema:
type: array
uniqueItems: true
items:
type: string
example: ["北京", "天津", "河北省", "……", "澳门特别行政区"]
'404':
description: 找不到这个省份
'/course':
get:
tags:
- course
summary: 获取与当前用户相关联的课程列表
operationId: getUserCourses
responses:
'200':
description: 成功
content:
application/json:
schema:
type: array
uniqueItems: true
items:
allOf:
- $ref: '#/components/schemas/Course'
- required:
- id
- name
- numClass
- numStudent
- startTime
- endTime
example: [{"id": 1, "name": "OOAD", "numClass": 3, "numStudent": 60, "startTime": "2017-9-1", "endTime": "2018-1-1"}, {"id": 2, "name": "J2EE", "numClass": 1, "numStudent": 60, "startTime": "2017-9-1", "endTime": "2018-1-1"}]
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
post:
tags:
- course
summary: 创建课程
operationId: createCourse
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Course'
- required:
- name
- proportions
- startTime
- endTime
example: {"name": "OOAD", "description": "面向对象分析与设计", "startTime": "2017-09-20", "endTime": "2018-1-31", "proportions": {"report": 50, "presentation": 50, "c": 20, "b": 60, "a": 20 }}
responses:
'201':
description: 创建成功,返回课程的ID
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Course'
- required:
- id
example: {"id": 23}
'403':
description: 用户权限不足(学生无法创建课程)
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/course/{courseId}':
get:
tags:
- course
summary: 按ID获取课程
operationId: getCourseById
parameters:
- name: courseId
in: path
description: 需获取课程的ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: 成功
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/CourseDetail'
- required:
- id
- name
- description
- teacherName
- teacherEmail
example: {"id": 23, "name": "OOAD", "description": "面向对象分析与设计", "teacherName": "邱明", "teacherEmail": "mingqiu@xmu.edu.cn"}
'400':
description: 错误的ID格式
'404':
description: 未找到课程
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
put:
tags:
- course
summary: 修改课程
operationId: updateCourse
parameters:
- name: courseId
in: path
description: 需修改课程的ID
required: true
schema:
type: integer
format: int64
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Course'
- example: {"name": "OOAD", "description": "面向对象分析与设计", "startTime": "2017-09-20", "endTime": "2018-1-1", "proportions": {"report": 70, "presentation": 30, "c": 20, "b": 60, "a": 20 }}
responses:
'204':
description: 修改成功
'403':
description: 用户权限不足(学生无法修改课程、无法修改他人课程)
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
delete:
tags:
- course
summary: 按ID删除课程
operationId: deleteCourseById
parameters:
- name: courseId
in: path
description: 需删除课程的ID
required: true
schema:
type: integer
format: int64
responses:
'204':
description: 成功
'400':
description: 错误的ID格式
'403':
description: 用户权限不足(无法删除他人课程、学生无法删除课程)
'404':
description: 未找到课程
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/course/{courseId}/class':
get:
tags:
- course
summary: 按ID获取课程的班级列表
operationId: getClassesByCourseId
parameters:
- name: courseId
in: path
description: 需获取班级的课程的ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: 成功,返回班级的ID和名称
content:
application/json:
schema:
type: array
uniqueItems: true
items:
allOf:
- $ref: '#/components/schemas/Class'
- required:
- id
- name
example: [{"id": 45, "name": "周三1-2节"}, {"id": 48, "name": "周三3-4节"}]
'400':
description: 错误的ID格式
'404':
description: 未找到课程
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
post:
tags:
- course
summary: 在指定ID的课程创建班级
operationId: createClassByCourseId
parameters:
- name: courseId
in: path
description: 待创建班级的课程的ID
required: true
schema:
type: integer
format: int64
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Class'
- required:
- name
- site
- time
- proportions
example: {"name": "周三1-2节", "site": "海韵212", "time": "周三一二节", "proportions": {"report": 50, "presentation": 50, "c": 10, "b": 60, "a": 30 }}
responses:
'201':
description: 成功
content:
application/json:
schema:
properties:
id:
type: integer
format: int64
example: 45
'403':
description: 用户权限不足(学生无法创建班级)
'404':
description: 未找到课程
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class':
get:
tags:
- class
summary: 获取与当前用户相关的或者符合条件的班级列表
operationId: getClass
parameters:
- name: courseName
in: query
description: 课程名称
schema:
type: string
- name: courseTeacher
in: query
description: 教师名称
schema:
type: string
responses:
'200':
description: 课程班级列表
content:
application/json:
schema:
type: array
items:
allOf:
- $ref: '#/components/schemas/CourseClass'
- required:
- id
- name
- time
- site
- numStudent
- courseName
- courseTeacher
example: [{"id": 23, "name": "周三1-2节", "numStudent": 60, "time": "周三1-2、周五1-2", "site": "公寓405", "courseName": "OOAD", "courseTeacher": "邱明"},{"id": 42, "name": "一班", "numStudent": 60, "time": "周三34节 周五12节", "site": "海韵202", "courseName": ".Net 平台开发", "courseTeacher": "杨律青"}]
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}':
get:
tags:
- class
summary: 按ID获取班级详情
operationId: getClassById
parameters:
- name: classId
in: path
description: 需获取班级的ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: 班级的详细信息
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Class'
- required:
- id
- name
- numStudent
- calling
- time
- site
- roster
- proportions
- properties:
proportions:
required:
- '3'
- '4'
- '5'
- report
- presentation
example: {"id": 23, "name": "周三1-2节", "numStudent": 120, "time": "周三一二节", "site": "海韵201", "calling": -1, "roster": "/roster/周三12班.xlsx", "proportions": {"report": 50, "presentation": 50, "c": 20, "b": 60, "a": 20 }}
'400':
description: 错误的ID格式
'404':
description: 未找到班级
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
put:
tags:
- class
summary: 按ID修改班级
description: 可以用于修改签到状态或其他班级信息
operationId: updateClassById
parameters:
- name: classId
in: path
description: 需获取班级的ID
required: true
schema:
type: integer
format: int64
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Class'
- required:
- name
- numStudent
- calling
- timeSite
- roster
- proportions
- properties:
proportions:
required:
- C
- B
- A
- report
- presentation
example: {"name": "周三1-2节", "numStudent": 120, "time":"周三12节 周一34节", "site": "海韵201,公寓405", "calling": -1, "roster": "/roster/周三12班.xlsx", "proportions": {"report": 50, "presentation": 50, "c": 20, "b": 60, "a": 20 }}
responses:
'204':
description: 成功
'400':
description: 错误的ID格式、班级名单不存在
'403':
description: 用户权限不足(无法修改他人班级、学生无法修改班级)
'404':
description: 未找到班级
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
delete:
tags:
- class
summary: 按ID删除班级
operationId: deleteClassById
parameters:
- name: classId
in: path
description: 需删除班级的ID
required: true
schema:
type: integer
format: int64
responses:
'204':
description: 成功
'400':
description: 错误的ID格式
'403':
description: 用户权限不足(无法删除他人班级、学生无法删除班级)
'404':
description: 未找到班级
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}/student':
get:
tags:
- class
summary: 按班级ID查找学生列表(查询学号、姓名开头)
operationId: selectClass
parameters:
- name: classId
in: path
description: 学生所属的班级ID
required: true
schema:
type: integer
format: int64
- name: numBeginWith
in: query
description: 学生的学号开头
schema:
type: string
- name: nameBeginWith
in: query
description: 学生的姓名开头
schema:
type: string
responses:
'200':
description: 满足条件的学生列表
content:
application/json:
schema:
type: array
uniqueItems: true
items:
allOf:
- $ref: '#/components/schemas/Student'
- required:
- id
- name
example: [{"id": 233, "name": "张三", "number": 24320152202333}, {"id": 245, "name": "张八", "number": 24320152202334}]
'400':
description: 错误的ID格式
'404':
description: 未找到班级
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
post:
tags:
- class
summary: 学生按ID选择班级
operationId: selectClass
parameters:
- name: classId
in: path
description: 待选择的班级ID
required: true
schema:
type: integer
format: int64
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Student'
- required:
- id
example: {"id": 233}
responses:
'201':
description: 成功
content:
application/json:
schema:
properties:
url:
type: string
format: url
example: "/class/34/student/2757"
'400':
description: 错误的ID格式
'403':
description: 学生无法为他人选课(请求体中ID与自身ID不同)
'409':
description: 已选过同课程的课
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}/student/{studentId}':
delete:
tags:
- class
summary: 学生按ID取消选择班级
operationId: deselectClass
parameters:
- name: classId
in: path
description: 取消选择的班级的ID
required: true
schema:
type: integer
format: int64
- name: studentId
in: path
description: 学生ID
required: true
schema:
type: integer
format: int64
responses:
'204':
description: 成功
'400':
description: 错误的ID格式
'403':
description: 学生无法为他人退课(URL中ID与自身ID不同)
'404':
description: 不存在这个选课或不存在这个学生、班级
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}/classgroup':
get:
tags:
- class
summary: 按ID获取自身所在班级小组
operationId: getClassGroupByClassId
parameters:
- name: classId
in: path
description: 班级小组所属班级的ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: 包含自身的班级小组(默认为自己是组长)
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ClassGroup'
- required:
- leader
- members
- properties:
leader:
allOf:
- $ref: '#/components/schemas/Student'
- required:
- id
- name
- number
members:
type: array
uniqueItems: true
items:
allOf:
- $ref: '#/components/schemas/Student'
- required:
- id
- name
- number
example: {"leader": {"id": 2757, "name": "张三", "number": "23320152202333"}, "members": [{"id": 2756, "name": "李四", "number": "23320152202443"}, {"id": 2777, "name": "王五", "number": "23320152202433"}]}
'400':
description: 错误的ID格式
'403':
description: 教师访问此API
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}/classgroup/resign':
put:
tags:
- class
summary: 班级小组组长辞职
operationId: resignClassGroupLeader
requestBody:
required: true
description: 学生的ID
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Student'
- required:
- id
example: {"id": 247}
responses:
'204':
description: 成功
'400':
description: 错误的ID格式、辞职的学生不存在
'403':
description: 权限不足(不是该小组的组长)
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}/classgroup/assign':
put:
tags:
- class
summary: 成为班级小组组长
operationId: assignClassGroupLeader
requestBody:
required: true
description: 学生的ID
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Student'
- required:
- id
example: {"id": 247}
responses:
'204':
description: 成功
'400':
description: 错误的ID格式、成为组长的学生不存在
'403':
description: 权限不足(不是该小组的成员)
'409':
description: 已经有组长了
security:
- http_pwd: []
- mp_code: []
- wechat_auth:
- snsapi_login
'/class/{classId}/classgroup/add':
put:
tags: