|
|
|
@ -16,6 +16,9 @@ type User struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func CreateUser(conn *sql.Conn, user *User) error {
|
|
|
|
func CreateUser(conn *sql.Conn, user *User) error {
|
|
|
|
|
|
|
|
if user.APIKey == "" {
|
|
|
|
|
|
|
|
user.APIKey = GenUUID()
|
|
|
|
|
|
|
|
}
|
|
|
|
_, err := conn.ExecContext(context.Background(),
|
|
|
|
_, err := conn.ExecContext(context.Background(),
|
|
|
|
`INSERT INTO users (APIKey, FirstName, LastName, Password, Status, Username)
|
|
|
|
`INSERT INTO users (APIKey, FirstName, LastName, Password, Status, Username)
|
|
|
|
VALUES (?, ?, ?, ?, ?, ?)`,
|
|
|
|
VALUES (?, ?, ?, ?, ?, ?)`,
|
|
|
|
|