syntax = "proto3"; package card; option go_package = "ttmylife.com/zeuszhao/types/card;card"; option java_multiple_files = true; option java_package = "card"; import "third_party/google/api/annotations.proto"; import "common/user/account.proto"; import "card/common/card.proto"; import "common/aliyun/alioss.proto"; import "common/pagination/pagination.proto"; service Card { rpc CreateAccountUser (CreateAccountUserRequest) returns (CreateAccountUserReply) { option (google.api.http) = { post: "/v1/account/create" body: "*" }; } rpc LoginAccount (LoginAccountRequest) returns (LoginAccountReply) { option (google.api.http) = { post: "/v1/account/login" body: "*" }; } rpc WxRegisterLogin(WxRegisterLoginRequest) returns (WxRegisterLoginReply) { option (google.api.http) = { post: "/v1/account/wx/login" body: "*" }; } rpc CreateCard(CreateCardRequest) returns (CreateCardReply) { option (google.api.http) = { post: "/v1/card/create" body: "*" }; } rpc GetCardInfo(GetCardInfoRequest) returns (GetCardInfoReply) { option (google.api.http) = { post: "/v1/card/info" body: "*" }; } rpc GetMyCards(GetMyCardsRequest) returns (GetMyCardsReply) { option (google.api.http) = { post: "/v1/cards" body: "*" }; } rpc DelCard(DelCardInfoRequest) returns (DelCardReply) { option (google.api.http) = { post: "/v1/card/del" body: "*" }; } rpc SaveCard(SaveCardInfoRequest) returns (SaveCardReply) { option (google.api.http) = { post: "/v1/card/save" body: "*" }; } rpc SearchCard(SearchCardRequest) returns (SearchCardReply) { option (google.api.http) = { post: "/v1/card/search" body: "*" }; } rpc GetTemplates(GetTemplatesRequest) returns (GetTemplatesReply) { option (google.api.http) = { post: "/v1/card/templates" body: "*" }; } rpc CreateShareToken(CreateShareTokenRequest) returns (CreateShareTokenReply) { option (google.api.http) = { post: "/v1/card/token/create" body: "*" }; } rpc AddCardByShareToken(AddCardByShareTokenRequest) returns (AddCardByShareTokenReply) { option (google.api.http) = { post: "/v1/card/user/bind" body: "*" }; } rpc OCRCard(OCRCardRequest) returns (OCRCardReply) { option (google.api.http) = { post: "/v1/card/ocr" body: "*" }; } rpc OssUpload(OssUploadRequest) returns (OssUploadReplay) { option (google.api.http) = { post: "/v1/card/ossupload" body: "*" }; } } message OssUploadRequest{} message OssUploadReplay { aliyun.Oss body = 1; } message OCRCardRequest { string url = 1; } message OCRCardReply { common.CardBaseBody body = 1; repeated common.CardSupplementBaseBody supplements = 2; } message AddCardByShareTokenRequest { string token = 1; } message AddCardByShareTokenReply { bool ok = 1; } message CreateShareTokenRequest { uint32 card_id = 1; } message CreateShareTokenReply { string token = 1; string expire = 2; } message GetTemplatesRequest {} message GetTemplatesReply { repeated common.CardTemplateBody templates = 1; } message WxRegisterLoginRequest { string code = 1; } message WxRegisterLoginReply { string token = 1; } message GetMyCardsRequest { } message GetMyCardsReply { repeated common.CardBody cards = 1; repeated common.CardSupplementBaseBody supplements = 2; repeated common.CardTemplateBody templates = 3; } message SearchCardRequest { common.CardFilterBody filter = 1; pagination.PaginationBody page = 2; } message SearchCardReply { repeated common.CardBody cards = 1; repeated common.CardSupplementBaseBody supplements = 2; uint32 total = 3; } message SaveCardInfoRequest { uint32 card_id = 1; common.CardBaseBody card = 2; repeated common.CardSupplementBaseBody supplements = 3; } message SaveCardReply { bool ok = 1; } message DelCardInfoRequest { uint32 card_id = 1; } message DelCardReply { bool ok = 1; } message GetCardInfoRequest { uint32 card_id = 1; } message GetCardInfoReply { common.CardBaseBody card = 1; repeated common.CardSupplementBaseBody supplements = 2; common.CardTemplateBaseBody template = 3; } message CreateCardRequest { common.CardBaseBody card = 1; repeated common.CardSupplementBaseBody supplements = 2; } message CreateCardReply { uint32 id = 1; } message LoginAccountRequest { user.AccountBaseBody account = 1; } message LoginAccountReply { string token = 1; } message CreateAccountUserRequest { user.AccountBaseBody account = 1; } message CreateAccountUserReply { bool ok = 1; }