app-cloudep-product-service/generate/protobuf/product.proto

221 lines
6.1 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package product;
option go_package="./product";
// OKResp
message OKResp {}
// NoneReq
message NoneReq {}
// ====================== Category Param ======================
message CreateCategoryReq {
string name = 1;
}
message ModifyCategoryReq {
string id =1;
string name = 2;
}
message CategoryReq {
string id =1;
}
message Category {
string id =1;
string name =2;
int64 create_time=3;
int64 update_time=4;
}
message ListCategoryReq {
int64 page_index =1;
int64 page_size =2;
repeated string ids=3;
}
message ListCategoryResp {
int64 total =1;
repeated Category data=3;
}
// ====================== Tags Param ======================
message CreateTagsReq{
int32 types=1;
string name=2;
int64 show_type=3;
optional string cover=4;
}
message ModifyTagsReq{
string id=1;
optional int32 types=2;
optional string name=3;
optional int64 show_type=4;
optional string cover=5;
}
message TagsReq {
string id =1;
}
message Tags{
string id=1;
int32 types=2;
string name=3;
int64 show_type=4;
string cover=5;
int64 update_at=6;
int64 created_at=7;
}
message ListTagsReq {
int64 page_index =1;
int64 page_size =2;
repeated string ids=3;
optional string name=4;
optional int32 types=5;
optional int64 show_type=6;
}
message ListTagsResp {
int64 total =1;
repeated Tags data=3;
}
// ====================== KYC Param ======================
message KYC {
string id = 1; // MongoDB ObjectID 字串格式
string uid = 2; // 驗證人 UID
string country_region = 3; // 地區(例如 "TW", "JP", "US"...
string name = 4; // 真實姓名
string identification = 5; // 身分證字號 or 護照號碼
string identification_type = 6; // ID 類型ID_CARD, PASSPORT, RESIDENT_CERT
string address = 7; // 戶籍地址(或居住地址)
string postal_code = 8; // 郵遞區號(海外使用)
string id_front_image = 9; // 身分證/護照 正面
string id_back_image = 10; // 身分證/居留證 反面
string bank_statement_img = 11; // 銀行存摺封面照
string bank_code = 12; // 銀行代碼(可為 SWIFT
string bank_name = 13; // 銀行名稱(顯示用)
string branch_code = 14; // 分行代碼
string branch_name = 15; // 分行名稱(顯示用)
string bank_account = 16; // 銀行帳號
string status = 17; // 審核狀態PENDING, APPROVED, REJECTED
string reject_reason = 18; // 若被駁回,原因描述
int64 updated_at = 19; // 更新時間timestamp
int64 created_at = 20; // 建立時間timestamp
}
message CreateKYCReq {
string uid = 1;
string country_region = 2;
string name = 3;
string identification = 4;
string identification_type = 5;
string address = 6;
string postal_code = 7;
string id_front_image = 8;
string id_back_image = 9;
string bank_statement_img = 10;
string bank_code = 11;
string bank_name = 12;
string branch_code = 13;
string branch_name = 14;
string bank_account = 15;
}
message FindLatestKYCByUIDReq {
string uid = 1;
}
message FindKYCByIDReq {
string id = 1;
}
message ListKYCReq {
optional string uid = 1;
optional string country = 2;
optional string status = 3; // 可改 enum
int64 page_size = 4;
int64 page_index = 5;
bool sort_by_date = 6;
}
message ListKYCResp {
repeated KYC list = 1;
int64 total = 2;
}
message UpdateKYCStatusReq {
string id = 1;
string status = 2; // 可改 enumPENDING, APPROVED, REJECTED
optional string reason = 3;
}
message UpdateKYCInfoReq {
string id = 1;
optional string name = 2;
optional string identification = 3;
optional string identification_type = 4;
optional string address = 5;
optional string postal_code = 6;
optional string id_front_image = 7;
optional string id_back_image = 8;
optional string bank_statement_img = 9;
optional string bank_code = 10;
optional string bank_name = 11;
optional string branch_code = 12;
optional string branch_name = 13;
optional string bank_account = 14;
}
service Product {
// ====================== Category Service Start ======================
// CreateCategory 建立 product 分類
rpc CreateCategory(CreateCategoryReq) returns(OKResp);
// ModifyCategory 修改 product 分類名稱
rpc ModifyCategory(ModifyCategoryReq) returns(OKResp);
// DeleteCategory 刪除 product 分類
rpc DeleteCategory(CategoryReq) returns(OKResp);
// GetCategory 取得 product 分類
rpc GetCategory(CategoryReq) returns(Category);
// ListCategory 建立 product 分類
rpc ListCategory(ListCategoryReq) returns(ListCategoryResp);
// ====================== Category Service End ======================
// ====================== Tags Service Start ======================
// CreateTags 建立 tags
rpc CreateTags(CreateTagsReq) returns(OKResp);
// ModifyTags 修改 tags
rpc ModifyTags(ModifyTagsReq) returns(OKResp);
// DeleteTags 刪除tags
rpc DeleteTags(TagsReq) returns(OKResp);
// GetTags 取得 tags
rpc GetTags(TagsReq) returns(Tags);
// ListTags 建立 tags
rpc ListTags(ListTagsReq) returns(ListTagsResp);
// ====================== Tags Service End ======================
// ====================== Know You Customer Service Start ======================
// CreateKYC 建立 KYC 資料
rpc CreateKYC (CreateKYCReq) returns (OKResp);
// FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄
rpc FindLatestKYCByUID (FindLatestKYCByUIDReq) returns (KYC);
// FindKYCByID 根據 KYC ID 查詢
rpc FindKYCByID (FindKYCByIDReq) returns (KYC);
// ListKYC 分頁查詢 KYC 清單(後台審核用)
rpc ListKYC (ListKYCReq) returns (ListKYCResp);
// UpdateKYCStatus 更新 KYC 審核狀態與原因
rpc UpdateKYCStatus (UpdateKYCStatusReq) returns (OKResp);
// UpdateKYCInfo 更新使用者的 KYC尚未審核
rpc UpdateKYCInfo (UpdateKYCInfoReq) returns (OKResp);
// ====================== Know You Customer Service End ======================
}