-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
WalkthroughThe recent changes introduce the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- campusapis/sklInfo/v1/skl.proto (1 hunks)
Additional context used
buf
campusapis/sklInfo/v1/skl.proto
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)
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)
Additional comments not posted (3)
campusapis/sklInfo/v1/skl.proto (3)
11-31
: Go package and OpenAPI documentation look good.The Go package and OpenAPI documentation options are well-defined, enhancing usability and accessibility for developers.
36-71
:SklStudentHistoryInfo
message definition looks good.The fields are well-defined and appropriately commented, providing clear context for each field.
86-102
: Message definitions look good, but verify alignment with renaming.The field definitions for
SklUnitInfo
,SklUnitInfoRequest
, andSklUnitInfoResponse
are appropriate. Ensure that the response message aligns with the suggested renaming of the RPC types.
campusapis/sklInfo/v1/skl.proto
Outdated
import "campusapis/schoolTime/defined.proto"; | ||
import "campusapis/staff/base.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/protobuf/empty.proto"; |
There was a problem hiding this comment.
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.
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)
service SklInfoService { | ||
// 获取某学院某年级的学生信息 | ||
rpc GetSklUnitInfo(SklUnitInfoRequest) returns (SklUnitInfo) { | ||
option (google.api.http) = { | ||
get: "/v1/sklInfo/unitInfo" | ||
additional_bindings { | ||
get: "/sklInfo/unitInfo" | ||
} | ||
}; | ||
} |
There was a problem hiding this comment.
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
toGetSklUnitInfoRequest
SklUnitInfo
toGetSklUnitInfoResponse
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.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
campusapis/sklInfo/v1/skl.proto (1)
33-68
: Remove commented-out code if not needed.The commented-out
SklStudentHistoryInfo
message should be removed if it's not required, to maintain cleanliness and readability.-//// Skl 数据库中的student_history_info表 -//message SklStudentHistoryInfo { -// string StudentName = 1; // 学生姓名 -// string UnitId = 2; // 学院ID -// ... -//}
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- campusapis/sklInfo/v1/skl.proto (1 hunks)
Additional context used
buf
campusapis/sklInfo/v1/skl.proto
72-72: RPC request type "SklUnitInfoRequest" should be named "GetSklUnitInfoRequest" or "SklInfoServiceGetSklUnitInfoRequest".
(RPC_REQUEST_STANDARD_NAME)
72-72: RPC response type "SklUnitInfo" should be named "GetSklUnitInfoResponse" or "SklInfoServiceGetSklUnitInfoResponse".
(RPC_RESPONSE_STANDARD_NAME)
Additional comments not posted (5)
campusapis/sklInfo/v1/skl.proto (5)
1-3
: Syntax and package declaration are correct.The syntax is set to proto3, and the package is correctly defined.
5-6
: Import statements are appropriate.The imports are relevant for API annotations and OpenAPI documentation.
10-28
: OpenAPI options are well-defined.The options enhance the documentation and usability of the API.
70-79
: Consider renaming RPC request and response types.To align with standard naming conventions, consider renaming:
SklUnitInfoRequest
toGetSklUnitInfoRequest
SklUnitInfo
toGetSklUnitInfoResponse
Rename the types as follows:
- rpc GetSklUnitInfo(SklUnitInfoRequest) returns (SklUnitInfo) { + rpc GetSklUnitInfo(GetSklUnitInfoRequest) returns (GetSklUnitInfoResponse) {Tools
buf
72-72: RPC request type "SklUnitInfoRequest" should be named "GetSklUnitInfoRequest" or "SklInfoServiceGetSklUnitInfoRequest".
(RPC_REQUEST_STANDARD_NAME)
72-72: RPC response type "SklUnitInfo" should be named "GetSklUnitInfoResponse" or "SklInfoServiceGetSklUnitInfoResponse".
(RPC_RESPONSE_STANDARD_NAME)
82-99
: Consider renaming message types for consistency.To align with standard naming conventions, consider renaming:
SklUnitInfo
toGetSklUnitInfoResponse
SklUnitInfoRequest
toGetSklUnitInfoRequest
This will improve consistency with the RPC method naming.
Summary by CodeRabbit
New Features
Bug Fixes