feat: update

This commit is contained in:
Rogee
2025-05-23 23:42:27 +08:00
parent 409a2e8304
commit 1166a5c949
17 changed files with 751 additions and 514 deletions

View File

@@ -7,12 +7,33 @@ import (
"context"
"database/sql"
. "github.com/go-jet/jet/v2/postgres"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
"go.ipao.vip/atom/opt"
)
type Cond func(BoolExpression) BoolExpression
func ExprCond(expr BoolExpression) Cond {
return func(cond BoolExpression) BoolExpression {
return cond.AND(expr)
}
}
func CondTrue(conds ...Cond) BoolExpression {
cond := BoolExp(Bool(true))
for _, c := range conds {
cond = c(cond)
}
return cond
}
func CondJoin(cond Cond, conds ...Cond) []Cond {
return append([]Cond{cond}, conds...)
}
var db *sql.DB
func MediasModel() *Medias { return &Medias{} }