Add focus plans and stage-aware follow-up drafting
This commit is contained in:
@@ -91,6 +91,34 @@ public sealed class ProfileCvController : ControllerBase
|
||||
return Ok(new { imported = true, characters = text.Length });
|
||||
}
|
||||
|
||||
[HttpPost("rebuild")]
|
||||
public async Task<IActionResult> Rebuild()
|
||||
{
|
||||
var user = await _users.GetUserAsync(User);
|
||||
if (user is null) return Unauthorized();
|
||||
if (string.IsNullOrWhiteSpace(user.ProfileCvText)) return BadRequest("Add or import CV text before rebuilding it.");
|
||||
|
||||
var rebuilt = await _aiService.SummarizeSectionAsync(
|
||||
"Rewrite this CV into a stronger master CV with clear sections such as Professional Summary, Core Skills, Experience Highlights, and Selected Achievements. Preserve only factual claims, avoid inventing employers or metrics, and make the output clean and ready for tailoring to job applications. Return only the rebuilt CV text.",
|
||||
user.ProfileCvText,
|
||||
2200,
|
||||
700);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(rebuilt))
|
||||
{
|
||||
return BadRequest("The AI service could not rebuild your CV text right now.");
|
||||
}
|
||||
|
||||
user.ProfileCvText = rebuilt.Trim();
|
||||
var result = await _users.UpdateAsync(user);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
return BadRequest(string.Join("; ", result.Errors.Select(e => e.Description)));
|
||||
}
|
||||
|
||||
return Ok(new { rebuilt = true, characters = user.ProfileCvText.Length, text = user.ProfileCvText });
|
||||
}
|
||||
|
||||
[HttpPost("improve")]
|
||||
public async Task<IActionResult> Improve()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user