package com.xunhong.erp.turbo.rbac.infrastructure.convert;

import com.xunhong.erp.turbo.rbac.domain.entity.Role;
import com.xunhong.erp.turbo.rbac.domain.entity.UserRole;
import com.xunhong.erp.turbo.rbac.infrastructure.entity.RoleDO;
import com.xunhong.erp.turbo.rbac.infrastructure.entity.UserRoleDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;

@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface UserRoleConvert {
	@Mapping(target = "role", source = "userRoleDO.roleDO")
	UserRole toUserRole(UserRoleDO userRoleDO);

	@SuppressWarnings("unused")
	Role toRole(RoleDO roleDO);
}
