mbbpa

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeNotice

func ChangeNotice(userID string) error

func CompleteTask

func CompleteTask(userID string, taskID string) error

func CreateRechargeGoods

func CreateRechargeGoods(params CreateRechargeGoodsRequest) error

func CreateTask

func CreateTask(params CreateTaskRequest) error

func DeleteRechargeGoods

func DeleteRechargeGoods(id string) error

func DeleteTask

func DeleteTask(id string) error

func Destroy

func Destroy()

func GetRewardTypes

func GetRewardTypes() ([]string, error)

func GetUserBonusPoints

func GetUserBonusPoints(userID string) (int64, error)

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func NotifyOrder

func NotifyOrder(outTradeNo string, resultCode string, errCodeDes string) error

func ReceiveAllTaskReward

func ReceiveAllTaskReward(userID string) error

func SignIn

func SignIn(userID string) (int64, error)

func UpdateRechargeGoods

func UpdateRechargeGoods(params UpdateRechargeGoodsRequest) error

func UpdateTask

func UpdateTask(params UpdateTaskRequest) error

func UploadRechargeGoodsPic

func UploadRechargeGoodsPic(f *multipart.FileHeader) (string, string, error)

func UploadTaskPic

func UploadTaskPic(f *multipart.FileHeader) (string, string, error)

Types

type BonusPointsRankingInfo

type BonusPointsRankingInfo struct {
	ID          int    `json:"id"`
	UserID      string `json:"userId"`
	BonusPoints int64  `json:"bonusPoints"`
}

func BonusPointsRanking

func BonusPointsRanking(num int) ([]BonusPointsRankingInfo, error)

type ChangeNoticeRequest

type ChangeNoticeRequest struct {
	UserID string `json:"userId" binding:"required"`
}

type CompleteUserTaskRequest

type CompleteUserTaskRequest struct {
	TaskID string `json:"taskId"`
	UserID string `json:"userId"`
}

type ConfigDayBonusPointsRequest

type ConfigDayBonusPointsRequest struct {
	Day         int `json:"day"`
	BonusPoints int `json:"bonusPoints"`
}

type ConsecutiveDaysRankingInfo

type ConsecutiveDaysRankingInfo struct {
	ID              int    `json:"id"`
	UserID          string `json:"userId"`
	ConsecutiveDays int    `json:"consecutiveDays"`
}

func GetConsecutiveDaysRanking

func GetConsecutiveDaysRanking(num int) ([]ConsecutiveDaysRankingInfo, error)

type CreateOrderRequest

type CreateOrderRequest struct {
	IP        string `json:"ip"`
	NotifyUrl string `json:"notifyUrl"`
	GoodsID   string `json:"goodsId"`
	UserID    string `json:"userId"`
	UserName  string `json:"userName"`
	UserPhone string `json:"userPhone"`
	OpenID    string `json:"openId"`
}

type CreateOrderResponse

type CreateOrderResponse struct {
	Info *RechargeOrderInfo `json:"info"`
	// contains filtered or unexported fields
}

type CreateRechargeGoodsRequest

type CreateRechargeGoodsRequest struct {
	Title       string  `json:"title"`
	SubTitle    string  `json:"subTitle"`
	Discount    string  `json:"discount"`
	Price       float64 `json:"price"`
	BonusPoints int64   `json:"bonusPoints"`
	Sort        int     `json:"sort"`
	Url         string  `json:"url"`
}

type CreateTaskRequest

type CreateTaskRequest struct {
	TaskName      string `json:"taskName"`
	TaskDetail    string `json:"taskDetail"`
	CompleteTimes uint8  `json:"completeTimes"`
	JumpType      uint8  `json:"jumpType"`
	JumpAddr      string `json:"jumpAddr"`
	EndTime       string `json:"endTime"`
	RewardType    uint8  `json:"rewardType"`
	TaskType      uint8  `json:"taskType"`
	RewardNum     int64  `json:"rewardNum"`
	Url           string `json:"url"`
}

type GetBonusPointsDetailResponse

