syntax = "proto3";

option go_package = "./;rpc_proto";
package rpc_proto;

import "rpc_abtest.proto";

message PayModeIner
{
	string			channel = 1;				//支付渠道：IAP、weixin、alipay、huawei
	uint32			val = 3;					//权值（占位符：1 2 4 8..等）
}

message PayMode
{
	repeated PayModeIner	paymodes = 1;
	string			support_appversion = 2;
}

message PriceInfo
{
	string			purchaseid = 1;					//商品购买ID
	uint32			price = 2;						//真实价格
	uint32			show_price = 3;					//展示价格
	string			discount_des = 4;				//促销等描述
}

message ProductVipDes
{
	uint32			continuous = 1;
	uint32			vtype = 2;
	uint32			vmonth = 3;
	uint32			days = 4;
}

message ProductDetail
{
	uint32			weight = 1;
	ProductVipDes	timevip = 2;
}

message ProductInfo
{
	string			activity_id = 1;				//商品对应的活动id
	string			productid = 2;					//商品ID
	uint32			ptype = 3;
	string			title = 4;
	string			description = 5;
	uint32			platform = 6;
	string			low_appversion = 7;		//最低支持的app版本号
	string			high_appversion = 8;
	uint32			hide_flag = 9;					//该商品是否隐藏（默认为0即展示，1为隐藏）
	uint64			start_ts = 10;
	uint64			end_ts = 11;
	string			backup_pid = 12;			//备用商品id
	string			redeem_pid = 13;					//兑换id，默认为空，仅供兑换商品使用
	PriceInfo		price = 14;				//原价（尝鲜价）
	ProductDetail	pdetail = 15;
	uint32			support_pay = 16;
	string			sub_description = 17;
}

message PurchaseNotes
{
	repeated string	note = 1;
}

message RpcGetMallReq 
{
	AbTestReq		abtest = 1;
}

message MallSwitch
{
	uint32				tips_switch = 1;
	uint32				virtual_tab_switch = 2;
	uint32				entity_tab_switch = 3;
	string				mall_tips = 4;
}

message RpcGetMallRsp
{
	PayMode					paymode = 1;					//支持的支付方式(全商品统一支持)
	uint32					guest_purchase = 2;				//0 ：禁止，1 ：允许
	repeated ProductInfo	products = 3;
	PurchaseNotes			purchase_notes = 4;
	MallSwitch				switch_config = 5;

}

message RpcProductOrderReq
{
	string			activity_id = 1;
	string			productid = 2;
	string			purchaseid = 3;
	string			paymode = 4;
	uint32			quantity = 5;					//购买数量
}

message RpcProductOrderRsp
{
	uint32			orderid = 1;
	string			activity_id = 2;
	string			productid = 3;
	string			purchaseid = 4;
	string			paymode = 5;
	uint32			quantity = 6;					//购买数量
	uint32			price = 7;
	uint64			create_ts = 8;
	string			jwt_token = 9;
}

message RpcSyncVisitorPurchaseRecordReq
{
	repeated ProductInfo	order_list = 1;
}

message RpcSyncVisitorPurchaseRecordRsp
{
	
}

message GuestSwitchInfo
{
	string			appversion = 1;
	uint32			switch = 2;
}

message RpcSyncGuestSwitchReq
{
	repeated GuestSwitchInfo			ios_switch = 1;
	repeated GuestSwitchInfo			android_switch = 2;
}

message RpcSyncGuestSwitchRsp
{
	repeated GuestSwitchInfo			ios_switch = 1;
	repeated GuestSwitchInfo			android_switch = 2;
}

message RpcGetMallSwitchReq
{
	
}

message RpcGetMallSwitchRsp
{
	MallSwitch				switch_config = 1;
	uint32					guest_purchase = 2;				//0 ：禁止，1 ：允许
}