Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "_type_proto",
srcs = ["order.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "_type_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_proto"],
importpath = "go-common/app/service/openplatform/ticket-sales/api/grpc/type",
proto = ":_type_proto",
tags = ["automanaged"],
deps = [
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
],
)
go_library(
name = "go_default_library",
srcs = [],
embed = [":_type_go_proto"],
importpath = "go-common/app/service/openplatform/ticket-sales/api/grpc/type",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_gogo_protobuf//sortkeys:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,85 @@
//存放订单内部的数据表结构
syntax = "proto3";
package ticket.service.sales.v1;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "_type";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
//OrderSKU 订单包含的sku信息
message OrderSKU {
int64 order_id = 1 [(gogoproto.jsontag) = "order_id", (gogoproto.customname) = "OrderID"];
int64 sku_id = 2 [(gogoproto.jsontag) = "sku_id", (gogoproto.customname) = "SKUID"];
int64 count = 3 [(gogoproto.jsontag) = "count"];
int64 origin_price = 4 [(gogoproto.jsontag) = "origin_price"];
int64 price = 5 [(gogoproto.jsontag) = "price"];
repeated int64 seat_ids = 6 [(gogoproto.jsontag) = "seat_ids", (gogoproto.customname) = "SeatIDs"];
int32 ticket_type = 7 [(gogoproto.jsontag) = "ticket_type", (gogoproto.casttype) = "int16"];
OrderSKUDiscounts discounts = 8 [(gogoproto.jsontag) = "discounts"];
int64 ctime = 9 [(gogoproto.jsontag) = "-", (gogoproto.customname) = "CTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 mtime = 10 [(gogoproto.jsontag) = "-", (gogoproto.customname) = "MTime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
//OrderPayCharge 订单支付信息
message OrderPayCharge {
int64 order_id = 1 [(gogoproto.jsontag) = "order_id", (gogoproto.customname) = "OrderID"];
string charge_id = 2 [(gogoproto.jsontag) = "charge_id", (gogoproto.customname) = "ChargeID"];
int32 channel = 3 [(gogoproto.jsontag) = "channel", (gogoproto.casttype) = "int16"];
int32 paid = 4 [(gogoproto.jsontag) = "paid", (gogoproto.casttype) = "int16"];
int32 refunded = 5 [(gogoproto.jsontag) = "refunded", (gogoproto.casttype) = "int16"];
int64 pay_time = 6 [(gogoproto.jsontag) = "-"];
int64 ctime = 7 [(gogoproto.jsontag) = "-", (gogoproto.customname) = "CTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 mtime = 8 [(gogoproto.jsontag) = "-", (gogoproto.customname) = "MTime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
//OrderItemInfo 订单中的商品快照
message OrderItemInfo {
string name = 1 [(gogoproto.jsontag) = "name"];
string img = 2 [(gogoproto.jsontag) = "img"];
int64 screen_id = 3 [(gogoproto.jsontag) = "screen_id", (gogoproto.customname) = "ScreenID"];
string screen_name = 4 [(gogoproto.jsontag) = "screen_name"];
int32 screen_type = 5 [(gogoproto.jsontag) = "screen_type", (gogoproto.casttype) = "int16"];
int32 deliver_type = 6 [(gogoproto.jsontag) = "deliver_type", (gogoproto.casttype) = "int16"];
int64 express_fee = 7 [(gogoproto.jsontag) = "express_fee"];
int32 vip_express_free = 8 [(gogoproto.jsontag) = "express_free_flag", (gogoproto.casttype) = "int16", (gogoproto.customname) = "VIPExpressFree"];
int64 ver_id = 9 [(gogoproto.jsontag) = "project_ver_id", (gogoproto.customname) = "VerID"];
}
//OrderSKUDiscounts 订单分摊到sku上的折扣信息
message OrderSKUDiscounts {
map<int32, int64> platform = 1 [(gogoproto.jsontag) = "1"];
map<int32, int64> merchant = 2 [(gogoproto.jsontag) = "2"];
}
//OrderBuyer 订单购买人快照
message OrderBuyer {
int64 id = 1 [(gogoproto.jsontag) = "id", (gogoproto.customname) = "ID"];
string name = 2 [(gogoproto.jsontag) = "name"];
string tel = 3 [(gogoproto.jsontag) = "tel"];
string personal_id = 4 [(gogoproto.jsontag) = "personal_id", (gogoproto.customname) = "PersonalID"];
}
//OrderDeliver 订单配送信息快照
message OrderDeliver {
int64 addr_id = 1 [(gogoproto.jsontag) = "addr_id", (gogoproto.customname) = "AddrID"];
string name = 2 [(gogoproto.jsontag) = "name"];
string tel = 3 [(gogoproto.jsontag) = "tel"];
string addr = 4 [(gogoproto.jsontag) = "addr"];
}
//OrderExtra 订单额外信息
message OrderExtra {
int64 auto_recv_time = 1 [(gogoproto.jsontag) = "AutoRecvTime"];
int64 delay_recv_times = 2 [(gogoproto.jsontag) = "DelayRecvTimes"];
}
//OrderCoupon 订单优惠券信息
message OrderCoupon {
string code = 1 [(gogoproto.jsontag) = "code"];
string name = 2 [(gogoproto.jsontag) = "name"];
int64 money = 3 [(gogoproto.jsontag) = "money"];
}

View File

@@ -0,0 +1,69 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["client.go"],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/openplatform/ticket-sales/api/grpc/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/openplatform/ticket-sales/api/grpc/type:go_default_library",
"//library/net/rpc/warden:go_default_library",
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)
proto_library(
name = "v1_proto",
srcs = [
"order.proto",
"pay.proto",
"promotion.proto",
"promotion_mis.proto",
"ticket.proto",
],
tags = ["manual"],
deps = [
"//app/service/openplatform/ticket-sales/api/grpc/type:_type_proto",
"@gogo_special_proto//github.com/gogo/protobuf/gogoproto",
],
)
go_proto_library(
name = "v1_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/openplatform/ticket-sales/api/grpc/v1",
proto = ":v1_proto",
tags = ["manual"],
deps = [
"//app/service/openplatform/ticket-sales/api/grpc/type:_type_go_proto",
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,35 @@
package v1
import (
"context"
"fmt"
"go-common/library/net/rpc/warden"
"google.golang.org/grpc"
)
// AppID 本服务的discoveryID
const AppID = "ticket.service.sales"
// TradeSalesClient .
type TradeSalesClient interface {
TradeClient
PromotionClient
}
var _ TradeSalesClient = client{}
type client struct {
TradeClient
PromotionClient
}
// NewClient include TradeClient adn SalesClient
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (TradeSalesClient, error) {
cc, err := warden.NewClient(cfg, opts...).Dial(context.Background(), fmt.Sprintf("discovery://default/%s", AppID))
if err != nil {
return nil, err
}
return client{TradeClient: NewTradeClient(cc), PromotionClient: NewPromotionClient(cc)}, nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,187 @@
//存放api使用的模型
syntax = "proto3";
package ticket.service.sales.v1;
import "app/service/openplatform/ticket-sales/api/grpc/type/order.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "v1";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
//ListOrdersRequest 用户订单列表请求参数
message ListOrdersRequest {
string uid = 1 [(gogoproto.customname) = "UID"];
repeated int64 order_id = 2 [(gogoproto.customname) = "OrderID"];
int64 item_id = 3 [(gogoproto.customname) = "ItemID"];
repeated int32 status = 4 [(gogoproto.casttype) = "int16"];
repeated int32 sub_status = 5 [(gogoproto.casttype) = "int16"];
repeated int32 refund_status = 6 [(gogoproto.casttype) = "int16"];
int64 limit = 7;
int64 offset = 8;
string order_by = 9;
}
//ListOrdersResponse 用户订单列表返回
message ListOrdersResponse {
repeated OrderResponse list = 1;
int64 count = 2;
int64 next_offset = 3;
}
//OrderResponse 单个订单响应
message OrderResponse {
int64 order_id = 1 [(gogoproto.jsontag) = "order_id", (gogoproto.customname) = "OrderID"];
string uid = 2 [(gogoproto.jsontag) = "uid", (gogoproto.customname) = "UID"];
int32 order_type = 3 [(gogoproto.jsontag) = "order_type", (gogoproto.casttype) = "int16"];
int64 item_id = 4 [(gogoproto.jsontag) = "item_id", (gogoproto.customname) = "ItemID"];
OrderItemInfo item_info = 5 [(gogoproto.jsontag) = "item_info"];
int64 count = 6 [(gogoproto.jsontag) = "count"];
int64 total_money = 7 [(gogoproto.jsontag) = "total_money"];
int64 pay_money = 8 [(gogoproto.jsontag) = "pay_money"];
int64 express_fee = 9 [(gogoproto.jsontag) = "express_fee"];
int32 status = 10 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
int32 sub_status = 11 [(gogoproto.jsontag) = "sub_status", (gogoproto.casttype) = "int16"];
int32 refund_status = 12 [(gogoproto.jsontag) = "refund_status", (gogoproto.casttype) = "int16"];
string source = 13 [(gogoproto.jsontag) = "source"];
int32 is_deleted = 14 [(gogoproto.jsontag) = "is_deleted", (gogoproto.casttype) = "int16"];
repeated OrderSKU skus = 15 [(gogoproto.jsontag) = "order_sku", (gogoproto.customname) = "SKUs"];
OrderResponseMore detail = 16 [(gogoproto.jsontag) = "detail"];
OrderPayCharge pay_charge = 17 [(gogoproto.jsontag) = "pay_charge"];
int64 ctime = 18 [(gogoproto.jsontag) = "ctime", (gogoproto.customname) = "CTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 mtime = 19 [(gogoproto.jsontag) = "mtime", (gogoproto.customname) = "MTime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
//OrderResponseMore 更详细的订单响应信息
message OrderResponseMore {
OrderCoupon coupon = 1 [(gogoproto.jsontag) = "coupon"];
repeated OrderBuyer buyers = 2 [(gogoproto.jsontag) = "buyers"];
OrderExtra extra = 3 [(gogoproto.jsontag) = "extra"];
OrderDeliver deliver = 4 [(gogoproto.jsontag) = "deliver"];
string remark = 5 [(gogoproto.jsontag) = "remark"];
int32 device_type = 6 [(gogoproto.jsontag) = "device_type", (gogoproto.casttype) = "int16"];
uint32 ip = 7 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
string msource = 8 [(gogoproto.jsontag) = "msource", (gogoproto.customname) = "MSource"];
string express_co = 9 [(gogoproto.jsontag) = "-", (gogoproto.customname) = "ExpressCO"];
string express_no = 10 [(gogoproto.jsontag) = "-", (gogoproto.customname) = "ExpressNO"];
int32 express_type = 11 [(gogoproto.jsontag) = "-", (gogoproto.casttype) = "int16"];
}
//CreateOrderSKU 创建订单的sku请求
message CreateOrderSKU {
int64 sku_id = 1 [(gogoproto.customname) = "SKUID"];
int64 count = 2;
}
//CreateOrderRequest 单个订单创建请求
message CreateOrderRequest {
int64 project_id = 1 [(gogoproto.customname) = "ProjectID"];
int64 screen_id = 2 [(gogoproto.customname) = "ScreenID"];
repeated CreateOrderSKU skus = 3 [(gogoproto.customname) = "SKUs"];
int64 uid = 4 [(gogoproto.customname) = "UID"];
int64 pay_money = 5;
int32 order_type = 6 [(gogoproto.casttype) = "int16"];
int64 ts = 7 [(gogoproto.customname) = "TS"];
int64 promo_id = 8 [(gogoproto.customname) = "PromoID"];
int64 promo_group_id = 9 [(gogoproto.customname) = "PromoGroupID"];
repeated .ticket.service.sales.v1.OrderBuyer buyers = 10;
.ticket.service.sales.v1.OrderDeliver deliver_detail = 11;
repeated uint64 seats = 12;
repeated string coupons = 13;
int64 lock_id = 14 [(gogoproto.customname) = "LockID"];
string source = 15;
int32 is_deleted = 16 [(gogoproto.casttype) = "int16"];
int32 device_type = 17 [(gogoproto.casttype) = "int16"];
}
//CreateOrdersRequest 创建订单请求
message CreateOrdersRequest {
repeated CreateOrderRequest orders = 1;
}
//CreateOrderResult 创建订单结果
message CreateOrderResult {
int64 order_id = 1 [(gogoproto.customname) = "OrderID"];
int32 code = 2 [(gogoproto.casttype) = "int"];
string message = 3;
}
//CreateOrdersResponse 创建订单响应
message CreateOrdersResponse {
uint32 count = 1;
repeated CreateOrderResult result = 2;
}
//UpBuyerRequest 更新购买人信息
message UpBuyerRequest{
int64 order_id = 1 [(gogoproto.customname) = "OrderID"];
.ticket.service.sales.v1.OrderBuyer buyers = 2;
}
//UpDeliveryRequest 更新配送信息
message UpDeliveryRequest{
int64 order_id = 1 [(gogoproto.customname) = "OrderID"];
OrderDeliver deliver_detail = 2 [(gogoproto.jsontag) = "deliver_detail"];
}
//UpDetailResponse 更新返回数据
message UpDetailResponse{
int64 order_id = 1 [(gogoproto.customname) = "OrderID"];
int32 is_update= 2 [(gogoproto.customname) = "IsUpdate",(gogoproto.jsontag) = "update",(gogoproto.casttype) = "int16"];
}
//OrderLog 订单日志
message OrderLog {
int64 id = 1 [(gogoproto.customname) = "ID"];
string uid = 2 [(gogoproto.customname) = "UID"];
int64 order_id = 3 [(gogoproto.customname) = "OID"];
string ip = 4 [(gogoproto.customname) = "IP"];
string op_data = 5 [(gogoproto.customname) = "OpData"];
string remark = 6 [(gogoproto.customname) = "Remark"];
string op_object = 7 [(gogoproto.customname) = "OpObject"];
string op_name = 8 [(gogoproto.customname) = "OpName"];
int64 ctime = 9 [(gogoproto.customname) = "CTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 mtime = 10 [(gogoproto.customname) = "MTime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
//ListOrdersLogRequest 订单日志
message ListOrderLogRequest {
int64 order_id = 1 [(gogoproto.customname) = "OrderID"];
int64 limit = 2;
int64 offset = 3;
string order_by = 4;
}
//ListOrderLogResponse 订单日志相应
message ListOrderLogResponse {
repeated OrderLog list = 1;
int64 cnt = 2;
}
//AddOrderLogRequest 订单日志插入
message AddOrderLogRequest {
OrderLog data = 1;
}
//AddOrderLogResponse 订单日志插入相应
message AddOrderLogResponse {
int64 id = 1;
}
service Trade {
rpc ListOrders (ListOrdersRequest) returns (ListOrdersResponse);
rpc CreateOrders (CreateOrdersRequest) returns (CreateOrdersResponse);
rpc UpdateBuyer (UpBuyerRequest) returns (UpDetailResponse);
rpc UpdateDelivery (UpDeliveryRequest) returns (UpDetailResponse);
rpc ListOrderLogs (ListOrderLogRequest) returns (ListOrderLogResponse);
rpc AddOrderLogs (AddOrderLogRequest) returns (AddOrderLogResponse);
}

View File

@@ -0,0 +1,557 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: app/service/openplatform/ticket-sales/api/grpc/v1/pay.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import context "golang.org/x/net/context"
import grpc "google.golang.org/grpc"
import strings "strings"
import reflect "reflect"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type PayNotifyRequest struct {
MsgID string `protobuf:"bytes,1,opt,name=msgID,proto3" json:"msgID,omitempty"`
MsgContent string `protobuf:"bytes,2,opt,name=msgContent,proto3" json:"msgContent,omitempty"`
TestMode bool `protobuf:"varint,3,opt,name=testMode,proto3" json:"testMode,omitempty"`
}
func (m *PayNotifyRequest) Reset() { *m = PayNotifyRequest{} }
func (*PayNotifyRequest) ProtoMessage() {}
func (*PayNotifyRequest) Descriptor() ([]byte, []int) { return fileDescriptorPay, []int{0} }
type PayNotifyResponse struct {
}
func (m *PayNotifyResponse) Reset() { *m = PayNotifyResponse{} }
func (*PayNotifyResponse) ProtoMessage() {}
func (*PayNotifyResponse) Descriptor() ([]byte, []int) { return fileDescriptorPay, []int{1} }
func init() {
proto.RegisterType((*PayNotifyRequest)(nil), "ticket.service.sales.v1.PayNotifyRequest")
proto.RegisterType((*PayNotifyResponse)(nil), "ticket.service.sales.v1.PayNotifyResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Pay service
type PayClient interface {
PayNotify(ctx context.Context, in *PayNotifyRequest, opts ...grpc.CallOption) (*PayNotifyResponse, error)
}
type payClient struct {
cc *grpc.ClientConn
}
func NewPayClient(cc *grpc.ClientConn) PayClient {
return &payClient{cc}
}
func (c *payClient) PayNotify(ctx context.Context, in *PayNotifyRequest, opts ...grpc.CallOption) (*PayNotifyResponse, error) {
out := new(PayNotifyResponse)
err := grpc.Invoke(ctx, "/ticket.service.sales.v1.Pay/PayNotify", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Pay service
type PayServer interface {
PayNotify(context.Context, *PayNotifyRequest) (*PayNotifyResponse, error)
}
func RegisterPayServer(s *grpc.Server, srv PayServer) {
s.RegisterService(&_Pay_serviceDesc, srv)
}
func _Pay_PayNotify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PayNotifyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PayServer).PayNotify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ticket.service.sales.v1.Pay/PayNotify",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PayServer).PayNotify(ctx, req.(*PayNotifyRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Pay_serviceDesc = grpc.ServiceDesc{
ServiceName: "ticket.service.sales.v1.Pay",
HandlerType: (*PayServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "PayNotify",
Handler: _Pay_PayNotify_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "app/service/openplatform/ticket-sales/api/grpc/v1/pay.proto",
}
func (m *PayNotifyRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PayNotifyRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.MsgID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintPay(dAtA, i, uint64(len(m.MsgID)))
i += copy(dAtA[i:], m.MsgID)
}
if len(m.MsgContent) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintPay(dAtA, i, uint64(len(m.MsgContent)))
i += copy(dAtA[i:], m.MsgContent)
}
if m.TestMode {
dAtA[i] = 0x18
i++
if m.TestMode {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
return i, nil
}
func (m *PayNotifyResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PayNotifyResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func encodeVarintPay(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *PayNotifyRequest) Size() (n int) {
var l int
_ = l
l = len(m.MsgID)
if l > 0 {
n += 1 + l + sovPay(uint64(l))
}
l = len(m.MsgContent)
if l > 0 {
n += 1 + l + sovPay(uint64(l))
}
if m.TestMode {
n += 2
}
return n
}
func (m *PayNotifyResponse) Size() (n int) {
var l int
_ = l
return n
}
func sovPay(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozPay(x uint64) (n int) {
return sovPay(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *PayNotifyRequest) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&PayNotifyRequest{`,
`MsgID:` + fmt.Sprintf("%v", this.MsgID) + `,`,
`MsgContent:` + fmt.Sprintf("%v", this.MsgContent) + `,`,
`TestMode:` + fmt.Sprintf("%v", this.TestMode) + `,`,
`}`,
}, "")
return s
}
func (this *PayNotifyResponse) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&PayNotifyResponse{`,
`}`,
}, "")
return s
}
func valueToStringPay(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *PayNotifyRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPay
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: PayNotifyRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: PayNotifyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MsgID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPay
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthPay
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MsgID = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MsgContent", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPay
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthPay
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MsgContent = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TestMode", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPay
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.TestMode = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipPay(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthPay
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *PayNotifyResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPay
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: PayNotifyResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: PayNotifyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipPay(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthPay
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipPay(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPay
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPay
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPay
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthPay
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPay
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipPay(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthPay = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowPay = fmt.Errorf("proto: integer overflow")
)
func init() {
proto.RegisterFile("app/service/openplatform/ticket-sales/api/grpc/v1/pay.proto", fileDescriptorPay)
}
var fileDescriptorPay = []byte{
// 287 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4f, 0xc3, 0x30,
0x10, 0x85, 0xeb, 0x56, 0x45, 0xad, 0x27, 0x30, 0x03, 0x55, 0x84, 0xdc, 0xaa, 0x53, 0x41, 0xaa,
0xad, 0xc0, 0xc8, 0x56, 0x58, 0x18, 0x8a, 0xaa, 0x8c, 0x6c, 0x4e, 0x70, 0x8c, 0x45, 0x93, 0x33,
0xb1, 0x13, 0x29, 0x1b, 0x3f, 0xaf, 0x23, 0x23, 0x13, 0xa2, 0xf9, 0x25, 0xa8, 0x0e, 0xaa, 0x2a,
0x24, 0x24, 0x36, 0xbf, 0xe7, 0xef, 0xee, 0xdd, 0x1d, 0xbe, 0x11, 0xc6, 0x70, 0x2b, 0x8b, 0x4a,
0x27, 0x92, 0x83, 0x91, 0xb9, 0x59, 0x0b, 0x97, 0x42, 0x91, 0x71, 0xa7, 0x93, 0x17, 0xe9, 0xe6,
0x56, 0xac, 0xa5, 0xe5, 0xc2, 0x68, 0xae, 0x0a, 0x93, 0xf0, 0x2a, 0xe4, 0x46, 0xd4, 0xcc, 0x14,
0xe0, 0x80, 0x9c, 0xb5, 0x0c, 0xfb, 0xa9, 0x67, 0x9e, 0x65, 0x55, 0x18, 0xcc, 0x95, 0x76, 0xcf,
0x65, 0xcc, 0x12, 0xc8, 0xb8, 0x02, 0x05, 0xdc, 0xf3, 0x71, 0x99, 0x7a, 0xe5, 0x85, 0x7f, 0xb5,
0x7d, 0xa6, 0x80, 0x8f, 0x57, 0xa2, 0x7e, 0x00, 0xa7, 0xd3, 0x3a, 0x92, 0xaf, 0xa5, 0xb4, 0x8e,
0x8c, 0x71, 0x3f, 0xb3, 0xea, 0xfe, 0x6e, 0x84, 0x26, 0x68, 0x36, 0x5c, 0x0c, 0x9b, 0xcf, 0x71,
0x7f, 0xb9, 0x33, 0xa2, 0xd6, 0x27, 0x14, 0xe3, 0xcc, 0xaa, 0x5b, 0xc8, 0x9d, 0xcc, 0xdd, 0xa8,
0xbb, 0xa3, 0xa2, 0x03, 0x87, 0x04, 0x78, 0xe0, 0xa4, 0x75, 0x4b, 0x78, 0x92, 0xa3, 0xde, 0x04,
0xcd, 0x06, 0xd1, 0x5e, 0x4f, 0x4f, 0xf1, 0xc9, 0x41, 0xa0, 0x35, 0x90, 0x5b, 0x79, 0xa5, 0x71,
0x6f, 0x25, 0x6a, 0x12, 0xe3, 0xe1, 0xfe, 0x8f, 0x5c, 0xb0, 0x3f, 0x56, 0x64, 0xbf, 0x07, 0x0e,
0x2e, 0xff, 0x83, 0xb6, 0x51, 0x8b, 0xf3, 0xcd, 0x96, 0x76, 0x3e, 0xb6, 0xb4, 0xf3, 0xd6, 0x50,
0xb4, 0x69, 0x28, 0x7a, 0x6f, 0x28, 0xfa, 0x6a, 0x28, 0x7a, 0xec, 0x56, 0x61, 0x7c, 0xe4, 0xaf,
0x72, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x78, 0x04, 0x37, 0x9c, 0x01, 0x00, 0x00,
}

View File

@@ -0,0 +1,25 @@
// 支付相关接口
syntax = "proto3";
package ticket.service.sales.v1;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "v1";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
service Pay {
rpc PayNotify (PayNotifyRequest) returns (PayNotifyResponse);
}
message PayNotifyRequest {
string msgID = 1 [(gogoproto.customname) = "MsgID"];
string msgContent = 2;
bool testMode = 3;
}
message PayNotifyResponse {
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,180 @@
syntax = "proto3";
package ticket.service.sales.v1;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "v1";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
message Promo{
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id", (gogoproto.customname)= "PromoID"];
int32 type = 2 [(gogoproto.jsontag) = "type", (gogoproto.casttype) = "int16"];
int64 item_id = 3 [(gogoproto.jsontag) = "item_id", (gogoproto.customname)= "ItemID"];
int64 sku_id = 4 [(gogoproto.jsontag) = "sku_id", (gogoproto.customname)= "SKUID"];
int64 extra = 5 [(gogoproto.jsontag) = "extra"];
int64 expire_sec = 6 [(gogoproto.jsontag) = "expire_sec"];
int64 sku_count = 7 [(gogoproto.jsontag) = "sku_count", (gogoproto.customname)= "SKUCount"];
int64 amount = 8 [(gogoproto.jsontag) = "amount"];
int64 buyer_count = 9 [(gogoproto.jsontag) = "buyer_count"];
int64 begin_time = 10 [(gogoproto.jsontag) = "begin_time"];
int64 end_time = 11 [(gogoproto.jsontag) = "end_time"];
int32 status = 12 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
int64 ctime = 13 [(gogoproto.jsontag) = "ctime"];
int64 mtime = 14 [(gogoproto.jsontag) = "mtime"];
int64 priv_sku_id = 15 [(gogoproto.jsontag) = "priv_sku_id", (gogoproto.customname)= "PrivSKUID"];
string usable_coupons = 16 [(gogoproto.jsontag) = "usable_coupons"];
}
message PromoGroup {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id", (gogoproto.customname)= "PromoID"];
int64 group_id = 2 [(gogoproto.jsontag) = "group_id", (gogoproto.customname)= "GroupID"];
int64 uid = 3 [(gogoproto.jsontag) = "uid", (gogoproto.customname)= "UID"];
int64 order_count = 4 [(gogoproto.jsontag) = "order_count"];
int32 status =5 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
int64 expire_at = 6 [(gogoproto.jsontag) = "expire_at"];
int64 ctime = 7 [(gogoproto.jsontag) = "ctime"];
int64 mtime = 8 [(gogoproto.jsontag) = "mtime"];
}
message PromoOrder {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id", (gogoproto.customname)= "PromoID"];
int64 group_id = 2 [(gogoproto.jsontag) = "group_id", (gogoproto.customname)= "GroupID"];
int64 order_id = 3 [(gogoproto.jsontag) = "order_id", (gogoproto.customname)= "OrderID"];
int32 is_master = 4 [(gogoproto.jsontag) = "is_master", (gogoproto.casttype) = "int16"];
int64 uid = 5 [(gogoproto.jsontag) = "uid", (gogoproto.customname)= "UID"];
int32 status = 6 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
int64 ctime = 7 [(gogoproto.jsontag) = "ctime"];
int64 mtime = 8 [(gogoproto.jsontag) = "mtime"];
int64 sku_id = 9 [(gogoproto.jsontag) = "sku_id", (gogoproto.customname)= "SKUID"];
}
message CreatePromoRequest{
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
int32 type = 2 [(gogoproto.jsontag) = "type",(gogoproto.moretags) = "form:\"type\"", (gogoproto.casttype) = "int16"];
int64 item_id = 3 [(gogoproto.jsontag) = "item_id",(gogoproto.moretags) = "form:\"item_id\" validate:\"required\"", (gogoproto.customname)= "ItemID"];
int64 sku_id = 4 [(gogoproto.jsontag) = "sku_id",(gogoproto.moretags) = "form:\"sku_id\" validate:\"required\"", (gogoproto.customname)= "SKUID"];
int64 extra = 5 [(gogoproto.jsontag) = "extra",(gogoproto.moretags) = "form:\"extra\" validate:\"required\""];
int64 expire_sec = 6 [(gogoproto.jsontag) = "expire_sec",(gogoproto.moretags) = "form:\"expire_sec\" validate:\"required\""];
int64 sku_count = 7 [(gogoproto.jsontag) = "sku_count",(gogoproto.moretags) = "form:\"sku_count\" validate:\"required\"", (gogoproto.customname)= "SKUCount"];
int64 amount = 8 [(gogoproto.jsontag) = "amount",(gogoproto.moretags) = "form:\"amount\" validate:\"required\""];
int64 buyer_count = 9 [(gogoproto.jsontag) = "buyer_count",(gogoproto.moretags) = "form:\"buyer_count\" validate:\"required\""];
int64 begin_time = 10 [(gogoproto.jsontag) = "begin_time",(gogoproto.moretags) = "form:\"begin_time\" validate:\"required\""];
int64 end_time = 11 [(gogoproto.jsontag) = "end_time",(gogoproto.moretags) = "form:\"end_time\" validate:\"required\""];
int64 priv_sku_id = 12 [(gogoproto.jsontag) = "priv_sku_id",(gogoproto.moretags) = "form:\"priv_sku_id\"", (gogoproto.customname)= "PrivSKUID"];
string usable_coupons = 13 [(gogoproto.jsontag) = "usable_coupons",(gogoproto.moretags) = "form:\"usable_coupons\""];
}
message OperatePromoRequest{
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
int32 operate_type = 2 [(gogoproto.jsontag) = "operate_type",(gogoproto.moretags) = "form:\"operate_type\" validate:\"required\"", (gogoproto.casttype) = "int16"];
}
message CheckCreatePromoOrderRequest{
int64 uid = 1 [(gogoproto.jsontag) = "uid",(gogoproto.moretags) = "form:\"uid\" validate:\"required\"", (gogoproto.customname)= "UID"];
int64 sku_id = 2 [(gogoproto.jsontag) = "sku_id",(gogoproto.moretags) = "form:\"sku_id\" validate:\"required\"", (gogoproto.customname)= "SKUID"];
int64 promo_id = 3 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
int64 group_id = 4 [(gogoproto.jsontag) = "group_id",(gogoproto.moretags) = "form:\"group_id\"", (gogoproto.customname)= "GroupID"];
}
message RepeatOrder{
int64 order_id = 1 [(gogoproto.jsontag) = "order_id", (gogoproto.customname)= "OrderID"];
int32 is_master = 2 [(gogoproto.jsontag) = "is_master", (gogoproto.casttype) = "int16"];
int32 status = 3 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
}
message CheckCreatePromoOrderResponse{
int64 amount = 1 [(gogoproto.jsontag) = "amount"];
int64 sku_id = 2 [(gogoproto.jsontag) = "sku_id", (gogoproto.customname)= "SKUID"];
int64 priv_sku_id = 3 [(gogoproto.jsontag) = "priv_sku_id", (gogoproto.customname)= "PrivSKUID"];
string usable_coupons = 4 [(gogoproto.jsontag) = "usable_coupons"];
RepeatOrder repeat_order = 5 [(gogoproto.jsontag) = "repeat_order"];
}
message CreatePromoOrderRequest{
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
int64 order_id = 2 [(gogoproto.jsontag) = "order_id",(gogoproto.moretags) = "form:\"order_id\" validate:\"required\"", (gogoproto.customname)= "OrderID"];
int64 group_id = 3 [(gogoproto.jsontag) = "group_id",(gogoproto.moretags) = "form:\"group_id\"", (gogoproto.customname)= "GroupID"];
int64 uid = 4 [(gogoproto.jsontag) = "uid",(gogoproto.moretags) = "form:\"uid\" validate:\"required\"", (gogoproto.customname)= "UID"];
int64 promo_sku_id = 5 [(gogoproto.jsontag) = "promo_sku_id",(gogoproto.moretags) = "form:\"promo_sku_id\" validate:\"required\"", (gogoproto.customname)= "PromoSKUID"];
int64 ctime = 6 [(gogoproto.jsontag) = "ctime",(gogoproto.moretags) = "form:\"ctime\" validate:\"required\""];
int64 pay_money = 7 [(gogoproto.jsontag) = "pay_money",(gogoproto.moretags) = "form:\"pay_money\""];
}
message CommonResponse {
int64 res = 1 [(gogoproto.jsontag) = "res"];
}
message PromoID{
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
}
message OrderID{
int64 order_id = 1 [(gogoproto.jsontag) = "order_id",(gogoproto.moretags) = "form:\"order_id\" validate:\"required\"", (gogoproto.customname)= "OrderID"];
}
message GroupID{
int64 group_id = 1 [(gogoproto.jsontag) = "group_id",(gogoproto.moretags) = "form:\"group_id\" validate:\"required\"", (gogoproto.customname)= "GroupID"];
}
message GetPromoGroupInfoRequest{
int64 order_id = 1 [(gogoproto.jsontag) = "order_id",(gogoproto.moretags) = "form:\"order_id\" validate:\"required\"", (gogoproto.customname)= "OrderID"];
}
message GetPromoGroupInfoResponse {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id", (gogoproto.customname)= "PromoID"];
int64 sku_count = 2 [(gogoproto.jsontag) = "sku_count", (gogoproto.customname)= "SKUCount"];
int64 amount = 3 [(gogoproto.jsontag) = "amount"];
int64 group_id = 4 [(gogoproto.jsontag) = "group_id", (gogoproto.customname)= "GroupID"];
int64 order_count = 5 [(gogoproto.jsontag) = "order_count"];
int64 expire_at = 6 [(gogoproto.jsontag) = "expire_at"];
int32 status = 7 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
int64 ctime = 8 [(gogoproto.jsontag) = "ctime"];
}
message CheckIssueResponse {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id", (gogoproto.customname)= "PromoID"];
int64 group_id = 2 [(gogoproto.jsontag) = "group_id", (gogoproto.customname)= "GroupID"];
repeated OrderID paid_orders = 3 [(gogoproto.jsontag) = "paid_orders"];
}
message FinishIssueRequest {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
int64 group_id = 2 [(gogoproto.jsontag) = "group_id",(gogoproto.moretags) = "form:\"group_id\" validate:\"required\"", (gogoproto.customname)= "GroupID"];
}
message GroupFailedRequest {
int64 group_id = 1 [(gogoproto.jsontag) = "group_id",(gogoproto.moretags) = "form:\"group_id\" validate:\"required\"", (gogoproto.customname)= "GroupID"];
int64 cancel_num = 2 [(gogoproto.jsontag) = "cancel_num",(gogoproto.moretags) = "form:\"cancel_num\" validate:\"required\""];
}
message EditPromoRequest {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id",(gogoproto.moretags) = "form:\"promo_id\" validate:\"required\"", (gogoproto.customname)= "PromoID"];
int64 amount = 2 [(gogoproto.jsontag) = "amount",(gogoproto.moretags) = "form:\"amount\""];
int64 expire_sec = 3 [(gogoproto.jsontag) = "expire_sec",(gogoproto.moretags) = "form:\"expire_sec\""];
int64 begin_time = 4 [(gogoproto.jsontag) = "begin_time",(gogoproto.moretags) = "form:\"begin_time\""];
int64 end_time = 5 [(gogoproto.jsontag) = "end_time",(gogoproto.moretags) = "form:\"end_time\""];
int64 priv_sku_id = 6 [(gogoproto.jsontag) = "priv_sku_id",(gogoproto.moretags) = "form:\"priv_sku_id\"", (gogoproto.customname)= "PrivSKUID"];
string usable_coupons = 7 [(gogoproto.jsontag) = "usable_coupons",(gogoproto.moretags) = "form:\"usable_coupons\""];
int64 sku_count = 8 [(gogoproto.jsontag) = "sku_count",(gogoproto.moretags) = "form:\"sku_count\"", (gogoproto.customname)= "SKUCount"];
}
service Promotion{
rpc CreatePromo(CreatePromoRequest) returns(PromoID){};
rpc GetPromo(PromoID) returns(Promo){};
rpc OperatePromo(OperatePromoRequest) returns(CommonResponse){};
rpc EditPromo(EditPromoRequest) returns(CommonResponse){};
rpc GetPromoGroupInfo(GetPromoGroupInfoRequest) returns(GetPromoGroupInfoResponse){};
rpc GroupFailed(GroupFailedRequest) returns(GroupID){};
rpc CheckCreateStatus(CheckCreatePromoOrderRequest) returns (CheckCreatePromoOrderResponse){};
rpc CreatePromoOrder(CreatePromoOrderRequest) returns(OrderID){};
rpc PromoPayNotify(OrderID) returns(OrderID){};
rpc CancelOrder(OrderID) returns(OrderID){};
rpc CheckIssue(OrderID) returns(CheckIssueResponse){};
rpc FinishIssue(FinishIssueRequest) returns(GroupID){};
rpc PromoRefundNotify(OrderID) returns(OrderID){};
}

View File

@@ -0,0 +1,922 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: app/service/openplatform/ticket-sales/api/grpc/v1/promotion_mis.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import context "golang.org/x/net/context"
import grpc "google.golang.org/grpc"
import strings "strings"
import reflect "reflect"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type PromoOrderMis struct {
PromoID int64 `protobuf:"varint,1,opt,name=promo_id,json=promoId,proto3" json:"promo_id"`
GroupID int64 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id"`
OrderID int64 `protobuf:"varint,3,opt,name=order_id,json=orderId,proto3" json:"order_id"`
IsMaster int16 `protobuf:"varint,4,opt,name=is_master,json=isMaster,proto3,casttype=int16" json:"is_master"`
UID int64 `protobuf:"varint,5,opt,name=uid,proto3" json:"uid"`
Status int16 `protobuf:"varint,6,opt,name=status,proto3,casttype=int16" json:"status"`
PayTime int64 `protobuf:"varint,7,opt,name=pay_time,json=payTime,proto3" json:"pay_time"`
Ctime int64 `protobuf:"varint,8,opt,name=ctime,proto3" json:"ctime"`
SKUID int64 `protobuf:"varint,9,opt,name=sku_id,json=skuId,proto3" json:"sku_id"`
}
func (m *PromoOrderMis) Reset() { *m = PromoOrderMis{} }
func (*PromoOrderMis) ProtoMessage() {}
func (*PromoOrderMis) Descriptor() ([]byte, []int) { return fileDescriptorPromotionMis, []int{0} }
type GetGroupOrdersMisRequest struct {
OrderID int64 `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id" form:"order_id"`
GroupID int64 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id" form:"group_id"`
}
func (m *GetGroupOrdersMisRequest) Reset() { *m = GetGroupOrdersMisRequest{} }
func (*GetGroupOrdersMisRequest) ProtoMessage() {}
func (*GetGroupOrdersMisRequest) Descriptor() ([]byte, []int) {
return fileDescriptorPromotionMis, []int{1}
}
type GetGroupOrdersMisResponse struct {
Orders []*PromoOrderMis `protobuf:"bytes,2,rep,name=orders" json:"orders"`
}
func (m *GetGroupOrdersMisResponse) Reset() { *m = GetGroupOrdersMisResponse{} }
func (*GetGroupOrdersMisResponse) ProtoMessage() {}
func (*GetGroupOrdersMisResponse) Descriptor() ([]byte, []int) {
return fileDescriptorPromotionMis, []int{2}
}
func init() {
proto.RegisterType((*PromoOrderMis)(nil), "ticket.service.sales.v1.PromoOrderMis")
proto.RegisterType((*GetGroupOrdersMisRequest)(nil), "ticket.service.sales.v1.GetGroupOrdersMisRequest")
proto.RegisterType((*GetGroupOrdersMisResponse)(nil), "ticket.service.sales.v1.GetGroupOrdersMisResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for PromotionMis service
type PromotionMisClient interface {
GetGroupOrdersMis(ctx context.Context, in *GetGroupOrdersMisRequest, opts ...grpc.CallOption) (*GetGroupOrdersMisResponse, error)
}
type promotionMisClient struct {
cc *grpc.ClientConn
}
func NewPromotionMisClient(cc *grpc.ClientConn) PromotionMisClient {
return &promotionMisClient{cc}
}
func (c *promotionMisClient) GetGroupOrdersMis(ctx context.Context, in *GetGroupOrdersMisRequest, opts ...grpc.CallOption) (*GetGroupOrdersMisResponse, error) {
out := new(GetGroupOrdersMisResponse)
err := grpc.Invoke(ctx, "/ticket.service.sales.v1.PromotionMis/GetGroupOrdersMis", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for PromotionMis service
type PromotionMisServer interface {
GetGroupOrdersMis(context.Context, *GetGroupOrdersMisRequest) (*GetGroupOrdersMisResponse, error)
}
func RegisterPromotionMisServer(s *grpc.Server, srv PromotionMisServer) {
s.RegisterService(&_PromotionMis_serviceDesc, srv)
}
func _PromotionMis_GetGroupOrdersMis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetGroupOrdersMisRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PromotionMisServer).GetGroupOrdersMis(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ticket.service.sales.v1.PromotionMis/GetGroupOrdersMis",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PromotionMisServer).GetGroupOrdersMis(ctx, req.(*GetGroupOrdersMisRequest))
}
return interceptor(ctx, in, info, handler)
}
var _PromotionMis_serviceDesc = grpc.ServiceDesc{
ServiceName: "ticket.service.sales.v1.PromotionMis",
HandlerType: (*PromotionMisServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetGroupOrdersMis",
Handler: _PromotionMis_GetGroupOrdersMis_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "app/service/openplatform/ticket-sales/api/grpc/v1/promotion_mis.proto",
}
func (m *PromoOrderMis) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PromoOrderMis) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.PromoID != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.PromoID))
}
if m.GroupID != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.GroupID))
}
if m.OrderID != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.OrderID))
}
if m.IsMaster != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.IsMaster))
}
if m.UID != 0 {
dAtA[i] = 0x28
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.UID))
}
if m.Status != 0 {
dAtA[i] = 0x30
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.Status))
}
if m.PayTime != 0 {
dAtA[i] = 0x38
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.PayTime))
}
if m.Ctime != 0 {
dAtA[i] = 0x40
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.Ctime))
}
if m.SKUID != 0 {
dAtA[i] = 0x48
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.SKUID))
}
return i, nil
}
func (m *GetGroupOrdersMisRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GetGroupOrdersMisRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.OrderID != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.OrderID))
}
if m.GroupID != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(m.GroupID))
}
return i, nil
}
func (m *GetGroupOrdersMisResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GetGroupOrdersMisResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Orders) > 0 {
for _, msg := range m.Orders {
dAtA[i] = 0x12
i++
i = encodeVarintPromotionMis(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
return i, nil
}
func encodeVarintPromotionMis(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *PromoOrderMis) Size() (n int) {
var l int
_ = l
if m.PromoID != 0 {
n += 1 + sovPromotionMis(uint64(m.PromoID))
}
if m.GroupID != 0 {
n += 1 + sovPromotionMis(uint64(m.GroupID))
}
if m.OrderID != 0 {
n += 1 + sovPromotionMis(uint64(m.OrderID))
}
if m.IsMaster != 0 {
n += 1 + sovPromotionMis(uint64(m.IsMaster))
}
if m.UID != 0 {
n += 1 + sovPromotionMis(uint64(m.UID))
}
if m.Status != 0 {
n += 1 + sovPromotionMis(uint64(m.Status))
}
if m.PayTime != 0 {
n += 1 + sovPromotionMis(uint64(m.PayTime))
}
if m.Ctime != 0 {
n += 1 + sovPromotionMis(uint64(m.Ctime))
}
if m.SKUID != 0 {
n += 1 + sovPromotionMis(uint64(m.SKUID))
}
return n
}
func (m *GetGroupOrdersMisRequest) Size() (n int) {
var l int
_ = l
if m.OrderID != 0 {
n += 1 + sovPromotionMis(uint64(m.OrderID))
}
if m.GroupID != 0 {
n += 1 + sovPromotionMis(uint64(m.GroupID))
}
return n
}
func (m *GetGroupOrdersMisResponse) Size() (n int) {
var l int
_ = l
if len(m.Orders) > 0 {
for _, e := range m.Orders {
l = e.Size()
n += 1 + l + sovPromotionMis(uint64(l))
}
}
return n
}
func sovPromotionMis(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozPromotionMis(x uint64) (n int) {
return sovPromotionMis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *PromoOrderMis) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&PromoOrderMis{`,
`PromoID:` + fmt.Sprintf("%v", this.PromoID) + `,`,
`GroupID:` + fmt.Sprintf("%v", this.GroupID) + `,`,
`OrderID:` + fmt.Sprintf("%v", this.OrderID) + `,`,
`IsMaster:` + fmt.Sprintf("%v", this.IsMaster) + `,`,
`UID:` + fmt.Sprintf("%v", this.UID) + `,`,
`Status:` + fmt.Sprintf("%v", this.Status) + `,`,
`PayTime:` + fmt.Sprintf("%v", this.PayTime) + `,`,
`Ctime:` + fmt.Sprintf("%v", this.Ctime) + `,`,
`SKUID:` + fmt.Sprintf("%v", this.SKUID) + `,`,
`}`,
}, "")
return s
}
func (this *GetGroupOrdersMisRequest) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&GetGroupOrdersMisRequest{`,
`OrderID:` + fmt.Sprintf("%v", this.OrderID) + `,`,
`GroupID:` + fmt.Sprintf("%v", this.GroupID) + `,`,
`}`,
}, "")
return s
}
func (this *GetGroupOrdersMisResponse) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&GetGroupOrdersMisResponse{`,
`Orders:` + strings.Replace(fmt.Sprintf("%v", this.Orders), "PromoOrderMis", "PromoOrderMis", 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringPromotionMis(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *PromoOrderMis) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: PromoOrderMis: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: PromoOrderMis: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field PromoID", wireType)
}
m.PromoID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.PromoID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field GroupID", wireType)
}
m.GroupID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.GroupID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field OrderID", wireType)
}
m.OrderID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.OrderID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field IsMaster", wireType)
}
m.IsMaster = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.IsMaster |= (int16(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType)
}
m.UID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.UID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
m.Status = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Status |= (int16(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 7:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field PayTime", wireType)
}
m.PayTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.PayTime |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 8:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Ctime", wireType)
}
m.Ctime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Ctime |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 9:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field SKUID", wireType)
}
m.SKUID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.SKUID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipPromotionMis(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthPromotionMis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GetGroupOrdersMisRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GetGroupOrdersMisRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GetGroupOrdersMisRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field OrderID", wireType)
}
m.OrderID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.OrderID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field GroupID", wireType)
}
m.GroupID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.GroupID |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipPromotionMis(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthPromotionMis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GetGroupOrdersMisResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GetGroupOrdersMisResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GetGroupOrdersMisResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthPromotionMis
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Orders = append(m.Orders, &PromoOrderMis{})
if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipPromotionMis(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthPromotionMis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipPromotionMis(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthPromotionMis
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowPromotionMis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipPromotionMis(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthPromotionMis = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowPromotionMis = fmt.Errorf("proto: integer overflow")
)
func init() {
proto.RegisterFile("app/service/openplatform/ticket-sales/api/grpc/v1/promotion_mis.proto", fileDescriptorPromotionMis)
}
var fileDescriptorPromotionMis = []byte{
// 552 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x31, 0x8f, 0xd3, 0x4c,
0x10, 0x8d, 0xe3, 0xcf, 0x71, 0xb2, 0xdf, 0x01, 0xc2, 0x27, 0x71, 0xe6, 0x84, 0xec, 0xc8, 0x05,
0x44, 0x41, 0x67, 0x2b, 0x39, 0x89, 0x82, 0x32, 0x22, 0x3a, 0x05, 0x14, 0x71, 0x32, 0xd0, 0xd0,
0x44, 0x4e, 0xbc, 0x67, 0x56, 0x39, 0x67, 0x17, 0xef, 0x3a, 0xd2, 0x49, 0x14, 0xfc, 0x00, 0xfe,
0x06, 0x12, 0x3f, 0xe5, 0x4a, 0x4a, 0x2a, 0x8b, 0x73, 0x99, 0x92, 0x92, 0x0a, 0xed, 0xac, 0x73,
0x06, 0x1d, 0x29, 0x68, 0xec, 0xf1, 0x9b, 0x79, 0x6f, 0xd6, 0x6f, 0x66, 0xd1, 0x38, 0x62, 0x2c,
0xe0, 0x38, 0x5b, 0x93, 0x05, 0x0e, 0x28, 0xc3, 0x2b, 0x76, 0x1e, 0x89, 0x33, 0x9a, 0xa5, 0x81,
0x20, 0x8b, 0x25, 0x16, 0x47, 0x3c, 0x3a, 0xc7, 0x3c, 0x88, 0x18, 0x09, 0x92, 0x8c, 0x2d, 0x82,
0xf5, 0x20, 0x60, 0x19, 0x4d, 0xa9, 0x20, 0x74, 0x35, 0x4b, 0x09, 0xf7, 0x59, 0x46, 0x05, 0xb5,
0x0e, 0x54, 0xb5, 0x5f, 0x29, 0xf9, 0xc0, 0xf2, 0xd7, 0x83, 0xc3, 0xa3, 0x84, 0x88, 0x77, 0xf9,
0xdc, 0x5f, 0xd0, 0x34, 0x48, 0x68, 0x42, 0x03, 0xa8, 0x9f, 0xe7, 0x67, 0xf0, 0x05, 0x1f, 0x10,
0x29, 0x1d, 0xef, 0xb3, 0x8e, 0x6e, 0x9d, 0x4a, 0xfd, 0x97, 0x59, 0x8c, 0xb3, 0x29, 0xe1, 0xd6,
0x10, 0xb5, 0xa1, 0xe1, 0x8c, 0xc4, 0xb6, 0xd6, 0xd5, 0x7a, 0xfa, 0xe8, 0xa0, 0x2c, 0x5c, 0x13,
0x8a, 0x26, 0xcf, 0x36, 0x85, 0x7b, 0x9d, 0x0e, 0x4d, 0x88, 0x26, 0xb1, 0xe4, 0x24, 0x19, 0xcd,
0x99, 0xe4, 0x34, 0x6b, 0xce, 0x89, 0xc4, 0x14, 0x67, 0x9b, 0x0e, 0x4d, 0x88, 0x14, 0x87, 0xca,
0x9e, 0x92, 0xa3, 0xd7, 0x1c, 0x38, 0x87, 0xe2, 0x6c, 0xd3, 0xa1, 0x09, 0xd1, 0x24, 0xb6, 0x8e,
0x51, 0x87, 0xf0, 0x59, 0x1a, 0x71, 0x81, 0x33, 0xfb, 0xbf, 0xae, 0xd6, 0x33, 0x46, 0xf7, 0x36,
0x85, 0x5b, 0x83, 0x3f, 0x0b, 0xd7, 0x20, 0x2b, 0x31, 0x78, 0x12, 0xb6, 0x09, 0x9f, 0x02, 0x64,
0x75, 0x91, 0x9e, 0x93, 0xd8, 0x36, 0xa0, 0xc7, 0xed, 0xb2, 0x70, 0xf5, 0x37, 0xa0, 0x2f, 0xd1,
0x50, 0x3e, 0xac, 0xc7, 0xa8, 0xc5, 0x45, 0x24, 0x72, 0x6e, 0xb7, 0x40, 0x73, 0x7f, 0x53, 0xb8,
0x15, 0x52, 0x0b, 0x56, 0x80, 0xf5, 0x08, 0xb5, 0x59, 0x74, 0x31, 0x13, 0x24, 0xc5, 0xb6, 0x09,
0x9a, 0x7b, 0x60, 0x4a, 0x85, 0x85, 0x26, 0x8b, 0x2e, 0x5e, 0x93, 0x14, 0x5b, 0x2e, 0x32, 0x16,
0x50, 0xd5, 0x86, 0xaa, 0xce, 0xa6, 0x70, 0x15, 0x10, 0xaa, 0x97, 0xd5, 0x47, 0x2d, 0xbe, 0xcc,
0xe5, 0xff, 0x77, 0xa0, 0x62, 0xbf, 0x2c, 0x5c, 0xe3, 0xd5, 0x0b, 0x75, 0xba, 0x2a, 0x15, 0x1a,
0x7c, 0x99, 0x4f, 0x62, 0xef, 0x8b, 0x86, 0xec, 0x13, 0x2c, 0xc0, 0x51, 0xb0, 0x88, 0x4f, 0x09,
0x0f, 0xf1, 0xfb, 0x1c, 0x73, 0x61, 0x8d, 0x7f, 0xb3, 0x52, 0x8d, 0xac, 0xbf, 0xc3, 0xca, 0x1f,
0x85, 0x7b, 0x47, 0x2e, 0xdb, 0x53, 0x6f, 0x8b, 0x78, 0xb5, 0xbb, 0xe3, 0x1b, 0x53, 0xec, 0xef,
0x98, 0x62, 0x2d, 0xb3, 0x45, 0xbc, 0xeb, 0xc1, 0x7a, 0x09, 0xba, 0xff, 0x97, 0x93, 0x72, 0x46,
0x57, 0x1c, 0x5b, 0xcf, 0x51, 0x0b, 0xda, 0x71, 0xbb, 0xd9, 0xd5, 0x7b, 0xff, 0x0f, 0x1f, 0xfa,
0x3b, 0x16, 0xd9, 0xff, 0x63, 0x2b, 0x47, 0x48, 0x5a, 0xa2, 0x98, 0x61, 0xf5, 0x1e, 0x7e, 0xd2,
0xd0, 0xde, 0xe9, 0xf6, 0x6e, 0xc8, 0xd5, 0xfd, 0x80, 0xee, 0xde, 0xe8, 0x6c, 0x0d, 0x76, 0x76,
0xd8, 0xe5, 0xe7, 0xe1, 0xf0, 0x5f, 0x28, 0xea, 0xc7, 0xbc, 0xc6, 0xe8, 0xc1, 0xe5, 0x95, 0xd3,
0xf8, 0x76, 0xe5, 0x34, 0x3e, 0x96, 0x8e, 0x76, 0x59, 0x3a, 0xda, 0xd7, 0xd2, 0xd1, 0xbe, 0x97,
0x8e, 0xf6, 0xb6, 0xb9, 0x1e, 0xcc, 0x5b, 0x70, 0xdf, 0x8e, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff,
0x5a, 0xdf, 0xa3, 0x84, 0x00, 0x04, 0x00, 0x00,
}

View File

@@ -0,0 +1,36 @@
syntax = "proto3";
package ticket.service.sales.v1;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "v1";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
message PromoOrderMis {
int64 promo_id = 1 [(gogoproto.jsontag) = "promo_id", (gogoproto.customname)= "PromoID"];
int64 group_id = 2 [(gogoproto.jsontag) = "group_id", (gogoproto.customname)= "GroupID"];
int64 order_id = 3 [(gogoproto.jsontag) = "order_id", (gogoproto.customname)= "OrderID"];
int32 is_master = 4 [(gogoproto.jsontag) = "is_master", (gogoproto.casttype) = "int16"];
int64 uid = 5 [(gogoproto.jsontag) = "uid", (gogoproto.customname)= "UID"];
int32 status = 6 [(gogoproto.jsontag) = "status", (gogoproto.casttype) = "int16"];
int64 pay_time = 7 [(gogoproto.jsontag) = "pay_time"];
int64 ctime = 8 [(gogoproto.jsontag) = "ctime"];
int64 sku_id = 9 [(gogoproto.jsontag) = "sku_id", (gogoproto.customname)= "SKUID"];
}
message GetGroupOrdersMisRequest{
int64 order_id = 1 [(gogoproto.jsontag) = "order_id",(gogoproto.moretags) = "form:\"order_id\"", (gogoproto.customname)= "OrderID"];
int64 group_id = 2 [(gogoproto.jsontag) = "group_id",(gogoproto.moretags) = "form:\"group_id\"", (gogoproto.customname)= "GroupID"];
}
message GetGroupOrdersMisResponse {
repeated PromoOrderMis orders = 2 [(gogoproto.jsontag) = "orders"];
}
service PromotionMis{
rpc GetGroupOrdersMis(GetGroupOrdersMisRequest) returns(GetGroupOrdersMisResponse){}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
//存放api使用的模型
syntax = "proto3";
package ticket.service.sales.v1;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "v1";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
service Ticket {
// 查询电子票详情 - 支持根据订单号查询、场次 + uid 查询、票 id 查询
rpc TicketView(TicketViewRequest) returns (TicketViewResponse);
// 查询赠票信息
rpc TicketSend(TicketSendRequest) returns (TicketSendResponse);
}
message TicketViewRequest {
int64 order_id = 1 [(gogoproto.customname) = "OrderID"];
int64 uid = 2 [(gogoproto.customname) = "UID"];
int64 screen_id = 3 [(gogoproto.customname) = "ScreenID"];
repeated int64 id = 4 [(gogoproto.customname) = "ID"];
}
message TicketViewResponse {
repeated TicketItem tickets = 1;
}
message TicketItem {
int64 id = 1 [(gogoproto.customname) = "ID"];
int64 uid = 2 [(gogoproto.customname) = "UID"];
int64 oid = 3 [(gogoproto.customname) = "OID"];
int64 sid = 4 [(gogoproto.customname) = "SID"];
int64 price = 5;
int64 src = 6 [(gogoproto.casttype) = "int16"];
int64 type = 7 [(gogoproto.casttype) = "int16"];
int64 status = 8 [(gogoproto.casttype) = "int16"];
string qr = 9;
int64 ref_id = 10 [(gogoproto.customname) = "RefID"];
int64 sku_id = 11 [(gogoproto.customname) = "SkuID"];
int64 seat_id = 12 [(gogoproto.customname) = "SeatID"];
string seat = 13;
int64 refund_apply_time = 14 [(gogoproto.casttype) = "go-common/library/time.Time"];
int64 etime = 15 [(gogoproto.customname) = "ETime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 ctime = 16 [(gogoproto.customname) = "CTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 mtime = 17 [(gogoproto.customname) = "MTime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
message TicketSendRequest {
repeated int64 send_tid = 1 [(gogoproto.customname) = "SendTID"];
repeated int64 recv_tid = 2 [(gogoproto.customname) = "RecvTID"];
}
message TicketSendResponse {
repeated TicketSendItem ticket_sends = 1;
}
message TicketSendItem {
int64 id = 1 [(gogoproto.customname) = "ID"];
int64 sid = 2 [(gogoproto.customname) = "SID"];
int64 send_tid = 3 [(gogoproto.customname) = "SendTID"];
int64 recv_tid = 4 [(gogoproto.customname) = "RecvTID"];
int64 send_uid = 5 [(gogoproto.customname) = "SendUID"];
int64 recv_uid = 6 [(gogoproto.customname) = "RecvUID"];
string recv_tel = 7 [(gogoproto.customname) = "RecvTel"];
int32 status = 8 [(gogoproto.casttype) = "int16"];
int64 ctime = 9 [(gogoproto.customname) = "CTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 mtime = 10 [(gogoproto.customname) = "MTime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 oid = 11 [(gogoproto.customname) = "OID"];
}