server

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 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 ListServerRequest added in v1.0.35

type ListServerRequest 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"`
	Status   *bool    `json:"status"`
	Ids      []uint32 `json:"ids"`
}

type Repo

type Repo interface {
	// GetServer 获取指定的服务信息
	GetServer(ctx kratosx.Context, id uint32) (*Server, error)

	// ListServer 获取服务信息列表
	ListServer(ctx kratosx.Context, req *ListServerRequest) ([]*Server, uint32, error)

	// CreateServer 创建服务信息
	CreateServer(ctx kratosx.Context, req *Server) (uint32, error)

	// UpdateServer 更新服务信息
	UpdateServer(ctx kratosx.Context, req *Server) error

	// DeleteServer 删除服务信息
	DeleteServer(ctx kratosx.Context, id uint32) error

	// GetServerByKeyword 获取指定的服务信息
	GetServerByKeyword(ctx kratosx.Context, keyword string) (*Server, error)

	// UpdateServerStatus 更新服务信息状态
	UpdateServerStatus(ctx kratosx.Context, id uint32, status bool) error
}

type Server

type Server struct {
	Id          uint32  `json:"id"`
	Token       string  `json:"token"`
	Keyword     string  `json:"keyword"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	Status      *bool   `json:"status"`
	CreatedAt   int64   `json:"createdAt"`
	UpdatedAt   int64   `json:"updatedAt"`
}

type UseCase

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

func NewUseCase

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

func (*UseCase) CreateServer added in v1.0.35

func (u *UseCase) CreateServer(ctx kratosx.Context, req *Server) (uint32, error)

CreateServer 创建服务信息

func (*UseCase) DeleteServer

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

DeleteServer 删除服务信息

func (*UseCase) ListServer added in v1.0.35

func (u *UseCase) ListServer(ctx kratosx.Context, req *ListServerRequest) ([]*Server, uint32, error)

ListServer 获取服务信息列表

func (*UseCase) UpdateServer

func (u *UseCase) UpdateServer(ctx kratosx.Context, req *Server) error

UpdateServer 更新服务信息

func (*UseCase) UpdateServerStatus added in v1.0.35

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

UpdateServerStatus 更新服务信息状态

Jump to

Keyboard shortcuts

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