liyong
8 天以前 be153de6203cf3c1f3b8bb3a38d8d23baea797fb
yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/api/category/MdmItemCategoryApiImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
package cn.iocoder.yudao.module.mdm.api.category;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.mdm.api.category.dto.MdmItemCategoryRespDTO;
import cn.iocoder.yudao.module.mdm.dal.dataobject.category.MdmItemCategoryDO;
import cn.iocoder.yudao.module.mdm.service.category.MdmItemCategoryService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
 * MDM ç‰©æ–™åˆ†ç±» API å®žçŽ°ç±»
 *
 * @author èŠ‹é“æºç 
 */
@RestController
@RequestMapping(MdmItemCategoryApi.PREFIX)
@Validated
public class MdmItemCategoryApiImpl implements MdmItemCategoryApi {
    @Resource
    private MdmItemCategoryService itemCategoryService;
    @Override
    public CommonResult<MdmItemCategoryRespDTO> getItemCategory(Long id) {
        MdmItemCategoryDO itemCategory = itemCategoryService.getItemCategory(id);
        return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class));
    }
    @Override
    public CommonResult<List<MdmItemCategoryRespDTO>> getItemCategoryList(Collection<Long> ids) {
        List<MdmItemCategoryDO> list = itemCategoryService.getItemCategoryList(ids);
        return success(BeanUtils.toBean(list, MdmItemCategoryRespDTO.class));
    }
    @Override
    public CommonResult<MdmItemCategoryRespDTO> validateItemCategoryExists(Long id) {
        MdmItemCategoryDO itemCategory = itemCategoryService.validateItemCategoryExists(id);
        return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class));
    }
}