u
This commit is contained in:
1 parent
5308dc8fda
commit
d51eacb8ad
32 files changed
+1788
-513
No files matched your search
@@ -4,13 +4,14 @@ package auth
|
||||
|
||||
import (
|
||||
"cn/oneao/base-go/db"
|
||||
dbtype "cn/oneao/base-go/db/sqlc"
|
||||
"cn/oneao/base-go/db/repo"
|
||||
"cn/oneao/base-go/logx"
|
||||
"cn/oneao/base-go/utils/jwtx"
|
||||
"cn/oneao/base-go/utils/response"
|
||||
"context"
|
||||
|
||||
"cn/oneao/base-go/biz/model/auth"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||
)
|
||||
@@ -30,7 +31,7 @@ func LoginDefault(ctx context.Context, c *app.RequestContext) {
|
||||
account := req.Account
|
||||
password := req.Password
|
||||
|
||||
params := dbtype.GetUserForLoginParams{
|
||||
params := repo.GetUserForLoginParams{
|
||||
Account: account,
|
||||
Password: password,
|
||||
}
|
||||
|
||||
@@ -5,11 +5,12 @@ package auth
|
||||
import (
|
||||
auth "cn/oneao/base-go/biz/model/auth"
|
||||
"cn/oneao/base-go/db"
|
||||
dbtype "cn/oneao/base-go/db/sqlc"
|
||||
"cn/oneao/base-go/db/repo"
|
||||
"cn/oneao/base-go/utils/errorx"
|
||||
"cn/oneao/base-go/utils/idgen"
|
||||
"cn/oneao/base-go/utils/response"
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||
"github.com/jackc/pgx/v5"
|
||||
@@ -64,7 +65,7 @@ func RegisterDefault(ctx context.Context, c *app.RequestContext) {
|
||||
}()
|
||||
|
||||
// 插入用户
|
||||
params := dbtype.InsertUserParams{
|
||||
params := repo.InsertUserParams{
|
||||
ID: idgen.NextId(),
|
||||
Account: account,
|
||||
Password: password,
|
||||
@@ -96,9 +97,9 @@ func initMoneyCategoryTx(ctx context.Context, tx pgx.Tx, userId int64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
userCategories := make([]dbtype.BatchInsertMoneyUserCategoriesParams, 0, len(sysCategories))
|
||||
userCategories := make([]repo.BatchInsertMoneyUserCategoriesParams, 0, len(sysCategories))
|
||||
for _, sysCat := range sysCategories {
|
||||
userCategories = append(userCategories, dbtype.BatchInsertMoneyUserCategoriesParams{
|
||||
userCategories = append(userCategories, repo.BatchInsertMoneyUserCategoriesParams{
|
||||
ID: idgen.NextId(),
|
||||
UserID: userId,
|
||||
Name: sysCat.Name,
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"context"
|
||||
|
||||
auth "cn/oneao/base-go/biz/model/auth"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user