Documentation ¶
Index ¶
- Constants
- func MD5(str string) string
- type AccountInfo
- type CardItem
- type CardOrderResult
- type CheckProductStockParams
- type CheckProductStockResult
- type Client
- func (c *Client) CheckProductStock(ctx context.Context, productID string, num int) (*CheckProductStockResult, error)
- func (c *Client) CreateCardOrder(ctx context.Context, params CreateCardOrderBizContent) (*CardOrderResult, error)
- func (c *Client) CreateDirectOrder(ctx context.Context, params CreateDirectOrderBizContent) (*DirectOrderResult, error)
- func (c *Client) CreateMobileOrder(ctx context.Context, params CreateMobileOrderBizContent) (*MobileOrderResult, error)
- func (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error)
- func (c *Client) GetMobileInfo(ctx context.Context, mobileNO string, faceValue ...float64) (*GetMobileInfoResult, error)
- func (c *Client) GetMobileMaintainStatus(ctx context.Context, mobileNO string, faceValue int) (*GetMobileMaintainStatusResult, error)
- func (c *Client) GetProductChangeInfo(data interface{})
- func (c *Client) GetProductInfo(ctx context.Context, productID string, format ...ProductDetailFormat) (*ProductInfo, error)
- func (c *Client) GetProductList(ctx context.Context, params *GetProductListParams) ([]ProductListItem, error)
- func (c *Client) GetProductTemplate(ctx context.Context, templateID string) (*ProductTemplate, error)
- func (c *Client) GetQQNickname(ctx context.Context, qqNumber string) (*GetQQNicknameResult, error)
- func (c *Client) GetReconciliation(ctx context.Context)
- func (c *Client) QueryOrder(ctx context.Context, customerOrderNO string) (*Order, error)
- func (c *Client) QueryOrderExtend(ctx context.Context, customerOrderNO string) (*OrderExtend, error)
- func (c *Client) Request(ctx context.Context, method Method, bizContent interface{}, result interface{}) error
- type Config
- type CreateCardOrderBizContent
- type CreateDirectOrderBizContent
- type CreateMobileOrderBizContent
- type DirectOrderResult
- type GetMobileInfoReqParams
- type GetMobileInfoResult
- type GetMobileMaintainStatusReqParams
- type GetMobileMaintainStatusResult
- type GetProductInfoParams
- type GetProductListParams
- type GetProductTemplateParams
- type GetQQNicknameResult
- type Method
- type MobileMaintainState
- type MobileOrderResult
- type MobileSpType
- type Order
- type OrderExtend
- type OrderExtendContent
- type OrderExtendTemp
- type OrderState
- type ProductDetailFormat
- type ProductInfo
- type ProductListItem
- type ProductTemplate
- type ReqParams
- type RespData
- type SaleStatus
- type StockStatus
Constants ¶
const ( MethodGetProductList = Method("fulu.goods.list.get") MethodGetProductInfo = Method("fulu.goods.info.get") MethodGetProductTemplate = Method("fulu.goods.template.get") MethodCheckProductStock = Method("fulu.goods.stock.check") MethodGetAccountInfo = Method("fulu.user.info.get") MethodGetQQNickname = Method("fulu.market.qqnickname.get") MethodGetMobileInfo = Method("fulu.mobile.info.get") MethodGetMobileMaintainStatus = Method("fulu.mobile.maintain.check") MethodCreateDirectOrder = Method("fulu.order.direct.add") MethodCreateCardOrder = Method("fulu.order.card.add") MethodCreateMobileOrder = Method("fulu.order.mobile.add") MethodQueryOrder = Method("fulu.order.info.get") MethodQueryOrderExtend = Method("fulu.order.extend.get") )
const ( OrderStateSuccess = "success" // 成功 OrderStateProcessing = "processing" // 处理中 OrderStateFailed = "failed" // 失败 OrderStateUntreated = "untreated" // 未处理 )
const ( ProductDetailFormatPlain = 0 // 纯文本 ProductDetailFormatJSON = 1 // json )
const ( SaleStatusValid = SaleStatus("上架") SaleStatusInvalid = SaleStatus("下架") SaleStatusMaintain = SaleStatus("维护中") SaleStatusStockMaintain = SaleStatus("库存维护") )
const ( StockStatusEnough = StockStatus("充足") StockStatusOut = StockStatus("断货") StockStatusAlarm = StockStatus("警报") )
const ( SpChinaMobile = MobileSpType("1") // 中国移动 SpChinaTelecom = MobileSpType("2") // 中国电信 SpChinaUnicom = MobileSpType("3") // 中国联通 )
const ( MaintainStateOK = MobileMaintainState("正常") MaintainStateNotOK = MobileMaintainState("维护") )
const (
TimestampFormat = "2006-01-02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountInfo ¶
type CardItem ¶
type CardItem struct { CardType int `json:"card_type"` CardNumber string `json:"card_number"` CardPwd string `json:"card_pwd"` CardDeadline string `json:"card_deadline"` }
CardItem 卡密商品
type CardOrderResult ¶
type CardOrderResult struct { OrderID string `json:"order_id"` CustomerOrderNO string `json:"customer_order_no"` ProductID int64 `json:"product_id"` ProductName string `json:"product_name"` BuyNum int `json:"buy_num"` OrderType int `json:"order_type"` OrderPrice float64 `json:"order_price"` OrderState string `json:"order_state"` CreateTime string `json:"create_time"` FinishTime string `json:"finish_time"` OperatorSerialNumber string `json:"operator_serial_number"` }
type CheckProductStockParams ¶
type CheckProductStockParams struct { BuyNum int `json:"buy_num"` ProductID string `json:"product_id"` }
CheckProductStockParams 校验库存请求参数
type CheckProductStockResult ¶
type CheckProductStockResult struct { StockStatus string `json:"stock_status"` ProductID int `json:"product_id"` }
CheckProductStockResult 校验库存结果
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithClient ¶
NewWithClient 初始化自定义http.Client的福禄sdk实例
func (*Client) CheckProductStock ¶
func (c *Client) CheckProductStock(ctx context.Context, productID string, num int) (*CheckProductStockResult, error)
CheckProductStock 校验商品库存
func (*Client) CreateCardOrder ¶
func (c *Client) CreateCardOrder(ctx context.Context, params CreateCardOrderBizContent) (*CardOrderResult, error)
CreateCardOrder 创建卡密订单
func (*Client) CreateDirectOrder ¶
func (c *Client) CreateDirectOrder(ctx context.Context, params CreateDirectOrderBizContent) (*DirectOrderResult, error)
CreateDirectOrder 创建直充订单
func (*Client) CreateMobileOrder ¶
func (c *Client) CreateMobileOrder(ctx context.Context, params CreateMobileOrderBizContent) (*MobileOrderResult, error)
CreateMobileOrder 创建话费订单
func (*Client) GetAccountInfo ¶
func (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error)
GetAccountInfo 获取用户信息
func (*Client) GetMobileInfo ¶
func (c *Client) GetMobileInfo(ctx context.Context, mobileNO string, faceValue ...float64) (*GetMobileInfoResult, error)
GetMobileInfo 获取手机归属地
func (*Client) GetMobileMaintainStatus ¶
func (c *Client) GetMobileMaintainStatus(ctx context.Context, mobileNO string, faceValue int) (*GetMobileMaintainStatusResult, error)
GetMobileMaintainStatus 话费维护状态检查
func (*Client) GetProductChangeInfo ¶
func (c *Client) GetProductChangeInfo(data interface{})
func (*Client) GetProductInfo ¶
func (c *Client) GetProductInfo(ctx context.Context, productID string, format ...ProductDetailFormat) (*ProductInfo, error)
GetProductInfo 获取商品信息 method: fulu.goods.info.get
func (*Client) GetProductList ¶
func (c *Client) GetProductList(ctx context.Context, params *GetProductListParams) ([]ProductListItem, error)
GetProductList 获取商品列表 method: fulu.goods.list.get
func (*Client) GetProductTemplate ¶
func (c *Client) GetProductTemplate(ctx context.Context, templateID string) (*ProductTemplate, error)
GetProductTemplate 获取商品模板
func (*Client) GetQQNickname ¶
GetQQNickname 获取qq昵称
func (*Client) GetReconciliation ¶
GetReconciliation 对账单申请
func (*Client) QueryOrder ¶
QueryOrder 订单查询
func (*Client) QueryOrderExtend ¶
func (c *Client) QueryOrderExtend(ctx context.Context, customerOrderNO string) (*OrderExtend, error)
QueryOrderExtend 订单扩展信息查询
type Config ¶
type Config struct { Debug bool `json:"debug" yaml:"debug"` Endpoint string `json:"endpoint" yaml:"endpoint"` AppKey string `json:"app_key" yaml:"app_key"` AppSecret string `json:"app_secret" yaml:"app_secret"` Format string `json:"format" yaml:"format"` Version string `json:"version" yaml:"version"` Charset string `json:"charset" yaml:"charset"` SignType string `json:"sign_type" yaml:"sign_type"` AppAuthToken string `json:"app_auth_token" yaml:"app_auth_token"` }
type CreateDirectOrderBizContent ¶
type CreateDirectOrderBizContent struct { ProductID int64 `json:"product_id"` CustomerOrder string `json:"customer_order"` ChargeAccount string `json:"charge_account"` BuyNum int `json:"buy_num"` ChargeGameName string `json:"charge_game_name"` ChargeGameRegion string `json:"charge_game_region"` ChargeType string `json:"charge_type"` ChargePassword string `json:"charge_password"` ChargeIp string `json:"charge_ip"` ContactQQ string `json:"contact_qq"` ContactTel string `json:"contact_tel"` RemainingNumber string `json:"remaining_number"` ChargeGameRole string `json:"charge_game_role"` CustomerPrice float64 `json:"customer_price"` ShopType string `json:"shop_type"` ExternalBizId string `json:"external_biz_id"` }
type CreateMobileOrderBizContent ¶
type CreateMobileOrderBizContent struct { ChargePhone string `json:"charge_phone"` ChargeValue float64 `json:"charge_value"` CustomerOrderNO string `json:"customer_order_no"` CustomerPrice float64 `json:"customer_price"` ShopType string `json:"shop_type"` ExternalBizID string `json:"external_biz_id"` }
type DirectOrderResult ¶
type DirectOrderResult struct { OrderID string `json:"order_id"` CustomerOrderNO string `json:"customer_order_no"` ProductID int64 `json:"product_id"` ProductName string `json:"product_name"` ChargeAccount string `json:"charge_account"` BuyNum int `json:"buy_num"` OrderType int `json:"order_type"` OrderPrice float64 `json:"order_price"` PrderState string `json:"prder_state"` CreateTime string `json:"create_time"` FinishTime string `json:"finish_time"` Area string `json:"area"` Server string `json:"server"` Type string `json:"type"` OperatorSerialNumber string `json:"operator_serial_number"` }
type GetMobileInfoReqParams ¶
type GetMobileInfoResult ¶
type GetMobileMaintainStatusReqParams ¶
type GetMobileMaintainStatusReqParams struct { Mobile string `json:"mobile"` FaceValue int `json:"face_value"` }
GetMobileMaintainStatusReqParams 话费维护状态检查请求参数
type GetMobileMaintainStatusResult ¶
type GetMobileMaintainStatusResult struct { Province string `json:"province"` City string `json:"city"` Sp string `json:"sp"` SpType string `json:"sp_type"` MaintainState string `json:"maintain_state"` CurrentSuccessRate float64 `json:"current_success_rate"` }
GetMobileMaintainStatusResult 话费维护状态检查结果
type GetProductInfoParams ¶
type GetProductInfoParams struct { ProductID string `json:"product_id"` DetailFormat int `json:"detail_format,omitempty"` }
GetProductInfoParams 获取商品信息请求参数
type GetProductListParams ¶
type GetProductListParams struct { ProductID int64 `json:"product_id,omitempty"` ProductName string `json:"product_name,omitempty"` ProductType string `json:"product_type,omitempty"` FaceValue float64 `json:"face_value,omitempty"` FirstCategoryID int `json:"first_category_id,omitempty"` SecondCategoryID int `json:"second_category_id,omitempty"` ThirdCategoryID int `json:"third_category_id,omitempty"` }
GetProductListParams 获取商品列表请求参数
type GetProductTemplateParams ¶
type GetProductTemplateParams struct {
TemplateID string `json:"template_id"` // 商品模板编号
}
GetProductTemplateParams 获取商品模板请求参数
type GetQQNicknameResult ¶
type MobileMaintainState ¶
type MobileMaintainState string
type MobileOrderResult ¶
type MobileOrderResult struct { OrderID string `json:"order_id"` CustomerOrderNO string `json:"customer_order_no"` ProductID int64 `json:"product_id"` ProductName string `json:"product_name"` ChargeAccount string `json:"charge_account"` BuyNum int `json:"buy_num"` OrderPrice float64 `json:"order_price"` OrderType int `json:"order_type"` OrderState string `json:"order_state"` CreateTime string `json:"create_time"` FinishTime string `json:"finish_time"` OperatorSerialNumber string `json:"operator_serial_number"` }
type MobileSpType ¶
type MobileSpType string
type Order ¶
type Order struct { OrderID string `json:"order_id"` CustomerOrderNO string `json:"customer_order_no"` ProductID int64 `json:"product_id"` ProductName string `json:"product_name"` ChargeAccount string `json:"charge_account"` BuyNum int `json:"buy_num"` OrderPrice float64 `json:"order_price"` OrderType int `json:"order_type"` OrderState string `json:"order_state"` CreateTime string `json:"create_time"` FinishTime string `json:"finish_time"` Area string `json:"area"` Server string `json:"server"` Type string `json:"type"` Cards []CardItem `json:"cards"` OperatorSerialNumber string `json:"operator_serial_number"` }
Order 订单信息
type OrderExtend ¶
type OrderExtend struct { OrderID string `json:"order_id"` CustomerOrderNO string `json:"customer_order_no"` OrderExtendContent *OrderExtendContent `json:"order_extend_content"` }
type OrderExtendContent ¶
type OrderExtendTemp ¶
type OrderState ¶
type OrderState string
type ProductDetailFormat ¶
type ProductDetailFormat int
type ProductInfo ¶
type ProductInfo struct { ProductID int64 `json:"product_id"` ProductName string `json:"product_name"` FaceValue float64 `json:"face_value"` ProductType string `json:"product_type"` PurchasePrice float64 `json:"purchase_price"` TemplateID string `json:"template_id"` StockStatus string `json:"stock_status"` SalesStatus string `json:"sales_status"` Details string `json:"details"` FourCategoryIcon string `json:"four_category_icon"` DetailType int `json:"detail_type"` }
ProductInfo 商品信息
type ProductListItem ¶
type ProductListItem struct { ProductID int64 `json:"product_id"` ProductName string `json:"product_name"` ProductType string `json:"product_type"` FaceValue float64 `json:"face_value"` PurchasePrice float64 `json:"purchase_price"` SalesStatus string `json:"sales_status"` StockStatus string `json:"stock_status"` TemplateID string `json:"template_id"` Details string `json:"details"` }
ProductListItem 商品列表项
type ProductTemplate ¶
type ProductTemplate struct { AddressID string `json:"AddressId"` // 商品模板编号 ElementInfo productTemplateElementInfo `json:"ElementInfo"` // 包括元素 AddressName string `json:"AddressName"` // 模板名称 IsServiceArea bool `json:"IsServiceArea"` // 是否有区服(预留字段,不用关注) GameTempaltePreviewList []productTemplateGameTemplateItem `json:"GameTempaltePreviewList"` // 游戏区服模板信息 }
ProductTemplate 商品模板内容
type ReqParams ¶
type ReqParams struct { AppKey string `json:"app_key"` Method Method `json:"method"` Timestamp string `json:"timestamp"` Version string `json:"version"` Format string `json:"format"` Charset string `json:"charset"` SignType string `json:"sign_type"` Sign string `json:"sign"` AppAuthToken string `json:"app_auth_token"` BizContent string `json:"biz_content"` }