DCI 的 註冊場景Context
我是用簡單的JS程式碼構建DCI的程式碼,希望各位和Banq大哥給與分析和指正。
/*----------註冊角色BEGIN-----------------*/
require("ext");
function RegerRole(user){
this.user = user;
Object.merge(this,user);
Object.merge(this,user.__proto__);
}
RegerRole.prototype.reg = function(callback){
userRepo.save(this.user);
callback(err);
}
/* ------------------ END -------------------- */
/*---------- 註冊場景 -----------------*/
function RegContext( loginname , password , confirm ){
this.loginname = loginname;
this.password = password;
this.confirm = confirm;
}
var o = RegContext.prototype;
o.interact = function(callback){
var user = userFactory.create({loginname:this.loginname,password:this.password});
var reger = new RegerRole(user,this.confirm);
reger.reg(callback) ;
}
/* ------------------ END -------------------- */
呼叫程式碼 >>
function callback(){ ... }
var cxt = new RegContext(...);
cxt.interact(callback);
/*----------註冊角色BEGIN-----------------*/
require("ext");
function RegerRole(user){
this.user = user;
Object.merge(this,user);
Object.merge(this,user.__proto__);
}
RegerRole.prototype.reg = function(callback){
userRepo.save(this.user);
callback(err);
}
/* ------------------ END -------------------- */
/*---------- 註冊場景 -----------------*/
function RegContext( loginname , password , confirm ){
this.loginname = loginname;
this.password = password;
this.confirm = confirm;
}
var o = RegContext.prototype;
o.interact = function(callback){
var user = userFactory.create({loginname:this.loginname,password:this.password});
var reger = new RegerRole(user,this.confirm);
reger.reg(callback) ;
}
/* ------------------ END -------------------- */
呼叫程式碼 >>
function callback(){ ... }
var cxt = new RegContext(...);
cxt.interact(callback);
相關文章
- Context的典型使用場景Context
- iris 路由註冊和上下文context路由Context
- vue 動態註冊路由 require.contextVue路由UIContext
- AppGallery Connect場景化開發實戰—註冊訂閱通知APP
- SpringMVC 中 @ControllerAdvice 註解的三種使用場景!SpringMVCController
- @Transactional 註解下,事務失效的多種場景
- 語音標註的具體應用場景
- MyBatis 中 @Param 註解的四種使用場景MyBatis
- oracle的靜態註冊和動態註冊Oracle
- Java 自定義註解及使用場景Java
- 【SpringBoot】服務對註冊中心的註冊時機Spring Boot
- 動態註冊和靜態註冊
- springboot註冊Spring Boot
- js 註冊事件的兩種方式詳解,傳統註冊事件與方法監聽註冊事件(addEventListener)JS事件dev
- 用 10 分鐘瞭解 Go 語言 context package 使用場景及介紹GoContextPackage
- npm註冊源的配置NPM
- Dubbo系列之 (二)Registry註冊中心-註冊(1)
- Dubbo系列之 (二)Registry註冊中心-註冊(2)
- 註冊中心 Eureka 原始碼解析 —— 應用例項註冊發現(一)之註冊原始碼
- 智慧醫療的主要應用場景和資料標註的關係 | 景聯文科技
- gRPC 註冊中心,常用的註冊中心你懂了?AP 還是 CP (七)RPC
- 3D點雲資料的標註方法和應用場景 | 景聯文科技3D
- 助力AI技術場景化落地 | 資料標註AI
- 存在多個不同註冊中心的時候,如何平滑的統一註冊中心?
- VMware註冊碼
- winform註冊功能ORM
- Eureka註冊中心
- 註冊中心-consul
- IJCNN註冊流程CNN
- PhpStorm註冊碼PHPORM
- PHP註冊功能PHP
- 註冊中心consul
- Spring元件註冊Spring元件
- 實現類的註冊方法
- GoDaddy註冊域名的優勢Go
- 我對註冊中心的理解
- IMS註冊流程的解讀
- 【SpringCloud】consul註冊中心註冊的服務為內網(區域網)IPSpringGCCloud內網
- ChatGPT最詳細註冊教程+不註冊直接使用教程ChatGPT