当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript bearcat.getBean函数代码示例

本文整理汇总了TypeScript中bearcat.getBean函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getBean函数的具体用法?TypeScript getBean怎么用?TypeScript getBean使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getBean函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

var ContentService=function () {
    let dataBaseConnect=Bearcat.getBean('dataBaseConnect');
    let db=dataBaseConnect.createConnection();
    let ContentSchema=Bearcat.getBean('ContentSchema');
    let BlogCateSchema=Bearcat.getBean('BlogCateSchema');
    this.ContentMongo= ContentSchema.createConnection(db);
    this.BlogCateMongo= BlogCateSchema.createConnection(db);
}
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:8,代码来源:ContentService.ts

示例2:

 Bearcat.start(function(){
     //var car = Bearcat.getBean('car'); // get bean 示例
     // console.log(bearcat.getModel('car'));
     //car.run(); // call the method
     var dataBaseConnects=Bearcat.getBean('dataBaseConnect');
     dataBaseConnects.connect();
     var UserSchema=Bearcat.getBean('UserSchema');
     UserSchema.connect();
 });
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:9,代码来源:bearcatConfig.ts

示例3: UserInfo

router.get('/bearcat', (req:express.Request, res:express.Response)=> {
    var car = Bearcat.getBean('car'); // get bean
    var car1=Bearcat.getBean('car');

    car.run();
    var info=new UserInfo();
   // info.UserId=1;
    info.QQ='123456';
    info.CreateDate=new Date().toDateString();
    var UserInfoServer=Bearcat.getBean('UserInfoService');
    UserInfoServer.InsertUser(info);
    console.log(new Date().toDateString());
    res.send(car===car1);
   // res.sendFile(path.join(baseDir, compilePath + '.html'));
});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:15,代码来源:bearcat.ts

示例4: response

router.get('/blog/deleteCate',(req:express.Request,res:express.Response)=>{
    let id=req.query['id']||'';
    var BlogCateService=Bearcat.getBean('BlogCateService');
    BlogCateService.DeleteBlogCate(id).then((result)=>{
        response(res,result);
    })
})
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:7,代码来源:blogControl.ts

示例5: keyMemberCK

router.post('/login',(req:express.Request,res:express.Response)=>{
    var UserInfoServer=Bearcat.getBean('UserInfoService');
    let userName=req.body.UserName;
    let passWord=req.body.UserPassWord;
    let code=req.body.Code;
    let cookieCode=getCookie(ValidateCodeKey,req);
    UserInfoServer.userLogin(userName,passWord,code,cookieCode).then((result)=>{
        var m=JSON.parse(result);
        if(m.State===1){
            let options={
                UserName:userName,
                UserPassWord:passWord
            };
            var option= keyMemberCK().encrypt(JSON.stringify(options),'base64');
            //console.log(key.decrypt(option,'utf-8'));
            m.Result={Message:m.Result,MemberCK:encodeURIComponent(option)};

            setCookie('MemberCK',encodeURIComponent(option),res,{expires:15,path:'/'});
        }

        res.writeHead(200, {'Content-Type': 'application/json','Access-Control-Allow-Credentials':true});
        res.end(JSON.stringify(m));
        return;
    });
});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:25,代码来源:login.ts

示例6:

router.post('/blog/editCate',(req:express.Request,res:express.Response)=>{
    let id=req.body.id;
    let cateName=req.body.cateName;
    var BlogCateService=Bearcat.getBean('BlogCateService');
    BlogCateService.UpdateBlogCate(cateName,id).then((result)=>{
        console.log(result)
        res.writeHead(200, {'Content-Type': 'application/json'});
        // res.end(JSON.stringify(result));
        //console.log(result)
        res.end(result);
        return;
    },(error)=>{
    })
});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:14,代码来源:blogControl.ts

示例7: BlogCateFiledEntity

router.get('/blog/GetPageCateList',(req:express.Request,res:express.Response)=>{
    let page=req.query['page']||1;
    var filedInfo=new BlogCateFiledEntity();
    filedInfo.CateCode.isShow=false;
    filedInfo.UpdateDate.isShow=false;
    let fileds=BlogCateFiledEntity.getFileds(filedInfo);
    var BlogCateService=Bearcat.getBean('BlogCateService');
    let pageSize=4;
    BlogCateService.GetPageCateList(page,pageSize,fileds).then((result)=>{
        response(res,result);
    })


});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:14,代码来源:blogControl.ts

示例8: ContentFiledEntity

router.get('/blog/GetContentPageList',(req:express.Request,res:express.Response)=>{
    let page=req.query['page']||1;
    var filedInfo=new ContentFiledEntity();
    filedInfo.Content.isShow=false;
    filedInfo.UpdateDate.isShow=false;
    filedInfo.Summary.isShow=false;
   // filedInfo.CateId.isShow=false;
    let fileds=ContentFiledEntity.getFileds(filedInfo);
    var ContentService=Bearcat.getBean('ContentService');
    let pageSize=4;
    ContentService.GetContentPageList(page,pageSize,fileds).then((result)=>{
        response(res,result);
    })
    
});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:15,代码来源:blogControl.ts

示例9: BlogCateEntity

router.post('/blog/addCate', (req:express.Request, res:express.Response)=> {
    let blogInfo=new BlogCateEntity();
    blogInfo.CateCode=generateUUID();
    blogInfo.CateName=req.body.CateName;
    blogInfo.CreateDate=new Date().toDateString();
    blogInfo.UpdateDate=new Date().toDateString();
    blogInfo.IsDelete=DeleteEnum.NotDel;
    var BlogCateService=Bearcat.getBean('BlogCateService');
    BlogCateService.InsertBlogCate(blogInfo).then((result)=>{
        res.writeHead(200, {'Content-Type': 'application/json'});
        // res.end(JSON.stringify(result));
        //console.log(result)
        res.end(result);
        return;
    });
});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:16,代码来源:blogControl.ts

示例10: UserInfo

router.post('/registTest', (req:express.Request, res:express.Response)=> {

    var info=new UserInfo();
    // info.UserId=1;
    info.TrueName=req.body.TrueName;
    info.Email=req.body.Email;
    info.IsDelete=0;
    info.Mobile=req.body.Mobile;
    info.UserName=req.body.UserName;
    info.UserPassword=req.body.UserPassword;
    info.CreateDate=new Date().toDateString();
    var UserInfoServer=Bearcat.getBean('UserInfoService');
    // UserInfoServer.InsertUser(info);
    console.log(req.body)
    // console.log(url.parse('http://www.mgenware.com/a/b/c'))
    res.writeHead(200, {'Content-Type': 'application/json'});
    res.end(JSON.stringify("1"));
});
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:18,代码来源:registTest.ts


注:本文中的bearcat.getBean函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。