npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gopalroy/biz-testdrive

v1.0.5

Published

The test drive business logic

Downloads

2

Readme

英卡试乘试驾业务

TestDrive

试乘试驾

TestDrive.FromJson(src)

从一个JSON对象创建一个TestDrive对象 src: 一个JSON对象,包含一组TestDrive的属性 return: 新创建的TestDrive对象

var bizTestDrive = require('@gopalroy/biz-testDrive');
var testDriveNew = bizTestDrive.TestDrive.FromJson({
   { name: 'testdrive', short_name: 'td' }
});

TestDrive.FromIdG*(id)

Generator方法.从id生成一个对应的TestDrive对象 id: 组织的id. return: TestDrive对象

var co = require('co');
co(function*(){
    var bizTestDrive = require('@gopalroy/biz-testDrive');
    var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
}).catch(console.error);

TestDrive.prototype.getAllTestDrivingG*(filter, sortBy,pageSize, nextMarker)

Generator方法.获取所有的TestDrive对象. filter: 过滤条件, 如{ name: /s/i }, 代表返回所有name包含s(不区分大小写) 如果过滤条件里是一个正则表达式,那么把属性转换为字符串,做字符串匹配; 如果过滤条件里不是正则表达式,那么直接比较值是否相等匹配. pageSize: 可选.分页大小,默认不分页,返回全部. nextMarker: 可选.填入上下页返回的第一个testDriving.id, 默认不填表示从第1页开始返回. sortBy: 可选.排序属性,默认按id升序.如name-表示按name降序, id+或id表示按id升序. return: { total: 34, testDriving: [] }. total,符合过滤条件的对象总数;testDriving,对象testDriving的数组

var co = require('co');
co(function*(){
    var bizTestDrive = require('@gopalroy/biz-testDrive');
    var total = yield bizTestDrive.TestDrive.getAllTestDrivingCountG({tdriveId:696});
    var orgAlls = yield bizTestDrive.TestDrive.getAllTestDrivingG({tdriveId:696},10,0,"id+");
     res.json({total:total.rowsCount,orgs:orgAlls});
}).catch(console.error);

TestDrive.prototype.getTestDrivingByIdG*(tdrivingId)

tdrivingId:试乘试驾信息的id

var co = require('co');
var bizTestDrive = require('@gopalroy/biz-testDrive');
co(function*(){
    var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
    var testDriving = yield testDrive.getTestDrivingByIdG(2);
}).catch(console.error);

TestDrive.prototype.addTestDrivingG(testDriving)

testDriving:添加的试乘试驾信息 return:添加后的试乘试驾信息

var co = require('co');
var bizTestDrive = require('@gopalroy/biz-testDrive');
co(function*(){
    var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
    var testDriveNew = bizTestDrive.TestDriving.FromJson({
        tdriveId:696,
        staffId:388,
        vehicleId:375,
        cust_name:'hao'+suffix,
        cust_license:'420117'+suffix,
        cust_sex:1,
        cust_phone:13888888888
    });
    testDriving = yield testDrive.addTestDrivingG(testDriveNew);
}).catch(console.error);

TestDrive.prototype.removeTestDrivingG(testDriving)

testDriving:要删除的试乘试驾信息

var co = require('co');
var bizTestDrive = require('@gopalroy/biz-testDrive');
co(function*(){
    var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
    var testDriveNew = bizTestDrive.TestDriving.FromIdG(5);
    yield testDrive.removeTestDrivingG(testDriveNew);
}).catch(console.error);

TestDrive.prototype.getAllTestDrivingReportG*(filter, sortBy,pageSize, nextMarker)

Generator方法.获取所有的TestDriveReport对象. filter: 过滤条件, 如{ name: /s/i }, 代表返回所有name包含s(不区分大小写) 如果过滤条件里是一个正则表达式,那么把属性转换为字符串,做字符串匹配; 如果过滤条件里不是正则表达式,那么直接比较值是否相等匹配. sortBy: 可选.排序属性,默认按id升序.如name-表示按name降序, id+或id表示按id升序. pageSize: 可选.分页大小,默认不分页,返回全部. nextMarker: 可选.填入上下页返回的第一个TestDrivingReport.id, 默认不填表示从第1页开始返回. return: { total: 34, TestDrivingReport: [] }. total,符合过滤条件的对象总数;TestDrivingReport,对象TestDrivingReport的数组

