1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Microsoft.AspNetCore.Http;
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- using TEAMModelOS.Model.Core.Models;
- using TEAMModelOS.SDK.Module.AzureTable.Interfaces;
- using TEAMModelOS.Service.Core.Interfaces;
- namespace TEAMModelOS.Service.Core.Implements
- {
- public class RoleService : IRoleService
- {
- private IAzureTableDBRepository _repository;
- private IHttpContextAccessor _httpContextAccessor;
- public RoleService(IAzureTableDBRepository repository, IHttpContextAccessor httpContextAccessor)
- {
- _httpContextAccessor = httpContextAccessor;
- _repository = repository;
- }
- public async Task<List<Role>> FindRolesByDict(Dictionary<string, object> dict)
- {
- if (dict.Count <= 0)
- {
- return await _repository.FindAll<Role>();
- }
- else
- {
- return await _repository.FindListByDict<Role>(dict);
- }
- }
- public async Task<Role> FindRoleByDict(Dictionary<string, object> dict) {
- return await _repository.FindOneByDict<Role>(dict);
- }
- public async Task<List<SchoolRole>> FindSchoolRolesByDict(Dictionary<string, object> dict)
- {
- if (dict != null && dict.Count > 0)
- {
- return await _repository.FindListByDict<SchoolRole>(dict);
-
- }
- else
- {
- return null;
- //return await _repository.FindAll<SchoolRole>();
- }
- }
- public async Task<Role> FindRoleByRowKey(string rowKey) {
- return await _repository.FindByRowKey<Role>(rowKey);
- }
- }
- }
|