...
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Service">
|
||||
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
|
||||
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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; }
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user