關於新客服的ngbusi三層調用方式
1.ngbusi調用ngbusiControl
nugbusi層:
(1)寫一個action.java
OutputObject object = super.getOutputObject();//得到control.xml中的service和method放入到inputObject
super.sendJson(super.convertOutputObject2Json(object));
super.getOutputObject()的源代碼如下:
public InputObject getInputObject() {
inputObject = (InputObject) ServletActionContext.getContext().get(ControlConstants.INPUTOBJECT);
return inputObject;
}
(2)在spring-action.xml中進行bean的配置
<bean id="scansionCodeInfoAction" class="com.cmos.ngbusi.action.customization.ScansionCodeInfoAction" parent="baseAction" scope="prototype"/>
(3)control.xml中配置前臺調用的uid
<action path="/front/sh/scansionCodeInfoAction!execute">
<input uid="s001" service="scansionCodeInfoService" method="queryScansionCodeInfo" desc="互聯網二維碼掃描新增接口查詢" >// 這裏的service指的是ngbusiControl層中spring.xml中配置的bean id,
<parameter key="limit" toKey="limit" />
<parameter key="page" toKey="page" />
</input>
<input uid="s002" service="scansionCodeInfoService" method="insertScansionCodeInfo" desc="互聯網二維碼掃描新增接口新增" >
</input>
<input uid="s003" service="scansionCodeInfoService" method="updateScansionCodeInfo" desc="互聯網二維碼掃描新增接口更新" >
</input>
</action>
(4)在struts-share.xml中配置action
<!-- 互聯網二維碼掃描 -->
<action name="scansionCodeInfoAction!*" class="scansionCodeInfoAction" method="{1}" />
ngbusiControl層:
(1)spring-all.xml中配置bean
(2)寫一個interface和impl
2.ngbusiControl層調用ngbusicore層
ngbusiControl層:
(1)在impl中直接調用
inputObject.setService("scansionCodeInfoService");
inputObject.setMethod("queryScansionCodeInfo");
BaseServiceImpl.getNgbusiRemoteSV().execute(inputObject, outputObject);
ngbusicore層:
(1)spring-services.xml中配置bean
(2)寫service層
3.ngcrmpfcore層調用ngbusiControl層
ngcrmpfcore層:
(1)寫一個platform類
CsfResponse csfResponse =CsfServiceCaller.call("NGBUSI_JX_SCANSIONCODEINFO_POST", mapParams);//直接連調用
(2)spring-platform-servicces.xml中配置bean
(3)(老版本)csf-develope.xml中配置Item
(新版本)在csf.propertites中配置送
ngbusiControl層:
(1)control.xml中配置暴露給ngcrmpfcore層的action
(2)spring-services.xml中配置bean
(3)寫service層
關於新客服的ngbusi三層調用方式