refactor: reorganize modules and add Linux build tooling

This commit is contained in:
2026-08-09 12:41:08 +08:00
parent 86024fa81d
commit 5cc5fd92ed
1461 changed files with 4054 additions and 4724 deletions

View File

@@ -0,0 +1,52 @@
syntax = "proto3";
package wallet;
option go_package = ".;wallet";
service Alipay {
//支付宝wap支付
rpc WapPay(AlipayTradeWapPayRequest) returns (AlipayTradeWapPayReply) {}
//支付宝电脑网站支付
rpc PagePay(AlipayTradePagePayRequest) returns (AlipayTradePagePayReply) {}
//支付宝APP支付
rpc AppPay(AlipayTradeAppPayRequest) returns (AlipayTradeAppPayReply) {}
//支付宝转账到个人支付宝账户
rpc Transfer(AlipayUniTransferRequest) returns (AlipayUniTransferReply) {}
}
message AlipayTradeWapPayRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //充值金额,单位:分
string description = 3; //商品描述
string notify_url = 4; //支付回调URL公网域名须为HTTPS
string quit_url = 5; //退出支付时用户返回的URL
}
message AlipayTradeWapPayReply {
string pay_url = 1; //支付链接
}
message AlipayTradePagePayRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //充值金额,单位:分
string description = 3; //商品描述
string notify_url = 4; //支付回调URL公网域名须为HTTPS
string return_url = 5; //支付成功时返回的URL
}
message AlipayTradePagePayReply {
string pay_url = 1; //支付链接
}
message AlipayTradeAppPayRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //充值金额,单位:分
string description = 3; //商品描述
string notify_url = 4; //支付回调URL公网域名须为HTTPS
}
message AlipayTradeAppPayReply {
string pay_param = 1; //调起支付的参数
}
message AlipayUniTransferRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //提现金额,单位:分
int64 fee = 3; //提现手续费,单位:分
string description = 4; //商品描述
}
message AlipayUniTransferReply {}

View File

@@ -0,0 +1,35 @@
syntax = "proto3";
package wallet;
option go_package = ".;wallet";
message FetchRequest {
int64 page_no=1; // 页数
int64 page_size=2; // 每页记录数
map<string,string> params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11
}
message IdentRequest{
int64 id = 1; // 唯一ID
string identity = 2; // 唯一码
}
message VersionRequest {
int64 version=1; // 时序版本号
}
message SearchRequest {
string keyword=1; //关键词
}
message StatusReply{
int32 code=1; // 状态码
string message=2; // 状态说明
string details=3; // 数据
int64 timeseq=4; // 响应时间序列
}
message Empty{
}

View File

@@ -0,0 +1,80 @@
syntax = "proto3";
package wallet;
option go_package = ".;wallet";
import "blocks.proto";
service Payment {
rpc Hello(Empty) returns (PaymentReply) {}
//获取平台支持的支付网关
rpc Way(WayRequest) returns (WayReply) {}
//获取支付的详情
rpc Get(IdentRequest) returns (PaymentItem){}
//支付-电商订单
rpc ByOrder (OrderRequest) returns (PaymentReply) {};
//支付-充值
rpc ByCharge (ChargeRequest) returns (PaymentReply) {};
//回调更新支付的结果和状态
rpc Callback (CallbackRequest) returns (StatusReply) {};
}
message WayRequest {
string platform=1;//平台
}
message WayReply {
repeated WayItem way=1; //支付通道列表
}
message WayItem {
string ident=1; //支付通道标识
string title=2; //支付通道标题
string intro=3; //支付通道说明
string args=4; //支付通道相关参数
}
message PaymentItem {
string order_no = 1; // 订单号
string trade_no = 2; // 第三方交易流水号
int32 type = 3; // 类型:1充值;2支付电商订单
int32 pay_channel = 4; // 支付模型WECHATALIPAY,BALANCE
string pay_type = 5; // 支付类型 JSAPI:微信浏览器内支付 APP:app支付 MINI:小程序 NATIVE:Native支付,pc端生成二维码供用户扫码支付,QUICK_MSECURITY_PAY:app支付 QUICK_WAP_WAY:手机网站支付 FAST_INSTANT_TRADE_PAY:pc网站支付
int64 amount = 6; //充值金额 单位为分
string args = 7; // 相关参数
int32 status = 8; // 支付状态
}
message ChargeRequest {
int64 amount = 1; //充值金额 单位为分
string remark = 2; //备注
int32 pay_channel = 3; //支付模型WECHATALIPAY
string pay_type = 4; //支付类型 JSAPI:微信浏览器内支付 APP:app支付 MWEB:H5支付 NATIVE:Native支付,pc端生成二维码供用户扫码支付,QUICK_MSECURITY_PAY:app支付 QUICK_WAP_WAY:手机网站支付 FAST_INSTANT_TRADE_PAY:pc网站支付
string desc=5; //支付描述
string open_id=6; //微信用户的OpenID
}
message OrderRequest {
string order_no = 1; //订单号
int32 pay_channel = 2; //支付模型WECHATALIPAY,BALANCE
string pay_type = 3; //支付类型 JSAPI:微信浏览器内支付 APP:app支付 MINI:小程序 NATIVE:Native支付,pc端生成二维码供用户扫码支付,QUICK_MSECURITY_PAY:app支付 QUICK_WAP_WAY:手机网站支付 FAST_INSTANT_TRADE_PAY:pc网站支付
string password =4; //支付密码
string args = 5; //相关参数
string desc=6; //支付描述
string open_id=7; //微信用户的OpenID
}
message CallbackRequest {
int64 id = 1; // 唯一ID
string identity = 2; // 唯一码
bool callback_status = 3; // 支付回调状态
string callback_msg = 4; // 支付回调结果
}
message PaymentReply {
int64 code =1;
map<string,string> result =2; //预支付返回
}

