mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-22 19:33:32 +03:00
feat: update user profile (#280)
This commit is contained in:
parent
24a0a9f5ee
commit
86e8ad41cb
9 changed files with 192 additions and 7 deletions
|
@ -127,6 +127,11 @@ func (o *JsonDB) GetUser() (model.User, error) {
|
|||
return user, o.conn.Read("server", "users", &user)
|
||||
}
|
||||
|
||||
// SaveUser func to user info to the database
|
||||
func (o *JsonDB) SaveUser(user model.User) error {
|
||||
return o.conn.Write("server", "users", user)
|
||||
}
|
||||
|
||||
// GetGlobalSettings func to query global settings from the database
|
||||
func (o *JsonDB) GetGlobalSettings() (model.GlobalSetting, error) {
|
||||
settings := model.GlobalSetting{}
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
type IStore interface {
|
||||
Init() error
|
||||
GetUser() (model.User, error)
|
||||
SaveUser(user model.User) error
|
||||
GetGlobalSettings() (model.GlobalSetting, error)
|
||||
GetServer() (model.Server, error)
|
||||
GetClients(hasQRCode bool) ([]model.ClientData, error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue