1
This commit is contained in:
+67
@@ -0,0 +1,67 @@
|
||||
namespace SimpleAdmin.Web.Core;
|
||||
|
||||
[ApiDescriptionSettings("Application", Tag = "员工入职提交")]
|
||||
[Route("open/onboarding")]
|
||||
[AllowAnonymous]
|
||||
public class OnboardingPublicSubmissionController
|
||||
{
|
||||
private readonly IOnboardingPublicSubmissionService _service;
|
||||
private readonly IFileService _fileService;
|
||||
|
||||
public OnboardingPublicSubmissionController(IOnboardingPublicSubmissionService service, IFileService fileService)
|
||||
{
|
||||
_service = service;
|
||||
_fileService = fileService;
|
||||
}
|
||||
|
||||
[HttpPost("save-dynamic-values")]
|
||||
public async Task SaveDynamicValues([FromBody] OnboardingSaveDynamicValuesInput input)
|
||||
{
|
||||
await _service.SaveDynamicValues(input);
|
||||
}
|
||||
|
||||
[HttpPost("save-material")]
|
||||
public async Task SaveMaterial([FromBody] OnboardingSaveMaterialInput input)
|
||||
{
|
||||
await _service.SaveMaterial(input);
|
||||
}
|
||||
|
||||
[HttpPost("confirm-contract")]
|
||||
public async Task ConfirmContract([FromBody] OnboardingConfirmContractInput input)
|
||||
{
|
||||
await _service.ConfirmContract(input);
|
||||
}
|
||||
|
||||
[HttpPost("submit")]
|
||||
public async Task Submit([FromBody] OnboardingSubmitInput input)
|
||||
{
|
||||
await _service.Submit(input);
|
||||
}
|
||||
|
||||
[HttpPost("upload-material")]
|
||||
[Consumes("multipart/form-data")]
|
||||
[RequestSizeLimit(20 * 1024 * 1024)]
|
||||
public async Task UploadMaterial([FromForm] string token, [FromForm] long materialTypeId, IFormFile file)
|
||||
{
|
||||
if (file == null || file.Length == 0)
|
||||
{
|
||||
throw new ArgumentException("请选择需要上传的文件");
|
||||
}
|
||||
|
||||
await _service.ValidateMaterialUpload(new OnboardingMaterialUploadValidationInput
|
||||
{
|
||||
Token = token,
|
||||
MaterialTypeId = materialTypeId,
|
||||
FileName = file.FileName,
|
||||
FileLength = file.Length
|
||||
});
|
||||
|
||||
var fileId = await _fileService.UploadFile(SysDictConst.FILE_ENGINE_LOCAL, file);
|
||||
await _service.SaveMaterial(new OnboardingSaveMaterialInput
|
||||
{
|
||||
Token = token,
|
||||
MaterialTypeId = materialTypeId,
|
||||
FileId = fileId
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user