Initial commit
This commit is contained in:
commit
141baa4e76
45 files changed
+4021
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"ent-scaffold/internal/db"
|
||||
"ent-scaffold/internal/ent"
|
||||
)
|
||||
|
||||
func CreateUser(ctx context.Context, username string) (*ent.User, error) {
|
||||
// 💡 直接跨包调用 db.Client
|
||||
return db.Client.User.Create().
|
||||
// SetUsername(username).
|
||||
Save(ctx)
|
||||
}
|
||||
Reference in new issue
Block a user