syntax = "proto3";

option go_package = "/proto";

//附件传输
package proto;

message FileRequest {
  repeated Request message = 1; //文件名称
  string other = 2;     //信息id
  string topic = 3;
}

message Request {
  string fileName = 1; //文件名称
  string fileUrl = 2;     //下载的url
  bytes fileBytes = 3;     //文件字节流
  string fileType = 4;    //文件类型 pdf ,xls ,doc
  int32 returnType = 5;    //文件类型 {0:url,1:content,2:url+content} 默认0
  int32 extractType = 6;  //解析文件类型{0:oss，1:fileBytes,2:url} 默认0
}

message FileResponse {
  repeated Result result = 1;  //返回结果
  string other = 2;     //信息id
}

message Result{
  string fileName = 1;  //文件名称
  string textContent = 2;   //文本内容
  string textUrl = 3;      //文本URL
  string filePath = 4;  //文件路径
  string errorState = 5;   //错误状态{0:文件下载失败，1：文件解析失败}
}


service FileExtract {
  rpc FileExtract(FileRequest) returns (FileResponse);
}
