dictionary

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dictionary

type Dictionary struct {
	Id          uint32  `json:"id"`
	Keyword     string  `json:"keyword"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	CreatedAt   int64   `json:"createdAt"`
	UpdatedAt   int64   `json:"updatedAt"`
}

type DictionaryValue

type DictionaryValue struct {
	Id           uint32  `json:"id"`
	DictionaryId uint32  `json:"dictionaryId"`
	Label        string  `json:"label"`
	Value        string  `json:"value"`
	Status       *bool   `json:"status"`
	Weight       *int32  `json:"weight"`
	Type         *string `json:"type"`
	Extra        *string `json:"extra"`
	Description  *string `json:"description"`
	CreatedAt    int64   `json:"createdAt"`
	UpdatedAt    int64   `json:"updatedAt"`
}

type GetDictionaryRequest added in v1.0.15

type GetDictionaryRequest struct {
	Id      *uint32 `json:"id"`
	Keyword *string `json:"keyword"`
}

type ListDictionaryRequest added in v1.0.15

type ListDictionaryRequest struct {
	Page     uint32  `json:"page"`
	PageSize uint32  `json:"pageSize"`
	Order    *string `json:"order"`
	OrderBy  *string `json:"orderBy"`
	Keyword  *string `json:"keyword"`
	Name     *string `json:"name"`
}

type ListDictionaryValueRequest added in v1.0.15

type ListDictionaryValueRequest struct {
	Page         uint32  `json:"page"`
	PageSize     uint32  `json:"pageSize"`
	Order        *string `json:"order"`
	OrderBy      *string `json:"orderBy"`
	DictionaryId *uint32 `json:"dictionaryId"`
	Label        *string `json:"label"`
	Value        *string `json:"value"`
	Status       *bool   `json:"status"`
}

type Repo

type Repo interface {
	// ListDictionary 获取字典目录列表
	ListDictionary(ctx kratosx.Context, req *ListDictionaryRequest) ([]*Dictionary, uint32, error)

	// CreateDictionary 创建字典目录
	CreateDictionary(ctx kratosx.Context, req *Dictionary) (uint32, error)

	// UpdateDictionary 更新字典目录
	UpdateDictionary(ctx kratosx.Context, req *Dictionary) error

	// DeleteDictionary 删除字典目录
	DeleteDictionary(ctx kratosx.Context, ids []uint32) (uint32, error)

	// ListDictionaryValue 获取字典值目录列表
	ListDictionaryValue(ctx kratosx.Context, req *ListDictionaryValueRequest) ([]*DictionaryValue, uint32, error)

	// AllDictionaryValue 获取全部字典值目录列表
	AllDictionaryValue(ctx kratosx.Context, keyword string) ([]*DictionaryValue, error)

	// CreateDictionaryValue 创建字典值目录
	CreateDictionaryValue(ctx kratosx.Context, req *DictionaryValue) (uint32, error)

	// UpdateDictionaryValue 更新字典值目录
	UpdateDictionaryValue(ctx kratosx.Context, req *DictionaryValue) error

	// UpdateDictionaryValueStatus 更新字典值目录状态
	UpdateDictionaryValueStatus(ctx kratosx.Context, id uint32, status bool) error

	// DeleteDictionaryValue 删除字典值目录
	DeleteDictionaryValue(ctx kratosx.Context, ids []uint32) (uint32, error)

	// GetDictionary 获取指定的字典目录
	GetDictionary(ctx kratosx.Context, id uint32) (*Dictionary, error)

	// GetDictionaryByKeyword 获取指定的字典目录
	GetDictionaryByKeyword(ctx kratosx.Context, keyword string) (*Dictionary, error)
}

type UseCase

type UseCase struct {
	// contains filtered or unexported fields
}

func NewUseCase

func NewUseCase(config *conf.Config, repo Repo) *UseCase

func (*UseCase) CreateDictionary added in v1.0.15

func (u *UseCase) CreateDictionary(ctx kratosx.Context, req *Dictionary) (uint32, error)

CreateDictionary 创建字典目录

func (*UseCase) CreateDictionaryValue added in v1.0.15

func (u *UseCase) CreateDictionaryValue(ctx kratosx.Context, req *DictionaryValue) (uint32, error)

CreateDictionaryValue 创建字典值目录

func (*UseCase) DeleteDictionary

func (u *UseCase) DeleteDictionary(ctx kratosx.Context, ids []uint32) (uint32, error)

DeleteDictionary 删除字典目录

func (*UseCase) DeleteDictionaryValue

func (u *UseCase) DeleteDictionaryValue(ctx kratosx.Context, ids []uint32) (uint32, error)

DeleteDictionaryValue 删除字典值目录

func (*UseCase) GetDictionary added in v1.0.15

func (u *UseCase) GetDictionary(ctx kratosx.Context, req *GetDictionaryRequest) (*Dictionary, error)

GetDictionary 获取指定的字典目录

func (*UseCase) GetDictionaryValues added in v1.0.16

func (u *UseCase) GetDictionaryValues(ctx kratosx.Context, keywords []string) (map[string][]*DictionaryValue, error)

GetDictionaryValues 获取字典值目录列表

func (*UseCase) ListDictionary added in v1.0.15

func (u *UseCase) ListDictionary(ctx kratosx.Context, req *ListDictionaryRequest) ([]*Dictionary, uint32, error)

ListDictionary 获取字典目录列表

func (*UseCase) ListDictionaryValue added in v1.0.15

func (u *UseCase) ListDictionaryValue(ctx kratosx.Context, req *ListDictionaryValueRequest) ([]*DictionaryValue, uint32, error)

ListDictionaryValue 获取字典值目录列表

func (*UseCase) UpdateDictionary

func (u *UseCase) UpdateDictionary(ctx kratosx.Context, req *Dictionary) error

UpdateDictionary 更新字典目录

func (*UseCase) UpdateDictionaryValue

func (u *UseCase) UpdateDictionaryValue(ctx kratosx.Context, req *DictionaryValue) error

UpdateDictionaryValue 更新字典值目录

func (*UseCase) UpdateDictionaryValueStatus added in v1.0.15

func (u *UseCase) UpdateDictionaryValueStatus(ctx kratosx.Context, id uint32, status bool) error

UpdateDictionaryValueStatus 更新字典值目录状态

Jump to

Keyboard shortcuts

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