[feature] migrate to monorepo
Some checks failed
Build Backend / Build Docker Image (push) Successful in 3m33s
Test Backend / test (push) Failing after 31s

This commit is contained in:
CDN 2025-02-21 00:49:20 +08:00
commit 05ddc1f783
Signed by: CDN
GPG key ID: 0C656827F9F80080
267 changed files with 75165 additions and 0 deletions

View file

@ -0,0 +1,88 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"tss-rocks-be/ent/dailycategory"
"tss-rocks-be/ent/predicate"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
)
// DailyCategoryDelete is the builder for deleting a DailyCategory entity.
type DailyCategoryDelete struct {
config
hooks []Hook
mutation *DailyCategoryMutation
}
// Where appends a list predicates to the DailyCategoryDelete builder.
func (dcd *DailyCategoryDelete) Where(ps ...predicate.DailyCategory) *DailyCategoryDelete {
dcd.mutation.Where(ps...)
return dcd
}
// Exec executes the deletion query and returns how many vertices were deleted.
func (dcd *DailyCategoryDelete) Exec(ctx context.Context) (int, error) {
return withHooks(ctx, dcd.sqlExec, dcd.mutation, dcd.hooks)
}
// ExecX is like Exec, but panics if an error occurs.
func (dcd *DailyCategoryDelete) ExecX(ctx context.Context) int {
n, err := dcd.Exec(ctx)
if err != nil {
panic(err)
}
return n
}
func (dcd *DailyCategoryDelete) sqlExec(ctx context.Context) (int, error) {
_spec := sqlgraph.NewDeleteSpec(dailycategory.Table, sqlgraph.NewFieldSpec(dailycategory.FieldID, field.TypeInt))
if ps := dcd.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
affected, err := sqlgraph.DeleteNodes(ctx, dcd.driver, _spec)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
dcd.mutation.done = true
return affected, err
}
// DailyCategoryDeleteOne is the builder for deleting a single DailyCategory entity.
type DailyCategoryDeleteOne struct {
dcd *DailyCategoryDelete
}
// Where appends a list predicates to the DailyCategoryDelete builder.
func (dcdo *DailyCategoryDeleteOne) Where(ps ...predicate.DailyCategory) *DailyCategoryDeleteOne {
dcdo.dcd.mutation.Where(ps...)
return dcdo
}
// Exec executes the deletion query.
func (dcdo *DailyCategoryDeleteOne) Exec(ctx context.Context) error {
n, err := dcdo.dcd.Exec(ctx)
switch {
case err != nil:
return err
case n == 0:
return &NotFoundError{dailycategory.Label}
default:
return nil
}
}
// ExecX is like Exec, but panics if an error occurs.
func (dcdo *DailyCategoryDeleteOne) ExecX(ctx context.Context) {
if err := dcdo.Exec(ctx); err != nil {
panic(err)
}
}