POST
/goodsChannel/addGoodsChannel管理后台商品渠道-新增
商品与履约 / 渠道
基本信息
- 接口状态前端在用
- 接口URLPOST
https://dscp-dev.hn12301.net/manage-api/goodsChannel/addGoodsChannel - 请求方式
POST - Content-Type
application/json - 暴露渠道管理后台 前缀
/manage-api - 名称来源源码注释
- 调用方已确认在用 · 管理后台(1 个前端)
- 需求上下文
- 维护人 / 最后改动AsiQue 2023-12-12
- 读写数据表
goods_channel、goods_channel_extend反查该表全部接口 → - 控制器
com.jxxx.dscp.api.controller.goods.GoodsChannelController#addGoodsChannel - 源码位置
jxxx-dscp/dscp-service-business/src/main/java/com/jxxx/dscp/api/controller/goods/GoodsChannelController.java:142 - 判定依据
请求参数
Header 请求参数
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
|---|---|---|---|---|
| 无(渠道统一鉴权头见《认证方式》) | ||||
Query 请求参数
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
|---|---|---|---|---|
| 无 | ||||
路径参数及说明
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
|---|---|---|---|---|
| 无 | ||||
Body 请求参数
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
|---|---|---|---|---|
| goodsChannelName | … | 是 | String | 商品渠道名称 → goods_channel.goods_channel_name |
| goodsId | … | 是 | Long | 关联商品id → goods_channel.goods_id |
| skuId | … | 是 | Long | 关联skuId → goods_channel.sku_id |
| channelShopId | … | 是 | Long | 渠道商铺id → goods_channel.channel_shop_id |
| maxSalesPrice | … | 是 | Integer | 最大销售价格 → goods_channel.max_sales_price |
| minSalesPrice | … | 是 | Integer | 最小销售价格/分 → goods_channel.min_sales_price |
| stock | … | 是 | Integer | 初始库存 → goods_channel.stock |
| introduction | … | 否 | String | 资源说明 → goods_channel.introduction |
| remark | … | 否 | String | 备注 → goods_channel.remark |
| goodsChannelExtendList | … | 是 | List<GoodsChannelExtendAddRequest> | 供货价设置列表 |
| goodsChannelId | … | 是 | Long | 商品渠道id(关联goods_channel表id) → goods_channel_extend.goods_channel_id |
| minSalesCount | … | 是 | Integer | 最小销量 → goods_channel_extend.min_sales_count |
| maxSalesCount | … | 是 | Integer | 最大销量 → goods_channel_extend.max_sales_count |
| supplyPrice | … | 是 | Integer | 供货价格/分 → goods_channel_extend.supply_price |
认证方式
响应参数
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
|---|---|---|---|---|
| void —— 不返回业务数据(外层包装见全局公共参数) | ||||
响应示例
成功响应示例
{"errcode":0,"errmsg":""}附录 · 实现细节
调用链 / 数据表 / 调用点证据 / 源码注释 / 逻辑摘要
涉及数据表:goods_channel、goods_channel_extend 反查全部引用接口 →
- GoodsChannelController#addGoodsChannel
- GoodsChannelService#mustGet(GoodsChannelServiceImpl)
- GoodsChannelMapper#mustGet
- GoodsChannelExtendService#addList(GoodsChannelExtendServiceImpl)
- GoodsChannelExtendMapper#addList
- BeanUtils.map → GoodsChannel ⇒ 表 goods_channel
- BeanUtils.map → GoodsChannelExtend ⇒ 表 goods_channel_extend
其它依赖:ChaosTransactionTemplate.execute
逻辑摘要:调用 execute(newTransactionTemplate.execute);调用 mustGet(goodsChannelService.mustGet);新增(goodsChannelService.add);入参与返回值经 BeanUtils 做对象/分页映射
操作日志:goods / 新增商品渠道
源码内联注释(旧站解析结果)
- 查询商品信息
- 查询商品sku信息
- 查询渠道商铺
- 新增商品渠道
- 新增商品供货区间
- 回滚事务
- 处理异常
旧站环境备注:pro:(仓库 .env.pro 指向 uat;生产域名未确认,此处沿用 uat 主机示意)
调用点证据
dscp-html-manage/src/api/goods/channel/index.ts:15管理后台 · request