mbvm

package
v0.15.101 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGood

func CreateGood(r *CreateGoodsRequest) error

func CreateSpecification

func CreateSpecification(req CreateSpecificationRequest) error

func CreateVoucher

func CreateVoucher(req CreateVoucherRequest) error

func DeleteGood

func DeleteGood(orgID string, id string) error

func DeleteSpecification

func DeleteSpecification(orgID string, id string) error

func DeleteVoucher

func DeleteVoucher(orgID string, voucherID string) error

func Destroy

func Destroy()

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func Off

func Off(req VoucherOffRequest) error

func UpdateGood

func UpdateGood(r UpdateGoodsRequest) error

func UpdateSpecification

func UpdateSpecification(r UpdateSpecificationRequest) error

func UpdateVoucher

func UpdateVoucher(req UpdateVoucherRequest) error

func UploadGood

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

func UploadVoucher

func UploadVoucher(h *multipart.FileHeader) (string, string, error)

Types

type CreateGoodsRequest

type CreateGoodsRequest struct {
	OrgID string               `json:"orgId" binding:"required"`
	Name  string               `json:"name" binding:"required"`
	SP    []SpecificationPrice `json:"sp"`
}

type CreateSpecificationRequest

type CreateSpecificationRequest struct {
	OrgID string `json:"orgId" binding:"required"`
	Name  string `json:"name" binding:"required"`
	Desc  string `json:"desc" `
}

type CreateVoucherRequest

type CreateVoucherRequest struct {
	OrgID       string           `json:"orgId"`
	Title       string           `json:"title"`
	PublisherID string           `json:"publisherId"`
	ObjName     string           `json:"objName"`
	RuleExplain string           `json:"ruleExplain"`
	GoodIDs     []string         `json:"goodIds"`
	RuleValues  []RuleTypeValues `json:"ruleValues"`
	WriteOffs   []string         `json:"writeOffs"`
}

type DeleteGoodsQuery

type DeleteGoodsQuery struct {
	OrgID string `form:"orgId" binding:"required"`
}

type DeleteSpecificationQuery

type DeleteSpecificationQuery struct {
	OrgID string `form:"orgId" binding:"required"`
}

type DeleteVoucherQuery

type DeleteVoucherQuery struct {
	OrgID string `form:"orgId" binding:"required"`
}

type Field

type Field struct {
	Name          string `json:"name"`
	ComponentType uint8  `json:"componentType"`
	Required      bool   `json:"required"`
}

type FieldValue

type FieldValue struct {
	Field
	Value interface{} `json:"value"`
}

type GetGoodsQuery

