object

package
v1.0.7 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 Object

type Object struct {
	types.BaseModel
	Keyword     string  `json:"keyword"`
	Name        string  `json:"name"`
	Api         string  `json:"api"`
	Method      string  `json:"method"`
	Params      *string `json:"params"`
	Label       string  `json:"label"`
	Value       string  `json:"value"`
	Description string  `json:"description"`
}

type ObjectRule

type ObjectRule struct {
	Field   string `json:"field"`
	Operate string `json:"operate"`
	Object  uint32 `json:"object"`
}

type PageObjectRequest

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

type Repo

type Repo interface {
	GetObjectById(ctx kratosx.Context, id uint32) (*Object, error)
	GetObjectByKeyword(ctx kratosx.Context, keyword string) (*Object, error)
	PageObject(ctx kratosx.Context, req *PageObjectRequest) ([]*Object, uint32, error)
	AddObject(ctx kratosx.Context, c *Object) (uint32, error)
	UpdateObject(ctx kratosx.Context, c *Object) error
	DeleteObject(ctx kratosx.Context, uint322 uint32) error
}

type UseCase

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

func NewUseCase

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

func (*UseCase) AddObject

func (u *UseCase) AddObject(ctx kratosx.Context, object *Object) (uint32, error)

AddObject 添加登录资源对象信息

func (*UseCase) DeleteObject

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

DeleteObject 删除登录资源对象信息

func (*UseCase) GetObjectById

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

GetObjectById 获取指定资源对象

func (*UseCase) GetObjectByKeyword

func (u *UseCase) GetObjectByKeyword(ctx kratosx.Context, keyword string) (*Object, error)

GetObjectByKeyword 获取指定资源对象

func (*UseCase) PageObject

func (u *UseCase) PageObject(ctx kratosx.Context, req *PageObjectRequest) ([]*Object, uint32, error)

PageObject 获取全部登录资源对象

func (*UseCase) UpdateObject

func (u *UseCase) UpdateObject(ctx kratosx.Context, object *Object) error

UpdateObject 更新登录资源对象信息

Jump to

Keyboard shortcuts

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