model

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint32 `json:"id"`
	CreatedAt uint32 `json:"created_at,omitempty"`
	UpdatedAt uint32 `json:"updated_at,omitempty"`
}

type Business added in v1.0.1

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

func (*Business) All added in v1.0.1

func (b *Business) All(ctx kratos.Context, scopes Scopes) ([]*Business, error)

All 查询所有业务字段

func (*Business) Create added in v1.0.1

func (b *Business) Create(ctx kratos.Context) error

Create 新建业务字段

func (*Business) DeleteByID added in v1.0.1

func (b *Business) DeleteByID(ctx kratos.Context, id uint32) error

DeleteByID 删除指定id的业务字段

func (*Business) OneByID added in v1.0.1

func (b *Business) OneByID(ctx kratos.Context, id uint32) error

OneByID 通过关键词查找指定业务字段

func (*Business) Page added in v1.0.1

func (b *Business) Page(ctx kratos.Context, options *PageOptions) ([]*Business, uint32, error)

Page 查询分页资源

func (*Business) Update added in v1.0.1

func (b *Business) Update(ctx kratos.Context) error

Update 更新指定id的业务字段

type BusinessValue added in v1.0.1

type BusinessValue struct {
	BaseModel
	EnvironmentID uint32      `json:"environment_id"`
	BusinessID    uint32      `json:"business_id"`
	Value         string      `json:"value"`
	Environment   Environment `json:"environment"`
	Business      Business    `json:"business"`
}

func (*BusinessValue) All added in v1.0.1

func (bv *BusinessValue) All(ctx kratos.Context, scopes Scopes) ([]*BusinessValue, error)

All 查询所有业务字段

func (*BusinessValue) AllByEnvAndServer added in v1.0.1

func (bv *BusinessValue) AllByEnvAndServer(ctx kratos.Context, envId, srvId uint32) ([]*BusinessValue, error)

func (*BusinessValue) Create added in v1.0.1

func (bv *BusinessValue) Create(ctx kratos.Context) error

Create 新建业务字段

func (*BusinessValue) Creates added in v1.0.6

func (rv *BusinessValue) Creates(ctx kratos.Context, rid uint32, list []*BusinessValue) error

Creates 批量创建资源

func (*BusinessValue) DeleteByID added in v1.0.1

func (bv *BusinessValue) DeleteByID(ctx kratos.Context, id uint32) error

DeleteByID 删除指定id的业务字段

func (*BusinessValue) OneByID added in v1.0.1

func (bv *BusinessValue) OneByID(ctx kratos.Context, id uint32) error

OneByID 通过关键词查找指定业务字段

func (*BusinessValue) Update added in v1.0.1

func (bv *BusinessValue) Update(ctx kratos.Context) error

Update 更新指定id的业务字段

type Configure added in v1.0.3

type Configure struct {
	BaseModel
	ServerID      uint32  `json:"server_id"`
	EnvironmentID uint32  `json:"environment_id"`
	Content       string  `json:"content"`
	Version       string  `json:"version"`
	Format        string  `json:"format"`
	Description   *string `json:"description"`
}

func (*Configure) Create added in v1.0.3

func (t *Configure) Create(ctx kratos.Context) error

func (*Configure) OneBySrvAndEnv added in v1.0.3

func (t *Configure) OneBySrvAndEnv(ctx kratos.Context, srvId, envId uint32) error

func (*Configure) Update added in v1.0.3

func (t *Configure) Update(ctx kratos.Context) error

type CreateModel

type CreateModel struct {
	ID        uint32 `json:"id"`
	CreatedAt uint32 `json:"created_at,omitempty"`
}

type DeleteModel

type DeleteModel struct {
	ID        uint32         `json:"id"`
	CreatedAt uint32         `json:"created_at,omitempty"`
	UpdatedAt uint32         `json:"updated_at,omitempty"`
	DeletedAt gorm.DeletedAt `json:"-"`
}

type Environment

