From 54cc507a31a7510460850302bf3282dbfe6a12b7 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期三, 19 三月 2025 16:18:09 +0800
Subject: [PATCH] 合并
---
LifePayment/LifePayment.Domain/Common/ChannelHelper.cs | 2 +-
LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs | 6 +++---
LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs | 1 +
LifePayment/LifePayment.Domain/Common/UserChannle.cs | 2 +-
LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs | 8 +++++++-
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs | 38 +++++++++++++++++++++++++-------------
6 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs b/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs
index 5f4a93e..69ba26d 100644
--- a/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs
+++ b/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs
@@ -120,5 +120,11 @@
鍥剧墖 = 1,
[Description("瑙嗛")]
- 瑙嗛 = 2
+ 瑙嗛 = 2,
+
+ [Description("瀵屾枃鏈�")]
+ 瀵屾枃鏈� = 3,
+
+ [Description("寰俊鐨勫唴瀹�")]
+ 寰俊鐨勫唴瀹� = 4,
}
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs
index ce5c054..4c7efd3 100644
--- a/LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs
+++ b/LifePayment/LifePayment.Domain/Common/AbstractChannelFilter.cs
@@ -14,12 +14,12 @@
{
public abstract class AbstractChannelFilter
{
- public abstract Task<IQueryable<TEntity>> GetPolicyFilter<TEntity, TKey>(IQueryable<TEntity> query)
- where TEntity : class, IChannelData, IMayHaveCreator, IEntity<TKey>;
+ public abstract Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query);
+
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
protected ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService<ICurrentUser>();
- protected IRepository<User> UserDepartmentRepository => LazyServiceProvider.LazyGetRequiredService<IRepository<User>>();
+ protected IRepository<UserChannle> UserChannleRepository => LazyServiceProvider.LazyGetRequiredService<IRepository<UserChannle>>();
}
}
diff --git a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
index 91ae58b..f4d0a5e 100644
--- a/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
+++ b/LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
@@ -1,21 +1,33 @@
-锘縰sing System;
+锘縰sing LifePayment.Application.Contracts;
+using LifePayment.Domain;
+using LifePayment.Domain.Models;
+using Microsoft.EntityFrameworkCore;
+using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Domain.Entities;
+using Volo.Abp.Domain.Repositories;
+using Z.EntityFramework.Plus;
+using ZeroD.Util;
namespace LifePayment.Domain.Common
{
- //public class ChannelFilter : AbstractChannelFilter
- //{
- // public async Task<IQueryable<ChannelsBase>> GetPolicyFilter<ChannelsBase, TKey>(IQueryable<ChannelsBase> query)
- // {
- // throw new NotImplementedException();
- // }
- //}
+ public class ChannelFilter : AbstractChannelFilter
+ {
+ public async override Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query)
+ {
+ var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList();
+ var queryResult = query.Where(s => queryUser.Contains(s.ChannleId));
+ return queryResult;
+ }
+ }
- //public class ChannelsBase:IChannelFilter
- //{
- // // public Guid ChannelId { get; set; }
- //}
+ public class ChannelsBase : Entity<Guid>
+ {
+ public Guid ChannleId { get; set; }
+
+ }
}
diff --git a/LifePayment/LifePayment.Domain/Common/ChannelHelper.cs b/LifePayment/LifePayment.Domain/Common/ChannelHelper.cs
index bb7107a..cff865d 100644
--- a/LifePayment/LifePayment.Domain/Common/ChannelHelper.cs
+++ b/LifePayment/LifePayment.Domain/Common/ChannelHelper.cs
@@ -36,7 +36,7 @@
public interface IChannelData
{
- Guid ChannelId { get; set; }
+ public Guid ChannleId { get; set; }
}
public class ChannelFilterInput
diff --git a/LifePayment/LifePayment.Domain/Common/UserChannle.cs b/LifePayment/LifePayment.Domain/Common/UserChannle.cs
index 51ea304..b4d23ae 100644
--- a/LifePayment/LifePayment.Domain/Common/UserChannle.cs
+++ b/LifePayment/LifePayment.Domain/Common/UserChannle.cs
@@ -8,7 +8,7 @@
/// <summary>
/// 鐢ㄦ埛Id
/// </summary>
- public virtual Guid UserId { get; set; }
+ public Guid UserId { get; set; }
/// <summary>
/// 娓犻亾Id
diff --git a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
index 73175b7..9759f0f 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
+++ b/LifePayment/LifePayment.Host/LifePaymentServiceHostModule.cs
@@ -149,6 +149,7 @@
cacheOptions.KeyPrefix = "LifePaymentServices_";
cacheOptions.GlobalCacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(20);
});
+ this.Configure<OssSettings>(configuration.GetSection("ossSettings"));
this.Configure<ACOOLYOption>(configuration.GetSection("ACOOLY"));
this.Configure<Config>("AliPayEcsign", configuration.GetSection("AliPayEcsign"));
this.Configure<InformationOption>(configuration.GetSection("WeiXinCgi"));
--
Gitblit v1.9.1