Skip to content

Commit

Permalink
Merge branch 'main' of github.com:CloudStriver/service-idl-go into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansongxx committed Apr 8, 2024
2 parents e6295e3 + 3e13696 commit 5b28653
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 76 deletions.
62 changes: 3 additions & 59 deletions platform/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,13 @@ enum State {
Hidden = 2; // 隐藏状态
}

message Content {
string id = 1;
string userId = 2; // 评论者
string atUserId = 3; // @谁
string content = 4; // 内容
string meta = 5; // 皮肤,字体等
int64 createTime = 6;
}

/*
一级评论:rootId = fatherId = subjectId
二级评论:rootId = fatherId != subjectId
三级评论:rootId != fatherId != subjectId
*/

message IndexInfo {
string id = 1;
string subjectId = 2;
string rootId = 3;
string fatherId = 4;
int64 count = 5; // 回复数
int64 state = 6; // 1: 正常, 2: 删除
int64 attrs = 7; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
repeated string tags = 8; // 标签:作者点赞,作者回复等
}

message Comment {
string id = 1;
string subjectId = 2;
string rootId = 3;
string fatherId = 4;
optional int64 count = 5; // 回复数
int64 state = 6; // 1: 正常, 2: 删除
int64 attrs = 7; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
repeated string labels = 8; // 标签:作者点赞,作者回复等
string userId = 9; // 评论者
string atUserId = 10; // @谁
string content = 11; // 内容
string meta = 12; // 皮肤,字体等
int64 sortTime = 13;
}

message CommentInfo {
string id = 1;
string subjectId = 2;
string rootId = 3;
Expand Down Expand Up @@ -87,22 +51,9 @@ message CommentFilterOptions {
}

message LabelFilterOptions {
optional string key = 1; // 用于匹配标签的key
optional string zone = 2;
optional string subZone = 3;
}

message Subject {
string id = 1;
string userId = 2;
string topCommentId = 3;
optional int64 rootCount = 4;
optional int64 allCount = 5;
int64 state = 6; // 1: 正常, 2: 删除
int64 attrs = 7; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
}

message SubjectDetails {
string id = 1;
string userId = 2;
string TopCommentId = 3;
Expand All @@ -112,17 +63,10 @@ message SubjectDetails {
int64 attrs = 7; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
}

message SubjectInfo {
string id = 1;
string userId = 2;
int64 attrs = 3; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
}

message Label {
string labelId = 1;
string zone = 2;
string subZone = 3;
string value = 4;
string id = 1;
string fatherId = 2;
string value = 3;
}

message Relation {
Expand Down
78 changes: 61 additions & 17 deletions platform/platform.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,37 @@ import "platform/common.proto";
import "basic/pagination.proto";

message CreateCommentReq {
Comment comment = 1;
string subjectId = 1;
string rootId = 2;
string fatherId = 3;
repeated string labelIds = 4; // 标签id列表:作者点赞,作者回复等
string userId = 5; // 评论者
string atUserId = 6; // @谁
string content = 7; // 内容
string meta = 8; // 皮肤,字体等
}

message CreateCommentResp {
string id = 1;
}

message GetCommentReq {
string commentId = 1;
string id = 1;
}

message GetCommentResp {
CommentInfo comment = 1;
string subjectId = 1;
string rootId = 2;
string fatherId = 3;
int64 count = 4; // 回复数
int64 state = 5; // 1: 正常, 2: 删除
int64 attrs = 6; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
repeated string labelIds = 7; // 标签:作者点赞,作者回复等
string userId = 8; // 评论者
string atUserId = 9; // @谁
string content = 10; // 内容
string meta = 11; // 皮肤,字体等
int64 createTime = 12;
}

message GetCommentListReq {
Expand All @@ -27,17 +45,19 @@ message GetCommentListReq {
}

message GetCommentListResp {
repeated CommentInfo comments = 1;
repeated Comment comments = 1;
int64 total = 2;
string token = 3;
}

message UpdateCommentReq {
Comment comment = 1;
string id = 1;
int64 state = 2; // 1: 正常, 2: 删除
repeated string labelIds = 3; // 标签:作者点赞,作者回复等
string meta = 4; // 皮肤,字体等
}

message UpdateCommentResp {

}

message DeleteCommentReq {
Expand All @@ -55,27 +75,35 @@ message SetCommentAttrsReq {
}

message SetCommentAttrsResp{

}

message GetCommentSubjectReq {
string id = 1;
}

message GetCommentSubjectResp {
SubjectDetails subject = 1;
string userId = 1;
string topCommentId = 2;
int64 rootCount = 3;
int64 allCount = 4;
int64 state = 5; // 1: 正常, 2: 删除
int64 attrs = 6; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
}

message CreateCommentSubjectReq {
Subject subject = 1;
string id = 1;
string userId = 2;
}

message CreateCommentSubjectResp {
string id = 1;
}

message UpdateCommentSubjectReq {
Subject subject = 1;
string id = 1;
optional int64 rootCount = 2;
optional int64 allCount = 3;
int64 state = 4; // 1: 正常, 2: 删除
int64 attrs = 5; // 1: 无, 2: 置顶, 3: 精华, 4: 置顶+精华
}

message UpdateCommentSubjectResp {
Expand All @@ -98,39 +126,54 @@ message DeleteCommentByIdsResp {
}

message CreateLabelReq {
Label label = 1;
string fatherId = 1;
string value = 2;
}

message CreateLabelResp {
string id = 1;
}

message DeleteLabelReq {
string id = 1;
}

message DeleteLabelResp {
}

message GetLabelReq {
string id = 1;
}

message GetLabelResp {
string label = 1;
string value = 1;
}

message UpdateLabelReq {
Label label = 1;
string id = 1;
string fatherId = 2;
string value = 3;
}

message UpdateLabelResp {
}

message GetLabelsReq {
optional LabelFilterOptions filterOptions = 1;
optional basic.PaginationOptions pagination = 2;
optional string key = 1; // 用于匹配标签的key
optional string fatherId = 2;
optional basic.PaginationOptions pagination = 3;
}

message GetLabelsResp {
repeated Label labels = 1;
int64 total = 2;
string token = 3;
}

message GetLabelsInBatchReq {
repeated string labelIds = 1;
repeated string ids = 1;
}

message GetLabelsInBatchResp {
repeated string labels = 1;
}
Expand All @@ -143,6 +186,7 @@ message CreateRelationReq{
int64 relationType = 5;
bool isOnly = 6;
}

message CreateRelationResp{
bool ok = 1;
}
Expand Down

0 comments on commit 5b28653

Please sign in to comment.