This commit is contained in:
mmrbnjd
2024-04-14 22:19:39 +03:30
parent f7e3f3b02a
commit 3f429e0539
8 changed files with 118 additions and 42 deletions

View File

@@ -34,7 +34,7 @@
<ItemGroup>
<Reference Include="Service">
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
<HintPath>..\..\Dlls\Service.dll</HintPath>
</Reference>
</ItemGroup>

View File

@@ -37,20 +37,14 @@ namespace Back.Controllers
item.CompanyID = pid.Value.ToString();
var Ticket = await _servTicket.NewTicket(item, StatusTicket.unknownPerson);
var code= await _servValidatinMsg.GenerateCode(new VerificationCode
var ID= await _servValidatinMsg.GenerateCode(new VerificationCode
{
ID = 0,
prm = Ticket.ID.ToString(),
val = item.Mobile,
Type = "NewTicketNoAuthentication"
});
return Ticket == null ? BadRequest() : Ok(new VerificationCodeDto
{
prm = Ticket.ID.ToString(),
val = item.Mobile,
Type = "NewTicketNoAuthentication"
});
return Ticket == null ? BadRequest() : Ok(ID);
}
}
}

View File

@@ -6,8 +6,9 @@ namespace Back.Data.Models
{
public class VerificationCode
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
public int ID { get; set; }
public int Code { get; set; }
public string prm { get; set; }
public string val { get; set; }
public string Type { get; set; }

View File

@@ -22,14 +22,14 @@ namespace Back.Services
}
public async Task<int> GenerateCode(VerificationCode code)
{
code.ID = Random.Shared.Next(1000, 9000);
code.Code = Random.Shared.Next(1000, 9000);
while (await GetRegistrationCode(code.ID) != null)
code.ID = Random.Shared.Next(1000, 9000);
code.Code = Random.Shared.Next(1000, 9000);
await _verificationCodeRepo.AddAsync(code);
var indb= await _verificationCodeRepo.AddAsync(code);
return code.ID;
return indb.ID;
}
}
}