dictionary

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 4 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 {
	types.BaseModel
	Keyword     string `json:"keyword"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type DictionaryValue

type DictionaryValue struct {
	types.BaseModel
	DictionaryId uint32  `json:"dictionary_id"`
	Label        string  `json:"label"`
	Value        string  `json:"value"`
	Status       *bool   `json:"status"`
	Weight       *uint32 `json:"weight"`
	Type         string  `json:"type"`
	Extra        string  `json:"extra"`
	Description  string  `json:"description"`
}

type PageDictionaryRequest

type PageDictionaryRequest struct {
	Page     uint32  `json:"page"`
	PageSize uint32  `json:"page_size"`
	Keyword  *string `json:"keyword"`
	Name     *string `json:"name"`
}

type PageDictionaryValueRequest

type PageDictionaryValueRequest struct {
	Page         uint32  `json:"page"`
	PageSize     uint32  `json:"page_size"`
	DictionaryId uint32  `json:"dictionary_id"`
	Label        *string `json:"label"`
	Value        *string `json:"value"`
}

type Repo

type Repo interface {
	PageDictionary(ctx kratosx.Context, in *PageDictionaryRequest) ([]*Dictionary, uint32, error)
	AddDictionary(ctx kratosx.Context, in *Dictionary) (uint32, error)
	UpdateDictionary(ctx kratosx.Context, in *Dictionary) error
	DeleteDictionary(ctx kratosx.Context, id uint32) error
	GetDictionaryValue(ctx kratosx.Context, keyword string) ([]*DictionaryValue, error)
	PageDictionaryValue(ctx kratosx.Context, in *PageDictionaryValueRequest) ([]*DictionaryValue, uint32, error)
	AddDictionaryValue(ctx kratosx.Context, in *DictionaryValue) (uint32, error)
	UpdateDictionaryValue(ctx kratosx.Context, in *DictionaryValue) error
	DeleteDictionaryValue(ctx kratosx.Context, id uint32) error
}

type UseCase

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

func NewUseCase

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

func (*UseCase) AddDictionary

func (u *UseCase) AddDictionary(ctx kratosx.Context, in *Dictionary) (uint32, error)

AddDictionary 添加字典信息

func (*UseCase) AddDictionaryValue

func (u *UseCase) AddDictionaryValue(ctx kratosx.Context, in *DictionaryValue) (uint32, error)

AddDictionaryValue 删除字典值

func (*UseCase) DeleteDictionary

func (u *UseCase) DeleteDictionary(ctx kratosx.Context, id uint32) error

DeleteDictionary 删除字典信息

func (*UseCase) DeleteDictionaryValue

func (u *UseCase) DeleteDictionaryValue(ctx kratosx.Context, id uint32) error

DeleteDictionaryValue 删除字典值

func (*UseCase) GetDictionaryValue

func (u *UseCase) GetDictionaryValue(ctx kratosx.Context, keyword string) ([]*DictionaryValue, error)

GetDictionaryValue 获取指定字典值

func (*UseCase) PageDictionary

func (u *UseCase) PageDictionary(ctx kratosx.Context, in *PageDictionaryRequest) ([]*Dictionary, uint32, error)

PageDictionary 获取分页字典信息

func (*UseCase) PageDictionaryValue

func (u *UseCase) PageDictionaryValue(ctx kratosx.Context, in *PageDictionaryValueRequest) ([]*DictionaryValue, uint32, error)

PageDictionaryValue 获取分页字典值

func (*UseCase) UpdateDictionary

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

UpdateDictionary 更新字典信息

func (*UseCase) UpdateDictionaryValue

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

UpdateDictionaryValue 更新字典值

Jump to

Keyboard shortcuts

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