فهرست منبع

:construction: create

visuddhinanda 3 سال پیش
والد
کامیت
540f2e2876
5فایلهای تغییر یافته به همراه350 افزوده شده و 0 حذف شده
  1. 115 0
      documents/proto/article.proto
  2. 71 0
      documents/proto/channel.proto
  3. 79 0
      documents/proto/course.proto
  4. 23 0
      documents/proto/public.proto
  5. 62 0
      documents/proto/studio.proto

+ 115 - 0
documents/proto/article.proto

@@ -0,0 +1,115 @@
+syntax = "proto3"
+import "public.proto"
+/*
+ * Article 服务
+ * 
+ * 
+ * 
+ */
+service Article{
+	rpc GetArticleListForStudio (ArticleListRequest) returns (ArticleListReply){}
+	rpc GetArticle (ArticleRequest) returns (ArticleReply){}
+	rpc SetArticle (ArticleRequest) returns (ArticleReply){}
+	rpc AddArticle (ArticleRequest) returns (ArticleReply){}
+	rpc DelArticle (ArticleRequest) returns (ArticleReply){}
+	rpc AddArticleToAnthologye (ArticleRequest) returns (ArticleReply){}
+	rpc RemoveArticleFromAnthologye (ArticleRequest) returns (ArticleReply){}
+
+	rpc GetAnthologyListForStudio (ArticleListRequest) returns (AnthologyeListReply){}
+	rpc GetAnthologye (AnthologyeRequest) returns (AnthologyeReply){}
+	rpc SetAnthology (AnthologyeRequest) returns (AnthologyeReply){}
+	rpc AddAnthology (AnthologyeRequest) returns (AnthologyeReply){}
+	rpc DelAnthology (AnthologyeRequest) returns (AnthologyeReply){}
+}
+
+message ArticleListRequest{
+	string Id = 1;
+	string Search = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  PageNo = 5;
+	int32  PageSize = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_TITLE = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_UPDATED_AT =  0;
+	EAO_CREATED_AT =  1;
+	EAO_TITLE =  2;
+}
+
+
+
+message ArticleRequest{
+	string Id        = 1;
+	string Title     = 2;
+	string Subtitle  = 3;
+	string Summary   = 4;	
+	string Content   = 5;	
+	EnumContentType ContentType = 6;
+	string Html = 7;
+	repeated Tag Tags = 8;
+	repeated Channel Channels = 9;
+
+	string Lang = 51;
+	string EditorId = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+
+message ArticleReply{
+	bool ok = 1;
+	string message = 2;
+	ArticleRequest data = 3;
+}
+
+message ArticleListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated ArticleRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}
+
+message AnthologyeRequest{
+	string Id        = 1;
+	string Title     = 2;
+	string Subtitle  = 3;
+	string Summary   = 4;	
+	string ArticleList   = 5;	
+	repeated Tag Tags = 6;
+
+	string Lang = 51;
+	string EditorId = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+message AnthologyeReply{
+	bool ok = 1;
+	string message = 2;
+	AnthologyeRequest data = 3;
+}
+
+message AnthologyeListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated AnthologyeRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 71 - 0
documents/proto/channel.proto

@@ -0,0 +1,71 @@
+syntax = "proto3"
+import "public.proto"
+/*
+ * channel/版本 服务
+ */
+service Channel{
+	rpc GetChannelListForChannel (ChannelListRequest) returns (ChannelListReply){}
+	rpc GetChannel (ChannelRequest) returns (ChannelReply){}
+	rpc SetChannel (ChannelRequest) returns (ChannelReply){}
+	rpc AddChannel (ChannelRequest) returns (ChannelReply){}
+	rpc DelChannel (ChannelRequest) returns (ChannelReply){}
+}
+
+message ChannelListRequest{
+	string Id = 1;
+	string Search = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  PageNo = 5;
+	int32  PageSize = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_NAME = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_CREATE_AT =  0;
+	EAO_NAME =  1;
+}
+
+enum EnumChannelType{
+	ECT_TRANSLATION = 0;
+	ECT_ORIGINAL = 1;
+	ECT_NISSAYA = 2;
+	ECT_COMMENTRAY = 3;
+	ECT_GENERAL = 4;
+}
+
+message ChannelRequest{
+	string Id        = 1;
+	string Name     = 2;
+	string Summary   = 3;	
+	EnumChannelType ChannelType = 4;
+	string StudioId     = 5;
+
+	string Lang = 51;
+	string EditorId = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+
+
+message ChannelReply{
+	bool ok = 1;
+	string message = 2;
+	ChannelRequest data = 3;
+}
+
+message ChannelListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated ChannelRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 79 - 0
documents/proto/course.proto

@@ -0,0 +1,79 @@
+syntax = "proto3"
+import "public.proto"
+/*
+ * 课程服务
+ */
+service Course{
+	rpc GetCourseListForStudio (CourseListRequest) returns (CourseListReply){}
+	rpc GetCourseListForCourse (CourseListRequest) returns (CourseListReply){}
+	rpc GetCourse (CourseRequest) returns (CourseReply){}
+	rpc SetCourse (CourseRequest) returns (CourseReply){}
+	rpc AddCourse (CourseRequest) returns (CourseReply){}
+	rpc DelCourse (CourseRequest) returns (CourseReply){}
+}
+
+message CourseListRequest{
+	string Id = 1;
+	string Search = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  PageNo = 5;
+	int32  PageSize = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_TITLE = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_START_AT =  0;
+	EAO_TITLE =  1;
+}
+
+message CourseRequest{
+	string Id        = 1;
+	string Title     = 2;
+	string Subtitle  = 3;
+	string Summary   = 4;	
+	string Cover     = 5;	
+	string Content   = 6;	
+	EnumContentType ContentType = 6;
+	string Html = 8;
+	string StartAt     = 7;
+	string EndAt       = 8;
+	repeated Tag Tags = 6;
+
+	string Lang = 51;
+	string EditorId = 52;
+	EnumPublicity Publicity = 53;
+
+	string CreatedAt = 101; 
+	string UpdatedAt = 102; 
+}
+message CourseList{
+	string Id = 1;
+	string Title = 2;
+	string Subtitle = 3;
+	string Summary = 4;						
+	date   Start = 5;
+	date   End   = 6;
+	string Cover = 7;
+	int32  Children = 8;
+}
+
+message CourseReply{
+	bool ok = 1;
+	string message = 2;
+	CourseRequest data = 3;
+}
+
+message CourseListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated CourseList rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}

+ 23 - 0
documents/proto/public.proto

@@ -0,0 +1,23 @@
+syntax = "proto3"
+
+enum EnumContentType{
+	ECT_MARKDOWN = 0;
+	ECT_HTML = 1;
+	ECT_TEXT = 2;
+}
+enum EnumPublicity{
+	EP_PRIVATE = 0;
+	EP_PUBLIC = 1;
+	EP_PUBLICEDIT = 2;
+	EP_DISABLE = 100;
+}
+
+message Tag{
+	string Id = 0;
+	string Name = 1;
+}
+
+message Channel{
+	string Id = 0;
+	string Name = 1;
+}

+ 62 - 0
documents/proto/studio.proto

@@ -0,0 +1,62 @@
+syntax = "proto3"
+import "public.proto"
+/*
+ * studio 服务
+ * 每个用户注册时有一个默认studio。与用户名相同。
+ * 用户可以建立另外的studio 
+ * 默认studio 不能转让,其他studio可以转让
+ */
+service Studio{
+	rpc GetStudioListForUser (StudioListRequest) returns (StudioListReply){}
+	rpc GetStudio (StudioRequest) returns (StudioReply){}
+	rpc SetStudio (StudioRequest) returns (StudioReply){}
+	rpc TransferStudio (StudioRequest) returns (StudioReply){} //转让
+	rpc AddStudio (StudioRequest) returns (StudioReply){}
+	rpc DelStudio (StudioRequest) returns (StudioReply){}
+}
+
+message StudioListRequest{
+	string Id = 1;
+	string Search = 3;
+	EnumAllowingSearch SearchCol = 4;
+	int32  PageNo = 5;
+	int32  PageSize = 6;
+	EnumAllowingOrderby OrderBy = 7;
+	bool   Desc = 8;
+}
+
+enum EnumAllowingSearch{
+	EAS_NAME = 0;
+}
+enum EnumAllowingOrderby{
+	EAO_CREATE_AT =  0;
+	EAO_NAME =  1;
+}
+
+message StudioRequest{
+	string Id        = 1;
+	string Name     = 2;
+	string Summary   = 3;	
+	string Cover     = 4;	
+	string Owner     = 5;
+	string CreatedAt = 6; 
+	string UpdatedAt = 7; 
+}
+
+
+message StudioReply{
+	bool ok = 1;
+	string message = 2;
+	StudioRequest data = 3;
+}
+
+message StudioListReply{
+	bool ok = 1;
+	string message = 2;
+	message data{
+		repeated StudioRequest rows = 1;
+		int32    Count = 2;
+		int32    PageNo = 3;
+		int32    PageSize = 4;
+	}
+}