View File

@@ -0,0 +1,137 @@
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<string,int64> 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; //支付模型WECHATALIPAY,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; //备注
}

View File

@@ -0,0 +1,91 @@
syntax = "proto3";
package wallet;
option go_package = ".;wallet";
service Wechat {
//微信JSAPI下单
rpc JsapiPreOrder(WxpayJSAPIPreOrderRequest) returns (WxpayJSAPIPreOrderReply) {}
//微信APP支付下单
rpc AppPreOrder(WxpayAppPreOrderRequest) returns (WxpayAppPreOrderReply) {}
//微信native二维码支付下单
rpc NativePreOrder(WxpayNativePreOrderRequest) returns (WxpayNativePreOrderReply) {}
//微信转账到零钱
rpc Transfer(WxpayTransferRequest) returns (WxpayTransferReply) {}
//微信支付回调
rpc WxCallback(WxCallBackRequest) returns(CallBackReply){}
}
message WxpayJSAPIPreOrderRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //充值金额,单位:分
string auth_code = 3; //微信授权码
string description = 4; //商品描述
string notify_url = 5; //支付回调URL公网域名须为HTTPS
string orderNo = 6; // 订单唯一码
}
message WxpayJSAPIPreOrderReply {
string prepay_id = 1; //预支付ID两小时有效
string app_id = 2; //微信app_id
string timestamp = 3; //时间戳
string nonce_str = 4; //随机字符串
string sign_type = 5; //签名方式
string sign = 6; //签名串
}
message WxpayAppPreOrderRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //充值金额,单位:分
string description = 3; //商品描述
string notify_url = 4; //支付回调URL公网域名须为HTTPS
}
message WxpayAppPreOrderReply {
string prepay_id = 1; //预支付ID两小时有效
string app_id = 2; //微信app_id
string mch_id = 3; //商户号,用以调起支付
}
message WxpayNativePreOrderRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //充值金额,单位:分
string description = 3; //商品描述
string notify_url = 4; //支付回调URL公网域名须为HTTPS
}
message WxpayNativePreOrderReply {
string code_url = 1; //二维码URL
}
message WxpayTransferRequest {
string user_identification = 1; //用户唯一标识
int64 amount = 2; //提现金额,单位:分
int64 fee = 3; //提现手续费,单位:分
string description = 4; //商品描述
string transfer_name = 5; //提现人真实姓名
}
message WxpayTransferReply {}
message WxCallBackResource{
string original_type = 1;
string algorithm = 2;
string ciphertext = 3;
string associated_data = 4;
string nonce = 5;
}
message WxCallBackSignInfo{
string transaction_id = 1;
string act_code = 2;
string hall_code = 3;
int64 hall_belong_mch_id = 4;
string card_id = 5;
string code = 6;
string activity_id = 7;
}
message WxCallBackRequest{
string id = 1;
string create_time = 2;
string resource_type = 3;
string event_type = 4;
string summary = 5;
WxCallBackResource resource = 6;
WxCallBackSignInfo SignInfo = 7;
}
message CallBackReply{
string code = 1; // 错误码SUCCESS为清算机构接收成功FAIL错误码为失败。
string message = 2; // 返回信息
}