mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-25 14:25:45 +01:00
0f180756ab
- Restructuring & co
24 lines
556 B
Go
24 lines
556 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/ansible-semaphore/semaphore/database"
|
|
)
|
|
|
|
type User struct {
|
|
ID string `db:"id" json:"id"`
|
|
Created time.Time `db:"created" json:"created"`
|
|
Username string `db:"username" json:"username"`
|
|
Name string `db:"name" json:"name"`
|
|
Email string `db:"email" json:"email"`
|
|
Password string `db:"password" json:"password"`
|
|
}
|
|
|
|
func FetchUser(userID int) (*User, error) {
|
|
var user User
|
|
|
|
err := database.Mysql.SelectOne(&user, "select * from user where id=?", userID)
|
|
return &user, err
|
|
}
|