init project

This commit is contained in:
yanghao05
2023-01-28 11:09:11 +08:00
parent 11a561bdd7
commit 114c003b2b
38 changed files with 2011 additions and 0 deletions

29
modules/system/dao/dao.go Normal file
View File

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