postage

package
Version: v0.0.0-...-2cd4ea5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DISPLAY_INDEX_ORDER_ASC = 1
View Source
const DISPLAY_INDEX_ORDER_DESC = 2
View Source
const STICK_BOUNDARY = 10000000

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPostage

type DefaultPostage struct {
	FirstWeight      string `json:"first_weight"`
	FirstWeightPrice string `json:"first_weight_price"`
	AddedWeight      string `json:"added_weight"`
	AddedWeightPrice string `json:"added_weight_price"`
}

type EncodePostageConfigService

type EncodePostageConfigService struct {
	eel.ServiceBase
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewEncodePostageConfigService

func NewEncodePostageConfigService(ctx context.Context) *EncodePostageConfigService

func (*EncodePostageConfigService) Encode

func (this *EncodePostageConfigService) Encode(postageConfig *PostageConfig) *RPostageConfig

Encode 对单个实体对象进行编码

func (*EncodePostageConfigService) EncodeMany

func (this *EncodePostageConfigService) EncodeMany(postageConfigs []*PostageConfig) []*RPostageConfig

EncodeMany 对实体对象进行批量编码

type FillPostageConfigService

type FillPostageConfigService struct {
	eel.ServiceBase
}

func NewFillPostageConfigService

func NewFillPostageConfigService(ctx context.Context) *FillPostageConfigService

func (*FillPostageConfigService) Fill

func (this *FillPostageConfigService) Fill(postageConfigs []*PostageConfig, option eel.FillOption)

func (*FillPostageConfigService) FillOne

func (this *FillPostageConfigService) FillOne(postageConfig *PostageConfig, option eel.FillOption)

type FreePostage

type FreePostage struct {
	Destinations   string `json:"destinations"`
	Condition      string `json:"condition"`
	ConditionValue string `json:"value"`
}

type FreePostageConfig

type FreePostageConfig struct {
	eel.EntityBase
	Id             int
	CorpId         int
	Destination    string
	Condition      string
	ConditionValue string
	CreatedAt      time.Time
}

func NewFreePostageConfigFromModel

func NewFreePostageConfigFromModel(ctx context.Context, model *m_mall.FreePostageConfig) *FreePostageConfig

根据model构建对象

type PostageConfig

type PostageConfig struct {
	eel.EntityBase
	Id                    int
	CorpId                int
	Name                  string
	FirstWeight           float64
	FirstWeightPrice      float64
	AddedWeight           float64
	AddedWeightPrice      float64
	IsUsed                bool
	IsSystemLevelConfig   bool
	IsEnableSpecialConfig bool
	IsEnableFreeConfig    bool
	IsEnabled             bool
	IsDeleted             bool
	CreatedAt             time.Time

	//foreign key
	SpecialAreaPostageConfigId int //refer to special_area_postage_config
	SpecialAreaPostageConfigs  []*SpecialAreaPostageConfig
	FreePostageConfigId        int //refer to free_postage_config
	FreePostageConfigs         []*FreePostageConfig
}

func NewPostageConfigFromModel

func NewPostageConfigFromModel(ctx context.Context, model *m_mall.PostageConfig) *PostageConfig

根据model构建对象

func (*PostageConfig) Delete

func (this *PostageConfig) Delete() error

func (*PostageConfig) Disable

func (this *PostageConfig) Disable()

func (*PostageConfig) Enable

func (this *PostageConfig) Enable()

func (*PostageConfig) SetUsed

func (this *PostageConfig) SetUsed() error

func (*PostageConfig) UpdateDisplayIndex

func (this *PostageConfig) UpdateDisplayIndex(action string) error

type PostageConfigFactory

type PostageConfigFactory struct {
	eel.ServiceBase
}

func NewPostageConfigFactory

func NewPostageConfigFactory(ctx context.Context) *PostageConfigFactory

func (*PostageConfigFactory) CreatePostageConfigForCorp

func (this *PostageConfigFactory) CreatePostageConfigForCorp(corp business.ICorp, name string, defaultPostageStr string, isEnableSpecialConfig bool, specialAreaPostagesStr string, isEnableFreeConfig bool, freePostagesStr string) (*PostageConfig, error)

func (*PostageConfigFactory) MakeSureDefaultPostageConfigExits

func (this *PostageConfigFactory) MakeSureDefaultPostageConfigExits(corp business.ICorp)

type PostageConfigRepository

type PostageConfigRepository struct {
	eel.RepositoryBase
}

func NewPostageConfigRepository

func NewPostageConfigRepository(ctx context.Context) *PostageConfigRepository

func (*PostageConfigRepository) GetActivePostageConfigInCorp

func (this *PostageConfigRepository) GetActivePostageConfigInCorp(corp business.ICorp) *PostageConfig

GetActivePostageConfigInCorp 获得当前被选中的运费配置

func (*PostageConfigRepository) GetAllPostageConfigsForCorp

func (this *PostageConfigRepository) GetAllPostageConfigsForCorp(corp business.ICorp, filters eel.Map) []*PostageConfig

GetAllPostageConfigsForCorp 获得所有PostageConfig对象集合

func (*PostageConfigRepository) GetEnabledPostageConfigsForCorp

func (this *PostageConfigRepository) GetEnabledPostageConfigsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*PostageConfig, eel.INextPageInfo)

