Преглед на файлове

Merge pull request #996 from visuddhinanda/laravel

微服务模块划分初步完成
visuddhinanda преди 3 години
родител
ревизия
68386c452f

BIN
documents/images/module.png


+ 4 - 1
documents/proto/article.proto

@@ -1,5 +1,8 @@
 syntax = "proto3";
 import "public.proto";
+
+package pcds.article.v1;
+
 /*
  * Article 服务
  * 
@@ -28,7 +31,7 @@ message ArticleListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5;
-	int32  PageSize = 6;
+	int32  PerPage = 6;
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }

+ 4 - 2
documents/proto/channel.proto

@@ -1,7 +1,9 @@
 syntax = "proto3";
 import "public.proto";
 
-package channel;
+package pcds.channel.v1;
+
+
 /*
  * channel/版本 服务
  * Studio 建立的时候会建立一个默认channel 
@@ -20,7 +22,7 @@ message ChannelListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5;
-	int32  PageSize = 6;
+	int32  PerPage = 6;
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }

+ 3 - 2
documents/proto/chapter.proto

@@ -1,7 +1,8 @@
 syntax = "proto3";
 import "public.proto";
 
-package chapter;
+package pcds.chapter.v1;
+
 /*
  * channel/版本 服务
  */
@@ -21,7 +22,7 @@ message ChapterListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5;
-	int32  PageSize = 6;
+	int32  PerPage = 6;
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }

+ 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;
+	}
+}

+ 3 - 2
documents/proto/course.proto

@@ -1,7 +1,8 @@
 syntax = "proto3";
 import "public.proto";
 
-package course;
+package pcds.course.v1;
+
 /*
  * 课程服务 
  */
@@ -19,7 +20,7 @@ message CourseListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5; //current page number
-	int32  PageSize = 6; //The number of items to be shown per page.
+	int32  PerPage = 6; //The number of items to be shown per page.
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }

+ 55 - 14
documents/proto/dictionary.proto

@@ -1,13 +1,14 @@
 syntax = "proto3";
 import "public.proto";
 
-package dictionary;
+package pcds.dictionary.v1;
+
 
 /*
  * dictionary 服务
- * 逐词译数据推送到社区字典,当这个channel是公开channel的时候。以channel的名义公开。不是公开channel ,推送到该studio默认channel
- * 每个channel对应一个且仅一个用户字典
- * 协作用户使用公共channel干活。公开的社区词典数据进到这个channel ,以及自己的默认channel
+ * 
+ * 
+ * 
  */
 service Dictionary{
 	//词典管理
@@ -26,6 +27,13 @@ service Dictionary{
 	rpc SetWord (WordRequest) returns (DictReply){}
 	rpc AddWord (WordRequest) returns (DictReply){}
 	rpc DelWord (WordRequest) returns (DictReply){}
+
+	//单词变格计算
+	rpc WordToBase(WordCaseRequest) returns (WordBaseReplay){}
+	rpc BaseToWord(WordCaseRequest) returns (WordListReply){}
+
+	//复合词自动拆词
+	rpc TurboSplit(TurboSplitRequest) returns (WordListReply){}
 }
 
 message DictListRequest{
@@ -33,7 +41,7 @@ message DictListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5;
-	int32  PageSize = 6;
+	int32  PerPage = 6;
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }
@@ -87,18 +95,21 @@ message DictListReply{
 
 
 message WordListRequest{
-	string Id = 1;
-	string Search = 3;
-	EnumAllowingSearch SearchCol = 4;
-	int32  CurrentPage = 5;
-	int32  PageSize = 6;
-	EnumAllowingOrderby OrderBy = 7;
-	bool   Desc = 8;
+	string Id       = 1;
+
+	EnumAllowingSearch SearchCol = 2;
+	string Search                = 3;
+	EnumAllowingOrderby OrderBy  = 4;
+	bool   Desc                  = 5;
+
+	int32  CurrentPage = 6;
+	int32  PerPage     = 7;
 }
 
 enum EnumWordAllowingSearch{
-	EWAS_WORD = 0;
-	EWAS_NOTE = 1;
+	EWAS_ALL = 0;
+	EWAS_WORD = 1;
+	EWAS_NOTE = 2;
 }
 enum EnumWordAllowingOrderby{
 	EWAO_UPDATED_AT = 0;	
@@ -145,4 +156,34 @@ message WordListReply{
 		int32    PageNo = 3;
 		int32    PageSize = 4;
 	}
+}
+
+//自动变格查询参数
+message WordCaseRequest{
+	string Word   = 1;
+	int32  Deep   = 2;//查询最大深度
+	bool   Verify = 3; //是否需要验证结果的存在性
+}
+
+message WordBaseReplay{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated WordBaseList Rows = 1;
+		int32    Count             = 2;
+		int32    PageNo            = 3;
+		int32    PageSize          = 4;
+	}
+}
+
+message WordBaseList{
+	string Base =  1;
+	fixed32 Confidence = 2;
+	repeated WordRequest Rows = 3;
+}
+
+
+//复合词自动拆词参数
+message TurboSplitRequest{
+	string Word = 1;
 }

+ 5 - 4
documents/proto/group.proto

@@ -1,7 +1,8 @@
 syntax = "proto3";
 import "public.proto";
 
-package group;
+package pcds.group.v1;
+
 /*
  * Group/群组 服务
  */
@@ -23,7 +24,7 @@ message GroupListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5; //current page number
-	int32  PageSize = 6; //The number of items to be shown per page.
+	int32  PerPage = 6; //The number of items to be shown per page.
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }
@@ -63,8 +64,8 @@ message GroupListReply{
 	message data{
 		repeated GroupRequest rows = 1;
 		int32    Count = 2;
-		int32    PageNo = 3;
-		int32    PageSize = 4;
+		int32    CurrentPage = 3;
+		int32    PerPage = 4;
 	}
 }
 message MemberReply{

+ 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;
+	}
+}

