zhengyuxuan
2025-03-19 24925c9d9243358a3a1c7fdcfb6eb67c867fc80f
fix:新增用户接口加入渠道
2个文件已修改
24 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/User/AccountService.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs
@@ -75,6 +75,11 @@
        public string[] RoleNames { get; set; }
        /// <summary>
        /// 渠道列表
        /// </summary>
        public Guid[] ChannlesId { get; set; }
        /// <summary>
        /// 小程序OpenId
        /// </summary>
        public string OpenId { get; set; }
LifePayment/LifePayment.Application/User/AccountService.cs
@@ -6,6 +6,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
@@ -27,6 +28,7 @@
        private readonly IConfiguration _configuration;
        private readonly IIdentityModelAuthenticationService _authenticator;
        private readonly IRepository<User, Guid> _userRepository;
        private readonly IRepository<UserChannle, Guid> _userChannleRep;
        private readonly IIdentityUserAppService _identityUserService;
        public AccountService(
@@ -35,7 +37,8 @@
               IIdentityModelAuthenticationService authenticator,
               IRepository<User, Guid> userRepository,
               IIdentityUserAppService identityUserService,
               IRepository<LifePayUser, Guid> lifePayUserRepository)
               IRepository<LifePayUser, Guid> lifePayUserRepository,
               IRepository<UserChannle, Guid> userChannleRep)
        {
            _configuration = configuration;
            _wxManager = wxManager;
@@ -43,6 +46,7 @@
            _lifePayUserRepository = lifePayUserRepository;
            _authenticator = authenticator;
            _userRepository = userRepository;
            _userChannleRep = userChannleRep;
        }
        #region 查询
@@ -170,6 +174,19 @@
                DepartmentOrgId = input.ClientId == LifePaymentConstant.ClientId.Back ? input.DepartmentOrgId : null,
                CompanyOrgId = input.ClientId == LifePaymentConstant.ClientId.Back ? input.CompanyOrgId : null
            });
            List<UserChannle> userChannles = new List<UserChannle>();
            foreach (var item in input.ChannlesId)
            {
                userChannles.Add(new UserChannle()
                {
                    Id = Guid.NewGuid(),
                    ChannleId = item,
                    UserId = user.Id
                });
            }
            await _userChannleRep.InsertManyAsync(userChannles);
            //if (input.ClientId == Constant.ClientType.Back)
            //{
            //    await _distributedEventBus.PublishAsync(new SendPhoneMessageInput