Example #1
0
        private async Task <string> PfopDo(Pfop pfop, string bucket, string key, string fops, string pipline, string saveAsKey, int userId, object temp = null)
        {
            return(await Task.Run(() =>
            {
                string persistentId_thumb = "";
                try
                {
                    persistentId_thumb = pfop.Do(new EntryPath(bucket, key), new string[] { fops }, new Uri("http://" + callBackUrl + "/api/QiniuUpload/Notify"), pipline);
                }
                catch (Exception e)
                {
                    string mesg = string.Format("Pfop.Do Error  bucket:{0}  key:{1}   fops:{2}    pipline:{3}  saveAsKey:{4}", bucket, key,
                                                fops, pipline, saveAsKey);
                    LogBuilder.Log4Net.Debug(mesg);
                    throw e;
                }
                QiniuFopLog bgImgfopLog = new QiniuFopLog
                {
                    OriginFile = key,
                    CreateTime = DateTime.Now,
                    SaveAsFile = saveAsKey,
                    PersistentId = persistentId_thumb,
                    Pipeline = pipline,
                    UserId = userId
                };
                _qiniuFopLogRepository.CreateEntity(bgImgfopLog);

                int vid = 0;
                if (temp != null && Int32.TryParse(temp.ToString(), out vid))
                {
                    var video = _videoRepository.GetEntity(ConditionEqualId(vid));
                    if (video != null)
                    {
                        video.PersistentId = persistentId_thumb;
                        _videoRepository.UpdateEntity(video);
                    }
                }

                return persistentId_thumb;
            }));
        }
Example #2
0
 public bool UpdateEntity(QiniuFopLog entity)
 {
     return(base.UpdateEntity <QiniuFopLog>(entity));
 }
Example #3
0
 public bool DeleteEntity(QiniuFopLog entity)
 {
     return(base.DeleteEntity <QiniuFopLog>(entity));
 }
Example #4
0
 public bool CreateEntity(QiniuFopLog entity)
 {
     return(base.CreateEntity <QiniuFopLog>(entity));
 }