u
This commit is contained in:
1 parent
2efeb7cee2
commit
c0531c1d0a
35 files changed
+1817
-984
No files matched your search
@@ -52,6 +52,25 @@ func (q *Queries) FindUserByOpenID(ctx context.Context, arg FindUserByOpenIDPara
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getUserById = `-- name: GetUserById :one
|
||||
SELECT id, nickname, avatar, status, last_login_time, create_time, update_time FROM "user" WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserById(ctx context.Context, id int64) (User, error) {
|
||||
row := q.db.QueryRow(ctx, getUserById, id)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.Nickname,
|
||||
&i.Avatar,
|
||||
&i.Status,
|
||||
&i.LastLoginTime,
|
||||
&i.CreateTime,
|
||||
&i.UpdateTime,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const insertUser = `-- name: InsertUser :exec
|
||||
INSERT INTO "user" (
|
||||
id,
|
||||
|
||||
Reference in new issue
Block a user