MuleSoft ESB介绍
1.maven+jdk+postman
2.anypoint statdio 下载安装
下载 Anypoint Studio & Mule |骡子软件 (mulesoft.com)
填好基本信息后,会发邮件,在邮件中下载,跳到官网下载
3注册账号 Download Anypoint Studio & Mule | MuleSoft
4.Connectors | MuleSoft Documentation![](https://img-blog.csdnimg.cn/direct/d047adc19bf84dcba1dface26169ee7e.png)
5.界面介绍
https://www.cnblogs.com/luqinghua/p/12790525.html
6数据格式转换
json转dw
%dw 2.0
output application/dw
---
payload
json 数据格式重新映射
%dw 2.0
output application/json
---
{
"iddddii":payload.total,
"nameeee":payload.msg
}
json 转 person 标签下的 xml
%dw 2.0
output application/xml
---
{
person:payload
}
结果:
<?xml version='1.0' encoding='UTF-8'?>
<person>
<total>1</total>
<rows>
<searchValue/>
<createBy>admin</createBy>
<createTime>2024-01-26 10:01:37</createTime>
<updateBy/>
<updateTime/>
<remark/>
<params/>
<followId>4694</followId>
<researchId>681</researchId>
<followStartDate/>
<followEndDate/>
<followInterval>0</followInterval>
<followIntervalUnit>1</followIntervalUnit>
<followFrequency>1</followFrequency>
<followTotal/>
<followNum>0</followNum>
<followName>注册登记</followName>
<templateName/>
<positionType/>
<hasUnstructuredAttr/>
<fmedicalForms>
<searchValue/>
<createBy/>
<createTime/>
<updateBy/>
<updateTime/>
<remark/>
<params/>
<medicalFormId>51676</medicalFormId>
<medicalCode>baseRegiter</medicalCode>
<medicalName>基本信息</medicalName>
<parentId>0</parentId>
<openImage>0</openImage>
<openProperty>0</openProperty>
<openMultiple/>
<attribute>{
"layout": "rowFormItem",
"isShowDom": true,
"tagIcon": "row",
"labelType": "form",
"isShowSubTitle": false,
"subTitle": "",
"justify": "start",
"align": "top",
"formCode": "baseRegiter",
"formName": "基础信息",
"isPCDoctorShow": true,
"isDoctorShow": true,
"isPatientShow": true,
"formType": "1"
}</attribute>
<formType>0</formType>
<followId>4694</followId>
<medicalFormList/>
<medicalProperties/>
<baseFormId/>
<articleId/>
<formSource>1</formSource>
<dynamic>0</dynamic>
<patientRecordFiles/>
<subjectList/>
<propertyNum>27</propertyNum>
<edcNum>0</edcNum>
<lockFlag/>
<openCollapse>0</openCollapse>
<sortNum>1</sortNum>
<positionType>1</positionType>
<isDoctorShow>true</isDoctorShow>
<isPatientShow>false</isPatientShow>
<isPCDoctorShow>true</isPCDoctorShow>
<scoresTotalVal/>
<projectName/>
</fmedicalForms>
<fmedicalForms>
<searchValue/>
<createBy/>
<createTime>2024-01-26 10:01:57</createTime>
<updateBy/>
<updateTime/>
<remark/>
<params/>
<medicalFormId>51682</medicalFormId>
<medicalCode>modelegites</medicalCode>
<medicalName>多选</medicalName>
<parentId>0</parentId>
<openImage>0</openImage>
<openProperty>0</openProperty>
<openMultiple/>
<attribute>{"layout":"rowFormItem","isShowDom":true,"tagIcon":"row","labelType":"form","type":"flex","isShowSubTitle":false,"subTitle":"","justify":"start","align":"top","formCode":"modelegites","formName":"多选","isPCDoctorShow":true,"isDoctorShow":true,"isPatientShow":true,"formType":0}</attribute>
<formType>0</formType>
<followId>4694</followId>
<medicalFormList/>
<medicalProperties/>
<baseFormId/>
<articleId/>
<formSource>1</formSource>
<dynamic>0</dynamic>
<patientRecordFiles/>
<subjectList/>
<propertyNum>1</propertyNum>
<edcNum>0</edcNum>
<lockFlag/>
<openCollapse>0</openCollapse>
<sortNum>1</sortNum>
<positionType>1</positionType>
<isDoctorShow>true</isDoctorShow>
<isPatientShow>true</isPatientShow>
<isPCDoctorShow>true</isPCDoctorShow>
<scoresTotalVal/>
<projectName/>
</fmedicalForms>
</rows>
<code>200</code>
<msg>查询成功</msg>
<data/>
</person>
转换其中的一部分数据
%dw 2.0
output application/xml
---
{
person:{
code:payload.code,
msg:payload.msg
}
}
结果:
<?xml version='1.0' encoding='UTF-8'?>
<person>
<code>200</code>
<msg>查询成功</msg>
</person>