syntax = "proto3"; package wallet; option go_package = ".;wallet"; import "blocks.proto"; service Basic { //获取钱包信息 rpc GetWallet(GetWalletRequest) returns (GetWalletReply) {} //设置支付密码 rpc SetPayPassword(SetPayPasswordRequest) returns (StatusReply) {} //绑定微信或支付宝账户 rpc BindPaymentId(BindPaymentIDRequest) returns (StatusReply) {} //查询交易记录 rpc Transactions(TransactionsRequest) returns (TransactionsReply) {} //添加银行卡 rpc AddBankCard (AddBankCardRequest) returns (StatusReply) {}; //获取用户银行卡列表 rpc GetBankCard (FinanceEmpty) returns (GetBankCardReply) {}; //删除银行卡 rpc RmBankCard (RmBankCardRequest) returns (StatusReply) {}; //申请提现 rpc ApplyCash (ApplyCashRequest) returns (StatusReply) {}; } message GetWalletRequest { bool is_total_today_in=1; // 是否统计今日收入 bool is_total_today_out=2; // 是否统计今日支出 bool is_total_month_in=3; // 是否统计本月收入 bool is_total_month_out=4; // 是否统计本月支出 bool is_total_all_in=5; // 是否统计全部收入 bool is_total_all_out=6; // 是否统计全部支出 } message GetWalletReply { string passport_identity = 1; //用户唯一标识 string wallet_identity = 2; //钱包唯一标识 int64 balance = 3; //余额 int64 withdrawal_balance = 4; //可提现余额 int32 status = 5; //状态 -1禁用,1:正常 string alipay_id = 6; //支付宝ID string alipay_name = 7; //支付宝账户名 string wxpay_id = 8; //微信ID string wxpay_name = 9; //微信支付账户名 map total = 10; //统计数据输出 string created = 11; //创建时间 } message TransactionsRequest { int64 trans_type = 1; //收支类型:-1支出,1:收入 int64 trade_type = 2; //交易类型:1:充值,2:提现,3:消费,4:退款,5:收益 string start = 3; //账单起始日期 string end = 4; //账单截止日期 int64 page = 5; //分页 int64 page_size = 6; //单页容量 } message TransactionsReply { int64 total = 1; //总记录数 repeated Transaction records = 2; //数据 } message Transaction { int32 trans_type = 1; //收支类型:-1支出,1:收入 int32 trade_type = 2; //交易类型:1:充值,2:提现,3:消费,4:退款,5:收益 string in_trade_no = 3; //内部流水号 string out_trade_no = 4; //外部流水号,eg:微信、支付宝、银行等 int64 money = 5; //交易金额,单位:分 int64 fee = 6; //手续费,单位:分 int32 pay_channel = 7; //支付模型:WECHAT,ALIPAY,BALANCE string pay_type = 8; //支付类型 JSAPI:微信浏览器内支付 APP:app支付 MINI:小程序 NATIVE:Native支付,pc端生成二维码供用户扫码支付,QUICK_MSECURITY_PAY:app支付 QUICK_WAP_WAY:手机网站支付 FAST_INSTANT_TRADE_PAY:pc网站支付 string created = 9; //创建时间 string remark = 10; //备注信息 } message SetPayPasswordRequest { string passport_identity = 1; //用户唯一标识 string password = 2; //支付密码 } message BindPaymentIDRequest { int32 pay_type = 1; //支付类型:1:微信支付,2:支付宝 string auth_code = 2; //微信授权码 } message RefundRequest { string user_identification = 1; //用户唯一标识 int64 amount = 2; //退款金额,单位:分 int64 fee = 3; //手续费, 单位:分 string remark = 4; //交易备注 } message RefundReply { int64 balance = 1; //钱包剩余余额,单位:分 Transaction transaction = 2; //交易记录 } message AddBankCardRequest { string wallet_identity = 1; //钱包唯一标识 string card_no = 2; //银行卡号 string card_owner = 3; //持卡人姓名 string id_card = 4; //持卡人身份证 string phone = 5; //银行预留的手机号 } message FinanceEmpty { } message RmBankCardRequest { string identity = 2; //银行卡Identity } message GetBankCardReply { repeated BankCardInfo data = 1; } message BankCardInfo { int64 id = 1; string bank_number = 2; //银行卡号 string bank_name = 3; //银行名 string card_owner = 4; //持卡人姓名 string id_card = 5; //持卡人身份证号 string phone = 6; //银行预留的手机号 string bind_id = 7; //绑定银行卡返回的绑定id string bank_type = 8; //银行卡类型 DC为储蓄卡,CC为信用卡 string bank = 9; //银行卡所属行 string created = 10; //添加日期 } message ApplyCashRequest { int32 channel = 1; //提现的平台 1、微信 2、支付宝 3、银行卡 int64 amount = 2; //提现金额 单位为分 string remark = 3; //备注 }