商品品牌架构文档
概述
- 品牌是由平台统一维护的
- 品牌和商品是通过分类进行关联的,也就是说,商品在发布时选择的品牌,必须要与选择的分类进行关联才会显示
数据结构图
数据库设计
品牌表
表名:es_brand
字段名 | 类型与长度 | 备注 |
---|---|---|
brand_id | bigint(20) | 主键ID |
name | varchar(50) | 名称 |
logo | varchar(255) | 图标 |
disabled | int(1) | 状态 0:已删除,1:正常 |
品牌与分类关联表
表名:es_category_brand
字段名 | 类型与长度 | 备注 |
---|---|---|
id | bigint(20) | 主键ID |
category_id | bigint(20) | 分类ID |
brand_id | bigint(20) | 品牌ID |
API规划
实体类参数可参考下方的类图展示
品牌维护
管理端:com.enation.app.javashop.api.manager.goods.BrandManagerController
请求方式 | API地址 | 参数说明 | 作用 |
---|---|---|---|
GET | https://{admin-api-domain}/admin/goods/brands | Long pageNo:分页页数;Long pageSize:每页数量;String name:品牌名称 | 查询品牌分页列表数据 |
POST | https://{admin-api-domain}/admin/goods/brands | BrandDO brand:品牌信息 | 新增品牌信息 |
PUT | https://{admin-api-domain}/admin/goods/brands/{id} | BrandDO brand:品牌信息,Long id:品牌主键ID | 修改品牌信息 |
GET | https://{admin-api-domain}/admin/goods/brands/{id} | Long id:品牌主键ID | 根据主键ID获取品牌信息 |
DELETE | https://{admin-api-domain}/admin/goods/brands/{ids} | Long[] ids:品牌主键ID集合 | 批量删除品牌数据 |
GET | https://{admin-api-domain}/admin/goods/brands/all | 无 | 查询所有品牌数据集合 |
品牌与分类关联
管理端:
com.enation.app.javashop.api.manager.goods.CategoryManagerController#getCatBrand
com.enation.app.javashop.api.manager.goods.CategoryManagerController#searchBrand
com.enation.app.javashop.api.manager.goods.CategoryManagerController#saveBrand
请求方式 | API地址 | 参数说明 | 作用 |
---|---|---|---|
GET | https://{admin-api-domain}/admin/goods/categories/{category_id}/brands/selected | Long categoryId:分类ID | 查询某个分类绑定的品牌数据集合 |
GET | https://{admin-api-domain}/admin/goods/categories/{category_id}/brands | Long categoryId:分类ID | 查询某个分类绑定的品牌数据集合(包括未绑定的品牌信息) |
PUT | https://{admin-api-domain}/admin/goods/categories/{category_id}/brands | Long categoryId:分类ID;Long[] chooseBrands:已选择绑定的品牌ID集合 | 分类绑定品牌 |
商家端:com.enation.app.javashop.api.seller.goods.CategorySellerController#queryBrands
请求方式 | API地址 | 参数说明 | 作用 |
---|---|---|---|
GET | https://{seller-api-domain}/seller/goods/category/{category_id}/brands | Long categoryId:分类ID | 查询某个分类绑定的品牌数据集合 |