pg_repository.go
432 字节
package repository
import (
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain"
)
func WhereContext(query *sqlbuilder.Query, queryOptions map[string]interface{}) {
if _, ok := queryOptions["context"]; !ok {
return
}
context := queryOptions["context"].(*domain.Context)
query.Where("context->'companyId'='?'", context.CompanyId)
}