facade

package
v0.0.0-...-a7c7adb Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockGiftExchangeService = newMockGiftExchangeService()
View Source
var MockInventoryService = newMockInventoryService()
View Source
var MockPointsService = newMockPointsService()
View Source
var MockShippingService = newMockShippingService()

Functions

This section is empty.

Types

type GiftExchangeRequest

type GiftExchangeRequest struct {
	ID         int
	UserID     int
	GiftID     int
	CreateTime int64
}

积分兑换礼品请求

type GiftInfo

type GiftInfo struct {
	ID     int
	Name   string
	Points int
}

礼品信息实体

func NewGiftInfo

func NewGiftInfo(id int, name string, points int) *GiftInfo

type IGiftExchangeService

type IGiftExchangeService interface {
	// 兑换礼品, 并返回物流单号
	Exchange(request *GiftExchangeRequest) (error, string)
}

礼品兑换服务

type IInventoryService

type IInventoryService interface {
	GetGift(goodsID int) *GiftInfo
	GetStock(goodsID int) (error, int)
	SaveStock(goodsID int, num int) error
}

库存服务

type IPointsService

type IPointsService interface {
	GetUserPoints(uid int) (error, int)
	SaveUserPoints(uid int, points int) error
}

用户积分服务

type IShippingService

type IShippingService interface {
	CreateShippingOrder(uid int, goodsID int) (error, string)
}

物流下单服务

Jump to

Keyboard shortcuts

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