package svc import ( "git.rtzhtech.cn/iss/public-lib/config" "git.rtzhtech.cn/iss/public-lib/dao" ) var SvcCtx *ServiceContext type ServiceContext struct { Config config.Config *dao.Query } func NewServiceContext(c *config.Config) (*ServiceContext, error) { conn, err := dao.ConnectDb(c) dao.TableInfo(c) SvcCtx = &ServiceContext{ Config: *c, Query: dao.Use(conn), } return SvcCtx, err }