impl

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: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName = "liveuser"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Order

type Order struct {
	ID       uint64     `bun:",pk"` // 订单编号
	UID      string     // 下单的用户ID
	State    OrderState // 订单状态
	Amount   int32      // 商品总额(单位:分)
	Discount int32      // 折扣(单位:分)
	Pay      int32      // 实付款(单位:分)
	PayAt    time.Time  // 支付时间

	CreatedAt time.Time // 下单时间
	UpdatedAt time.Time // 订单状态更新时间
	DeletedAt time.Time
}

func (*Order) AfterCreateTable

func (o *Order) AfterCreateTable(ctx context.Context, query *bun.CreateTableQuery) error

type OrderProduct

type OrderProduct struct {
	OrderID   uint64 // 订单编号
	ProductID string // 商品编号
	Name      string // 商品名称
	Price     int32  // 购买时的商品价格(单位:分)
	Count     int32  // 购买的数量
	Snapshot  uint64 // 购买时的商品快照
	Detail    string // 商品详情(JSON格式)
}

func (*OrderProduct) AfterCreateTable

func (p *OrderProduct) AfterCreateTable(ctx context.Context, query *bun.CreateTableQuery) error

type OrderService

type OrderService struct {
	// contains filtered or unexported fields
}

func (*OrderService) Create

func (*OrderService) Init

func (o *OrderService) Init(sqlDB *bun.DB)

func (*OrderService) InitMicroClient

func (o *OrderService) InitMicroClient(serivce micro.Service, namespace string)

func (*OrderService) List

func (*OrderService) Submit

type OrderState

type OrderState liveuser.OrderRecord_State

type Server

type Server struct {
	Namespace          string   `json:"namespace"`
	Production         bool     `json:"production"`
	LogOutputPaths     []string `json:"logging_output_paths"`
	RedisServerAddress string   `json:"redis_server_address"`
}

func NewServer

func NewServer() *Server

func (*Server) Name

func (s *Server) Name() string

func (*Server) Run

func (s *Server) Run()

type SessionResponse

type SessionResponse struct {
	OpenID     string `json:"openid"`
	SessionKey string `json:"session_key"`
	UnionID    string `json:"unionid"`
	ErrCode    int    `json:"errcode"`
	ErrMsg     string `json:"errmsg"`
}

type User

type User struct {
	// contains filtered or unexported fields
}

func (*User) Get

func (*User) Init

func (u *User) Init(sqlDB *bun.DB, redisDB *redis.Client)

func (*User) Set

type UserRecord

type UserRecord struct {
	UID      string `bun:",pk"`
	Name     string
	Agent    string
	Avatar   string
	UpdateAt time.Time
}

type Wx

type Wx struct {
	// contains filtered or unexported fields
}

func (*Wx) Init

func (w *Wx) Init(serivce micro.Service, namespace string)

func (*Wx) Login

func (w *Wx) Login(ctx context.Context, req *liveuser.LoginReq, res *liveuser.LoginRes) error

func (*Wx) Postpay

func (w *Wx) Postpay(ctx context.Context, req *liveuser.PostpayReq, res *liveuser.PostpayRes) error

func (*Wx) Prepay

func (w *Wx) Prepay(ctx context.Context, req *liveuser.PrepayReq, res *liveuser.PrepayRes) error

func (*Wx) RenewToken

func (w *Wx) RenewToken(ctx context.Context, req *liveuser.RenewTokenReq, res *liveuser.RenewTokenRes) error

Jump to

Keyboard shortcuts

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