+ 101 - 0
documents/proto/operation.proto

@@ -0,0 +1,101 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.operation.v1;
+
+/*
+ * 用户编辑操作记录
+ * 
+ *  
+ * 
+ */
+service Operation{
+	rpc GetOperation (OperationListRequest) returns (OperationReply){}     //以操作为单位返回记录	
+	rpc GetOperationByFrame (OperationListRequest) returns (OperationReply){}     //以操作块为单位返回记录	
+	rpc GetOperationByDay (OperationListRequest) returns (OperationReply){}     //以天为单位返回记录
+}
+
+/**
+ *    $active_type[10] = "_CHANNEL_EDIT_";//编辑channel信息——项目
+    $active_type[11] = "_CHANNEL_NEW_";//创建channel——项目
+    $active_type[20] = "_ARTICLE_EDIT_";//article编辑——项目
+    $active_type[21] = "_ARTICLE_NEW_";//article创建——项目
+    $active_type[30] = "_DICT_LOOKUP_";//查字典——通用
+    $active_type[40] = "_TERM_EDIT_";//编辑术语——研究
+    $active_type[41] = "_TERM_LOOKUP_";//术语查询——研究
+    $active_type[60] = "_WBW_EDIT_";//逐词解析编辑——基本功
+    $active_type[70] = "_SENT_EDIT_";//句子译文编辑——翻译
+    $active_type[71] = "_SENT_NEW_";//新建句子译文——翻译
+    $active_type[80] = "_COLLECTION_EDIT_";//文集编辑——项目
+    $active_type[81] = "_COLLECTION_NEW_";//文集编辑——项目
+    $active_type[90] = "_NISSAYA_FIND_";//找nissaya——研究
+ */
+enum EnumOperationType{
+	EOT_UNKNOW =  0;
+
+	EAO_CHANNEL_ADD =  101;
+	EAO_CHANNEL_SET =  102;
+	EAO_CHANNEL_DEL =  199;
+
+	EAO_ARTICLE_ADD =  201;
+	EAO_ARTICLE_SET =  202;
+	EAO_ARTICLE_DEL =  299;
+
+	EAO_DICT_GET =  300;
+	EAO_DICT_ADD =  301;
+	EAO_DICT_SET =  302;
+	EAO_DICT_DEL =  399;
+
+	EAO_TERM_ADD =  401;
+	EAO_TERM_SET =  402;
+	EAO_TERM_DEL =  499;
+
+	EAO_WBW_ADD =  501;
+	EAO_WBW_SET =  502;
+	EAO_WBW_DEL =  599;
+
+	EAO_SENT_ADD =  601;
+	EAO_SENT_SET =  602;
+	EAO_SENT_DEL =  699;
+
+	EAO_COURSE_ADD =  701;
+	EAO_COURSEE_SET =  702;
+	EAO_COURSE_DEL =  799;
+
+	EAO_ANTHOLOGYE_ADD =  801;
+	EAO_ANTHOLOGYE_SET =  802;
+	EAO_ANTHOLOGYE_DEL =  899;
+
+	EAO_NISSAYA_GET =  900;
+
+}
+
+message OperationListRequest{
+	string UserId   = 1;
+	string Start    = 2;
+	string End      = 3;
+}
+
+/**
+编辑操作详情
+*/
+message OperationList{
+	string Id         = 1;
+	string StartAt    = 2;
+	string EndAt      = 3;
+	int32  OperationType   = 4;	
+	string Data          = 5;	
+
+	User   User           = 52;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message OperationReply{
+	bool ok          = 1;
+	string message   = 2;
+	repeated OperationList data = 3;
+}
+

+ 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;
+}

