mapProductManagerListUpgradeGoodsSimpleResponse.js
1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* eslint-disable jsdoc/require-property-description, jsdoc/require-returns-description */
/**
* @typedef {Object} ProductManagerListUpgradeGoodsSimpleParams
* @property {number} currentPage [optional] - 当前页码
* @property {number} pageSize [optional] - 每页条数
* @property {string} commodityCode [optional] - UID(产品编码,模糊查询)对应commodity_code
* @property {string} productType [optional] - 产品类型 1-轻改 2-权益、延保
*/
/**
* @typedef {Object} ProductManagerListUpgradeGoodsSimpleRow
* @property {string} errId - 错误码
* @property {string} data - 成功返回数据
*/
/**
* @typedef {Object} ProductManagerListUpgradeGoodsSimplePageResponse
* @property {number} [pageNum]
* @property {number} [pageSize]
* @property {number} [total]
* @property {ProductManagerListUpgradeGoodsSimpleRow[]} [list]
*/
/**
* dj.api.smartcarlife.productManager.listUpgradeGoodsSimple 响应 → 页面数据
* @param {ProductManagerListUpgradeGoodsSimpleRow} [row]
* @returns {ProductManagerListUpgradeGoodsSimpleRow}
* @see __contracts__/dj_api_smartcarlife_productManager_listUpgradeGoodsSimple.contract.md
*/
export function mapProductManagerListUpgradeGoodsSimpleRow(row = {}) {
return { ...row };
}
/**
* @param {ProductManagerListUpgradeGoodsSimplePageResponse} [res]
* @returns {ProductManagerListUpgradeGoodsSimplePageResponse}
*/
export function mapProductManagerListUpgradeGoodsSimplePageResponse(res = {}) {
const list = Array.isArray(res.list) ? res.list.map(mapProductManagerListUpgradeGoodsSimpleRow) : [];
return {
...res,
list,
pageNum: res.pageNum ?? res.currentPage,
};
}
export default mapProductManagerListUpgradeGoodsSimpleRow;