feat: Implement system setup functionality

This commit is contained in:
CaIon
2025-04-03 18:57:15 +08:00
parent 1de0d9123b
commit f33ebc8e2c
11 changed files with 490 additions and 1 deletions
+9
View File
@@ -808,3 +808,12 @@ func (user *User) FillUserByLinuxDOId() error {
err := DB.Where("linux_do_id = ?", user.LinuxDOId).First(user).Error
return err
}
func RootUserExists() bool {
var user User
err := DB.Where("role = ?", common.RoleRootUser).First(&user).Error
if err != nil {
return false
}
return true
}