| 12345678910111213141516171819202122 |
- package svc
- import (
- "git.i2edu.net/i2/i2-bill-erp/internal/config"
- "git.i2edu.net/i2/i2-bill-erp/model"
- "git.i2edu.net/i2/go-zero/core/stores/sqlx"
- )
- type ServiceContext struct {
- Config config.Config
- StudentModel model.StudentModel
- SysUserModel model.SysUserModel
- }
- func NewServiceContext(c config.Config) *ServiceContext {
- return &ServiceContext{
- Config: c,
- StudentModel: model.NewStudentModel(sqlx.NewMysql(c.DataSource), c.Cache),
- SysUserModel: model.NewSysUserModel(sqlx.NewMysql(c.DataSource), c.Cache),
- }
- }
|