コード例 #1
0
        public IActionResult UpdateFirmJobPost(UpdateJobPostDTO model)
        {
            var jobPost = _jobPostService.GetJobPostById(model.Id);

            if (string.IsNullOrEmpty(jobPost.Id))
            {
                return(OK(StatusCodeType.JOBPOST_NOTFOUND, StatusMessage.JOBPOST_NOTFOUND, false));
            }

            var firm = _firmService.GetFirmById(model.FirmId);

            if (string.IsNullOrEmpty(firm.Id))
            {
                return(OK(StatusCodeType.FIRM_NOTFOUND, StatusMessage.FIRM_NOTFOUND, false));
            }

            var response = _firmService.UpdateFirmJobPost(model);

            if (response == null)
            {
                return(OK(StatusCodeType.HAS_EXCEPTION, StatusMessage.HAS_EXCEPTION, false));
            }

            return(OK(StatusCodeType.SUCCESS, StatusMessage.SUCCESS, response));
        }
コード例 #2
0
        public IActionResult ApplyJobPost(ApplyJobPostDTO model)
        {
            var user = _userService.GetUserById(model.UserId);

            if (string.IsNullOrEmpty(user.Id))
            {
                return(OK(StatusCodeType.USER_NOTFOUND, StatusMessage.USER_NOTFOUND, false));
            }
            if (user.ResponseCVDTO == null)
            {
                return(OK(StatusCodeType.CV_NOTFOUND, StatusMessage.CV_NOTFOUND, false));
            }
            var jobPost = _jobPostService.GetJobPostById(model.JobPostId);

            if (string.IsNullOrEmpty(jobPost.Id))
            {
                return(OK(StatusCodeType.JOBPOST_NOTFOUND, StatusMessage.JOBPOST_NOTFOUND, false));
            }

            var hasApplyUser = _jobPostService.AnyApplyUser(model);

            if (hasApplyUser)
            {
                return(OK(StatusCodeType.ALREADY_HASJOBPOST, StatusMessage.ALREADY_HASJOBPOST, false));
            }

            var response = _jobPostService.ApplyJobPost(model);

            if (string.IsNullOrEmpty(response.Id))
            {
                return(OK(StatusCodeType.HAS_EXCEPTION, StatusMessage.HAS_EXCEPTION, false));
            }

            return(OK(StatusCodeType.SUCCESS, StatusMessage.SUCCESS, response));
        }