repository

package
v0.0.0-...-3e77f05 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISvcRepository

type ISvcRepository interface {
	//初始化表
	InitTable() error
	//根据ID查处找数据
	FindSvcByID(int64) (*model.Svc, error)
	//创建一条 svc 数据
	CreateSvc(*model.Svc) (int64, error)
	//根据ID删除一条 svc 数据
	DeleteSvcByID(int64) error
	//修改更新数据
	UpdateSvc(*model.Svc) error
	//查找svc所有数据
	FindAll() ([]model.Svc, error)
}

创建需要实现的接口

func NewSvcRepository

func NewSvcRepository(db *gorm.DB) ISvcRepository

创建svcRepository

type SvcRepository

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

func (*SvcRepository) CreateSvc

func (u *SvcRepository) CreateSvc(svc *model.Svc) (int64, error)

创建Svc信息

func (*SvcRepository) DeleteSvcByID

func (u *SvcRepository) DeleteSvcByID(svcID int64) error

根据ID删除Svc信息

func (*SvcRepository) FindAll

func (u *SvcRepository) FindAll() (svcAll []model.Svc, err error)

获取结果集

func (*SvcRepository) FindSvcByID

func (u *SvcRepository) FindSvcByID(svcID int64) (svc *model.Svc, err error)

根据ID查找Svc信息

func (*SvcRepository) InitTable

func (u *SvcRepository) InitTable() error

初始化表

func (*SvcRepository) UpdateSvc

func (u *SvcRepository) UpdateSvc(svc *model.Svc) error

更新Svc信息

Jump to

Keyboard shortcuts

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