package com.sptg.iot.biz.controller;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.iot.api.entity.IotAepProduct;
import com.sptg.iot.api.feigns.IotAepProductFeign;
import com.sptg.iot.biz.service.IotAepProductServiceInterface;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zwx
 * @create 2020/12/14 18:53
 */
@Slf4j
@RestController
@RequiredArgsConstructor
public class IotAepProductController implements IotAepProductFeign {

    private final IotAepProductServiceInterface iotAepProductServiceInterface;

    @Override
    @GetMapping(value = "/iot/aepProduct/list")
    public ResultBean<List<IotAepProduct>> getList() {
        ResultBean<List<IotAepProduct>> resultBean = this.iotAepProductServiceInterface.getList();
        return resultBean;
    }

    @Override
    @PostMapping(value = "/iot/aepProduct/sync")
    public ResultBean<String> syncAepProductList() {
        ResultBean<String> resultBean = this.iotAepProductServiceInterface.syncAepProductList();
        return resultBean;
    }
}
