This commit is contained in:
mmrbnjd
2024-06-24 11:48:53 +03:30
parent 4412e920fd
commit a1d265bf7f
10 changed files with 52 additions and 34 deletions

View File

@@ -61,7 +61,7 @@ namespace Back.Services
company.IsActive = true;
if (await _CompanyRepo.UpdateAsync(company))
{
_servSendMsg.SuccessfulRegistration(user.Mobile, $"{user.Mobile};{user.Mobile}");
_servSendMsg.SuccessfulRegistration(user.Mobile, user.Mobile,user.Mobile);
return true;
}
@@ -69,7 +69,7 @@ namespace Back.Services
}
return false;
}
public async Task<int> GenerateCode(VerificationCode code)
public async Task<VerificationCode> GenerateCode(VerificationCode code)
{
code.Code = Random.Shared.Next(1000, 9000);
while (await GetVerificationCode(code.Code) != null)
@@ -77,8 +77,8 @@ namespace Back.Services
var indb= await _verificationCodeRepo.AddAsync(code);
return indb.ID;
code.ID = indb.ID;
return code;
}
}
}

View File

@@ -4,11 +4,22 @@
{
private readonly mpNuget.RestClient _restClient;
public servSendMsg(mpNuget.RestClient restClient)=> _restClient = restClient;
private void SendMsgByPatern(string Text, string To, int bodyID) {/*_restClient.SendByBaseNumber(Text, To, bodyID);*/ }
//private void SendMsgByPatern(string Text, string To, int bodyID) {/*_restClient.SendByBaseNumber(Text, To, bodyID);*/ }
private void SendMsg(string Text, string To)=> _restClient.Send(To, "50004001660045", Text, false);
public void Authentication(string to,string code) => SendMsgByPatern(code, to, 0);
public void SuccessfulRegistration(string to, string code) => SendMsgByPatern(code, to, 1);
public void SuccessfulPayment(string to, string code) => SendMsgByPatern(code, to, 2);
// public void firstEntry(string to, string code) => SendMsgByPatern(code, to, 3);
public void toContinue(string Code, string To,string title)
{
SendMsg($"برای ادامه {title} از کد {Code} استفاده کنید",To);
}
public void SuccessfulRegistration(string to, string Username, string Password)
{
SendMsg("ثبت نام شما با موفقیت انجام شد" + '\n' +
"اطلاعات کاربری:" + '\n' +
$"نام کاربری : {Username}" +
$"کلمه عبور : {Password}" ,to);
}
//public void Authentication(string to,string code) => SendMsgByPatern(code, to, 0);
//
//public void SuccessfulPayment(string to, string code) => SendMsgByPatern(code, to, 2);
// public void firstEntry(string to, string code) => SendMsgByPatern(code, to, 3);
}
}