visuddhinanda пре 3 година
родитељ
комит
1519e341a3

BIN
documents/images/module.png


+ 80 - 0
documents/proto/comment.proto

@@ -0,0 +1,80 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.comment.v1;
+
+
+/*
+ * 评论(修改建议/问答/评论)
+ * 
+ * 
+ */
+service Comment{
+	rpc GetCommentList (CommentListRequest) returns (CommentListReply){}  
+	rpc GetComment (CommentRequest) returns (CommentReply){}    
+	rpc SetComment (CommentRequest) returns (CommentReply){}    
+	rpc AddComment (CommentRequest) returns (CommentReply){}    
+	rpc DelComment (CommentRequest) returns (CommentReply){}
+}
+
+message CommentListRequest{
+	string      ResId            = 1;
+	EnumResType ResType          = 2;
+	string Search                = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  CurrentPage           = 5;
+	int32  PerPage               = 6;
+	EnumAllowingOrderby OrderBy  = 7;
+	bool   Desc                  = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_CONTENT = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_UPDATED_AT =  0;
+}
+enum EnumCommentType{
+	ECT_MODIFY  = 0;
+	ECT_QA      = 1;
+	ECT_COMMENT = 2;
+}
+enum EnumResType{
+	ERT_CHAPTER = 0;
+	ERT_ARTICLE = 1;
+	ERT_COURSE = 2;
+}
+
+message CommentRequest{
+	string Id           = 1;
+	EnumCommentType Type   = 2;
+	string ResId        = 3;
+	EnumResType ResType = 4;
+	string ParentId     = 5;
+	string Content      = 6;
+
+	string Lang             = 51;
+	User   Editor           = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message CommentReply{
+	bool ok = 1;
+	string message = 2;
+	CommentRequest data = 3;
+}
+
+message CommentListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated CommentRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 63 - 0
documents/proto/hit.proto

@@ -0,0 +1,63 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.hit.v1;
+
+
+/*
+ * 访问量统计
+ * 
+ * 
+ */
+service Hit{
+	rpc GetHitListForRes (HitListRequest) returns (HitListReply){}
+	rpc GetHits (HitRequest) returns (HitReply){}
+}
+
+message HitListRequest{
+	string Id     = 1;
+	string Search   = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  CurrentPage = 5;
+	int32  PerPage = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_NAME = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_CREATE_AT =  0;
+	EAO_NAME =  1;
+}
+
+enum EnumResType{
+	ERT_CHAPTER = 0;
+	ERT_ARTICLE = 1;
+	ERT_COURSE = 2;
+}
+
+message HitRequest{
+	string Id           = 1;
+	EnumResType ResType = 2;
+	int32 count         = 3;
+}
+
+
+message HitReply{
+	bool ok = 1;
+	string message = 2;
+	HitRequest data = 3;
+}
+
+message HitListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated HitRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 82 - 0
documents/proto/like.proto

@@ -0,0 +1,82 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.like.v1;
+
+
+/*
+ * 点赞/收藏/订阅(关注)
+ * 
+ * 
+ */
+service Like{
+	rpc GetLikeList (LikeListRequest) returns (LikeListReply){}  //某资源的点赞人列表
+	rpc GetLikeCount (LikeRequest) returns (LikeCountReply){}    //某资源的点赞数量
+	rpc DelLike (LikeRequest) returns (LikeReply){}
+}
+
+message LikeListRequest{
+	string      ResId            = 1;
+	EnumResType ResType          = 2;
+	string Search                = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  CurrentPage           = 5;
+	int32  PerPage               = 6;
+	EnumAllowingOrderby OrderBy  = 7;
+	bool   Desc                  = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_TITLE = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_CREATE_AT =  0;
+	EAO_TITLE =  1;
+}
+enum EnumLikeType{
+	ELT_LIKE = 0;
+	ELT_FAVORITE = 1;
+	ELT_WATCH = 2;
+}
+enum EnumResType{
+	ERT_CHAPTER = 0;
+	ERT_ARTICLE = 1;
+	ERT_COURSE = 2;
+}
+
+message LikeRequest{
+	string Id           = 1;
+	EnumLikeType Type   = 2;
+	string ResId        = 3;
+	EnumResType ResType = 4;
+	string Context      = 5;
+
+	User   User         = 52;
+
+}
+
+message LikeCountReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		LikeRequest Like = 1;
+		int32 Count      = 2;
+		bool  Taken      = 3;
+	}
+}
+message LikeReply{
+	bool ok = 1;
+	string message = 2;
+	LikeRequest data = 3;
+}
+
+message LikeListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated LikeRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 80 - 0
documents/proto/notification.proto

