first commit
This commit is contained in:
195
apps/sentinel/sentinel.proto
Normal file
195
apps/sentinel/sentinel.proto
Normal file
@@ -0,0 +1,195 @@
|
||||
syntax = "proto3";
|
||||
|
||||
|
||||
option go_package = "./sentinel";
|
||||
|
||||
message PageListRequest {
|
||||
int64 page = 2;
|
||||
int64 page_size = 3;
|
||||
}
|
||||
message UserProuctPageListRequest {
|
||||
int64 user_id = 1;
|
||||
int64 page = 2;
|
||||
int64 page_size = 3;
|
||||
}
|
||||
message WhitePageListRequest {
|
||||
int64 user_id = 1;
|
||||
int64 page = 2;
|
||||
int64 page_size = 3;
|
||||
}
|
||||
|
||||
message GetRecordByIdRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
|
||||
message Whitelist {
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
string whitelist_ip = 3;
|
||||
string created_at = 4;
|
||||
string updated_at = 5;
|
||||
}
|
||||
|
||||
message CreateWhitelistRequest {
|
||||
int64 user_id = 1;
|
||||
string whitelist_ip = 2;
|
||||
}
|
||||
|
||||
message UpdateWhitelistRequest {
|
||||
int64 id = 1;
|
||||
string whitelist_ip = 2;
|
||||
}
|
||||
|
||||
message DeleteWhitelistRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message WhitelistResponse {
|
||||
int64 total = 1;
|
||||
repeated Whitelist whitelists = 2;
|
||||
}
|
||||
|
||||
// Message for Secrets operations
|
||||
message Secret {
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
string secret_id = 3;
|
||||
string aes_key = 4;
|
||||
string created_at = 5;
|
||||
string updated_at = 6;
|
||||
}
|
||||
message GetSecretBySecretIdRequest {
|
||||
string secret_id = 1;
|
||||
}
|
||||
message CreateSecretRequest {
|
||||
int64 user_id = 1;
|
||||
}
|
||||
|
||||
message UpdateSecretRequest {
|
||||
int64 id = 1;
|
||||
string secret_id = 2;
|
||||
string aes_key = 3;
|
||||
}
|
||||
|
||||
message DeleteSecretRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message SecretResponse {
|
||||
int64 total = 1;
|
||||
repeated Secret secrets = 2;
|
||||
}
|
||||
|
||||
// Message for Products operations
|
||||
message Product {
|
||||
int64 id = 1;
|
||||
string product_name = 2;
|
||||
string product_code = 3;
|
||||
string product_description = 4;
|
||||
string product_content = 5;
|
||||
string product_group = 6;
|
||||
double product_price = 7;
|
||||
string created_at = 8;
|
||||
string updated_at = 9;
|
||||
}
|
||||
|
||||
message CreateProductRequest {
|
||||
string product_name = 1;
|
||||
string product_code = 2;
|
||||
string product_description = 3;
|
||||
string product_group = 4;
|
||||
string product_content = 5;
|
||||
double product_price = 6;
|
||||
}
|
||||
|
||||
message UpdateProductRequest {
|
||||
int64 id = 1;
|
||||
string product_name = 2;
|
||||
string product_code = 3;
|
||||
string product_description = 4;
|
||||
string product_content = 5;
|
||||
string product_group = 6;
|
||||
double product_price = 7;
|
||||
}
|
||||
|
||||
message DeleteProductRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message ProductResponse {
|
||||
int64 total = 1;
|
||||
repeated Product products = 2;
|
||||
}
|
||||
|
||||
// Message for UserProducts operations
|
||||
message UserProductEmptyResponse {
|
||||
}
|
||||
message UserProductItem {
|
||||
int64 id = 1; // 用户产品ID
|
||||
int64 productId = 2; // 产品ID
|
||||
string productName = 3; // 产品名称
|
||||
string productCode = 4; // 产品编号
|
||||
string productDescription = 5; // 产品简介
|
||||
string productGroup = 6; // 产品分类
|
||||
double productPrice = 7; // 产品价格
|
||||
string createdAt = 8; // 创建时间
|
||||
string updatedAt = 9; // 更新时间
|
||||
}
|
||||
message CreateUserProductRequest {
|
||||
int64 user_id = 1;
|
||||
int64 product_id = 2;
|
||||
}
|
||||
|
||||
message UpdateUserProductRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message DeleteUserProductRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message UserProductResponse {
|
||||
int64 total = 1;
|
||||
repeated UserProductItem user_products = 2;
|
||||
}
|
||||
|
||||
message matchingUserIdProductCodeRequest {
|
||||
int64 id = 1;
|
||||
string product_code = 2;
|
||||
}
|
||||
message matchResponse {
|
||||
bool match = 1;
|
||||
}
|
||||
message MatchWhitelistByIpRequest{
|
||||
string ip = 1;
|
||||
}
|
||||
// Service definitions for Whitelist, Secrets, Products, and UserProducts
|
||||
service whitelist {
|
||||
// Whitelist methods
|
||||
rpc CreateWhitelist(CreateWhitelistRequest) returns (Whitelist);
|
||||
rpc UpdateWhitelist(UpdateWhitelistRequest) returns (Whitelist);
|
||||
rpc DeleteWhitelist(DeleteWhitelistRequest) returns (Whitelist);
|
||||
rpc GetWhitePageList(WhitePageListRequest) returns (WhitelistResponse);
|
||||
rpc MatchWhitelistByIp(MatchWhitelistByIpRequest) returns (matchResponse);
|
||||
}
|
||||
service secret {
|
||||
// Secret methods
|
||||
rpc CreateSecret(CreateSecretRequest) returns (Secret);
|
||||
rpc GetSecretByUserId(GetRecordByIdRequest) returns (Secret);
|
||||
rpc GetSecretBySecretId(GetSecretBySecretIdRequest) returns (Secret);
|
||||
}
|
||||
service product {
|
||||
// Product methods
|
||||
rpc CreateProduct(CreateProductRequest) returns (Product);
|
||||
rpc UpdateProduct(UpdateProductRequest) returns (Product);
|
||||
rpc DeleteProduct(DeleteProductRequest) returns (Product);
|
||||
rpc GetProductPageList(PageListRequest) returns (ProductResponse);
|
||||
rpc GetProductById(GetRecordByIdRequest) returns (Product);
|
||||
}
|
||||
service userProduct {
|
||||
// UserProduct methods
|
||||
rpc CreateUserProduct(CreateUserProductRequest) returns (UserProductEmptyResponse);
|
||||
rpc GetUserProductPageList(UserProuctPageListRequest) returns (UserProductResponse);
|
||||
rpc MatchingUserIdProductCode(matchingUserIdProductCodeRequest) returns (matchResponse);
|
||||
}
|
||||
Reference in New Issue
Block a user