gin-blog/internal/service/service.go
2021-05-28 18:40:39 +08:00

19 lines
252 B
Go

package service
import (
"blog/global"
"blog/internal/dao"
"context"
)
type Service struct {
ctx context.Context
dao *dao.Dao
}
func New(ctx context.Context) Service {
svc := Service{ctx: ctx}
svc.dao = dao.New(global.DBEngine)
return svc
}