Beispiel #1
0
        public FavoriteScript Add(string token, string scriptId)
        {
            FavoriteScript script = new FavoriteScript();

            script.id       = Guid.NewGuid().ToString();
            script.addTime  = DateTime.Now;
            script.scriptId = scriptId;
            script.userId   = _SessionMgeSvr.Get(token).Name;
            _FavoriteScriptDao.Insert(script);
            return(script);
        }
Beispiel #2
0
 public Project Create(string token, Project project)
 {
     project.id         = Guid.NewGuid().ToString();
     project.createTime = DateTime.Now;
     project.userId     = _SessionMgeSvr.Get(token).Name;
     if (project.domains == null)
     {
         project.domains = new DataList <Domain>();
     }
     if (project.scripts == null)
     {
         project.scripts = new DataList <Script>();
     }
     _ProjectDao.Insert(project);
     return(project);
 }
        public BlogInfo Add(string token, BlogInfo blogInfo)
        {
            if (blogInfo.content.Length > 50000 || blogInfo.title.Length > 50)
            {
                throw new ServiceException((int)TYPE_OF_RESULT_TYPE.failure, "字数过长");
            }
            var info = _SessionMgeSvr.Get(token);

            if (string.IsNullOrEmpty(info.Name))
            {
                throw new ServiceException((int)TYPE_OF_RESULT_TYPE.offline, "未登录");
            }
            blogInfo.id         = Guid.NewGuid().ToString();
            blogInfo.createTime = DateTime.Now;
            blogInfo.auther     = info.Name;
            _BlogInfoDao.Insert(blogInfo);
            return(blogInfo);
        }
        public BuildingScript Create(string token, BuildingScript buildingScript)
        {
            buildingScript.id         = Guid.NewGuid().ToString();
            buildingScript.createTime = DateTime.Now;
            buildingScript.userId     = _SessionMgeSvr.Get(token).Name;
            _BuildingScriptDao.Insert(buildingScript);
            SaveJsFile(buildingScript);
            FavoriteScript script = new FavoriteScript();

            script.id       = Guid.NewGuid().ToString();
            script.addTime  = DateTime.Now;
            script.scriptId = buildingScript.id;
            script.userId   = _SessionMgeSvr.Get(token).Name;
            _FavoriteScriptDao.Insert(script);
            return(buildingScript);
        }
Beispiel #5
0
        public bool CheckLogin(string token)
        {
            var res = _SessionMgeSvr.Get(token);

            return(!string.IsNullOrEmpty(res.Token));
        }