Skip to content

Commit

Permalink
Merge pull request #2 from isd-sgcu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
bookpanda authored Jun 27, 2024
2 parents a8a36d0 + 81d4c34 commit 9ef475f
Show file tree
Hide file tree
Showing 11 changed files with 218 additions and 177 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

go:
mkdir -p go
-cd go; go mod init github.com/isd-sgcu/johnjud-go-proto
-cd go; go mod init github.com/isd-sgcu/rpkm67-go-proto
perl scripts/go/go.pl
cd go; go mod tidy

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# rpkm67-proto

## Note
rpkm67-proto: private SSH key in secret
rpkm67-go-proto: public SSH key in Deploy Keys
62 changes: 12 additions & 50 deletions rpkm67/auth/auth/v1/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ option go_package = "rpkm67/auth/auth/v1";
service AuthService {
rpc Validate(ValidateRequest) returns (ValidateResponse) {}
rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse) {}
rpc SignUp(SignUpRequest) returns (SignUpResponse) {}
rpc SignIn(SignInRequest) returns (SignInResponse) {}
rpc SignOut(SignOutRequest) returns (SignOutResponse) {}
rpc ForgotPassword(ForgotPasswordRequest) returns (ForgotPasswordResponse) {}
rpc ResetPassword(ResetPasswordRequest) returns (ResetPasswordResponse) {}
rpc GetGoogleLoginUrl(GetGoogleLoginUrlRequest) returns (GetGoogleLoginUrlResponse) {}
rpc VerifyGoogleLogin(VerifyGoogleLoginRequest) returns (VerifyGoogleLoginResponse) {}
}

