package com.ruoyi.web.modules.account.support;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.web.modules.mall.facade.IMallConfigFacade;

/**
 * 会员头像解析（空则回退商城默认头像）
 */
@Component
public class MemberAvatarSupport
{
    @Autowired
    private IMallConfigFacade mallConfigFacade;

    public String resolve(String avatar)
    {
        if (StringUtils.isNotEmpty(avatar))
        {
            return avatar;
        }
        return mallConfigFacade.getDefaultAvatarUrl();
    }
}
