:new:新增客户端配置文件模板

This commit is contained in:
coward
2024-03-13 17:30:39 +08:00
parent 7c48551989
commit 91a1e61334
4 changed files with 16 additions and 3 deletions

View File

@@ -96,6 +96,7 @@ func (r clientRepo) Save(p param.SaveClient, adminId string) (client *entity.Cli
return
}
keys := template_data.Keys{
PrivateKey: privateKey.String(),
PublicKey: publicKey,
PresharedKey: presharedKey.String(),
}
@@ -114,6 +115,7 @@ func (r clientRepo) Save(p param.SaveClient, adminId string) (client *entity.Cli
EnableAfterCreation: p.EnabledAfterCreation,
Keys: string(keysStr),
UserId: adminId,
Enabled: true,
}
err = r.Model(&entity.Client{}).Create(ent).Error