diff options
author | crupest <crupest@outlook.com> | 2022-12-20 19:14:32 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:53 +0800 |
commit | 51bf9d6c9e522ecc31f9068d9e5eaa0321fef587 (patch) | |
tree | 8367de0e8fa3ddfd2d0c313aa8d2d2510634b520 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs | |
parent | ea6afcf68bd10d5dbae5b99e590794dd219ea413 (diff) | |
download | crupest-51bf9d6c9e522ecc31f9068d9e5eaa0321fef587.tar.gz crupest-51bf9d6c9e522ecc31f9068d9e5eaa0321fef587.tar.bz2 crupest-51bf9d6c9e522ecc31f9068d9e5eaa0321fef587.zip |
Develop secret api. v49
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs index 4d9b14c..47e9583 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs @@ -1,4 +1,5 @@ using CrupestApi.Commons.Crud; +using Dapper; namespace CrupestApi.Commons.Secrets; @@ -23,6 +24,12 @@ public class SecretService : CrudService<SecretInfo>, ISecretService transaction.Commit(); } + public void CreateTestSecret(string key, string secret) + { + var connection = _dbConnection; + connection.Execute("INSERT INTO secrets (key, secret, description) VALUES (@key, @secret, @desc)", new { key, secret, desc = "Test key." }); + } + public List<string> GetPermissions(string secret) { var list = _table.Select<SecretInfo>(_dbConnection, |