using BPA.SAAS.Manage.Application.Org.Dtos.Users; using BPA.SAAS.Manage.Application.Org.Interface; using BPA.SAAS.Manage.Application.Org.Interface; using BPA.SAAS.Manage.Comm.Const; using BPA.SAAS.Manage.Core.Org; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPA.SAAS.Manage.Application.Org.Services { public class UserService : IUserService, ITransient { private readonly ISqlSugarClient _db; public UserService(ISqlSugarClient db) { _db=db; } public async Task AddUser(UserDtoInput input) { var user = input.Adapt(); user.Id= Guid.NewGuid().ToString(); user.Password = MD5Encryption.Encrypt("123456").ToLower(); user.CreateAt=DateTime.Now; user.CreateBy = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; var check = _db.Queryable().First(t => t.Account == user.Account); if (check != null) return false; return await _db.Insertable(user).ExecuteCommandAsync()> 0; } } }