type GetGoodsQuery struct {
	OrgID    string `form:"orgId"`
	ID       string `form:"id"`
	Name     string `form:"name"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetGoodsResponse

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

type GetRuleResponse

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

type GetSpecificationsQuery

type GetSpecificationsQuery struct {
	OrgID    string `form:"orgId"`
	ID       string `form:"id"`
	Name     string `form:"name"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetSpecificationsResponse

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

type GetVoucherGoodResponse

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

type GetVoucherReceiveLogsQuery

type GetVoucherReceiveLogsQuery struct {
	AppID       string `form:"appId" binding:"required"`
	Secret      string `form:"secret" binding:"required"`
	Page        string `form:"page" binding:"required"`
	UserID      string `form:"userId" binding:"required"`
	OrgID       string `form:"orgId"`
	ID          string `form:"id"`
	RecipientID string `form:"recipientId"`
	VoucherID   string `form:"voucherId"`
	PageNo      int    `form:"pageNo"`
	PageSize    int    `form:"pageSize"`
}

type GetVoucherReceiveLogsResponse

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

type GetVouchersQuery

type GetVouchersQuery struct {
	AppID    string `form:"appId" binding:"required"`
	Secret   string `form:"secret" binding:"required"`
	Page     string `form:"page" binding:"required"`
	OrgID    string `form:"orgId"`
	ID       string `form:"id"`
	Title    string `form:"title"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetVouchersResponse

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

type GetWriteOffLogsQuery

type GetWriteOffLogsQuery struct {
	OrgID            string `form:"orgId"`
	ID               string `form:"id"`
	WriteOffPersonID string `form:"writeOffPersonId"`
	VoucherID        string `form:"voucherId"`
	WriteOffTime     string `form:"writeOffTime"`
	PageNo           int    `form:"pageNo"`
	PageSize         int    `form:"pageSize"`
}

type GetWriteOffLogsResponse

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

type GoodPicInfo

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

type GoodPriceInfo

type GoodPriceInfo struct {
	GSS         []GoodSpecificationInfo `json:"gss"`
	MarketPrice float64                 `json:"marketPrice"`
	SalePrice   float64                 `json:"salePrice"`
	Url         string                  `json:"url"`
	ObjName     string                  `json:"objName"`
}

type GoodSpecificationInfo

type GoodSpecificationInfo struct {
	SpecificationID   string `json:"specificationId"`
	Name              string `json:"name"`
	SpecificationName string `json:"specificationName"`
}

type GoodsInfo

type GoodsInfo struct {
	ID    string          `json:"id"`
	Name  string          `json:"name"`
	OrgID string          `json:"orgId"`
	GSS   []GoodPriceInfo `json:"gss"`
}

func GetGood

func GetGood(orgID string, id string, name string,
	pageNo int, pageSize int) ([]GoodsInfo, int64, error)

type RuleFieldInfo

type RuleFieldInfo struct {
	Name          string `json:"name"`
	ComponentType uint8  `json:"componentType"`
	Required      bool   `json:"required"`
}

type RuleInfo

type RuleInfo struct {
	TypeCode uint8           `json:"typeCode"`
	Fields   []RuleFieldInfo `json:"fields"`
}

func GetDefaultRules

func GetDefaultRules() ([]RuleInfo, error)

func GetNonDefaultRules

func GetNonDefaultRules() ([]RuleInfo, error)

type RuleTypeValues

type RuleTypeValues struct {
	TypeCode uint8       `json:"typeCode"`
	Fields   []RuleValue `json:"fields"`
}

type RuleValue

type RuleValue struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

type RuleValueComponent

type RuleValueComponent struct {
	TypeCode uint8        `json:"typeCode"`
	Def      bool         `json:"def"`
	Fields   []FieldValue `json:"fields"`
}

type SpecificationInfo

type SpecificationInfo struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Desc  string `json:"desc"`
	OrgID string `json:"orgId"`
}

func GetSpecification

func GetSpecification(orgID string, id string, name string,
	pageNo int, pageSize int) ([]SpecificationInfo, int64, error)

type SpecificationName

type SpecificationName struct {
	SpecificationID string `json:"specificationId"`
	Name            string `json:"name"`
}

type SpecificationPrice

type SpecificationPrice struct {
	SN          []SpecificationName `json:"sn"`
	MarketPrice float64             `json:"marketPrice"`
	SalePrice   float64             `json:"salePrice"`
	ObjName     string              `json:"objName"`
}

type UpdateGoodsRequest

type UpdateGoodsRequest struct {
	OrgID string               `json:"orgId" binding:"required"`
	ID    string               `json:"id" binding:"required"`
	Name  string               `json:"name"`
	SP    []SpecificationPrice `json:"sp"`
}

type UpdateSpecificationRequest

type UpdateSpecificationRequest struct {
	OrgID string `json:"orgId" binding:"required"`
	ID    string `json:"id" binding:"required"`
	Name  string `json:"name"`
	Desc  string `json:"desc"`
}

type UpdateVoucherRequest

type UpdateVoucherRequest struct {
	OrgID       string           `json:"orgId"`
	ID          string           `json:"id"`
	Title       string           `json:"title"`
	ObjName     string           `json:"objName"`
	RuleExplain string           `json:"ruleExplain"`
	GoodIDs     []string         `json:"goodIds"`
	RuleValues  []RuleTypeValues `json:"ruleValues"`
	WriteOffs   []string         `json:"writeOffs"`
}

type UploadGoodsRequest

type UploadGoodsRequest struct {
	File *multipart.FileHeader `form:"file"`
}

type UploadGoodsResponse

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

type UploadVoucherResponse

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

type VoucherGoodInfo

type VoucherGoodInfo struct {
	GoodID      string                         `json:"goodId"`
	Name        string                         `json:"name"`
	GSS         []VoucherGoodSpecificationInfo `json:"gss"`
	MarketPrice float64                        `json:"marketPrice"`
	SalePrice   float64                        `json:"salePrice"`
	Url         string                         `json:"url"`
	GoodPriceID string                         `json:"goodPriceId"`
}

func GetVoucherGood

func GetVoucherGood(orgID string, pageNo int, pageSize int) ([]VoucherGoodInfo, int64, error)

type VoucherGoodSpecificationInfo

type VoucherGoodSpecificationInfo struct {
	SpecificationID     string `json:"specificationId"`
	SpecificationName   string `json:"specificationName"`
	Specification       string `json:"specification"`
	GoodSpecificationID string `json:"goodSpecificationId"`
}

type VoucherInfo

type VoucherInfo struct {
	ID          string                 `json:"id"`
	Title       string                 `json:"title"`
	PublishTime string                 `json:"publishTime"`
	PublisherID string                 `json:"publisherId"`
	OrgID       string                 `json:"orgId"`
	RuleExplain string                 `json:"ruleExplain"`
	Url         string                 `json:"url"`
	Qr          string                 `json:"qr"`
	ObjName     string                 `json:"objName"`
	WriteOffs   []string               `json:"writeOffs"`
	Goods       []VoucherGoodInfo      `json:"goods"`
	RuleValues  []RuleValueComponent   `json:"ruleValues"`
	Features    map[string]interface{} `json:"features"`
}

func GetVoucher

func GetVoucher(req GetVouchersQuery) ([]VoucherInfo, int64, error)

type VoucherOffRequest

type VoucherOffRequest struct {
	LogID              string `json:"logId"`
	WriteOffPersonID   string `json:"writeOffPersonId"`
	WriteOffPersonName string `json:"writeOffPersonName"`
}

type VoucherPicInfo

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

type VoucherReceiveLogInfo

type VoucherReceiveLogInfo struct {
	ID             string                 `json:"id"`
	VoucherID      string                 `json:"voucherId"`
	VoucherName    string                 `json:"voucherName"`
	OrgName        string                 `json:"orgName"`
	RecipientID    string                 `json:"recipientId"`
	RecipientName  string                 `json:"recipientName"`
	RecipientTime  string                 `json:"recipientTime"`
	RecipientPhone string                 `json:"recipientPhone"`
	OrgID          string                 `json:"orgId"`
	Qr             string                 `json:"qr"`
	VoucherPic     string                 `json:"voucherPic"`
	RuleExplain    string                 `json:"ruleExplain"`
	Used           bool                   `json:"used"`
	CanOff         bool                   `json:"canOff"`
	Features       map[string]interface{} `json:"features"`
	Goods          []VoucherGoodInfo      `json:"goods"`
}

type WriteOffLogInfo

type WriteOffLogInfo struct {
	ID                 string                 `json:"id"`
	VoucherID          string                 `json:"voucherId"`
	VoucherName        string                 `json:"voucherName"`
	VoucherPic         string                 `json:"voucherPic"`
	WriteOffPersonID   string                 `json:"writeOffPersonId"`
	WriteOffPersonName string                 `json:"writeOffPersonName"`
	RecipientID        string                 `json:"recipientId"`
	RecipientName      string                 `json:"recipientName"`
	RecipientPhone     string                 `json:"recipientPhone"`
	WriteOffTime       string                 `json:"writeOffTime"`
	OrgName            string                 `json:"orgName"`
	OrgID              string                 `json:"orgId"`
	Feature            map[string]interface{} `json:"feature"`
	RuleExplain        string                 `json:"ruleExplain"`
	Goods              []VoucherGoodInfo      `json:"goods"`
}

func GetWriteOffLogs

func GetWriteOffLogs(params GetWriteOffLogsQuery) ([]WriteOffLogInfo, int64, error)

Jump to

Keyboard shortcuts

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