本文整理汇总了C#中UserRepository.GetVisitorBeenTo方法的典型用法代码示例。如果您正苦于以下问题:C# UserRepository.GetVisitorBeenTo方法的具体用法?C# UserRepository.GetVisitorBeenTo怎么用?C# UserRepository.GetVisitorBeenTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserRepository
的用法示例。
在下文中一共展示了UserRepository.GetVisitorBeenTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostInitializeMyRecords
public async Task<HttpResponseMessage> PostInitializeMyRecords([FromBody]LoginParameter postParameter)
{
string openid = postParameter.openID;
if(string.IsNullOrEmpty(openid))
{
return WebApiHelper.HttpRMtoJson(null, HttpStatusCode.OK, customStatus.InvalidArguments);
}
using(UserRepository userRepository = new UserRepository())
{
var userUuid = await userRepository.GetUserUuidByOpenid(openid);
if(userUuid == Guid.Empty)
{
return WebApiHelper.HttpRMtoJson(postParameter.jsonpCallback, null, HttpStatusCode.OK, customStatus.NotFound);
}
else
{
List<UserSkill> userSkillList = await userRepository.GetUserRecords(new UserSkill() { AccountEmail_uuid = userUuid });
List<UserCourse> userCourseList = await userRepository.GetUserRecords(new UserCourse() { AccountEmail_uuid = userUuid });
List<UserEducation> userEducationList = await userRepository.GetUserRecords(new UserEducation() { AccountEmail_uuid = userUuid });
List<UserExperience> userExperienceList = await userRepository.GetUserRecords(new UserExperience() { AccountEmail_uuid = userUuid });
int userArticleNumber = await userRepository.GetUserRecordsNumber(new UserArticle() { AccountEmail_uuid = userUuid });
int visitorsBeenToNumber = await userRepository.GetVisitorBeenToNumber(userUuid);
List<UserInfo> visitorsBeenTo = await userRepository.GetVisitorBeenTo(userUuid, 6);
Dictionary<string,object> tempResult = new Dictionary<string, object>();
tempResult.Add("userSkillList", userSkillList);
tempResult.Add("userCourseList", userCourseList);
tempResult.Add("userEducationList", userEducationList);
tempResult.Add("userExperienceList", userExperienceList);
tempResult.Add("userArticleNumber", userArticleNumber);
tempResult.Add("visitorsBeenToNumber", visitorsBeenToNumber);
tempResult.Add("visitorsBeenToTopSix", visitorsBeenTo);
return WebApiHelper.HttpRMtoJson(tempResult, HttpStatusCode.OK, customStatus.Success);
}
}
}
示例2: PostInitializeMyRecords
public async Task<HttpResponseMessage> PostInitializeMyRecords([FromBody]DualParameter postParameter)
{
string openid = postParameter.openID;
if (string.IsNullOrEmpty(openid) || Guid.Empty.Equals(postParameter.uuid))
{
return WebApiHelper.HttpRMtoJson("必须同时传入openid与uuid", HttpStatusCode.OK, customStatus.InvalidArguments);
}
using (UserRepository userRepository = new UserRepository())
{
var userUuid = postParameter.uuid;
if (userUuid == Guid.Empty)
{
return WebApiHelper.HttpRMtoJson(postParameter.jsonpCallback, null, HttpStatusCode.OK, customStatus.NotFound);
}
else
{
UserInfo userinfo = await userRepository.GetUserInfoByUuidAsync(userUuid);
//研究兴趣
string Interests = userinfo.Interests;
//学术地位
List<UserAcademic> userAcademicList = await userRepository.GetUserRecords(new UserAcademic { AccountEmail_uuid = userUuid });
List<string> acadmeicList = RepositoryHelper.ConvertUserAcademicToString(userAcademicList);
//项目资助
List<UserAwards> userAwardList = await userRepository.GetUserRecords(new UserAwards() { AccountEmail_uuid = userUuid });
//教育经历
List<UserEducation> userEducationList = await userRepository.GetUserRecords(new UserEducation() { AccountEmail_uuid = userUuid });
//工作经历
List<UserExperience> userExperienceList = await userRepository.GetUserRecords(new UserExperience() { AccountEmail_uuid = userUuid });
//论文数
int userArticleNumber = await userRepository.GetUserRecordsNumber(new UserArticle() { AccountEmail_uuid = userUuid });
//专利数
int userPatendNumber = await userRepository.GetUserRecordsNumber(new UserPatent() { AccountEmail_uuid = userUuid });
//访问过我的人还访问过谁
int visitorsBeenToNumber = await userRepository.GetVisitorBeenToNumber(userUuid);
List<UserInfo> visitorsBeenTo = await userRepository.GetVisitorBeenTo(userUuid, 6);
Dictionary<string, object> tempResult = new Dictionary<string, object>();
tempResult.Add("Interests", Interests);
tempResult.Add("acadmeicList", acadmeicList);
tempResult.Add("userAwardList", userAwardList);
tempResult.Add("userEducationList", userEducationList);
tempResult.Add("userExperienceList", userExperienceList);
tempResult.Add("userArticleNumber", userArticleNumber);
tempResult.Add("userPatendNumber", userPatendNumber);
tempResult.Add("visitorsBeenToNumber", visitorsBeenToNumber);
tempResult.Add("visitorsBeenToTopSix", visitorsBeenTo);
return WebApiHelper.HttpRMtoJson(tempResult, HttpStatusCode.OK, customStatus.Success);
}
}
}
示例3: PostInitializeVisitorBeenTo
public async Task<HttpResponseMessage> PostInitializeVisitorBeenTo([FromBody]LoginParameter postParameter)
{
string openid = postParameter.openID;
int pageIndex = postParameter.pageIndex;
int pageSize = postParameter.pageSize;
if(string.IsNullOrEmpty(openid) || pageSize == 0)
{
return WebApiHelper.HttpRMtoJson(postParameter.jsonpCallback, null, HttpStatusCode.OK, customStatus.InvalidArguments);
}
using(UserRepository userRepository = new UserRepository())
{
Guid userUuid = await userRepository.GetUserUuidByOpenid(openid);
var uclist = await userRepository.GetVisitorBeenTo(userUuid, pageIndex, pageSize);
return WebApiHelper.HttpRMtoJson(postParameter.jsonpCallback, uclist, HttpStatusCode.OK, customStatus.Success);
}
}
示例4: PostInitializeProfessorRecords
public async Task<HttpResponseMessage> PostInitializeProfessorRecords([FromBody]BaseParameter postParameter)
{
string openid = postParameter.openID;
if (string.IsNullOrEmpty(openid))
{
return WebApiHelper.HttpRMtoJson(null, HttpStatusCode.OK, customStatus.InvalidArguments);
}
using (UserRepository userRepository = new UserRepository())
{
var userUuid = await userRepository.GetUserUuidByOpenid(openid);
if (userUuid == Guid.Empty)
{
return WebApiHelper.HttpRMtoJson(postParameter.jsonpCallback, null, HttpStatusCode.OK, customStatus.NotFound);
}
else
{
Dictionary<string, object> tempResult = new Dictionary<string, object>();
UserInfo userinfo = await userRepository.GetUserInfoByOpenid(openid);
//研究兴趣
string researchField = userinfo.Interests;
tempResult.Add("yjly", researchField);
//学术地位
List<UserAcademic> userAcademicList = await userRepository.GetUserRecords(new UserAcademic { AccountEmail_uuid = userUuid });
List<string> acadmeicList = RepositoryHelper.ConvertUserAcademicToString(userAcademicList);
tempResult.Add("xsdw", Tuple.Create("UserAcademic", acadmeicList));
//项目资助
List<UserAwards> userAwardList = await userRepository.GetUserRecords(new UserAwards() { AccountEmail_uuid = userUuid });
tempResult.Add("zzxm", Tuple.Create("UserAwards", userAwardList));
//教育经历
List<UserEducation> userEducationList = await userRepository.GetUserRecords(new UserEducation() { AccountEmail_uuid = userUuid });
tempResult.Add("jyjl", Tuple.Create("UserEducation", userEducationList));
//工作经历
List<UserExperience> userExperienceList = await userRepository.GetUserRecords(new UserExperience() { AccountEmail_uuid = userUuid });
tempResult.Add("gzjl", Tuple.Create("UserExperience", userExperienceList));
//论文数
int userArticleNumber = await userRepository.GetUserRecordsNumber(new UserArticle() { AccountEmail_uuid = userUuid });
tempResult.Add("lws", Tuple.Create("UserArticle", userArticleNumber));
//专利数
int userPatendNumber = await userRepository.GetUserRecordsNumber(new UserPatent() { AccountEmail_uuid = userUuid });
tempResult.Add("zls", Tuple.Create("UserPatent", userPatendNumber));
//访问过我的人还访问过谁
int visitorsBeenToNumber = await userRepository.GetVisitorBeenToNumber(userUuid);
List<UserInfo> visitorsBeenTo = await userRepository.GetVisitorBeenTo(userUuid, 6);
tempResult.Add("visitorsBeenToNumber", visitorsBeenToNumber);
tempResult.Add("visitorsBeenToTopSix", visitorsBeenTo);
return WebApiHelper.HttpRMtoJson(tempResult, HttpStatusCode.OK, customStatus.Success);
}
}
}