當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript guid.raw函數代碼示例

本文整理匯總了TypeScript中guid.raw函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript raw函數的具體用法?TypeScript raw怎麽用?TypeScript raw使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了raw函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

                bcrypt.hash(password, 8, function(err, hash) {
                    if(!err) {
                        var request = new Request(
                            '[dbo].[CreateNewUser]',
                            function(err, rowCount) {
                                console.log('RC: ' + rowCount)
                                if (err) {
                                    console.log(err);
                                    res.status(500).send();
                                }
                                else {
                                    connection.close();
                                    res.status(200).send();
                                }
                            }
                        )

                        request.addParameter('UserId', TYPES.NVarChar, username);
                        request.addParameter('Password', TYPES.NVarChar, hash);
                        request.addParameter('Depot', TYPES.NVarChar, depot);
                        request.addParameter('CreatedOn', TYPES.DateTime, new Date());
                        request.addParameter('ApiKey', TYPES.NVarChar, Guid.raw());
                        request.addParameter('ServerKey', TYPES.NVarChar, Guid.raw());
                        request.addParameter('CreateUsers', TYPES.Bit, createUsers)

                        connection.callProcedure(request);
                    }
                });
開發者ID:MattGauler,項目名稱:support-portal-uat,代碼行數:28,代碼來源:createUser.ts

示例2: return

        _.each(data, d => {


            var master_obj = _.find(this.entityManager.getEntities('specsdim'), dim => {
                return _.result(dim, 'specsdim_title') === d.master
            });


            if (master_obj === undefined) {

                master_obj = this.entityManager.createEntity('specsdim', {
                    id: guid.raw(),
                    specsdim_title: d.master,
                    specsdim_display: d.display
                });
            }


            if (d.dim != null && d.dim != undefined) {

                var dim_obj = _.find(this.entityManager.getEntities('specsdim'), dim => {
                    return (_.result(dim, 'specsdim_title') === d.dim)
                        && (_.result(master_obj, 'specsdim_title') === d.master);
                });

                if (dim_obj === undefined) {

                    dim_obj = this.entityManager.createEntity('specsdim', {
                        id: guid.raw(),
                        specsdim_title: d.dim,
                        specsdim_display: d.display,
                        specsdim_parentid: _.result(master_obj, 'id')
                    });
                }
            }            
        });
開發者ID:afriknet,項目名稱:umarket,代碼行數:36,代碼來源:specsdim_srv.ts

示例3: insert_cat

    insert_cat(name: string, parentid?: string, subs?: string[]) {

        var e = this.entityManager.createEntity('itemcats', {
            id: guid.raw(),
            catname: name,
            parentid: parentid,
            isdemo: 1
        });

        if (subs) {

            _.each(Object.keys(subs), s => {
                this.insert_cat(s, _.result(e, 'id') as any);
            });            
        }        
    }
開發者ID:afriknet,項目名稱:umarket,代碼行數:16,代碼來源:itemcats_srv.ts

示例4: generateDeviceSupportRequest

    generateDeviceSupportRequest(topic:string, subscription:string, supportMessageContent:any): any{
        var base = this.generateBaseMessage(topic);
        var customProperties = base;
        customProperties.content = supportMessageContent;
        customProperties.content.id = Guid.raw();
        customProperties.content.messageDate = moment().toDate();
        
        customProperties.target = subscription;
        customProperties.topic = topic;
        customProperties.channel = 'driverapp';
        
        var message = {
            body: JSON.stringify(customProperties),
            customProperties: customProperties
        };

        return message;
    }
開發者ID:MattGauler,項目名稱:support-portal-uat,代碼行數:18,代碼來源:messageManager.ts

示例5: generateBaseMessage

    generateBaseMessage(p_channel?:string): any {
        
        /*
        
        {
            "id": "c56bcaff-8e00-446c-8755-9c477b742db7", 
            "channel": "t-notifyshamrock-0", 
            "subchannel": "1234",
            "expiry": 1457607834463, 
            "date": 1457604234466,
            "notification": "", 
            "provider": "", 
            "content": {
                "@class": "ConnectivityRequest", 
                "data": {
                    "requestExpiry": 1457604299655
                }, 
                "driverId": "53224eb8-ce59-42a8-9391-e35d7a5b9eb5", 
                "id": "cff50718-c3eb-f2ed-45bc-fe662fd102f8", 
                "messageDate": "2016-03-10T10:03:19+00:00", 
                "subscriptionToken": "5-20501-6a996228-d73b-1add-baad-8c04bf8cbccb"
            }             
        }
        */
        
        var channel = p_channel || 't-notifyshamrock-0';
        
        var message = {
            id: Guid.raw(),
            channel: channel ,
            subchannel: '1234',
            expiry: moment().add(1,'m').valueOf(),
            date: moment().valueOf(),
            notification: '', 
            provider: '', 
            content: {
                '@class': ''
            }
        };

        return message;
    }
開發者ID:MattGauler,項目名稱:support-portal-uat,代碼行數:42,代碼來源:messageManager.ts

示例6: sendInstructionToDevice

    function sendInstructionToDevice() {
        var customProperties = {
            id: Guid.raw(),
            channel: deviceUserId.toString(),
            subchannel: '1',
            expiry: 0,
            date: 131007203230000000,
            content: {
                type: instructionType,
                requester: userId,
                instructionValues: instructionValues
            }
        };

        var message = {
            body: JSON.stringify(customProperties),
            customProperties: customProperties
        };

        managers.commsManager.commsWorker.sendAndCreateQueue(message);
    }
開發者ID:MattGauler,項目名稱:support-portal-uat,代碼行數:21,代碼來源:instruction.ts

示例7: function

router.post('/', function(req, res, next) {
    var managers = new Managers.Managers();

    var customProperties = {
        id: Guid.raw(),
        channel: '899991',
        subchannel: '1',
        expiry: 0,
        date: 131007203230000000,
        content: {
            test: 'test'
        }
    };

    var message = {
        body: JSON.stringify(customProperties),
        customProperties: customProperties
    };

    managers.commsManager.commsWorker.sendAndCreateQueue(message);

    res.send('success');
});
開發者ID:MattGauler,項目名稱:support-portal-uat,代碼行數:23,代碼來源:sendMessageTest.ts

示例8: generateConnectionRequest

    generateConnectionRequest(topic:string, subToken:string,driverId:string): any{
        var base = this.generateBaseMessage();
        var customProperties = base;
        var content = {
            "@class": "ConnectivityRequest", 
            data: {
                "requestExpiry": moment().add(1,'m').valueOf()
            }, 
            driverId: driverId, 
            id: Guid.raw(), 
            messageDate: moment().toDate(), 
            subscriptionToken: subToken
        }
        customProperties.content = content;
        customProperties.topic = topic;
        customProperties.channel = 'driverapp';
        
        var message = {
            body: JSON.stringify(customProperties),
            customProperties: customProperties
        };

        return message;
    }
開發者ID:MattGauler,項目名稱:support-portal-uat,代碼行數:24,代碼來源:messageManager.ts


注:本文中的guid.raw函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。