@@ -0,0 +1,80 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.notification.v1;
+
+
+/*
+ * 通知
+ * 
+ *  
+ * 
+ */
+service Notification{
+	rpc GetNotificationList (NotificationListRequest) returns (NotificationListReply){}
+	rpc GetNotification (NotificationRequest) returns (NotificationReply){}
+	rpc AddNotification (NotificationRequest) returns (NotificationReply){}
+	rpc DelNotification (NotificationRequest) returns (NotificationReply){}
+}
+
+message NotificationListRequest{
+	string Id = 1;
+	string Search = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  CurrentPage = 5;
+	int32  PerPage = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_WORD = 0;
+	EAS_NOTE = 1;
+}
+enum EnumAllowingOrderby{
+	EAO_UPDATED_AT = 0;
+	EAO_CREATED_AT = 1;
+	EAO_WORD       = 2;
+}
+
+enum EnumSendMethod{
+	ESM_WEB     = 0;
+	ESM_WECHAT  = 1;
+	ESM_DING    = 2;
+	ESM_EMAIL   = 3;
+}
+
+message NotificationRequest{
+	string Id                       = 1;
+	string Title                    = 2;
+	string Message                  = 3;	
+	repeated EnumSendMethod Method  = 4;
+	string Param                    = 5; // 发送参数,比如用wechat发送,要设置url
+	string Topic                    = 6; //Topic uuid
+	Studio Studio                   = 7;
+
+	string Lang             = 51;
+	User   Editor           = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message NotificationReply{
+	bool ok                  = 1;
+	string message           = 2;
+	NotificationRequest data = 3;
+}
+
+message NotificationListReply{
+	bool ok        = 1;
+	string message = 2;
+	message data{
+		repeated NotificationRequest rows = 1;
+		int32    Count                    = 2;
+		int32    CurrentPage              = 3;
+		int32    PerPage 				  = 4;
+	}
+}

+ 82 - 0
documents/proto/palicanon.proto

@@ -0,0 +1,82 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.palicanon.v1;
+
+
+/*
+ * pali 语料库
+ * 段落
+ * 句子
+ */
+service Palicanon{
+	rpc GetChapter (ParagraphRequest) returns (ChapterReply){}  
+	rpc GetParagraph (ParagraphRequest) returns (ParagraphReply){}
+
+	rpc GetChapterListByTag (TagRequest) returns (ChapterReply){}  //查找包涵指定标签的章节
+	rpc GetTagListByTag (TagRequest) returns (TagListReply){}  
+
+	rpc GetSimilarList (SimilarRequest) returns (SimilarListReply){}  
+}
+
+message ParagraphRequest{
+	string Id           = 1;   //uuid
+	int32 Book          = 2;   //书号
+	int32 Paragraph     = 3;   //段落编号
+	int32 Level         = 4;   //目录层级 标题1-7 偈诵编号8 正文100
+	string Title        = 5;   //标题 
+	string Text         = 6;   //纯文本
+	string Html         = 7;   //vri原文
+	string StrLen       = 8;   //纯文本段落字符串长度
+	int32  ChapterLen   = 9;   //纯文本章节字符串长度
+	int32  NextChapter  = 10;   //上一个章节
+	int32  PrevChapter  = 11;  //下一个章节
+	int32  Parent       = 12;  //父层级段落
+	string  Path        = 13;  //该段落全路径
+	repeated Tag        = 14;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+message ChapterReply{
+	bool ok = 1;
+	string message = 2;
+	repeated ParagraphRequest data = 3;
+}
+
+message ParagraphReply{
+	bool ok = 1;
+	string message = 2;
+	ParagraphRequest data = 3;
+}
+
+message TagRequest{
+	repeated string TagName = 1;
+}
+message TagList {
+	Tag Tag = 1;
+	int32 Count = 2;
+};
+message TagListReply{
+	bool ok               = 1;
+	string message        = 2;
+	repeated TagList data = 3;
+}
+
+message SimilarRequest{
+	int32 Book = 1;
+	int32 Paragraph = 2;
+	int32 Start = 3;
+	int32 End = 4;
+	string Text = 5;
+	string Path = 6;
+	int32  Translation = 7;
+	int32  Nissaya = 8;
+	int32  Commentray = 9;
+}
+message SimilarListReply{
+	bool Ok                      = 1;
+	string Message               = 2;
+	repeated SimilarRequest Data = 3;
+}

+ 66 - 0
documents/proto/recent.proto

@@ -0,0 +1,66 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.recent.v1;
+
+
+/*
+ * 栏目访问记录
+ * 比如阅读器访问记录。用于用户找到上次阅读的文章等。
+ * 
+ */
+service Recent{
+	rpc GetRecentListForUser (RecentListRequest) returns (RecentListReply){} //最近访问列表
+	rpc GetRecents (RecentRequest) returns (RecentReply){}
+}
+
+message RecentListRequest{
+	string Id                    = 1;
+	EnumResType ResType          = 2;
+	string Search                = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  CurrentPage           = 5;
+	int32  PerPage               = 6;
+	EnumAllowingOrderby OrderBy  = 7;
+	bool   Asc                   = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_NAME = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_CREATE_AT =  0;
+	EAO_NAME =  1;
+}
+
+enum EnumResType{
+	ERT_ALL = 0;
+	ERT_CHAPTER = 1;
+	ERT_ARTICLE = 2;
+	ERT_COURSE = 3;
+	ERT_WBW_EDITOR = 4;
+}
+
+message RecentRequest{
+	string Id           = 1;
+	EnumResType ResType = 2;
+	string Param         = 3; //json字符串 访问参数
+}
+
+
+message RecentReply{
+	bool ok = 1;
+	string message = 2;
+	RecentRequest data = 3;
+}
+
+message RecentListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated RecentRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 42 - 0
documents/proto/timeline.proto

@@ -0,0 +1,42 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.timeline.v1;
+
+
+/*
+ * 评论(修改建议/问答/评论)
+ * 
+ * 
+ */
+service Timeline{
+	rpc GetTimeline (TimelineRequest) returns (TimelineReply){}      
+	rpc AddTimeline (TimelineRequest) returns (TimelineReply){}    
+}
+
+enum EnumResType{
+	ERT_SENTENCE = 0;
+	ERT_ARTICLE  = 1;
+	ERT_COURSE   = 2;
+	ERT_WBW      = 3;
+}
+
+message TimelineRequest{
+	string Id           = 1;
+	string ResId        = 3;
+	EnumResType ResType = 4;
+	string Data         = 5;
+
+	User   Editor       = 52;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message TimelineReply{
+	bool ok = 1;
+	string message = 2;
+	repeated TimelineRequest data = 3;
+}
+

+ 32 - 0
documents/proto/user_setting.proto

@@ -0,0 +1,32 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.usersetting.v1;
+
+
+/*
+ * 用户设置
+ * 
+ * 
+ */
+service UserSetting{
+	rpc GetUserSetting (UserSettingRequest) returns (UserSettingReply){}
+	rpc SetUserSetting (UserSettingRequest) returns (UserSettingReply){}
+}
+
+
+message UserSettingRequest{
+	string UserId       = 1;
+	string Data         = 2;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message UserSettingReply{
+	bool ok = 1;
+	string message = 2;
+	UserSettingRequest data = 3;
+}
+