* simplify code, format makefile * simplify code * some optimize by kevwan and benying (#240) Co-authored-by: 杨志泉 <zhiquan.yang@yiducloud.cn> * optimization (#241) * optimize docker file generation, make docker build faster * support k8s deployment yaml generation Co-authored-by: benying <31179034+benyingY@users.noreply.github.com> Co-authored-by: 杨志泉 <zhiquan.yang@yiducloud.cn> Co-authored-by: bittoy <bittoy@qq.com>
21 lines
389 B
Go
Executable File
21 lines
389 B
Go
Executable File
package svc
|
|
|
|
import (
|
|
"bookstore/rpc/check/internal/config"
|
|
"bookstore/rpc/model"
|
|
|
|
"github.com/tal-tech/go-zero/core/stores/sqlx"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
c config.Config
|
|
Model *model.BookModel
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
return &ServiceContext{
|
|
c: c,
|
|
Model: model.NewBookModel(sqlx.NewMysql(c.DataSource), c.Cache, c.Table),
|
|
}
|
|
}
|