实现category service基础接口
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
CategoryModel model.CategoriesModel
|
||||
SqlConn sqlx.SqlConn // 添加这个字段
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
@ -18,5 +19,6 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
CategoryModel: model.NewCategoriesModel(conn),
|
||||
SqlConn: conn, // 赋值
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user