Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add skl in salmon base #20

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions campusapis/sklInfo/v1/skl.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
syntax = "proto3";

package campusapis.sklInfo.v1;

import "campusapis/schoolTime/defined.proto";
import "campusapis/staff/base.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused imports.

The following imports are unused and can be removed to clean up the file:

  • campusapis/schoolTime/defined.proto
  • campusapis/staff/base.proto
  • google/protobuf/empty.proto

Remove the unused imports:

- import "campusapis/schoolTime/defined.proto";
- import "campusapis/staff/base.proto";
- import "google/protobuf/empty.proto";
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import "campusapis/schoolTime/defined.proto";
import "campusapis/staff/base.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
Tools
buf

5-5: Import "campusapis/schoolTime/defined.proto" is unused.

(IMPORT_USED)


6-6: Import "campusapis/staff/base.proto" is unused.

(IMPORT_USED)


8-8: Import "google/protobuf/empty.proto" is unused.

(IMPORT_USED)

import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "./campusapis/sklInfo/v1";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "SklInfo API";
version: "0.1";
description: "SklInfo API";
contact: {
name: "hduhelp salmon base project";
url: "https://github.com/hduhelp/salmon_api_base";
email: "[email protected]";
};
license: {
name: "BSD 3-Clause License";
url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt";
};
};
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
};




// Skl 数据库中的student_history_info表
message SklStudentHistoryInfo {
string StudentName = 1; // 学生姓名
string UnitId = 2; // 学院ID
//18,卓越学院
//27,网络空间安全学院(浙江保密学院)
//14,会计学院
//06,自动化学院(人工智能学院)
//15,经济学院
//01,机械工程学院
//07,理学院
//03,管理学院
//05,计算机学院(软件学院)
//34,法学院
//11,外国语学院
//08,通信工程学院
//33,人文艺术与数字媒体学院
//20,材料与环境工程学院
//12,人文与法学院
//17,国际教育学院
//28,人文艺术与数字媒体学院、法学院
//22,数字媒体与艺术设计学院
//32,圣光机联合学院
//31,继续教育学院
//04,电子信息学院(集成电路科学与工程学院)
//19,生命信息与仪器工程学院
string UnitName = 3; // 学院名称
string MajorCode = 4; // 专业代码
string Major = 5; // 专业名称
string ClassNo = 6; // 班级
string Grade = 7; // 年级
string TeacherId = 8; // 辅导员工号
string SchoolYear = 9; // 学年
string Semester = 10; // 学期
string StudentId = 11; // 学号
}

service SklInfoService {
// 获取某学院某年级的学生信息
rpc GetSklUnitInfo(SklUnitInfoRequest) returns (SklUnitInfo) {
option (google.api.http) = {
get: "/v1/sklInfo/unitInfo"
additional_bindings {
get: "/sklInfo/unitInfo"
}
};
}
Comment on lines +70 to +79
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming RPC request and response types.

To align with standard naming conventions, consider renaming:

  • SklUnitInfoRequest to GetSklUnitInfoRequest
  • SklUnitInfo to GetSklUnitInfoResponse

Rename the types as follows:

- rpc GetSklUnitInfo(SklUnitInfoRequest) returns (SklUnitInfo) {
+ rpc GetSklUnitInfo(GetSklUnitInfoRequest) returns (GetSklUnitInfoResponse) {
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
service SklInfoService {
// 获取某学院某年级的学生信息
rpc GetSklUnitInfo(SklUnitInfoRequest) returns (SklUnitInfo) {
option (google.api.http) = {
get: "/v1/sklInfo/unitInfo"
additional_bindings {
get: "/sklInfo/unitInfo"
}
};
}
service SklInfoService {
// 获取某学院某年级的学生信息
rpc GetSklUnitInfo(GetSklUnitInfoRequest) returns (GetSklUnitInfoResponse) {
option (google.api.http) = {
get: "/v1/sklInfo/unitInfo"
additional_bindings {
get: "/sklInfo/unitInfo"
}
};
}
Tools
buf

75-75: RPC request type "SklUnitInfoRequest" should be named "GetSklUnitInfoRequest" or "SklInfoServiceGetSklUnitInfoRequest".

(RPC_REQUEST_STANDARD_NAME)


75-75: RPC response type "SklUnitInfo" should be named "GetSklUnitInfoResponse" or "SklInfoServiceGetSklUnitInfoResponse".

(RPC_RESPONSE_STANDARD_NAME)

}

// 用于从Skl数据库中筛选某年级某学院的学生
message SklUnitInfo {
string UnitId = 1; // 学院ID
string UnitName = 2; // 学院名称
string Grade = 3; // 年级
repeated string Teachers = 4; // 辅导员
repeated string Students = 5; // 学生
}

message SklUnitInfoRequest {
string StaffId = 1; // 学/工号
}

message SklUnitInfoResponse {
int32 error = 1;
string msg = 2;
SklUnitInfo sklUnitInfo = 3;
}



Loading