syntax = "proto3";
option csharp_namespace = "TMDGrpc.KnowledgeService";
option java_package = "TMDGrpc.KnowledgeService";
package TMDGrpc;


service KnowledgeService {
   //查询知识点
   rpc FinKnowledge(Dict) returns(stream Knowledge);

   //保存知识点
   rpc SaveKnowledge(stream Knowledge) returns(stream Knowledge);

   //删除知识点
   rpc DeleteKnowledge(ListPid) returns(ListPid);

}



//请求参数Dict
message Dict {
   //数字Dict
   map<string,double> NMap = 1;
   //字符串Dict
   map<string,string> SMap = 2;
   //布尔Dict
   map<string,bool> BMap = 3;
   //字符串ListMap
   repeated LSMap LSMap = 4;
   //数字ListMap
   repeated LNMap LNMap = 5;
   //Byte ListMap
   repeated LBMap LBMap = 6;
}

//Byte[] Map
message LBMap {
   //Key
   string Key = 1;
   //byte数组
   bytes Value = 2;
}

//数字ListMap
message LNMap {
   //Key
   string Key = 1;
   //数字数组
   repeated double Value = 2 [packed = false];
}

//字符串ListMap
message LSMap {
   //数字Dict
   string Key = 1;
   //字符串数组
   repeated string Value = 2;
}

//知识点
message Knowledge {
   string id = 1;
   //标记为知识块，0=知识块 ，1 知识点
   int32 type = 2;
   //名称
   string name = 3;
   //描述
   string alias = 4;
   //学科
   string subjectCode = 5;
   //学校编码 如果是教师个人知识点为醍摩豆id 否则为学校编码
   string scopeCode = 6;
   int32 order = 7;
   //删除状态0 删除 1 有效
   int32 status = 8;
   //知识点 id
   repeated string points = 9;
   //来自于标准表 Rowkey
   string knowledgeId = 10;
   //0 标准，1自建，2.....
   int32 source = 11;
   //学段 私有的没有学段
   string period = 12;
}

enum HttpStatusCode {
   option allow_alias = true;
   ZERO = 0; // proto3 requires a zero value as the first item (it can be named anything)
   Continue = 100;
   SwitchingProtocols = 101;
   Processing = 102;
   EarlyHints = 103;
   OK = 200;
   Created = 201;
   Accepted = 202;
   NonAuthoritativeInformation = 203;
   NoContent = 204;
   ResetContent = 205;
   PartialContent = 206;
   MultiStatus = 207;
   AlreadyReported = 208;
   IMUsed = 226;
   Ambiguous = 300;
   MultipleChoices = 300;
   MovedPermanently = 301;
   Moved = 301;
   Found = 302;
   Redirect = 302;
   SeeOther = 303;
   RedirectMethod = 303;
   NotModified = 304;
   UseProxy = 305;
   Unused = 306;
   TemporaryRedirect = 307;
   RedirectKeepVerb = 307;
   PermanentRedirect = 308;
   BadRequest = 400;
   Unauthorized = 401;
   PaymentRequired = 402;
   Forbidden = 403;
   NotFound = 404;
   MethodNotAllowed = 405;
   NotAcceptable = 406;
   ProxyAuthenticationRequired = 407;
   RequestTimeout = 408;
   Conflict = 409;
   Gone = 410;
   LengthRequired = 411;
   PreconditionFailed = 412;
   RequestEntityTooLarge = 413;
   RequestUriTooLong = 414;
   UnsupportedMediaType = 415;
   RequestedRangeNotSatisfiable = 416;
   ExpectationFailed = 417;
   MisdirectedRequest = 421;
   UnprocessableEntity = 422;
   Locked = 423;
   FailedDependency = 424;
   UpgradeRequired = 426;
   PreconditionRequired = 428;
   TooManyRequests = 429;
   RequestHeaderFieldsTooLarge = 431;
   UnavailableForLegalReasons = 451;
   InternalServerError = 500;
   NotImplemented = 501;
   BadGateway = 502;
   ServiceUnavailable = 503;
   GatewayTimeout = 504;
   HttpVersionNotSupported = 505;
   VariantAlsoNegotiates = 506;
   InsufficientStorage = 507;
   LoopDetected = 508;
   NotExtended = 510;
   NetworkAuthenticationRequired = 511;
}

message IdPk {
   string id = 1;
   string pk = 2;
   HttpStatusCode StatusCode = 3;
}

message ListPid {
   //list IdPk
   repeated IdPk idPks = 1;
}