package com.lutao.cloud.oil.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.lutao.cloud.common.core.util.MessageInfo;
import com.lutao.cloud.common.security.annotation.Inner;
import com.lutao.cloud.oil.pojo.vo.AppInfoVO;
import com.lutao.cloud.oil.pojo.vo.PlatformInfoVO;
import com.lutao.cloud.oil.service.IBusinessPlatformInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

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

@Api(value = "平台信息",tags = "平台信息")
@RestController
@RequestMapping("/platform-info")
public class PlatformInfoController {

    @Resource
    private IBusinessPlatformInfoService iBusinessPlatformInfoService;


    @ApiOperation(value = "油商列表")
    @ApiOperationSupport(order = 2)
    @PostMapping("/search-app")
    @Inner(value = false)
    public MessageInfo<List<AppInfoVO>> searchApp(){

        return iBusinessPlatformInfoService.appInfoList();
    }

    @ApiOperation(value = "根据油商获取平台")
    @ApiOperationSupport(order = 3)
    @PostMapping("/search-platform-by-app-id")
    @Inner(value = false)
    public MessageInfo<List<PlatformInfoVO>> searchPlatformByAppId(String appId){

        return iBusinessPlatformInfoService.platformList(appId);
    }
}
