package com.wecloud.im.service.impl;

import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.mapper.ImApplicationMapper;
import com.wecloud.im.service.ImApplicationService;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.shiro.signature.Application;
import io.geekidea.springbootplus.framework.shiro.signature.ApplicationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author Future
 * @Date 2022/9/27 13:45
 * @Description 不在落库取，本地构造
 */
@Slf4j
@Service
public class ImApplicationServiceImpl extends BaseServiceImpl<ImApplicationMapper, ImApplication> implements ImApplicationService, ApplicationService {

    @Override
    public ImApplication getCacheById(Long id) {
        return this.getByLocal();
    }

    @Override
    public ImApplication getCacheAppByAppKey(String appKey) {
        return getByLocal();
    }

    @Override
    public ImApplication getByLocal() {
        ImApplication imApplication = new ImApplication();
        imApplication.setId(1L);
        imApplication.setAppKey("QizKVHcILRWp6Td2");
        imApplication.setAppSecret("287d04828099fb7de871e9dda845fa8b6b2302faf2ab3737");
        imApplication.setAppName("遇乐圈");
        imApplication.setIosPushChannel(1);
        imApplication.setAndroidPushChannel(1);
        imApplication.setUmengKey("62b43a6d88ccdf4b7ea76bfd");
        imApplication.setUmengSecret("ekcdlz2jivhddwsva7i47pkhywk0tmrm");
        imApplication.setIosUmengKey("62b43ad388ccdf4b7ea76c2e");
        imApplication.setIosUmengSecret("1rokfrxpidqnm3nywm2wsrcmbfg0f1ln");
        imApplication.setRepeatSessionStatus(0);
        imApplication.setContrastExtendedFieldStatus(0);
        imApplication.setOnlineStatusSubscribeUrl("http://xiaohudou:8080/callback/clientOnlineStatusChange");
        imApplication.setFullMessageSubscribeUrl("http://xiaohudou:8080/message/sync");
        return imApplication;
    }

    @Override
    public Application getApplication(String appKey) {
        return getByLocal();
    }
}
