server

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 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 PageServerRequest

type PageServerRequest struct {
	Page        uint32   `json:"page"`
	PageSize    uint32   `json:"page_size"`
	ServerScope []string `json:"server_scope"`
	Keyword     *string  `json:"keyword"`
	IsBusiness  *bool    `json:"is_business"`
}

type Repo

type Repo interface {
	GetServer(ctx kratosx.Context, id uint32) (*Server, error)
	GetServerByKeyword(ctx kratosx.Context, key string) (*Server, error)
	PageServer(ctx kratosx.Context, req *PageServerRequest) ([]*Server, uint32, error)
	AddServer(ctx kratosx.Context, c *Server) (uint32, error)
	UpdateServer(ctx kratosx.Context, c *Server) error
	DeleteServer(ctx kratosx.Context, uint322 uint32) error
}

type Server

type Server struct {
	ktypes.BaseModel
	Keyword     string `json:"keyword"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type UseCase

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

func NewUseCase

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

func (*UseCase) AddServer

func (s *UseCase) AddServer(ctx kratosx.Context, server *Server) (uint32, error)

AddServer 添加服务信息

func (*UseCase) DeleteServer

func (s *UseCase) DeleteServer(ctx kratosx.Context, id uint32) error

DeleteServer 删除服务信息

func (*UseCase) GetServer

func (s *UseCase) GetServer(ctx kratosx.Context, id uint32) (*Server, error)

GetServer 获取指定服务信息

func (*UseCase) GetServerByKeyword

func (s *UseCase) GetServerByKeyword(ctx kratosx.Context, keyword string) (*Server, error)

GetServerByKeyword 获取指定标识的服务信息

func (*UseCase) PageServer

func (s *UseCase) PageServer(ctx kratosx.Context, req *PageServerRequest) ([]*Server, uint32, error)

PageServer 获取分页服务信息

func (*UseCase) UpdateServer

func (s *UseCase) UpdateServer(ctx kratosx.Context, server *Server) error

UpdateServer 更新服务信息

Jump to

Keyboard shortcuts

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