package cn.iocoder.yudao.module.mdm.service.brand;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.module.mdm.controller.admin.brand.vo.MdmBrandPageReqVO;
|
import cn.iocoder.yudao.module.mdm.controller.admin.brand.vo.MdmBrandSaveReqVO;
|
import cn.iocoder.yudao.module.mdm.dal.dataobject.brand.MdmBrandDO;
|
import jakarta.validation.Valid;
|
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
|
/**
|
* MDM 品牌 Service 接口
|
*
|
* @author 芋道源码
|
*/
|
public interface MdmBrandService {
|
|
/**
|
* 创建品牌
|
*
|
* @param createReqVO 创建信息
|
* @return 编号
|
*/
|
Long createBrand(@Valid MdmBrandSaveReqVO createReqVO);
|
|
/**
|
* 更新品牌
|
*
|
* @param updateReqVO 更新信息
|
*/
|
void updateBrand(@Valid MdmBrandSaveReqVO updateReqVO);
|
|
/**
|
* 更新品牌状态
|
*
|
* @param id 编号
|
* @param status 状态
|
*/
|
void updateBrandStatus(Long id, Integer status);
|
|
/**
|
* 删除品牌
|
*
|
* @param id 编号
|
*/
|
void deleteBrand(Long id);
|
|
/**
|
* 获得品牌
|
*
|
* @param id 编号
|
* @return 品牌
|
*/
|
MdmBrandDO getBrand(Long id);
|
|
/**
|
* 校验品牌存在
|
*
|
* @param id 编号
|
* @return 品牌
|
*/
|
MdmBrandDO validateBrandExists(Long id);
|
|
/**
|
* 获得品牌分页
|
*
|
* @param pageReqVO 分页查询
|
* @return 品牌分页
|
*/
|
PageResult<MdmBrandDO> getBrandPage(MdmBrandPageReqVO pageReqVO);
|
|
/**
|
* 获得品牌列表
|
*
|
* @param ids 编号数组
|
* @return 品牌列表
|
*/
|
List<MdmBrandDO> getBrandList(Collection<Long> ids);
|
|
/**
|
* 获得品牌 Map
|
*
|
* @param ids 编号数组
|
* @return 品牌 Map
|
*/
|
default Map<Long, MdmBrandDO> getBrandMap(Collection<Long> ids) {
|
return convertMap(getBrandList(ids), MdmBrandDO::getId);
|
}
|
|
/**
|
* 根据编码获取品牌
|
*
|
* @param code 品牌编码
|
* @return 品牌
|
*/
|
MdmBrandDO getBrandByCode(String code);
|
|
}
|