public MUserModel( UserManager <IdentityUser> userManager, ILogger <MUserModel> logger, MUserService mUserSservice ) { _userManager = userManager; _logger = logger; _mUserService = mUserSservice; }
public async Task <JsonResultGenerics <bool> > CancelUserFavoriteClass(VM_Wx_User_Class userClass) { userClass.ChangeUnionId2UserId(strUnionId => MUserService.GetMember(unionId: strUnionId)); await MUserService.CancelFavoriteMicrocalss(userClass.UserId, userClass.ClassId); return(new JsonResultGenerics <bool> { Value = true, Result = true }); }
public async Task <JsonResultGenerics <bool> > ToCollectClass(VM_Wx_User_Class userClass) { userClass.ChangeUnionId2UserId(strUnionId => MUserService.GetMember(unionId: strUnionId)); var collectResult = await MUserService.MemberFavoriteMicrocalss(userClass.UserId, userClass.ClassId); var ret = new JsonResultGenerics <bool>(); if (collectResult == MemberFavoriteClassResult.Success) { ret.Result = true; } else { ret.Error = collectResult.ToDescription(); } return(ret); }
public async Task <List <VM_Wx_ClassInfo> > GetUserFavoriteClasses(long userId) { var userClassIds = await MUserService.GetMemberFavoriteMicrocalssIds(userId); if (userClassIds == null || userClassIds.Count == 0) { return(new List <VM_Wx_ClassInfo>()); } return(MClassService.GetMicroclasses(m => userClassIds.Contains(m.id) && !m.is_deleted).Select(m => { var vo = new VM_Wx_ClassInfo(m, id => MDoctorService.GetDoctor(id), hid => MHospitalService.GetHospitalProfileByID(hid), cid => MClassService.GetOnlineUserCountByType(cid, 0)); return vo; }).ToList()); }
public UsersController(MUserService mUserService) { this.mUserService = mUserService; }