feat: phone validation
Some checks failed
build quyun / Build (push) Failing after 1m25s

This commit is contained in:
2025-12-20 11:47:45 +08:00
parent fdbf26d751
commit 0e4af79b53
31 changed files with 1130 additions and 984 deletions

View File

@@ -60,7 +60,6 @@ func (m *users) PostList(
pagePosts, cnt, err := query.Select(tbl.PostID).
Where(tbl.UserID.Eq(userId)).
FindByPage(int(pagination.Offset()), int(pagination.Limit))
if err != nil {
return nil, err
}
@@ -211,3 +210,9 @@ func (m *users) Count(ctx context.Context, conds ...gen.Condition) (int64, error
}
return query.Count()
}
// FindByPhone
func (m *users) FindByPhone(ctx context.Context, phone string) (*models.User, error) {
tbl, query := models.UserQuery.QueryContext(ctx)
return query.Where(tbl.Phone.Eq(phone)).First()
}