type Environment struct {
	BaseModel
	Keyword     string `json:"keyword"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Token       string `json:"token,omitempty"`
	Status      *bool  `json:"status"`
}

func (*Environment) All

func (e *Environment) All(ctx kratos.Context) ([]*Environment, error)

All 查询所有环境

func (*Environment) Create

func (e *Environment) Create(ctx kratos.Context) error

Create 新建环境

func (*Environment) DeleteByID

func (e *Environment) DeleteByID(ctx kratos.Context, id uint32) error

DeleteByID 删除指定id的环境

func (*Environment) OneByID added in v1.0.1

func (e *Environment) OneByID(ctx kratos.Context, id uint32) error

OneByID 通过id查找指定环境

func (*Environment) OneByKeyword

func (e *Environment) OneByKeyword(ctx kratos.Context, keyword string) error

OneByKeyword 通过关键词查找指定环境

func (*Environment) OneByToken added in v1.0.3

func (e *Environment) OneByToken(ctx kratos.Context, token string) error

OneByToken 通过token查找指定环境

func (*Environment) UpdateByID

func (e *Environment) UpdateByID(ctx kratos.Context, id uint32) error

UpdateByID 更新指定id的环境

type OperateLog added in v1.0.1

type OperateLog struct {
	ServerID      uint32      `json:"server_id"`
	EnvironmentID uint32      `json:"environment_id"`
	Config        string      `json:"config"`
	Compare       string      `json:"compare"`
	Server        Server      `json:"server"`
	Environment   Environment `json:"environment"`
}

func (*OperateLog) Create added in v1.0.1

func (ol *OperateLog) Create(ctx kratos.Context) error

func (*OperateLog) OneById added in v1.0.1

func (ol *OperateLog) OneById(ctx kratos.Context, id uint32) error

func (*OperateLog) Page added in v1.0.1

func (ol *OperateLog) Page(ctx kratos.Context, options PageOptions) ([]*OperateLog, uint32, error)

type PageOptions

type PageOptions struct {
	Page     uint32
	PageSize uint32
	Scopes   Scopes
}

type Resource added in v1.0.1

type Resource struct {
	BaseModel
	Keyword     string `json:"keyword"`
	Description string `json:"description"`
	Fields      string `json:"fields"`
	Tag         string `json:"tag"`
	Private     *bool  `json:"private"`
}

func (*Resource) All added in v1.0.1

func (r *Resource) All(ctx kratos.Context, scopes Scopes) ([]*Resource, error)

All 查询全部资源

func (*Resource) Create added in v1.0.1

func (r *Resource) Create(ctx kratos.Context) error

Create 新建资源

func (*Resource) DeleteByID added in v1.0.1

func (r *Resource) DeleteByID(ctx kratos.Context, id uint32) error

DeleteByID 删除指定id的资源

func (*Resource) OneByID added in v1.0.1

func (r *Resource) OneByID(ctx kratos.Context, id uint32) error

OneByID 通过关键词查找指定资源

func (*Resource) Page added in v1.0.1

func (r *Resource) Page(ctx kratos.Context, options *PageOptions) ([]*Resource, uint32, error)

Page 查询分页资源

func (*Resource) Update added in v1.0.1

func (r *Resource) Update(ctx kratos.Context) error

Update 更新指定id的资源

type ResourceServer added in v1.0.1

type ResourceServer struct {
	ID         uint32   `json:"id"`
	ServerID   uint32   `json:"server_id"`
	ResourceID uint32   `json:"resource_id"`
	Resource   Resource `json:"resource"`
	Server     Server   `json:"server"`
}

func (*ResourceServer) All added in v1.0.1

func (rs *ResourceServer) All(ctx kratos.Context, scopes Scopes) ([]*ResourceServer, error)

All 查询全部资源

func (*ResourceServer) CreateBySrvIds added in v1.0.6

func (rs *ResourceServer) CreateBySrvIds(ctx kratos.Context, rid uint32, srvIds []uint32) error

CreateBySrvIds 新建资源服务

func (*ResourceServer) DeleteByID added in v1.0.1

func (rs *ResourceServer) DeleteByID(ctx kratos.Context, id uint32) error

DeleteByID 删除指定id的资源

type ResourceValue added in v1.0.1

type ResourceValue struct {
	BaseModel
	EnvironmentID uint32      `json:"environment_id"`
	ResourceID    uint32      `json:"resource_id"`
	Values        string      `json:"values"`
	Environment   Environment `json:"environment"`
	Resource      Resource    `json:"resource"`
}

func (*ResourceValue) All added in v1.0.1

func (rv *ResourceValue) All(ctx kratos.Context, scopes Scopes) ([]*ResourceValue, error)

All 查询全部资源

func (*ResourceValue) AllByEnvAndServer added in v1.0.1

func (rv *ResourceValue) AllByEnvAndServer(ctx kratos.Context, envId, srvId uint32) ([]*ResourceValue, error)

func (*ResourceValue) Create added in v1.0.1

func (rv *ResourceValue) Create(ctx kratos.Context) error

Create 新建资源

func (*ResourceValue) Creates added in v1.0.1

func (rv *ResourceValue) Creates(ctx kratos.Context, rid uint32, list []*ResourceValue) error

Creates 批量创建资源

func (*ResourceValue) Update added in v1.0.1

func (rv *ResourceValue) Update(ctx kratos.Context) error

Update 更新指定id的资源值

type Scopes added in v1.0.1

type Scopes func(db *gorm.DB) *gorm.DB

type Server added in v1.0.1

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

func (*Server) All added in v1.0.1

func (s *Server) All(ctx kratos.Context, scopes Scopes) ([]*Server, error)

All 查询全部资源

func (*Server) Create added in v1.0.1

func (s *Server) Create(ctx kratos.Context) error

Create 新建资源

func (*Server) DeleteByID added in v1.0.1

func (s *Server) DeleteByID(ctx kratos.Context, id uint32) error

DeleteByID 删除指定id的资源

func (*Server) OneByID added in v1.0.1

func (s *Server) OneByID(ctx kratos.Context, id uint32) error

OneByID 通过关键词查找指定资源

func (*Server) OneByKeyword added in v1.0.1

func (s *Server) OneByKeyword(ctx kratos.Context, keyword string) error

func (*Server) Page added in v1.0.1

func (s *Server) Page(ctx kratos.Context, options *PageOptions) ([]*Server, uint32, error)

Page 查询分页资源

func (*Server) Update added in v1.0.1

func (s *Server) Update(ctx kratos.Context) error

Update 更新指定id的资源

type Template added in v1.0.1

type Template struct {
	BaseModel
	ServerID    uint32  `json:"server_id"`
	Content     string  `json:"content"`
	Version     string  `json:"version"`
	IsUse       bool    `json:"is_use"`
	Format      string  `json:"format"`
	Description *string `json:"description"`
}

func (*Template) Create added in v1.0.1

func (t *Template) Create(ctx kratos.Context) error

func (*Template) Current added in v1.0.1

func (t *Template) Current(ctx kratos.Context, srvId uint32) error

func (*Template) OneById added in v1.0.1

func (t *Template) OneById(ctx kratos.Context, id uint32) error

func (*Template) Page added in v1.0.1

func (t *Template) Page(ctx kratos.Context, options *PageOptions) ([]*Template, uint32, error)

Page 查询分页资源

func (*Template) UseVersionByID added in v1.0.1

func (t *Template) UseVersionByID(ctx kratos.Context, srvId, id uint32) error

type User

type User struct {
	ID                uint32 `json:"id"`
	DepartmentID      uint32 `json:"department_id"`
	DepartmentKeyword string `json:"department_keyword"`
	RoleID            uint32 `json:"role_id"`
	RoleKeyword       string `json:"role_keyword"`
	Name              string `json:"name"`
	Email             string `json:"email"`
}

Jump to

Keyboard shortcuts

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