public async Task <IActionResult> GetHealthManagementPageBanner() { var bannerBiz = new BannerBiz(); var dtos = await bannerBiz.GetBannerInfoAsync(DictionaryType.HealthManagementPage); return(Success(dtos)); }
public async Task <IActionResult> UpdateBannerAsync([FromBody] UpdateBannerRequestDto request) { BannerBiz bannerBiz = new BannerBiz(); var entity = await bannerBiz.GetAsync(request.BannerGuid); if (entity == null) { return(Failed(ErrorCode.UserData, "找不到数据")); } entity.BannerName = request.BannerName; entity.OwnerGuid = request.OwnerGuid; entity.TargetUrl = request.TargetUrl; entity.PictureGuid = request.PictureGuid; entity.Description = request.Description; entity.Enable = request.Enable; entity.LastUpdatedDate = DateTime.Now; entity.Sort = request.Sort; var result = await bannerBiz.UpdateAsync(entity); if (!result) { return(Failed(ErrorCode.UserData, "修改失败")); } return(Success()); }
public async Task <IActionResult> GetAskedDoctorLectureHallBanner() { var bannerBiz = new BannerBiz(); var dtos = await bannerBiz.GetBannerInfoAsync(DictionaryType.AskedDoctorLectureHall); return(Success(dtos)); }
public async Task <IActionResult> DisableEnableBannerAsync([FromBody] DisableEnableBannerRequestDto request) { BannerBiz bannerBiz = new BannerBiz(); var entity = await bannerBiz.GetAsync(request.Guid); if (entity == null) { return(Failed(ErrorCode.UserData, "找不到数据")); } entity.LastUpdatedBy = UserID; entity.LastUpdatedDate = DateTime.Now; entity.Enable = request.Enable; var result = await bannerBiz.UpdateAsync(entity); if (!result) { return(Failed(ErrorCode.UserData, "修改失败")); } return(Success()); }