GetEnabledPostageConfigsForCorp 获得启用的PostageConfig对象集合

func (*PostageConfigRepository) GetPagedPostageConfigs

func (this *PostageConfigRepository) GetPagedPostageConfigs(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PostageConfig, eel.INextPageInfo)

func (*PostageConfigRepository) GetPostageConfig

func (this *PostageConfigRepository) GetPostageConfig(id int) *PostageConfig

GetPostageConfig 根据id和corp获得PostageConfig对象

func (*PostageConfigRepository) GetPostageConfigInCorp

func (this *PostageConfigRepository) GetPostageConfigInCorp(corp business.ICorp, id int) *PostageConfig

GetPostageConfigInCorp 根据id和corp获得PostageConfig对象

func (*PostageConfigRepository) GetPostageConfigs

func (this *PostageConfigRepository) GetPostageConfigs(filters eel.Map, orderExprs ...string) []*PostageConfig

func (*PostageConfigRepository) GetUsedPostageConfigForCorp

func (this *PostageConfigRepository) GetUsedPostageConfigForCorp(corp business.ICorp) *PostageConfig

GetPostageConfig 根据id和corp获得PostageConfig对象

type PostageConfigService

type PostageConfigService struct {
	eel.ServiceBase
}

func NewPostageConfigService

func NewPostageConfigService(ctx context.Context) *PostageConfigService

func (*PostageConfigService) SetDefaultPostageConfigForCorp

func (this *PostageConfigService) SetDefaultPostageConfigForCorp(corp business.ICorp, id int) error

func (*PostageConfigService) UpdatePostageConfigForCorp

func (this *PostageConfigService) UpdatePostageConfigForCorp(corp business.ICorp, id int, name string, defaultPostageStr string, isEnableSpecialConfig bool, specialAreaPostagesStr string, isEnableFreeConfig bool, freePostagesStr string) error

type RDefaultPostageConfig

type RDefaultPostageConfig struct {
	FirstWeight      float64 `json:"first_weight"`
	FirstWeightPrice float64 `json:"first_weight_price"`
	AddedWeight      float64 `json:"added_weight"`
	AddedWeightPrice float64 `json:"added_weight_price"`
}

type RFreePostageConfig

type RFreePostageConfig struct {
	Destination          string       `json:"destination"`
	DestinationProvinces []*RProvince `json:"destination_provinces"`
	Condition            string       `json:"condition"`
	ConditionValue       string       `json:"value"`
}

type RPostageConfig

type RPostageConfig struct {
	Id                        int                          `json:"id"`
	CorpId                    int                          `json:"corp_id"`
	Name                      string                       `json:"name"`
	IsUsed                    bool                         `json:"is_used"`
	IsSystemLevelConfig       bool                         `json:"is_system_level_config"`
	IsEnableSpecialConfig     bool                         `json:"is_enable_special_config"`
	IsEnableFreeConfig        bool                         `json:"is_enable_free_config"`
	DefaultPostageConfig      *RDefaultPostageConfig       `json:"default_config"`
	SpecialAreaPostageConfigs []*RSpecialAreaPostageConfig `json:"special_configs"`
	FreePostageConfigs        []*RFreePostageConfig        `json:"free_configs"`
	IsEnabled                 bool                         `json:"is_enabled"`
	IsDeleted                 bool                         `json:"is_deleted"`
	CreatedAt                 string                       `json:"created_at"`
}

type RProvince

type RProvince struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type RSpecialAreaPostageConfig

type RSpecialAreaPostageConfig struct {
	FirstWeight          float64      `json:"first_weight"`
	FirstWeightPrice     float64      `json:"first_weight_price"`
	AddedWeight          float64      `json:"added_weight"`
	AddedWeightPrice     float64      `json:"added_weight_price"`
	Destination          string       `json:"destination"`
	DestinationProvinces []*RProvince `json:"destination_provinces"`
}

type SpecialAreaPostage

type SpecialAreaPostage struct {
	Destinations     string `json:"destinations"`
	FirstWeight      string `json:"first_weight"`
	FirstWeightPrice string `json:"first_weight_price"`
	AddedWeight      string `json:"added_weight"`
	AddedWeightPrice string `json:"added_weight_price"`
}

type SpecialAreaPostageConfig

type SpecialAreaPostageConfig struct {
	eel.EntityBase
	Id               int
	CorpId           int
	FirstWeight      float64
	FirstWeightPrice float64
	AddedWeight      float64
	AddedWeightPrice float64
	Destination      string
	CreatedAt        time.Time
}

func NewSpecialAreaPostageConfigFromModel

func NewSpecialAreaPostageConfigFromModel(ctx context.Context, model *m_mall.SpecialAreaPostageConfig) *SpecialAreaPostageConfig

根据model构建对象

Jump to

Keyboard shortcuts

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