实现category service基础接口

This commit is contained in:
2025-05-31 16:27:01 +08:00
parent faa6a35475
commit e5446bf836
33 changed files with 1420 additions and 67 deletions

View File

@ -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, // 赋值
}
}