From 88477dffdd0811a5613dba0aa1db4818bf4fd058 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 19 Dec 2022 12:24:54 +0800 Subject: Develop secret api. v43 --- .../CrupestApi.Commons/Secrets/SecretService.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs') diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs new file mode 100644 index 0000000..fc13707 --- /dev/null +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Secrets/SecretService.cs @@ -0,0 +1,20 @@ +using CrupestApi.Commons; +using CrupestApi.Commons.Crud; + +namespace CrupestApi.Commons.Secrets; + +public class SecretService : CrudService, ISecretService +{ + public SecretService(ITableInfoFactory tableInfoFactory, IDbConnectionFactory dbConnectionFactory, EntityJsonHelper jsonHelper, ILoggerFactory loggerFactory) + : base(tableInfoFactory, dbConnectionFactory, jsonHelper, loggerFactory) + { + + } + + public List GetPermissions(string secret) + { + var list = _table.Select(_dbConnection, + where: WhereClause.Create().Eq(nameof(SecretInfo.Secret), secret)); + return list.Select(x => x.Key).ToList(); + } +} -- cgit v1.2.3