+ 10 - 0
documents/proto/public.proto

@@ -1,10 +1,20 @@
 syntax = "proto3";
 
+
+
 enum EnumContentType{
 	ECT_MARKDOWN = 0;
 	ECT_HTML = 1;
 	ECT_TEXT = 2;
 }
+
+enum EnumResType{
+	ERT_CHANNEL = 0;
+	ERT_TRANSLATION = 1;
+	ERT_CHAPTER = 2;
+	ERT_ARTICLE = 3;
+}
+
 enum EnumPublicity{
 	EP_PRIVATE = 0;
 	EP_PUBLIC = 1;

+ 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;
+	}
+}

+ 6 - 3
documents/proto/studio.proto

@@ -1,6 +1,9 @@
 syntax = "proto3";
 import "public.proto";
 
+package pcds.studio.v1;
+
+
 /*
  * studio 服务
  * 每个用户注册时有一个默认studio。与用户名相同。
@@ -21,7 +24,7 @@ message StudioListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5;
-	int32  PageSize = 6;
+	int32  PerPage = 6;
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }
@@ -57,7 +60,7 @@ message StudioListReply{
 	message data{
 		repeated StudioRequest rows = 1;
 		int32    Count = 2;
-		int32    PageNo = 3;
-		int32    PageSize = 4;
+		int32    CurrentPage = 3;
+		int32    PerPage = 4;
 	}
 }

+ 82 - 0
documents/proto/tag.proto

@@ -0,0 +1,82 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.tag.v1;
+
+
+/*
+ * Tag 服务
+ * 
+ *  
+ * 
+ */
+service Tag{
+	rpc GetResListByTag (ResListRequest) returns (TagListReply){}
+	rpc GetTagListByRes (TagListResRequest) returns (TagListReply){}
+
+	rpc GetTagListForStudio (TagListRequest) returns (TagListReply){}
+	rpc GetTag (TagRequest) returns (TagReply){}
+	rpc SetTag (TagRequest) returns (TagReply){}
+	rpc AddTag (TagRequest) returns (TagReply){}
+	rpc DelTag (TagRequest) returns (TagReply){}
+}
+
+message TagListRequest{
+	string Id = 1;
+	string Search = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  CurrentPage = 5;
+	int32  PerPage = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+message ResListRequest{
+	repeated string TagId = 1;
+	EnumResType ResType = 2;
+}
+message TagListResRequest{
+	repeated string ResId = 1;
+}
+
+enum EnumAllowingSearch{
+	EAS_Name = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_UPDATED_AT = 0;
+	EAO_CREATED_AT = 1;
+	EAO_Name       = 2;
+}
+
+message TagRequest{
+	string Id          = 1;
+	string Name        = 2;
+	string Description = 3;	
+	int32  Color       = 4;
+	Studio Studio      = 5;
+
+	string Lang             = 51;
+	User   Editor           = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message TagReply{
+	bool ok          = 1;
+	string message   = 2;
+	TagRequest data = 3;
+}
+
+message TagListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated TagRequest rows = 1;
+		int32    Count = 2;
+		int32    CurrentPage = 3;
+		int32    PerPage = 4;
+	}
+}