message Credential{
Expand All @@ -30,7 +27,7 @@ message ValidateResponse{
string role = 2;
}

// Redeem Refresh Token
// RefreshToken
message RefreshTokenRequest{
string refreshToken = 1;
}
Expand All @@ -39,54 +36,19 @@ message RefreshTokenResponse{
Credential credential = 1;
}

// Sign up
message SignUpRequest {
string studentId = 1;
string password = 2;
string firstname = 3;
string lastname = 4;
string tel = 5;
string role = 6;
// GetGoogleLoginUrl
message GetGoogleLoginUrlRequest {
}

message SignUpResponse {
Credential credential = 1;
}

// Sign in
message SignInRequest {
string studentId = 1;
string password = 2;
}

message SignInResponse {
Credential credential = 1;
}

// Sign out
message SignOutRequest {
string token = 1;
}

message SignOutResponse {
bool isSuccess = 1;
}

// Forgot password
message ForgotPasswordRequest {
string tel = 1;
}

message ForgotPasswordResponse {
message GetGoogleLoginUrlResponse {
string url = 1;
}

// Reset password
message ResetPasswordRequest {
string token = 1;
string password = 2;
// VerifyGoogleLogin
message VerifyGoogleLoginRequest {
string code = 1;
}

message ResetPasswordResponse {
bool isSuccess = 1;
}
message VerifyGoogleLoginResponse {
Credential credential = 1;
}
100 changes: 62 additions & 38 deletions rpkm67/auth/user/v1/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,87 @@ package rpkm67.auth.user.v1;
option go_package = "rpkm67/auth/user/v1";

service UserService {
rpc Create(CreateRequest) returns (CreateResponse){}
rpc FindOne(FindOneRequest) returns (FindOneResponse){}
// rpc Update(UpdateUserRequest) returns (UpdateUserResponse){}
// rpc Delete(DeleteRequest) returns (DeleteResponse){}
rpc Create(CreateUserRequest) returns (CreateUserResponse){}
rpc FindOne(FindOneUserRequest) returns (FindOneUserResponse){}
rpc FindByEmail(FindByEmailRequest) returns (FindByEmailResponse){}
rpc Update(UpdateUserRequest) returns (UpdateUserResponse){}
}

message User{
string id = 1;
string studentId = 2;
string password = 3;
string firstname = 4;
string lastname = 5;
string tel = 6;
string role = 7;
string email = 2;
string nickname = 3;
string title = 4;
string firstname = 5;
string lastname = 6;
int32 year = 7;
string faculty = 8;
string tel = 9;
string parentTel = 10;
string parent = 11;
string foodAllergy = 12;
string drugAllergy = 13;
string illness = 14;
string role = 15;
string photoKey = 16;
string photoUrl = 17;
string baan = 18;
string groupId = 19;
int32 receiveGift = 20;
}

// Create
message CreateRequest{
string studentId = 1;
string password = 2;
string firstname = 3;
string lastname = 4;
string tel = 5;
string role = 6;
message CreateUserRequest{
string email = 1;
string role = 2;
}

message CreateResponse{
message CreateUserResponse{
User user = 1;
}

// FindOne
message FindOneRequest{
message FindOneUserRequest{
string id = 1;
}

message FindOneResponse{
message FindOneUserResponse{
User user = 1;
}

// Update
// message UpdateUserRequest{
// string id = 1;
// string email = 2;
// string password = 3;
// string firstname = 4;
// string lastname = 5;
// }
// FindByEmail
message FindByEmailRequest{
string email = 1;
}

// message UpdateUserResponse{
// User user = 1;
// }
message FindByEmailResponse{
User user = 1;
}

// Delete
// message DeleteRequest{
// string id = 1;
// }
// Update
message UpdateUserRequest{
string id = 1;
string email = 2;
string nickname = 3;
string title = 4;
string firstname = 5;
string lastname = 6;
int32 year = 7;
string faculty = 8;
string tel = 9;
string parentTel = 10;
string parent = 11;
string foodAllergy = 12;
string drugAllergy = 13;
string illness = 14;
string role = 15;
string photoKey = 16;
string photoUrl = 17;
string baan = 18;
string groupId = 19;
int32 receiveGift = 20;
}

// message DeleteResponse{
// bool success = 1;
// }
message UpdateUserResponse{
User user = 1;
}
60 changes: 0 additions & 60 deletions rpkm67/backend/baan/v1/baan.proto

This file was deleted.

32 changes: 32 additions & 0 deletions rpkm67/backend/pin/v1/pin.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
syntax = "proto3";

package rpkm67.backend.pin.v1;

option go_package = "rpkm67/backend/pin/v1";

service PinService {
rpc FindAll(FindAllPinRequest) returns (FindAllPinResponse){}
rpc ResetPin(ResetPinRequest) returns (ResetPinResponse) {}
}

message Pin{
string workshopId = 1;
string code = 2;
}

// FindAll
message FindAllPinRequest{
}

message FindAllPinResponse{
repeated Pin pins = 1;
}

// ResetPin
message ResetPinRequest{
string workshopId = 1;
}

message ResetPinResponse{
bool success = 1;
}
46 changes: 31 additions & 15 deletions rpkm67/backend/selection/v1/selection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,56 @@ option go_package = "rpkm67/backend/selection/v1";

service SelectionService {
rpc Create(CreateSelectionRequest) returns (CreateSelectionResponse){}
rpc FindByStudentId(FindByStudentIdSelectionRequest) returns (FindByStudentIdSelectionResponse) {}
rpc Update(UpdateSelectionRequest) returns (UpdateSelectionResponse){}
rpc FindByGroupId(FindByGroupIdSelectionRequest) returns (FindByGroupIdSelectionResponse) {}
rpc Delete(DeleteSelectionRequest) returns (DeleteSelectionResponse){}
rpc CountByBaanId(CountByBaanIdSelectionRequest) returns (CountByBaanIdSelectionResponse){}
}

message Selection{
string id = 1;
string userId = 2;
repeated string baanIds = 3;
string groupId = 2;
string baanId = 3;
int32 order = 4;
}

message BaanCount{
string baanId = 1;
int32 count = 2;
}

// Create
message CreateSelectionRequest{
string userId = 1;
repeated string baanIds = 2;
string groupId = 1;
string baanId = 2;
int32 order = 3;
}

message CreateSelectionResponse{
Selection selection = 1;
}

// FindByStudentId
message FindByStudentIdSelectionRequest{
string userId = 1;
// FindByGroupId
message FindByGroupIdSelectionRequest{
string groupId = 1;
}

message FindByStudentIdSelectionResponse{
Selection selection = 1;
message FindByGroupIdSelectionResponse{
repeated Selection selections = 1;
}

// Update
message UpdateSelectionRequest{
Selection selection = 1;
// Delete
message DeleteSelectionRequest{
string id = 1;
}

message UpdateSelectionResponse{
message DeleteSelectionResponse{
bool success = 1;
}

// CountByBaanId
message CountByBaanIdSelectionRequest{
}

message CountByBaanIdSelectionResponse{
repeated BaanCount baanCounts = 1;
}
Loading

0 comments on commit 9ef475f

Please sign in to comment.