You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/service/service.go

27 lines
572 B

package service
import (
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/global"
"github.com/rocboss/paopao-ce/internal/dao"
"github.com/rocboss/paopao-ce/pkg/zinc"
)
type Service struct {
ctx *gin.Context
dao *dao.Dao
}
func New(ctx *gin.Context) Service {
svc := Service{ctx: ctx}
svc.dao = dao.New(global.DBEngine, &zinc.ZincClient{
ZincClientConfig: &zinc.ZincClientConfig{
ZincHost: global.SearchSetting.ZincHost,
ZincUser: global.SearchSetting.ZincUser,
ZincPassword: global.SearchSetting.ZincPassword,
},
})
return svc
}