|
1 | 1 | syntax = "proto3"; |
2 | 2 |
|
3 | | -package campusapis.sklInfo.v1; |
| 3 | +package campusapis.skl.v1; |
4 | 4 |
|
5 | 5 | import "google/api/annotations.proto"; |
6 | | -import "protoc-gen-openapiv2/options/annotations.proto"; |
7 | | - |
8 | | -option go_package = "./campusapis/sklInfo/v1"; |
9 | | - |
10 | | -option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { |
11 | | - info: { |
12 | | - title: "SklInfo API"; |
13 | | - version: "0.1"; |
14 | | - description: "SklInfo API"; |
15 | | - contact: { |
16 | | - name: "hduhelp salmon base project"; |
17 | | - url: "https://github.com/hduhelp/salmon_api_base"; |
18 | | - |
19 | | - }; |
20 | | - license: { |
21 | | - name: "BSD 3-Clause License"; |
22 | | - url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; |
23 | | - }; |
24 | | - }; |
25 | | - schemes: HTTPS; |
26 | | - consumes: "application/json"; |
27 | | - produces: "application/json"; |
28 | | -}; |
29 | | - |
30 | 6 |
|
| 7 | +option go_package = "./campusapis/skl/v1"; |
31 | 8 |
|
32 | 9 |
|
33 | 10 | //// Skl 数据库中的student_history_info表 |
@@ -67,35 +44,35 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { |
67 | 44 | // string StudentId = 11; // 学号 |
68 | 45 | //} |
69 | 46 |
|
70 | | -service SklInfoService { |
| 47 | +service SklService { |
71 | 48 | // 获取某学院某年级的学生信息 |
72 | | - rpc GetSklUnitInfo(SklUnitInfoRequest) returns (SklUnitInfo) { |
| 49 | + rpc GetStaffUnitInfo(StaffUnitInfoRequest) returns (StaffUnitInfoResponse) { |
73 | 50 | option (google.api.http) = { |
74 | | - get: "/v1/sklInfo/unitInfo" |
| 51 | + get: "/skl/unitInfo" |
75 | 52 | additional_bindings { |
76 | | - get: "/sklInfo/unitInfo" |
| 53 | + get: "/skl/v1/unitInfo" |
77 | 54 | } |
78 | 55 | }; |
79 | 56 | } |
80 | 57 | } |
81 | 58 |
|
82 | 59 | // 用于从Skl数据库中筛选某年级某学院的学生 |
83 | 60 | message SklUnitInfo { |
84 | | - string UnitId = 1; // 学院ID |
85 | | - string UnitName = 2; // 学院名称 |
86 | | - string Grade = 3; // 年级 |
87 | | - repeated string Teachers = 4; // 辅导员 |
88 | | - repeated string Students = 5; // 学生 |
| 61 | + string unitId = 1; // 学院ID |
| 62 | + string unitName = 2; // 学院名称 |
| 63 | + string grade = 3; // 年级 |
| 64 | + repeated string teachers = 4; // 辅导员 |
| 65 | + repeated string classNos = 5; |
89 | 66 | } |
90 | 67 |
|
91 | | -message SklUnitInfoRequest { |
| 68 | +message StaffUnitInfoRequest { |
92 | 69 | string StaffId = 1; // 学/工号 |
93 | 70 | } |
94 | 71 |
|
95 | | -message SklUnitInfoResponse { |
| 72 | +message StaffUnitInfoResponse { |
96 | 73 | int32 error = 1; |
97 | 74 | string msg = 2; |
98 | | - SklUnitInfo sklUnitInfo = 3; |
| 75 | + repeated SklUnitInfo data = 3; |
99 | 76 | } |
100 | 77 |
|
101 | 78 |
|
|
0 commit comments