type GetBonusPointsDetailResponse struct {
	Infos      []UserBonusPointsDetailInfo `json:"infos"`
	TotalCount int64                       `json:"totalCount"`
	PageNo     int                         `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetBonusPointsRankingQuery

type GetBonusPointsRankingQuery struct {
	Num int `form:"num"`
}

type GetBonusPointsRankingResponse

type GetBonusPointsRankingResponse struct {
	Infos []BonusPointsRankingInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetConsecutiveDaysRankingQuery

type GetConsecutiveDaysRankingQuery struct {
	Num int `form:"num"`
}

type GetConsecutiveDaysRankingResponse

type GetConsecutiveDaysRankingResponse struct {
	Infos []ConsecutiveDaysRankingInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetOrdersResponse

type GetOrdersResponse struct {
	Infos      []OrderInfo `json:"infos"`
	TotalCount int64       `json:"totalCount"`
	PageNo     int         `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetRechargeGoodsQuery

type GetRechargeGoodsQuery struct {
	PageNo   int `form:"pageNo"`
	PageSize int `form:"pageSize"`
}

type GetRechargeGoodsResponse

type GetRechargeGoodsResponse struct {
	Infos      []RechargeGoodsInfo `json:"infos"`
	TotalCount int64               `json:"totalCount"`
	PageNo     int                 `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetRewardTypesResponse

type GetRewardTypesResponse struct {
	Types []string `json:"types"`
	// contains filtered or unexported fields
}

type GetSignConfigQuery

type GetSignConfigQuery struct {
	Day int `form:"day"`
}

type GetSignConfigResponse

type GetSignConfigResponse struct {
	Infos []SignConfigInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetSignInfoQuery

type GetSignInfoQuery struct {
	UserID   string `form:"userId"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetSignInfoResponse

type GetSignInfoResponse struct {
	Infos      []UserSignInfo `json:"infos"`
	TotalCount int64          `json:"totalCount"`
	PageNo     int            `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetTaskConfigResponse

type GetTaskConfigResponse struct {
	Infos      []TaskConfigInfo `json:"infos"`
	TotalCount int64            `json:"totalCount"`
	PageNo     int              `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetUserBonusPointsResponse

type GetUserBonusPointsResponse struct {
	BonusPoints int64 `json:"bonusPoints"`
	// contains filtered or unexported fields
}

type GetUserTasksResponse

type GetUserTasksResponse struct {
	Infos []UserTaskInfo `json:"infos"`
	// contains filtered or unexported fields
}

type NotifyOrderRequest

type NotifyOrderRequest struct {
	OutTradeNo string `json:"outTradeNo"`
	ResultCode string `json:"resultCode"`
	ErrCodeDes string `json:"errCodeDes"`
}

type OrderInfo

type OrderInfo struct {
	ID          string  `json:"id"`
	UserID      string  `json:"userId"`
	UserName    string  `json:"userName"`
	UserPhone   string  `json:"userPhone"`
	GoodsID     string  `json:"goodsId"`
	GoodsName   string  `json:"goodsName"`
	GoodsPrice  float64 `json:"goodsPrice"`
	BonusPoints int64   `json:"bonusPoints"`
	OpenID      string  `json:"openId"`
	FailReason  string  `json:"failReason"`
	State       uint8   `json:"state"`
	CreateTime  string  `json:"createTime"`
}

func GetOrders

func GetOrders(userID string, pageNo int, pageSize int) ([]OrderInfo, int64, error)

type PicInfo

type PicInfo struct {
	Url     string `json:"url"`
	ObjName string `json:"objName"`
}

type ReceiveAllTaskRewardRequest

type ReceiveAllTaskRewardRequest struct {
	UserID string `json:"userId"`
}

type RechargeGoodsInfo

type RechargeGoodsInfo struct {
	ID          string  `json:"id"`
	Title       string  `json:"title"`
	SubTitle    string  `json:"subTitle"`
	Discount    string  `json:"discount"`
	Price       float64 `json:"price"`
	BonusPoints int64   `json:"bonusPoints"`
	Sort        int     `json:"sort"`
	Url         string  `json:"url"`
}

func GetRechargeGoods

func GetRechargeGoods(pageNo int, pageSize int) ([]RechargeGoodsInfo, int64, error)

type RechargeOrderInfo

type RechargeOrderInfo struct {
	TimeStamp string `json:"timeStamp"`
	Nonce     string `json:"nonceStr"`
	Package   string `json:"package"`
	SignType  string `json:"signType"`
	PaySign   string `json:"paySign"`
}

func CreateOrder

func CreateOrder(ip string, notifyUrl string, goodsID string, userID string, userName string,
	userPhone string, openID string) (*RechargeOrderInfo, error)

type SignConfigInfo

type SignConfigInfo struct {
	Day         int `json:"day,omitempty"`
	BonusPoints int `json:"bonusPoints,omitempty"`
}

func GetSignConfig

func GetSignConfig(day int) ([]SignConfigInfo, error)

type SignInRequest

type SignInRequest struct {
	UserID string `json:"userId" binding:"required"`
}

type SignInResponse

type SignInResponse struct {
	BonusPoints int64 `json:"bonusPoints"`
	// contains filtered or unexported fields
}

type StartUserTaskRequest

type StartUserTaskRequest struct {
	UserID string `json:"userId"`
	TaskID string `json:"taskId"`
}

type TaskConfigInfo

type TaskConfigInfo struct {
	ID            string `json:"id"`
	TaskName      string `json:"taskName"`
	TaskDetail    string `json:"taskDetail"`
	CompleteTimes uint8  `json:"completeTimes"`
	JumpType      uint8  `json:"jumpType"`
	JumpAddr      string `json:"jumpAddr"`
	EndTime       string `json:"endTime"`
	RewardType    uint8  `json:"rewardType"`
	TaskType      uint8  `json:"taskType"`
	Url           string `json:"url"`
	RewardNum     int64  `json:"rewardNum"`
}

func GetTasks

func GetTasks(taskType uint8, pageNo int, pageSize int) ([]TaskConfigInfo, int64, error)

type UpdateRechargeGoodsRequest

type UpdateRechargeGoodsRequest struct {
	ID          string  `json:"id" binding:"required"`
	Title       string  `json:"title"`
	SubTitle    string  `json:"subTitle"`
	Discount    string  `json:"discount"`
	Price       float64 `json:"price"`
	BonusPoints int64   `json:"bonusPoints"`
	Sort        int     `json:"sort"`
	Url         string  `json:"url"`
}

type UpdateTaskRequest

type UpdateTaskRequest struct {
	ID            string `json:"id"`
	TaskName      string `json:"taskName"`
	TaskDetail    string `json:"taskDetail"`
	CompleteTimes int    `json:"completeTimes"`
	JumpType      uint8  `json:"jumpType"`
	JumpAddr      string `json:"jumpAddr"`
	EndTime       string `json:"endTime"`
	TaskType      uint8  `json:"taskType"`
	RewardType    uint8  `json:"rewardType"`
	RewardNum     int64  `json:"rewardNum"`
	Url           string `json:"url"`
}

type UploadGoodsPicResponse

type UploadGoodsPicResponse struct {
	Url     string `json:"url"`
	ObjName string `json:"objName"`
	// contains filtered or unexported fields
}

type UploadTaskPicResponse

type UploadTaskPicResponse struct {
	Info *PicInfo `json:"info"`
	// contains filtered or unexported fields
}

type UserBonusPointsDetailInfo

type UserBonusPointsDetailInfo struct {
	ID                string `json:"id"`
	UserID            string `json:"userId"`
	BonusPointsOffset int64  `json:"bonusPointsOffset"`
	ChangeType        string `json:"changeType"`
	ChangeTime        string `json:"changeTime"`
}

func GetBonusPointsDetails

func GetBonusPointsDetails(userID string, changeType string, increment *bool,
	pageNo int, pageSize int) ([]UserBonusPointsDetailInfo, int64, error)

type UserSignInfo

type UserSignInfo struct {
	UserID          string `json:"userId"`
	ConsecutiveDays int    `json:"consecutiveDays"`
	SevenDays       int    `json:"sevenDays"`
	Notice          bool   `json:"notice"`
	Signed          bool   `json:"signed"`
}

func GetSignInfo

func GetSignInfo(userID string, pageNo int, pageSize int) ([]UserSignInfo, error)

type UserTaskInfo

type UserTaskInfo struct {
	ID         string `json:"id"`
	TaskName   string `json:"taskName"`
	TaskDetail string `json:"taskDetail"`
	JumpType   uint8  `json:"jumpType"`
	JumpAddr   string `json:"jumpAddr"`
	Complete   bool   `json:"complete"`
	Url        string `json:"url"`
}

func GetUserTasks

func GetUserTasks(userID string, taskType uint8) ([]UserTaskInfo, error)

Jump to

Keyboard shortcuts

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