var co = require('co');
co(function*(){
    var bizTestDrive = require('@gopalroy/biz-testDrive');
    var total = yield bizTestDrive.TestDrive.getAllTestDrivingReportCountG({tdriveId:696});
    var orgAlls = yield bizTestDrive.TestDrive.getAllTestDrivingReportG({tdriveId:696},10,0,"id+");
     res.json({total:total.rowsCount,orgs:orgAlls});
}).catch(console.error);

TestDrive.prototype.getTestDrivingReportByIdG*(tdrivingId)

tdrivingId:试乘试驾报告的id

var co = require('co');
var bizTestDrive = require('@gopalroy/biz-testDrive');
co(function*(){
    var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
    var testDrivingReport = yield testDrive.getTestDrivingReportByIdG(2);
}).catch(console.error);

TestDrive.prototype.addTestDrivingReportG(testDrivingReport)

testDrivingReport:添加的试乘试驾报告 return:添加后的试乘试驾报告

var co = require('co');
var bizTestDrive = require('@gopalroy/biz-testDrive');
co(function*(){
   var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
   var testDriveNew = bizTestDrive.TestDrivingReport.FromJson({
       tdriveId:696,
       staffId:388,
       vehicleId:375,
       tripId:suffix,
       status:0,
       reportTime:new Date()
   });
   testDrivingReport = yield testDrive.addTestDrivingReportG(testDriveNew);
}).catch(console.error);

TestDrive.prototype.removeTestDrivingReportG(testDrivingReport)

testDrivingReport:要删除的试乘试驾报告

var co = require('co');
var bizTestDrive = require('@gopalroy/biz-testDrive');
co(function*(){
    var testDrive = yield bizTestDrive.TestDrive.FromIdG(696);
    var testDriveNew = bizTestDrive.TestDrivingReport.FromIdG(5);
    yield testDrive.removeTestDrivingReportG(testDriveNew);
}).catch(console.error);

TestDriving

试乘试驾信息

TestDriving.FromJson(src)

从一个JSON对象创建一个试驾对象

var bizTestDrive = require('@gopalroy/biz-testDrive');
var TestDriveNew = bizTestDrive.TestDriving.FromJson({
    tdriveId:696,
    staffId:388,
    vehicleId:375,
    cust_name:'hao'+suffix,
    cust_license:'420117'+suffix,
    cust_sex:1,
    cust_phone:13888888888
});

TestDriving.prototype.updateG*()

修改一条试乘试驾信息

var bizTestDrive = require('@gopalroy/biz-testDrive');
var TestDriveNew = bizTestDrive.TestDriving.FromJson({
    id:5,
    tdriveId:696,
    staffId:388,
    vehicleId:375,
    cust_name:'hao'+suffix,
    cust_license:'420117'+suffix,
    cust_sex:1,
    cust_phone:13888888888
});
 testDriving = yield testDriveNew.updateG();

TestDrivingReport

试乘试驾报告

TestDrivingReport.FromJson(src)

从一个JSON对象创建一个试驾报告对象

var bizTestDrive = require('@gopalroy/biz-testDrive');
var TestDriveNew = bizTestDrive.TestDrivingReport.FromJson({
    tdriveId:696,
    staffId:388,
    vehicleId:375,
    tripId:22,
    status:0,
    reportTime:new Date()
});

TestDrivingReport.prototype.updateG*()

修改一条试乘试驾报告

var bizTestDrive = require('@gopalroy/biz-testDrive');
var TestDriveNew = bizTestDrive.TestDrivingReport.FromJson({
    id:5,
    tdriveId:696,
    staffId:388,
    vehicleId:375,
    tripId:33,
    status:0,
    reportTime:new Date()
});
 testDrivingReport = yield testDriveNew.updateG();