+ 5 - 4
documents/proto/term.proto

@@ -1,7 +1,8 @@
 syntax = "proto3";
 import "public.proto";
 
-package term;
+package pcds.term.v1;
+
 
 /*
  * Term 服务
@@ -24,7 +25,7 @@ message TermListRequest{
 	string Search = 3;
 	EnumAllowingSearch SearchCol = 4;
 	int32  CurrentPage = 5;
-	int32  PageSize = 6;
+	int32  PerPage = 6;
 	EnumAllowingOrderby OrderBy = 7;
 	bool   Desc = 8;
 }
@@ -70,7 +71,7 @@ message TermListReply{
 	message data{
 		repeated TermRequest rows = 1;
 		int32    Count = 2;
-		int32    PageNo = 3;
-		int32    PageSize = 4;
+		int32    CurrentPage = 3;
+		int32    PerPage = 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;
+}
+

+ 55 - 0
documents/proto/translation.proto

@@ -0,0 +1,55 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.translation.v1;
+
+
+/*
+ * 译文
+ * 
+ *  
+ * 
+ */
+service Translation{
+	rpc GetTranslation (TranslationListRequest) returns (TranslationReply){}
+	rpc SetTranslation (TranslationListRequest) returns (TranslationReply){}
+	rpc AddTranslation (TranslationListRequest) returns (TranslationReply){}
+	rpc DelTranslation (TranslationListRequest) returns (TranslationReply){}
+
+	rpc GetPr (TranslationListRequest) returns (TranslationReply){}
+	rpc SetPr (TranslationListRequest) returns (TranslationReply){}
+	rpc AddPr (TranslationListRequest) returns (TranslationReply){}
+	rpc DelPr (TranslationListRequest) returns (TranslationReply){}
+}
+
+message TranslationRequest{
+	string Id                   = 1;
+	string Book                 = 2;
+	string Paragraph            = 3;
+	string Start                = 4;
+	string End                  = 5;
+	string Channel              = 7;
+	string Content              = 8;
+	EnumContentType ContentType = 9;
+	string Html                 = 10;
+
+	string Lang             = 51;
+	User   Editor           = 52;
+	EnumPublicity Publicity = 53;
+	int32 Version           = 54;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+message TranslationListRequest{
+	repeated TranslationRequest data = 1;
+}
+
+message TranslationReply{
+	bool Ok = 1;
+	string Message = 2;
+	message Data{
+		repeated TranslationRequest Rows = 1;
+	}
+}

+ 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;
+}
+

+ 62 - 0
documents/proto/wbw.proto

@@ -0,0 +1,62 @@
+syntax = "proto3";
+import "public.proto";
+
+package pcds.wbw.v1;
+
+/*
+ * 逐词解析 服务
+ * 
+ *  
+ * 
+ */
+service Wbw{
+	rpc GetWbwForPara (WbwListRequest) returns (WbwReply){}     //获取一个段落的逐词译信息
+	rpc AddWbwForPara (WbwParaSaveRequest) returns (WbwReply){}	
+	rpc SetWbwForPara (WbwParaSaveRequest) returns (WbwReply){} //批量保存。用于调整词序的保存。
+
+	rpc GetWbw (WbwRequest) returns (WbwReply){}
+	rpc SetWbw (WbwRequest) returns (WbwReply){}
+	rpc DelWbw (WbwRequest) returns (WbwReply){}
+}
+
+message WbwListRequest{
+	int32 Book        = 2;
+	int32 Paragraph   = 3;	
+	string Channel     = 4;
+}
+
+message WbwRequest{
+	string Id         = 1;
+	int32 Book        = 2;
+	int32 Paragraph   = 3;	
+	int32 Sn          = 4;	
+	string Data       = 5;	
+	string Channel    = 6;
+	string Studio     = 7;
+
+	string Lang             = 51;
+	User   Editor           = 52;
+	EnumPublicity Publicity = 53;
+
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+message WbwParaSaveRequest{
+	WbwListRequest info = 1;
+	repeated WbwRequest data = 2;
+}
+
+message WbwReply{
+	bool ok          = 1;
+	string message   = 2;
+	WbwRequest data = 3;
+}
+
+message WbwParaReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated WbwRequest rows = 1;
+	}
+}