package com.jeequan.jeepay.member.service;

import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.ctrls.AbstractCtrl;
import com.jeequan.jeepay.member.config.SystemYmlConfig;
import com.jeequan.jeepay.service.impl.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Collections;

/**
 * 定义通用CommonService
 *
 * @author zx
 * @date 2023/4/8 17:09
 */
public abstract class CommonService extends AbstractCtrl {

    @Autowired
    protected SystemYmlConfig mainConfig;

    @Autowired
    protected PayInterfaceDefineService payInterfaceDefineService;

    @Autowired
    protected MchInfoService mchInfoService;

    @Autowired
    protected MchStoreService mchStoreService;

    @Autowired
    protected AgentInfoService agentInfoService;

    @Autowired
    protected SysConfigService sysConfigService;

    /**
     * 获取当前用户登录IP
     *
     * @return
     */
    protected String getIp() {
        return getClientIp();
    }

    /**
     * 会员头像地址默认值获取
     **/
    public String getMemberAvatarDefault() {
        Collections.shuffle(CS.MEMBER_AVATAR_ICON);
        return CS.MEMBER_AVATAR_ICON.get(0);
    }

}
