agent

package
v0.0.0-...-c8dbcfe Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AgentConfigSet = wire.NewSet(wire.Struct(new(AgentConfigRepo), "*"))

Functions

func GetAgentConfigDB

func GetAgentConfigDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

Types

type AgentConfig

type AgentConfig struct {
	util.Model
	Name      string   `gorm:"column:name;unique"     json:"name,omitempty"`
	Status    *int     `gorm:"index;"`           // 状态(1:启用 0:禁用)
	AgentRate *float32 `gorm:"index;default:1;"` // 经销商费率
	Memo      string   `gorm:"size:1024;"`       // 备注
}

AgentConfig is config table to config an agent.

func (AgentConfig) ToSchemaAgentConfig

func (a AgentConfig) ToSchemaAgentConfig() *schema.AgentConfig

type AgentConfigRepo

type AgentConfigRepo struct {
	DB *gorm.DB
}

func (*AgentConfigRepo) Create

func (a *AgentConfigRepo) Create(ctx context.Context, item schema.AgentConfig) error

func (*AgentConfigRepo) Delete

func (a *AgentConfigRepo) Delete(ctx context.Context, id uint64) error

func (*AgentConfigRepo) Get

func (*AgentConfigRepo) Update

func (a *AgentConfigRepo) Update(ctx context.Context, id uint64, item schema.AgentConfig) error

func (*AgentConfigRepo) UpdateStatus

func (a *AgentConfigRepo) UpdateStatus(ctx context.Context, id uint64, status int) error

type AgentConfigs

type AgentConfigs []*AgentConfig

func (AgentConfigs) ToSchemaAgentConfigs

func (a AgentConfigs) ToSchemaAgentConfigs() []*schema.AgentConfig

type SchemaAgentConfig

type SchemaAgentConfig schema.AgentConfig

func (SchemaAgentConfig) ToAgentConfig

func (a SchemaAgentConfig) ToAgentConfig() *AgentConfig

Jump to

Keyboard shortcuts

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