Files
juwan-backend/desc/rpc/community.proto
2026-04-23 01:06:58 +08:00

321 lines
8.3 KiB
Protocol Buffer

syntax = "proto3";
option go_package ="./pb";
package pb;
// ------------------------------------
// Messages
// ------------------------------------
//--------------------------------commentLikes--------------------------------
message CommentLikes {
int64 commentId = 1; //commentId
int64 userId = 2; //userId
int64 createdAt = 3; //createdAt
}
message AddCommentLikesReq {
int64 commentId = 1; //commentId
int64 userId = 2; //userId
int64 createdAt = 3; //createdAt
}
message AddCommentLikesResp {
}
message UpdateCommentLikesReq {
int64 commentId = 1; //commentId
int64 userId = 2; //userId
int64 createdAt = 3; //createdAt
}
message UpdateCommentLikesResp {
}
message DelCommentLikesReq {
int64 id = 1; //id
optional int64 userId = 2; //userId
}
message DelCommentLikesResp {
}
message GetCommentLikesByIdReq {
int64 id = 1; //id
}
message GetCommentLikesByIdResp {
CommentLikes commentLikes = 1; //commentLikes
}
message SearchCommentLikesReq {
int64 offset = 1; //offset
int64 limit = 2; //limit
int64 commentId = 3; //commentId
int64 userId = 4; //userId
int64 createdAt = 5; //createdAt
}
message SearchCommentLikesResp {
repeated CommentLikes commentLikes = 1; //commentLikes
}
//--------------------------------comments--------------------------------
message Comments {
int64 id = 1; //id
int64 postId = 2; //postId
int64 authorId = 3; //authorId
string content = 4; //content
int64 likeCount = 5; //likeCount
int64 createdAt = 6; //createdAt
int64 deletedAt = 7; //deletedAt
}
message AddCommentsReq {
int64 postId = 1; //postId
int64 authorId = 2; //authorId
string content = 3; //content
int64 likeCount = 4; //likeCount
int64 createdAt = 5; //createdAt
int64 deletedAt = 6; //deletedAt
}
message AddCommentsResp {
}
message UpdateCommentsReq {
int64 id = 1; //id
int64 postId = 2; //postId
int64 authorId = 3; //authorId
string content = 4; //content
int64 likeCount = 5; //likeCount
int64 createdAt = 6; //createdAt
int64 deletedAt = 7; //deletedAt
}
message UpdateCommentsResp {
}
message DelCommentsReq {
int64 id = 1; //id
}
message DelCommentsResp {
}
message GetCommentsByIdReq {
int64 id = 1; //id
}
message GetCommentsByIdResp {
Comments comments = 1; //comments
}
message SearchCommentsReq {
int64 offset = 1; //offset
int64 limit = 2; //limit
int64 id = 3; //id
int64 postId = 4; //postId
int64 authorId = 5; //authorId
optional string content = 6; //content
optional int64 likeCount = 7; //likeCount
int64 createdAt = 8; //createdAt
int64 deletedAt = 9; //deletedAt
}
message SearchCommentsResp {
repeated Comments comments = 1; //comments
}
//--------------------------------postLikes--------------------------------
message PostLikes {
int64 postId = 1; //postId
int64 userId = 2; //userId
int64 createdAt = 3; //createdAt
}
message AddPostLikesReq {
int64 postId = 1; //postId
int64 userId = 2; //userId
int64 createdAt = 3; //createdAt
}
message AddPostLikesResp {
}
message UpdatePostLikesReq {
optional int64 postId = 1; //postId
optional int64 userId = 2; //userId
int64 createdAt = 3; //createdAt
}
message UpdatePostLikesResp {
}
message DelPostLikesReq {
int64 id = 1; //id
optional int64 userId = 2; //userId
}
message DelPostLikesResp {
}
message GetPostLikesByIdReq {
int64 id = 1; //id
}
message GetPostLikesByIdResp {
PostLikes postLikes = 1; //postLikes
}
message SearchPostLikesReq {
int64 offset = 1; //offset
int64 limit = 2; //limit
optional int64 postId = 3; //postId
optional int64 userId = 4; //userId
int64 createdAt = 5; //createdAt
}
message SearchPostLikesResp {
repeated PostLikes postLikes = 1; //postLikes
}
//--------------------------------posts--------------------------------
message Posts {
int64 id = 1; //id
int64 authorId = 2; //authorId
string authorRole = 3; //authorRole
string title = 4; //title
string content = 5; //content
repeated string images = 6; //images
repeated string tags = 7; //tags
int64 linkedOrderId = 8; //linkedOrderId
int64 quotedPostId = 9; //quotedPostId
int64 likeCount = 10; //likeCount
int64 commentCount = 11; //commentCount
bool pinned = 12; //pinned
string searchText = 13; //searchText
int64 createdAt = 14; //createdAt
int64 updatedAt = 15; //updatedAt
int64 deletedAt = 16; //deletedAt
}
message AddPostsReq {
int64 authorId = 1; //authorId
string authorRole = 2; //authorRole
string title = 3; //title
string content = 4; //content
repeated string images = 5; //images
repeated string tags = 6; //tags
int64 linkedOrderId = 7; //linkedOrderId
int64 quotedPostId = 8; //quotedPostId
int64 likeCount = 9; //likeCount
int64 commentCount = 10; //commentCount
bool pinned = 11; //pinned
string searchText = 12; //searchText
int64 createdAt = 13; //createdAt
int64 updatedAt = 14; //updatedAt
int64 deletedAt = 15; //deletedAt
}
message AddPostsResp {
}
message UpdatePostsReq {
int64 id = 1; //id
optional int64 authorId = 2; //authorId
optional string authorRole = 3; //authorRole
optional string title = 4; //title
optional string content = 5; //content
repeated string images = 6; //images
repeated string tags = 7; //tags
optional int64 linkedOrderId = 8; //linkedOrderId
optional int64 quotedPostId = 9; //quotedPostId
optional int64 likeCount = 10; //likeCount
optional int64 commentCount = 11; //commentCount
optional bool pinned = 12; //pinned
optional string searchText = 13; //searchText
optional int64 createdAt = 14; //createdAt
optional int64 updatedAt = 15; //updatedAt
optional int64 deletedAt = 16; //deletedAt
}
message UpdatePostsResp {
}
message DelPostsReq {
int64 id = 1; //id
}
message DelPostsResp {
}
message GetPostsByIdReq {
int64 id = 1; //id
}
message GetPostsByIdResp {
Posts posts = 1; //posts
}
message SearchPostsReq {
int64 offset = 1; //offset
int64 limit = 2; //limit
int64 id = 3; //id
optional int64 authorId = 4; //authorId
optional string authorRole = 5; //authorRole
optional string title = 6; //title
optional string content = 7; //content
repeated string images = 8; //images
repeated string tags = 9; //tags
optional int64 linkedOrderId = 10; //linkedOrderId
optional int64 quotedPostId = 11; //quotedPostId
optional int64 likeCount = 12; //likeCount
optional int64 commentCount = 13; //commentCount
optional bool pinned = 14; //pinned
optional string searchText = 15; //searchText
optional int64 createdAt = 16; //createdAt
optional int64 updatedAt = 17; //updatedAt
optional int64 deletedAt = 18; //deletedAt
}
message SearchPostsResp {
repeated Posts posts = 1; //posts
}
// ------------------------------------
// Rpc Func
// ------------------------------------
service communityService{
//-----------------------commentLikes-----------------------
rpc AddCommentLikes(AddCommentLikesReq) returns (AddCommentLikesResp);
rpc UpdateCommentLikes(UpdateCommentLikesReq) returns (UpdateCommentLikesResp);
rpc DelCommentLikes(DelCommentLikesReq) returns (DelCommentLikesResp);
rpc GetCommentLikesById(GetCommentLikesByIdReq) returns (GetCommentLikesByIdResp);
rpc SearchCommentLikes(SearchCommentLikesReq) returns (SearchCommentLikesResp);
//-----------------------comments-----------------------
rpc AddComments(AddCommentsReq) returns (AddCommentsResp);
rpc UpdateComments(UpdateCommentsReq) returns (UpdateCommentsResp);
rpc DelComments(DelCommentsReq) returns (DelCommentsResp);
rpc GetCommentsById(GetCommentsByIdReq) returns (GetCommentsByIdResp);
rpc SearchComments(SearchCommentsReq) returns (SearchCommentsResp);
//-----------------------postLikes-----------------------
rpc AddPostLikes(AddPostLikesReq) returns (AddPostLikesResp);
rpc UpdatePostLikes(UpdatePostLikesReq) returns (UpdatePostLikesResp);
rpc DelPostLikes(DelPostLikesReq) returns (DelPostLikesResp);
rpc GetPostLikesById(GetPostLikesByIdReq) returns (GetPostLikesByIdResp);
rpc SearchPostLikes(SearchPostLikesReq) returns (SearchPostLikesResp);
//-----------------------posts-----------------------
rpc AddPosts(AddPostsReq) returns (AddPostsResp);
rpc UpdatePosts(UpdatePostsReq) returns (UpdatePostsResp);
rpc DelPosts(DelPostsReq) returns (DelPostsResp);
rpc GetPostsById(GetPostsByIdReq) returns (GetPostsByIdResp);
rpc SearchPosts(SearchPostsReq) returns (SearchPostsResp);
}