remove interfaces

This commit is contained in:
yanghao05
2023-02-09 14:57:32 +08:00
parent 45400ae272
commit aceac5d8eb
16 changed files with 74 additions and 137 deletions

View File

@@ -8,20 +8,16 @@ import (
"gorm.io/gorm"
)
type Dao interface {
Release(context.Context, int, string) error
}
type DaoImpl struct {
type Dao struct {
Conf *config.Config
DB *gorm.DB
}
func NewDao(DB *gorm.DB) Dao {
return &DaoImpl{DB: DB}
func NewDao(DB *gorm.DB) *Dao {
return &Dao{DB: DB}
}
func (c *DaoImpl) Release(ctx context.Context, a int, b string) error {
func (c *Dao) Release(ctx context.Context, a int, b string) error {
if a == 20 {
return errors.New("A cant't be 20 ")
}