极客正式套餐开通tx
This commit is contained in:
14
Services/Hncore.Pass.Vpn/Domain/AgreementEntity.cs
Normal file
14
Services/Hncore.Pass.Vpn/Domain/AgreementEntity.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Hncore.Infrastructure.DDD;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Hncore.Pass.Vpn.Domain
|
||||
{
|
||||
public partial class AgreementEntity
|
||||
{
|
||||
public int id { get; set; }
|
||||
public int user_id { get; set; }
|
||||
public int status { get; set; }
|
||||
public string username { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -148,6 +148,15 @@ namespace Hncore.Pass.Vpn.Domain
|
||||
entity.HasKey(p => p.id);
|
||||
entity.Property(e => e.id).ValueGeneratedOnAdd();
|
||||
});
|
||||
|
||||
//上传tx认证
|
||||
modelBuilder.Entity<AgreementEntity>(entity =>
|
||||
{
|
||||
entity.ToTable("use_agreement");
|
||||
|
||||
entity.HasKey(p => p.id);
|
||||
entity.Property(e => e.id).ValueGeneratedOnAdd();
|
||||
});
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,13 +170,22 @@ namespace Hncore.Pass.Vpn.Service
|
||||
{
|
||||
if (packageKey == "test_pay")
|
||||
return await NewTestAccount(account, pwd);
|
||||
|
||||
var acc = account;
|
||||
var tx = "no";
|
||||
if(account.Contains("-")){
|
||||
string[] arrStr = account.Split('-');
|
||||
acc = arrStr[0];
|
||||
tx = arrStr[1];
|
||||
}
|
||||
var client = CreateHttpClient();
|
||||
var map = new Dictionary<string, string>(){
|
||||
{"type","adduser" },
|
||||
{"user",account },
|
||||
{"user",acc },
|
||||
{"pass",pwd },
|
||||
{"logincount",connCount.ToString()},
|
||||
{"serverid",packageKey },
|
||||
{"tx",tx },
|
||||
};
|
||||
var title = GetOpTitle("NewAccount", account);
|
||||
LogHelper.Info(title, map.ToJson());
|
||||
|
||||
16
Services/Hncore.Pass.Vpn/Service/AgreementService.cs
Normal file
16
Services/Hncore.Pass.Vpn/Service/AgreementService.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Hncore.Infrastructure.Service;
|
||||
using Hncore.Pass.Vpn.Domain;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Hncore.Pass.Vpn.Service
|
||||
{
|
||||
public partial class AgreementService : ServiceBase<AgreementEntity>, IFindService
|
||||
{
|
||||
CourseContext m_DbContext;
|
||||
public AgreementService(CourseContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
|
||||
{
|
||||
m_DbContext = dbContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
private static readonly AsyncLock _mutex1 = new AsyncLock();
|
||||
CourseContext m_DbContext;
|
||||
ProductService m_ProductService;
|
||||
AgreementService m_Agreement;
|
||||
ProductPackageService m_ProductPackageService;
|
||||
UserService m_UserService;
|
||||
BaseUserService m_BaseUserService;
|
||||
@@ -49,6 +50,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
, ProductPriceSchemeService _ProductPriceSchemeService
|
||||
, AgentPriceService _AgentPriceService
|
||||
, ProductService _ProductService
|
||||
, AgreementService _Agreement
|
||||
, ProductPackageService _ProductPackageService
|
||||
, UserService _UserService
|
||||
, ProductOrderItemService _ProductOrderItemService
|
||||
@@ -66,6 +68,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
m_AgentScoreService = _AgentScoreService;
|
||||
m_AgentPriceService = _AgentPriceService;
|
||||
m_ProductService = _ProductService;
|
||||
m_Agreement = _Agreement;
|
||||
m_ProductPackageService = _ProductPackageService;
|
||||
m_UserService = _UserService;
|
||||
m_ProductOrderItemService = _ProductOrderItemService;
|
||||
@@ -696,7 +699,14 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
} else if(accountEntity.ProductId.Value == 8 || accountEntity.ProductId.Value == 7){
|
||||
var account_remark = accountEntity.Account + "-" + user_remark;
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, account_remark, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
|
||||
} else if (accountEntity.PackageId.Value > 1034 && accountEntity.PackageId.Value < 1040) {
|
||||
} else if(accountEntity.ProductId.Value == 13){
|
||||
var agreementEntity = await m_Agreement.Query(m => m.user_id == order.UserId).FirstOrDefaultAsync();
|
||||
var account_remark = accountEntity.Account;
|
||||
if (agreementEntity != null){
|
||||
account_remark = accountEntity.Account + "-yes";
|
||||
}
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, account_remark, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
|
||||
} else if (accountEntity.PackageId.Value > 1034 && accountEntity.PackageId.Value < 1040) {
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,2);
|
||||
}
|
||||
else if (accountEntity.PackageId.Value > 1040 && accountEntity.PackageId.Value < 1046) {
|
||||
@@ -924,14 +934,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
var accountError = "";
|
||||
await accountEntitys.ForEachAsync(async accountEntity =>
|
||||
{
|
||||
|
||||
var ret = new ApiResult();
|
||||
if(accountEntity.PackageId.Value == 86 || accountEntity.PackageId.Value == 88){
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
|
||||
} else if(accountEntity.ProductId.Value == 8 || accountEntity.ProductId.Value == 7){
|
||||
var account_remark = accountEntity.Account + "-" + user_remark;
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, account_remark, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
|
||||
} else if (accountEntity.PackageId.Value > 1034 && accountEntity.PackageId.Value < 1040) {
|
||||
}else if (accountEntity.PackageId.Value > 1034 && accountEntity.PackageId.Value < 1040) {
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,2);
|
||||
}
|
||||
else if (accountEntity.PackageId.Value > 1040 && accountEntity.PackageId.Value < 1046) {
|
||||
|
||||
Reference in New Issue
Block a user