business

package
v1.0.32 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 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 Business

type Business struct {
	ktypes.BaseModel
	ServerID    uint32 `json:"server_id"`
	Keyword     string `json:"keyword"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

type BusinessValue

type BusinessValue struct {
	ktypes.BaseModel
	EnvId      uint32    `json:"env_id"`
	BusinessId uint32    `json:"business_id"`
	Value      string    `json:"value"`
	Business   *Business `json:"business" gorm:"foreignKey:business_id;references:id"`
}

type PageBusinessRequest

type PageBusinessRequest struct {
	Page     uint32  `json:"page"`
	PageSize uint32  `json:"page_size"`
	ServerId uint32  `json:"server_id"`
	Keyword  *string `json:"keyword"`
	Tag      *string `json:"tag"`
}

type Repo

type Repo interface {
	GetBusiness(ctx kratosx.Context, id uint32) (*Business, error)
	GetBusinessByKeyword(ctx kratosx.Context, key string) (*Business, error)
	PageBusiness(ctx kratosx.Context, req *PageBusinessRequest) ([]*Business, uint32, error)

	// AllBusiness(ctx kratosx.Context, id uint32) ([]*Business, error)
	AddBusiness(ctx kratosx.Context, c *Business) (uint32, error)

	UpdateBusiness(ctx kratosx.Context, c *Business) error
	DeleteBusiness(ctx kratosx.Context, uint322 uint32) error
	GetBusinessValues(ctx kratosx.Context, bid uint32) ([]*BusinessValue, error)
	UpdateBusinessValue(ctx kratosx.Context, rvs *BusinessValue) error
	CheckBusinessValue(ctx kratosx.Context, id uint32, value string) bool
	AllBusinessField(ctx kratosx.Context, sid uint32) ([]string, error)
	AllBusinessValue(ctx kratosx.Context, eid, sid uint32) ([]*BusinessValue, error)
}

type UseCase

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

func NewUseCase

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

func (*UseCase) AddBusiness

func (u *UseCase) AddBusiness(ctx kratosx.Context, business *Business) (uint32, error)

AddBusiness 添加业务变量信息

func (*UseCase) DeleteBusiness

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

DeleteBusiness 删除业务变量信息

func (*UseCase) GetBusiness

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

GetBusiness 获取指定业务变量信息

func (*UseCase) GetBusinessByKeyword

func (u *UseCase) GetBusinessByKeyword(ctx kratosx.Context, keyword string) (*Business, error)

GetBusinessByKeyword 获取指定标识的业务变量信息

func (*UseCase) GetBusinessValues

func (u *UseCase) GetBusinessValues(ctx kratosx.Context, bid uint32) ([]*BusinessValue, error)

GetBusinessValues 获取指定业务变量的所有环境值

func (*UseCase) PageBusiness

func (u *UseCase) PageBusiness(ctx kratosx.Context, req *PageBusinessRequest) ([]*Business, uint32, error)

PageBusiness 获取指定服务的业务变量

func (*UseCase) UpdateBusiness

func (u *UseCase) UpdateBusiness(ctx kratosx.Context, business *Business) error

UpdateBusiness 更新业务变量信息

func (*UseCase) UpdateBusinessValue

func (u *UseCase) UpdateBusinessValue(ctx kratosx.Context, rv *BusinessValue) error

UpdateBusinessValue 更新指定业务变量的值

Jump to

Keyboard shortcuts

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