gin-blog/internal/service/service.go

19 lines
252 B
Go
Raw Permalink Normal View History

2021-05-28 10:40:39 +00:00
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
}