liveuser

package
v0.0.0-...-551f129 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

liveuser

微信小程序的服务器后台。

删除过期的 access_token

sqlite3 /root/.microsqlstore/io_goeasy.db "delete from auth where key like 'tokens/%' and expiry < datetime('now','localtime')"

删除过期的 log 和 trace

/opt/goeasy/log/goeasy.log
/root/.microtrace/trace.csv
/root/.microstd/*.log
{
    missingok
    daily
    copytruncate
    rotate 7
    notifempty
}

门户页面放在

/portal

用户数据库放在

/root/.liveuser/liveuser.db

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OrderRecord_State_name = map[int32]string{
	0: "CREATED",
	1: "SUBMITTED",
	2: "PAID",
}
View Source
var OrderRecord_State_value = map[string]int32{
	"CREATED":   0,
	"SUBMITTED": 1,
	"PAID":      2,
}

Functions

func NewOrderEndpoints

func NewOrderEndpoints() []*api.Endpoint

func NewUserEndpoints

func NewUserEndpoints() []*api.Endpoint

func NewWxEndpoints

func NewWxEndpoints() []*api.Endpoint

func RegisterOrderHandler

func RegisterOrderHandler(s server.Server, hdlr OrderHandler, opts ...server.HandlerOption) error

func RegisterUserHandler

func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption) error

func RegisterWxHandler

func RegisterWxHandler(s server.Server, hdlr WxHandler, opts ...server.HandlerOption) error

Types

type CreateOrderReq

type CreateOrderReq struct {
	// 订单内包含的商品,只需要填 product_id 和 count
	Products             []*OrderProduct `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*CreateOrderReq) Descriptor

func (*CreateOrderReq) Descriptor() ([]byte, []int)

func (*CreateOrderReq) GetProducts

func (m *CreateOrderReq) GetProducts() []*OrderProduct

func (*CreateOrderReq) ProtoMessage

func (*CreateOrderReq) ProtoMessage()

func (*CreateOrderReq) Reset

func (m *CreateOrderReq) Reset()

func (*CreateOrderReq) String

func (m *CreateOrderReq) String() string

func (*CreateOrderReq) XXX_DiscardUnknown

func (m *CreateOrderReq) XXX_DiscardUnknown()

func (*CreateOrderReq) XXX_Marshal

func (m *CreateOrderReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateOrderReq) XXX_Merge

func (m *CreateOrderReq) XXX_Merge(src proto.Message)

func (*CreateOrderReq) XXX_Size

func (m *CreateOrderReq) XXX_Size() int

func (*CreateOrderReq) XXX_Unmarshal

func (m *CreateOrderReq) XXX_Unmarshal(b []byte) error

type CreateOrderRes

type CreateOrderRes struct {
	// 创建成功的订单
	Order                *OrderRecord `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*CreateOrderRes) Descriptor

func (*CreateOrderRes) Descriptor() ([]byte, []int)

func (*CreateOrderRes) GetOrder

func (m *CreateOrderRes) GetOrder() *OrderRecord

func (*CreateOrderRes) ProtoMessage

func (*CreateOrderRes) ProtoMessage()

func (*CreateOrderRes) Reset

func (m *CreateOrderRes) Reset()

func (*CreateOrderRes) String

func (m *CreateOrderRes) String() string

func (*CreateOrderRes) XXX_DiscardUnknown

func (m *CreateOrderRes) XXX_DiscardUnknown()

func (*CreateOrderRes) XXX_Marshal

func (m *CreateOrderRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateOrderRes) XXX_Merge

func (m *CreateOrderRes) XXX_Merge(src proto.Message)

func (*CreateOrderRes) XXX_Size

func (m *CreateOrderRes) XXX_Size() int

func (*CreateOrderRes) XXX_Unmarshal

func (m *CreateOrderRes) XXX_Unmarshal(b []byte) error

type GetUserInfoReq

type GetUserInfoReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetUserInfoReq) Descriptor

func (*GetUserInfoReq) Descriptor() ([]byte, []int)

func (*GetUserInfoReq) ProtoMessage

func (*GetUserInfoReq) ProtoMessage()

func (*GetUserInfoReq) Reset

func (m *GetUserInfoReq) Reset()

func (*GetUserInfoReq) String

func (m *GetUserInfoReq) String() string

func (*GetUserInfoReq) XXX_DiscardUnknown

func (m *GetUserInfoReq) XXX_DiscardUnknown()

func (*GetUserInfoReq) XXX_Marshal

func (m *GetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetUserInfoReq) XXX_Merge

func (m *GetUserInfoReq) XXX_Merge(src proto.Message)

func (*GetUserInfoReq) XXX_Size

func (m *GetUserInfoReq) XXX_Size() int

func (*GetUserInfoReq) XXX_Unmarshal

func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error

type GetUserInfoRes

type GetUserInfoRes struct {
	User                 *UserRecord `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*GetUserInfoRes) Descriptor

func (*GetUserInfoRes) Descriptor() ([]byte, []int)

func (*GetUserInfoRes) GetUser

func (m *GetUserInfoRes) GetUser() *UserRecord

func (*GetUserInfoRes) ProtoMessage

func (*GetUserInfoRes) ProtoMessage()

func (*GetUserInfoRes) Reset

func (m *GetUserInfoRes) Reset()

func (*GetUserInfoRes) String

func (m *GetUserInfoRes) String() string

func (*GetUserInfoRes) XXX_DiscardUnknown

func (m *GetUserInfoRes) XXX_DiscardUnknown()

func (*GetUserInfoRes) XXX_Marshal

func (m *GetUserInfoRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetUserInfoRes) XXX_Merge

func (m *GetUserInfoRes) XXX_Merge(src proto.Message)

func (*GetUserInfoRes) XXX_Size

func (m *GetUserInfoRes) XXX_Size() int

func (*GetUserInfoRes) XXX_Unmarshal

func (m *GetUserInfoRes) XXX_Unmarshal(b []byte) error

type ListOrderReq

type ListOrderReq struct {
	// 翻页游标:初始值是 0, 下次用服务端返回的 cursor. 当服务端返回 cursor 0 时,翻页结束。
	Cursor               uint64   `protobuf:"varint,1,opt,name=cursor,proto3" json:"cursor,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListOrderReq) Descriptor

func (*ListOrderReq) Descriptor() ([]byte, []int)

func (*ListOrderReq) GetCursor

func (m *ListOrderReq) GetCursor() uint64

func (*ListOrderReq) ProtoMessage

func (*ListOrderReq) ProtoMessage()

func (*ListOrderReq) Reset

func (m *ListOrderReq) Reset()

func (*ListOrderReq) String

func (m *ListOrderReq) String() string

func (*ListOrderReq) XXX_DiscardUnknown

func (m *ListOrderReq) XXX_DiscardUnknown()

func (*ListOrderReq) XXX_Marshal

func (m *ListOrderReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListOrderReq) XXX_Merge

func (m *ListOrderReq) XXX_Merge(src proto.Message)

func (*ListOrderReq) XXX_Size

func (m *ListOrderReq) XXX_Size() int

func (*ListOrderReq) XXX_Unmarshal

func (m *ListOrderReq) XXX_Unmarshal(b []byte) error

type ListOrderRes

type ListOrderRes struct {
	// 订单列表
	Orders []*OrderRecord `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
	// 翻页游标:用于下次请求。
	Cursor               uint64   `protobuf:"varint,2,opt,name=cursor,proto3" json:"cursor,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListOrderRes) Descriptor

func (*ListOrderRes) Descriptor() ([]byte, []int)

func (*ListOrderRes) GetCursor

func (m *ListOrderRes) GetCursor() uint64

func (*ListOrderRes) GetOrders

func (m *ListOrderRes) GetOrders() []*OrderRecord

func (*ListOrderRes) ProtoMessage

func (*ListOrderRes) ProtoMessage()

func (*ListOrderRes) Reset

func (m *ListOrderRes) Reset()

func (*ListOrderRes) String

func (m *ListOrderRes) String() string

func (*ListOrderRes) XXX_DiscardUnknown

func (m *ListOrderRes) XXX_DiscardUnknown()

func (*ListOrderRes) XXX_Marshal

func (m *ListOrderRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListOrderRes) XXX_Merge

func (m *ListOrderRes) XXX_Merge(src proto.Message)

func (*ListOrderRes) XXX_Size

func (m *ListOrderRes) XXX_Size() int

func (*ListOrderRes) XXX_Unmarshal

func (m *ListOrderRes) XXX_Unmarshal(b []byte) error

type LoginReq

type LoginReq struct {
	// 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 auth.code2Session,
	// 使用 code 换取 openid、unionid、session_key 等信息
	Code                 string   `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LoginReq) Descriptor

func (*LoginReq) Descriptor() ([]byte, []int)

func (*LoginReq) GetCode

func (m *LoginReq) GetCode() string

func (*LoginReq) ProtoMessage

func (*LoginReq) ProtoMessage()

func (*LoginReq) Reset

func (m *LoginReq) Reset()

func (*LoginReq) String

func (m *LoginReq) String() string

func (*LoginReq) XXX_DiscardUnknown

func (m *LoginReq) XXX_DiscardUnknown()

func (*LoginReq) XXX_Marshal

func (m *LoginReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LoginReq) XXX_Merge

func (m *LoginReq) XXX_Merge(src proto.Message)

func (*LoginReq) XXX_Size

func (m *LoginReq) XXX_Size() int

func (*LoginReq) XXX_Unmarshal

func (m *LoginReq) XXX_Unmarshal(b []byte) error

type LoginRes

type LoginRes struct {
	// 该用户调用开发者服务器后台的凭据,用来识别用户身份
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// 用来换取新的 access_token,客户端应该保存在本地存储
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// access_token 凭证到期的时间,格式为Unix时间戳
	Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// 用户的唯一ID
	Uid                  string   `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LoginRes) Descriptor

func (*LoginRes) Descriptor() ([]byte, []int)

func (*LoginRes) GetAccessToken

func (m *LoginRes) GetAccessToken() string

func (*LoginRes) GetExpiry

func (m *LoginRes) GetExpiry() int64

func (*LoginRes) GetRefreshToken

func (m *LoginRes) GetRefreshToken() string

func (*LoginRes) GetUid

func (m *LoginRes) GetUid() string

func (*LoginRes) ProtoMessage

func (*LoginRes) ProtoMessage()

func (*LoginRes) Reset

func (m *LoginRes) Reset()

func (*LoginRes) String

func (m *LoginRes) String() string

func (*LoginRes) XXX_DiscardUnknown

func (m *LoginRes) XXX_DiscardUnknown()

func (*LoginRes) XXX_Marshal

func (m *LoginRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LoginRes) XXX_Merge

func (m *LoginRes) XXX_Merge(src proto.Message)

func (*LoginRes) XXX_Size

func (m *LoginRes) XXX_Size() int

func (*LoginRes) XXX_Unmarshal

func (m *LoginRes) XXX_Unmarshal(b []byte) error

type OrderHandler

type OrderHandler interface {
	// 创建订单
	Create(context.Context, *CreateOrderReq, *CreateOrderRes) error
	// 提交订单
	Submit(context.Context, *SubmitOrderReq, *SubmitOrderRes) error
	// 查询自己的订单
	List(context.Context, *ListOrderReq, *ListOrderRes) error
}

type OrderProduct

type OrderProduct struct {
	OrderId              uint64   `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	ProductId            string   `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	Name                 string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Price                int32    `protobuf:"varint,4,opt,name=price,proto3" json:"price,omitempty"`
	Count                int32    `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"`
	ProductSnapshot      uint64   `protobuf:"varint,6,opt,name=product_snapshot,json=productSnapshot,proto3" json:"product_snapshot,omitempty"`
	Detail               string   `protobuf:"bytes,7,opt,name=detail,proto3" json:"detail,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

订单内的商品

func (*OrderProduct) Descriptor

func (*OrderProduct) Descriptor() ([]byte, []int)

func (*OrderProduct) GetCount

func (m *OrderProduct) GetCount() int32

func (*OrderProduct) GetDetail

func (m *OrderProduct) GetDetail() string

func (*OrderProduct) GetName

func (m *OrderProduct) GetName() string

func (*OrderProduct) GetOrderId

func (m *OrderProduct) GetOrderId() uint64

func (*OrderProduct) GetPrice

func (m *OrderProduct) GetPrice() int32

func (*OrderProduct) GetProductId

func (m *OrderProduct) GetProductId() string

func (*OrderProduct) GetProductSnapshot

func (m *OrderProduct) GetProductSnapshot() uint64

func (*OrderProduct) ProtoMessage

func (*OrderProduct) ProtoMessage()

func (*OrderProduct) Reset

func (m *OrderProduct) Reset()

func (*OrderProduct) String

func (m *OrderProduct) String() string

func (*OrderProduct) XXX_DiscardUnknown

func (m *OrderProduct) XXX_DiscardUnknown()

func (*OrderProduct) XXX_Marshal

func (m *OrderProduct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OrderProduct) XXX_Merge

func (m *OrderProduct) XXX_Merge(src proto.Message)

func (*OrderProduct) XXX_Size

func (m *OrderProduct) XXX_Size() int

func (*OrderProduct) XXX_Unmarshal

func (m *OrderProduct) XXX_Unmarshal(b []byte) error

type OrderRecord

type OrderRecord struct {
	Id                   uint64            `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Uid                  string            `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
	State                OrderRecord_State `protobuf:"varint,3,opt,name=state,proto3,enum=liveuser.OrderRecord_State" json:"state,omitempty"`
	Amount               int32             `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"`
	Discount             int32             `protobuf:"varint,5,opt,name=discount,proto3" json:"discount,omitempty"`
	Pay                  int32             `protobuf:"varint,6,opt,name=pay,proto3" json:"pay,omitempty"`
	PayAt                int64             `protobuf:"varint,7,opt,name=pay_at,json=payAt,proto3" json:"pay_at,omitempty"`
	Products             []*OrderProduct   `protobuf:"bytes,8,rep,name=products,proto3" json:"products,omitempty"`
	CreatedAt            int64             `protobuf:"varint,1002,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt            int64             `protobuf:"varint,1003,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	DeletedAt            int64             `protobuf:"varint,1004,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

一条订单

func (*OrderRecord) Descriptor

func (*OrderRecord) Descriptor() ([]byte, []int)

func (*OrderRecord) GetAmount

func (m *OrderRecord) GetAmount() int32

func (*OrderRecord) GetCreatedAt

func (m *OrderRecord) GetCreatedAt() int64

func (*OrderRecord) GetDeletedAt

func (m *OrderRecord) GetDeletedAt() int64

func (*OrderRecord) GetDiscount

func (m *OrderRecord) GetDiscount() int32

func (*OrderRecord) GetId

func (m *OrderRecord) GetId() uint64

func (*OrderRecord) GetPay

func (m *OrderRecord) GetPay() int32

func (*OrderRecord) GetPayAt

func (m *OrderRecord) GetPayAt() int64

func (*OrderRecord) GetProducts

func (m *OrderRecord) GetProducts() []*OrderProduct

func (*OrderRecord) GetState

func (m *OrderRecord) GetState() OrderRecord_State

func (*OrderRecord) GetUid

func (m *OrderRecord) GetUid() string

func (*OrderRecord) GetUpdatedAt

func (m *OrderRecord) GetUpdatedAt() int64

func (*OrderRecord) ProtoMessage

func (*OrderRecord) ProtoMessage()

func (*OrderRecord) Reset

func (m *OrderRecord) Reset()

func (*OrderRecord) String

func (m *OrderRecord) String() string

func (*OrderRecord) XXX_DiscardUnknown

func (m *OrderRecord) XXX_DiscardUnknown()

func (*OrderRecord) XXX_Marshal

func (m *OrderRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OrderRecord) XXX_Merge

func (m *OrderRecord) XXX_Merge(src proto.Message)

func (*OrderRecord) XXX_Size

func (m *OrderRecord) XXX_Size() int

func (*OrderRecord) XXX_Unmarshal

func (m *OrderRecord) XXX_Unmarshal(b []byte) error

type OrderRecord_State

type OrderRecord_State int32

订单的状态枚举值

const (
	OrderRecord_CREATED   OrderRecord_State = 0
	OrderRecord_SUBMITTED OrderRecord_State = 1
	OrderRecord_PAID      OrderRecord_State = 2
)

func (OrderRecord_State) EnumDescriptor

func (OrderRecord_State) EnumDescriptor() ([]byte, []int)

func (OrderRecord_State) String

func (x OrderRecord_State) String() string

type OrderService

type OrderService interface {
	// 创建订单
	Create(ctx context.Context, in *CreateOrderReq, opts ...client.CallOption) (*CreateOrderRes, error)
	// 提交订单
	Submit(ctx context.Context, in *SubmitOrderReq, opts ...client.CallOption) (*SubmitOrderRes, error)
	// 查询自己的订单
	List(ctx context.Context, in *ListOrderReq, opts ...client.CallOption) (*ListOrderRes, error)
}

func NewOrderService

func NewOrderService(name string, c client.Client) OrderService

type PostpayReq

type PostpayReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PostpayReq) Descriptor

func (*PostpayReq) Descriptor() ([]byte, []int)

func (*PostpayReq) ProtoMessage

func (*PostpayReq) ProtoMessage()

func (*PostpayReq) Reset

func (m *PostpayReq) Reset()

func (*PostpayReq) String

func (m *PostpayReq) String() string

func (*PostpayReq) XXX_DiscardUnknown

func (m *PostpayReq) XXX_DiscardUnknown()

func (*PostpayReq) XXX_Marshal

func (m *PostpayReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PostpayReq) XXX_Merge

func (m *PostpayReq) XXX_Merge(src proto.Message)

func (*PostpayReq) XXX_Size

func (m *PostpayReq) XXX_Size() int

func (*PostpayReq) XXX_Unmarshal

func (m *PostpayReq) XXX_Unmarshal(b []byte) error

type PostpayRes

type PostpayRes struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PostpayRes) Descriptor

func (*PostpayRes) Descriptor() ([]byte, []int)

func (*PostpayRes) ProtoMessage

func (*PostpayRes) ProtoMessage()

func (*PostpayRes) Reset

func (m *PostpayRes) Reset()

func (*PostpayRes) String

func (m *PostpayRes) String() string

func (*PostpayRes) XXX_DiscardUnknown

func (m *PostpayRes) XXX_DiscardUnknown()

func (*PostpayRes) XXX_Marshal

func (m *PostpayRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PostpayRes) XXX_Merge

func (m *PostpayRes) XXX_Merge(src proto.Message)

func (*PostpayRes) XXX_Size

func (m *PostpayRes) XXX_Size() int

func (*PostpayRes) XXX_Unmarshal

func (m *PostpayRes) XXX_Unmarshal(b []byte) error

type PrepayReq

type PrepayReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrepayReq) Descriptor

func (*PrepayReq) Descriptor() ([]byte, []int)

func (*PrepayReq) ProtoMessage

func (*PrepayReq) ProtoMessage()

func (*PrepayReq) Reset

func (m *PrepayReq) Reset()

func (*PrepayReq) String

func (m *PrepayReq) String() string

func (*PrepayReq) XXX_DiscardUnknown

func (m *PrepayReq) XXX_DiscardUnknown()

func (*PrepayReq) XXX_Marshal

func (m *PrepayReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrepayReq) XXX_Merge

func (m *PrepayReq) XXX_Merge(src proto.Message)

func (*PrepayReq) XXX_Size

func (m *PrepayReq) XXX_Size() int

func (*PrepayReq) XXX_Unmarshal

func (m *PrepayReq) XXX_Unmarshal(b []byte) error

type PrepayRes

type PrepayRes struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrepayRes) Descriptor

func (*PrepayRes) Descriptor() ([]byte, []int)

func (*PrepayRes) ProtoMessage

func (*PrepayRes) ProtoMessage()

func (*PrepayRes) Reset

func (m *PrepayRes) Reset()

func (*PrepayRes) String

func (m *PrepayRes) String() string

func (*PrepayRes) XXX_DiscardUnknown

func (m *PrepayRes) XXX_DiscardUnknown()

func (*PrepayRes) XXX_Marshal

func (m *PrepayRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrepayRes) XXX_Merge

func (m *PrepayRes) XXX_Merge(src proto.Message)

func (*PrepayRes) XXX_Size

func (m *PrepayRes) XXX_Size() int

func (*PrepayRes) XXX_Unmarshal

func (m *PrepayRes) XXX_Unmarshal(b []byte) error

type RenewTokenReq

type RenewTokenReq struct {
	// 客户端保存在本地存储的上次的 refresh_token
	RefreshToken         string   `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RenewTokenReq) Descriptor

func (*RenewTokenReq) Descriptor() ([]byte, []int)

func (*RenewTokenReq) GetRefreshToken

func (m *RenewTokenReq) GetRefreshToken() string

func (*RenewTokenReq) ProtoMessage

func (*RenewTokenReq) ProtoMessage()

func (*RenewTokenReq) Reset

func (m *RenewTokenReq) Reset()

func (*RenewTokenReq) String

func (m *RenewTokenReq) String() string

func (*RenewTokenReq) XXX_DiscardUnknown

func (m *RenewTokenReq) XXX_DiscardUnknown()

func (*RenewTokenReq) XXX_Marshal

func (m *RenewTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RenewTokenReq) XXX_Merge

func (m *RenewTokenReq) XXX_Merge(src proto.Message)

func (*RenewTokenReq) XXX_Size

func (m *RenewTokenReq) XXX_Size() int

func (*RenewTokenReq) XXX_Unmarshal

func (m *RenewTokenReq) XXX_Unmarshal(b []byte) error

type RenewTokenRes

type RenewTokenRes struct {
	// 该用户调用开发者服务器后台的凭据,用来识别用户身份
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// 用来换取新的 access_token,客户端应该保存在本地存储。
	// 取决于是否开启了 Refresh Token Rotation,它可能与请求时的 refresh_token 不同
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// access_token 凭证到期的时间,格式为Unix时间戳
	Expiry               int64    `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RenewTokenRes) Descriptor

func (*RenewTokenRes) Descriptor() ([]byte, []int)

func (*RenewTokenRes) GetAccessToken

func (m *RenewTokenRes) GetAccessToken() string

func (*RenewTokenRes) GetExpiry

func (m *RenewTokenRes) GetExpiry() int64

func (*RenewTokenRes) GetRefreshToken

func (m *RenewTokenRes) GetRefreshToken() string

func (*RenewTokenRes) ProtoMessage

func (*RenewTokenRes) ProtoMessage()

func (*RenewTokenRes) Reset

func (m *RenewTokenRes) Reset()

func (*RenewTokenRes) String

func (m *RenewTokenRes) String() string

func (*RenewTokenRes) XXX_DiscardUnknown

func (m *RenewTokenRes) XXX_DiscardUnknown()

func (*RenewTokenRes) XXX_Marshal

func (m *RenewTokenRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RenewTokenRes) XXX_Merge

func (m *RenewTokenRes) XXX_Merge(src proto.Message)

func (*RenewTokenRes) XXX_Size

func (m *RenewTokenRes) XXX_Size() int

func (*RenewTokenRes) XXX_Unmarshal

func (m *RenewTokenRes) XXX_Unmarshal(b []byte) error

type SetUserInfoReq

type SetUserInfoReq struct {
	// 需要更新的用户信息。其中 uid, update_at 可以不填。
	User                 *UserRecord `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*SetUserInfoReq) Descriptor

func (*SetUserInfoReq) Descriptor() ([]byte, []int)

func (*SetUserInfoReq) GetUser

func (m *SetUserInfoReq) GetUser() *UserRecord

func (*SetUserInfoReq) ProtoMessage

func (*SetUserInfoReq) ProtoMessage()

func (*SetUserInfoReq) Reset

func (m *SetUserInfoReq) Reset()

func (*SetUserInfoReq) String

func (m *SetUserInfoReq) String() string

func (*SetUserInfoReq) XXX_DiscardUnknown

func (m *SetUserInfoReq) XXX_DiscardUnknown()

func (*SetUserInfoReq) XXX_Marshal

func (m *SetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetUserInfoReq) XXX_Merge

func (m *SetUserInfoReq) XXX_Merge(src proto.Message)

func (*SetUserInfoReq) XXX_Size

func (m *SetUserInfoReq) XXX_Size() int

func (*SetUserInfoReq) XXX_Unmarshal

func (m *SetUserInfoReq) XXX_Unmarshal(b []byte) error

type SetUserInfoRes

type SetUserInfoRes struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SetUserInfoRes) Descriptor

func (*SetUserInfoRes) Descriptor() ([]byte, []int)

func (*SetUserInfoRes) ProtoMessage

func (*SetUserInfoRes) ProtoMessage()

func (*SetUserInfoRes) Reset

func (m *SetUserInfoRes) Reset()

func (*SetUserInfoRes) String

func (m *SetUserInfoRes) String() string

func (*SetUserInfoRes) XXX_DiscardUnknown

func (m *SetUserInfoRes) XXX_DiscardUnknown()

func (*SetUserInfoRes) XXX_Marshal

func (m *SetUserInfoRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetUserInfoRes) XXX_Merge

func (m *SetUserInfoRes) XXX_Merge(src proto.Message)

func (*SetUserInfoRes) XXX_Size

func (m *SetUserInfoRes) XXX_Size() int

func (*SetUserInfoRes) XXX_Unmarshal

func (m *SetUserInfoRes) XXX_Unmarshal(b []byte) error

type SubmitOrderReq

type SubmitOrderReq struct {
	OrderId              uint64   `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SubmitOrderReq) Descriptor

func (*SubmitOrderReq) Descriptor() ([]byte, []int)

func (*SubmitOrderReq) GetOrderId

func (m *SubmitOrderReq) GetOrderId() uint64

func (*SubmitOrderReq) ProtoMessage

func (*SubmitOrderReq) ProtoMessage()

func (*SubmitOrderReq) Reset

func (m *SubmitOrderReq) Reset()

func (*SubmitOrderReq) String

func (m *SubmitOrderReq) String() string

func (*SubmitOrderReq) XXX_DiscardUnknown

func (m *SubmitOrderReq) XXX_DiscardUnknown()

func (*SubmitOrderReq) XXX_Marshal

func (m *SubmitOrderReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubmitOrderReq) XXX_Merge

func (m *SubmitOrderReq) XXX_Merge(src proto.Message)

func (*SubmitOrderReq) XXX_Size

func (m *SubmitOrderReq) XXX_Size() int

func (*SubmitOrderReq) XXX_Unmarshal

func (m *SubmitOrderReq) XXX_Unmarshal(b []byte) error

type SubmitOrderRes

type SubmitOrderRes struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SubmitOrderRes) Descriptor

func (*SubmitOrderRes) Descriptor() ([]byte, []int)

func (*SubmitOrderRes) ProtoMessage

func (*SubmitOrderRes) ProtoMessage()

func (*SubmitOrderRes) Reset

func (m *SubmitOrderRes) Reset()

func (*SubmitOrderRes) String

func (m *SubmitOrderRes) String() string

func (*SubmitOrderRes) XXX_DiscardUnknown

func (m *SubmitOrderRes) XXX_DiscardUnknown()

func (*SubmitOrderRes) XXX_Marshal

func (m *SubmitOrderRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubmitOrderRes) XXX_Merge

func (m *SubmitOrderRes) XXX_Merge(src proto.Message)

func (*SubmitOrderRes) XXX_Size

func (m *SubmitOrderRes) XXX_Size() int

func (*SubmitOrderRes) XXX_Unmarshal

func (m *SubmitOrderRes) XXX_Unmarshal(b []byte) error

type UserHandler

type UserHandler interface {
	// 新增或更新自己的用户信息
	Set(context.Context, *SetUserInfoReq, *SetUserInfoRes) error
	// 获取自己的用户信息
	Get(context.Context, *GetUserInfoReq, *GetUserInfoRes) error
}

type UserRecord

type UserRecord struct {
	Uid                  string   `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Agent                string   `protobuf:"bytes,3,opt,name=agent,proto3" json:"agent,omitempty"`
	UpdateAt             int64    `protobuf:"varint,4,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"`
	Avatar               string   `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

UserRecord 是用户信息

func (*UserRecord) Descriptor

func (*UserRecord) Descriptor() ([]byte, []int)

func (*UserRecord) GetAgent

func (m *UserRecord) GetAgent() string

func (*UserRecord) GetAvatar

func (m *UserRecord) GetAvatar() string

func (*UserRecord) GetName

func (m *UserRecord) GetName() string

func (*UserRecord) GetUid

func (m *UserRecord) GetUid() string

func (*UserRecord) GetUpdateAt

func (m *UserRecord) GetUpdateAt() int64

func (*UserRecord) ProtoMessage

func (*UserRecord) ProtoMessage()

func (*UserRecord) Reset

func (m *UserRecord) Reset()

func (*UserRecord) String

func (m *UserRecord) String() string

func (*UserRecord) XXX_DiscardUnknown

func (m *UserRecord) XXX_DiscardUnknown()

func (*UserRecord) XXX_Marshal

func (m *UserRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserRecord) XXX_Merge

func (m *UserRecord) XXX_Merge(src proto.Message)

func (*UserRecord) XXX_Size

func (m *UserRecord) XXX_Size() int

func (*UserRecord) XXX_Unmarshal

func (m *UserRecord) XXX_Unmarshal(b []byte) error

type UserService

type UserService interface {
	// 新增或更新自己的用户信息
	Set(ctx context.Context, in *SetUserInfoReq, opts ...client.CallOption) (*SetUserInfoRes, error)
	// 获取自己的用户信息
	Get(ctx context.Context, in *GetUserInfoReq, opts ...client.CallOption) (*GetUserInfoRes, error)
}

func NewUserService

func NewUserService(name string, c client.Client) UserService

type WxHandler

type WxHandler interface {
	// 客户端调用 wx.login() 获取临时登录凭证 code ,用此接口回传到开发者服务器。
	// 开发者服务器处理之后,返回开发者服务器的自定义登录态。
	// 关于自定义登录态的解释,可以参考 https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/
	Login(context.Context, *LoginReq, *LoginRes) error
	// 开发者服务器的自定义登录态里的 access_token 到期之前,用此接口获取新的 access_token。
	RenewToken(context.Context, *RenewTokenReq, *RenewTokenRes) error
	// 下单。调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易会话标识。
	Prepay(context.Context, *PrepayReq, *PrepayRes) error
	// 支付通知。微信支付通过支付通知接口将用户支付成功消息通知给开发者服务器。
	Postpay(context.Context, *PostpayReq, *PostpayRes) error
}

type WxService

type WxService interface {
	// 客户端调用 wx.login() 获取临时登录凭证 code ,用此接口回传到开发者服务器。
	// 开发者服务器处理之后,返回开发者服务器的自定义登录态。
	// 关于自定义登录态的解释,可以参考 https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/
	Login(ctx context.Context, in *LoginReq, opts ...client.CallOption) (*LoginRes, error)
	// 开发者服务器的自定义登录态里的 access_token 到期之前,用此接口获取新的 access_token。
	RenewToken(ctx context.Context, in *RenewTokenReq, opts ...client.CallOption) (*RenewTokenRes, error)
	// 下单。调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易会话标识。
	Prepay(ctx context.Context, in *PrepayReq, opts ...client.CallOption) (*PrepayRes, error)
	// 支付通知。微信支付通过支付通知接口将用户支付成功消息通知给开发者服务器。
	Postpay(ctx context.Context, in *PostpayReq, opts ...client.CallOption) (*PostpayRes, error)
}

func NewWxService

func NewWxService(name string, c client.Client) WxService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL