예제 #1
0
        public void MakeThumb()
        {
            lastId = 0;
            msgList = new List<string>();

            ThumbParam obj = new ThumbParam();
            obj.StartId = ctx.PostInt( "startId" );
            obj.EndId = ctx.PostInt( "endId" );

            try {
                String thumbType = ctx.Post( "thumbType" );
                if (thumbType == "s") {
                    new Thread( makeSmall ).Start( obj );
                }
                else if (thumbType == "m") {
                    new Thread( makeMiddle ).Start( obj );
                }
                else if (thumbType == "b") {
                    new Thread( makeBig ).Start( obj );
                }
                else {
                    echo( "缩略图类型错误:" + thumbType );
                    return;
                }

                echoAjaxOk();

            }
            catch (Exception ex) {
                logger.Error( ex.Message );
                logger.Error( ex.StackTrace );
                echo( "生成错误,请查看日志" );
            }
        }
예제 #2
0
 private static List<User> getByStartEndId( ThumbParam obj )
 {
     List<User> userList = User.find( "Id>=:sid and Id<=:eid order by Id" )
         .set( "sid", obj.StartId )
         .set( "eid", obj.EndId )
         .list();
     return userList;
 }
예제 #3
0
        private static List <User> getByStartEndId(ThumbParam obj)
        {
            List <User> userList = User.find("Id>=:sid and Id<=:eid order by Id")
                                   .set("sid", obj.StartId)
                                   .set("eid", obj.EndId)
                                   .list();

            return(userList);
        }
예제 #4
0
        private static List <User> getUsersById(ThumbParam obj)
        {
            List <User> list = User.find("Id>=:sid and Id<=:eid order by Id")
                               .set("sid", obj.StartId)
                               .set("eid", obj.EndId)
                               .list();

            DbContext.closeConnectionAll();
            return(list);
        }
예제 #5
0
        private List <PhotoPost> getPhotoById(ThumbParam obj)
        {
            List <PhotoPost> list = PhotoPost.find("Id>=:sid and Id<=:eid order by Id")
                                    .set("sid", obj.StartId)
                                    .set("eid", obj.EndId)
                                    .list();

            DbContext.closeConnectionAll();
            return(list);
        }
예제 #6
0
        public void MakeFaceThumb()
        {
            lastId  = 0;
            msgList = new List <string>();

            ThumbParam obj = new ThumbParam();

            obj.StartId = ctx.PostInt("startId");
            obj.EndId   = ctx.PostInt("endId");

            try {
                new Thread(makeUserFace).Start(obj);
                echoAjaxOk();
            }
            catch (Exception ex) {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                echo("生成错误,请查看日志");
            }
        }
예제 #7
0
        public void MakeFaceThumb()
        {
            lastId = 0;
            msgList = new List<string>();

            ThumbParam obj = new ThumbParam();
            obj.StartId = ctx.PostInt( "startId" );
            obj.EndId = ctx.PostInt( "endId" );

            try {
                new Thread( makeUserFace ).Start( obj );
                echoAjaxOk();

            }
            catch (Exception ex) {
                logger.Error( ex.Message );
                logger.Error( ex.StackTrace );
                echo( "生成错误,请查看日志" );
            }
        }
예제 #8
0
        public virtual void MakePhotoThumb()
        {
            lastId  = 0;
            msgList = new List <string>();

            ThumbParam obj = new ThumbParam();

            obj.StartId          = ctx.PostLong("startId");
            obj.EndId            = ctx.PostLong("endId");
            obj.OnlyComputerSize = ctx.PostInt("onlyComputerSize");

            try {
                new Thread(makePhoto).Start(obj);
                echoAjaxOk();
            }
            catch (Exception ex) {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                echo("生成错误,请查看日志");
            }
        }
예제 #9
0
        public virtual void MakePhotoThumb() {

            lastId = 0;
            msgList = new List<string>();

            ThumbParam obj = new ThumbParam();
            obj.StartId = ctx.PostLong( "startId" );
            obj.EndId = ctx.PostLong( "endId" );
            obj.OnlyComputerSize = ctx.PostInt( "onlyComputerSize" );

            try {
                new Thread( makePhoto ).Start( obj );
                echoAjaxOk();

            }
            catch (Exception ex) {
                logger.Error( ex.Message );
                logger.Error( ex.StackTrace );
                echo( "生成错误,请查看日志" );
            }
        }
예제 #10
0
        public void MakeThumb()
        {
            lastId  = 0;
            msgList = new List <string>();

            ThumbParam obj = new ThumbParam();

            obj.StartId = ctx.PostInt("startId");
            obj.EndId   = ctx.PostInt("endId");

            try {
                String thumbType = ctx.Post("thumbType");
                if (thumbType == "s")
                {
                    new Thread(makeSmall).Start(obj);
                }
                else if (thumbType == "m")
                {
                    new Thread(makeMiddle).Start(obj);
                }
                else if (thumbType == "b")
                {
                    new Thread(makeBig).Start(obj);
                }
                else
                {
                    echo("缩略图类型错误:" + thumbType);
                    return;
                }

                echoAjaxOk();
            }
            catch (Exception ex) {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                echo("生成错误,请查看日志");
            }
        }
예제 #11
0
        private void makePhoto(Object objParam)
        {
            ThumbParam param = objParam as ThumbParam;

            List <PhotoPost> photoList = getPhotoById(param);

            log("begin... photo count=" + photoList.Count);

            foreach (PhotoPost x in photoList)
            {
                lastId = x.Id;

                String photoPath = x.DataUrl;
                if (strUtil.IsNullOrEmpty(photoPath))
                {
                    continue;
                }
                if (photoPath.ToLower().StartsWith("http://"))
                {
                    continue;
                }
                if (photoPath.StartsWith("/"))
                {
                    continue;
                }

                // 如果不是仅仅生成缩略图
                if (param.OnlyComputerSize == 0)
                {
                    makeThumbPrivate(photoPath);
                }

                updatePhotoSize(x);
            }

            log("操作结束, last photo id=" + lastId);
        }
예제 #12
0
 private List<PhotoPost> getPhotoById( ThumbParam obj )
 {
     List<PhotoPost> list = PhotoPost.find( "Id>=:sid and Id<=:eid order by Id" )
         .set( "sid", obj.StartId )
         .set( "eid", obj.EndId )
         .list();
     DbContext.closeConnectionAll();
     return list;
 }
예제 #13
0
 private static List<User> getUsersById( ThumbParam obj )
 {
     List<User> list = User.find( "Id>=:sid and Id<=:eid order by Id" )
         .set( "sid", obj.StartId )
         .set( "eid", obj.EndId )
         .list();
     DbContext.closeConnectionAll();
     return list;
 }