public IActionResult GetById(string id) { var recommend = _iRecommendService.GetById(id); var recommendModel = _iMapper.Map <RecommendModels>(recommend); var post = _iPostService.GetById(recommendModel.PostId); var postModel = _iMapper.Map <PostModel>(post); var resume = _iResumeService.GetById(recommendModel.ResumeId); var resumeModel = _iMapper.Map <ResumeModel>(resume); var company = _iCompanyService.GetById(post.CompanyId); var companyModel = _iMapper.Map <ResponseCompanyUserModel>(company); var user = _iUserService.GetById(resume.UserId); var userModel = _iMapper.Map <ResponseUserModel>(user); recommendModel.postModel = postModel; recommendModel.resumeModel = resumeModel; recommendModel.companyUserModel = companyModel; recommendModel.userModel = userModel; var count = 1; if (recommendModel != null) { return(Output( recommendModel, count)); } throw new Exception("该推荐不存在"); }