//public WxApp GetEntityByAppId(string appId) //{ // var specification = new Specification<WxApp>(p => p.AppId == appId); // WxApp wxApp = wxAppRepository.Find(specification); // return wxApp; //} public void SubmitForm(WxImageInputDto wxImageInputDto, string keyValue) { WxImage wxImage = new WxImage(); string appId = WxOperatorProvider.Provider.GetCurrent().AppId; if (!string.IsNullOrEmpty(keyValue)) { var id = Convert.ToInt64(keyValue); wxImage = wxImageRepository.Get(id); //AutoMapper.Mapper.Map<WxImageInputDto, WxImage>(wxImageInputDto, wxImage); wxImage.FileName = wxImageInputDto.FileName; wxImage.LastModificationTime = DateTime.Now; wxImageRepository.Update(wxImage); } else { AutoMapper.Mapper.Map <WxImageInputDto, WxImage>(wxImageInputDto, wxImage); wxImage.Id = IdWorkerHelper.GenId64(); wxImage.AppId = appId; wxImage.DeletedMark = false; wxImage.CreationTime = DateTime.Now; wxImage.CreatorUserId = 1; wxImageRepository.Add(wxImage); } }
public void SaveWxImage(string fileName, string filePath, string thumbPath, string fileSize, string fileExt, string mediaId, string mediaUrl) { WxImageService wxImageService = new WxImageService(); WxImageInputDto wxImageInputDto = new WxImageInputDto(); wxImageInputDto.FileName = fileName; wxImageInputDto.FilePath = filePath; wxImageInputDto.FileSize = Convert.ToInt64(fileSize); wxImageInputDto.FileExt = fileExt; wxImageInputDto.ThumbPath = thumbPath; wxImageInputDto.MediaId = mediaId; wxImageInputDto.MediaUrl = mediaUrl; wxImageService.SubmitForm(wxImageInputDto, ""); }
public ActionResult SubmitForm(WxImageInputDto wxImageInputDto, string keyValue) { wxImageService.SubmitForm(wxImageInputDto, keyValue); return Success("操作成功。"); }