username@email.com
2024-09-09 e8fd9aa8a76c638991e60544ccab53e2e5bd5b6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using CoreCms.Net.IRepository;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities.baifenbingfa.jon;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Services;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Threading.Tasks;
 
namespace CoreCms.Net.Web.WebApi.Controllers.baifenbingfa
{
    /// <summary>
    /// 招聘相关
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class JobController : ControllerBase
    {
        IJob_jobSetingRepository _job_JobSetingRepository;
        IJob_jobSetingServices _job_JobSetingServices;
        IJob_ApplicantProfileServices _job_ApplicantProfileServices;
         public JobController(IJob_jobSetingRepository job_JobSeting ,IJob_jobSetingServices job_JobSetingServices,IJob_ApplicantProfileServices job_ApplicantProfileServices)
        {
            _job_JobSetingRepository=job_JobSeting;
            _job_JobSetingServices=job_JobSetingServices;
             _job_ApplicantProfileServices=job_ApplicantProfileServices;
        }
   
        /// <summary>
        /// 获取招聘信息
        /// </summary>
        /// <returns></returns>
        [HttpPost("jobSet")]
        [SwaggerResponse(200, "返回数据", typeof(WebApiCallBack))]
        [SwaggerResponse(201, "Data类型", typeof(Job_jobSeting))]
        public async Task<WebApiCallBack> GetjobSeting()
        {
            var jm = new WebApiCallBack();
 
            jm.data = await _job_JobSetingRepository.QueryAsyncALL();
            jm.status = true;
            return jm;
 
        }
        /// <summary>
        /// 创建简历
        /// </summary>
        /// <param name="Param"></param>
        /// <returns></returns>
        [HttpPost("CreatCV")]
        public async Task<WebApiCallBack> CreatCVFile([FromBody] Job_ApplicantProfile Param)
        {
            var jm = new WebApiCallBack();
            var CreatTime=DateTime.Now;
            Param.createTime = CreatTime;
            Param.createBy = "PC";
            if (Param.employmentRecords!=null)
                foreach(var record in Param.employmentRecords)
                {
                    if(record.StartEndDateTimes==null||record.StartEndDateTimes.Count<2)
                    {
                        jm.status = false;
                        jm.msg = "工作经历必须填起止时间";
                        jm.code = 1;
                        return jm;
                    }
                    record.startDate= record.StartEndDateTimes[0];
                    record.endDate = record.StartEndDateTimes[1];
                    
                }
            jm.data = await _job_ApplicantProfileServices.InsertAsync(Param);
            jm.status = true;
            return jm;
 
        }
 
    }
}