package com.lutao.cloud.oil.service.impl;

import com.lutao.cloud.common.core.util.MessageInfo;
import com.lutao.cloud.oil.mapper.PlatformInfoMapper;
import com.lutao.cloud.oil.pojo.vo.AppInfoVO;
import com.lutao.cloud.oil.pojo.vo.PlatformInfoVO;
import com.lutao.cloud.oil.service.IBusinessPlatformInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class BusinessPlatformInfoServiceImpl implements IBusinessPlatformInfoService {

    @Resource
    private PlatformInfoMapper platformInfoMapper;

    @Override
    public MessageInfo<List<PlatformInfoVO>> searchPlatformList(String platformName) {

        List<PlatformInfoVO> platformInfoVOS = platformInfoMapper.selectByPlatformNameList(platformName);

        return MessageInfo.ok(platformInfoVOS);
    }

    @Override
    public MessageInfo<List<AppInfoVO>> appInfoList() {
        return MessageInfo.ok(platformInfoMapper.selectAppInfo());
    }

    @Override
    public MessageInfo<List<PlatformInfoVO>> platformList(String appId) {
        List<PlatformInfoVO> platformInfoVOS = platformInfoMapper.selectByAppId(appId);
        return MessageInfo.ok(platformInfoVOS);
    }
}
