package quant.rich.emoney.controller.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import lombok.extern.slf4j.Slf4j;
import quant.rich.emoney.controller.common.BaseController;
import quant.rich.emoney.entity.config.ChromeVersionsConfig;
import quant.rich.emoney.entity.config.DeviceInfoConfig;
import quant.rich.emoney.pojo.dto.R;

@Slf4j
@Controller
@RequestMapping("/admin/v1/config/emoneyRequest")
public class EmoneyRequestConfigControllerV1 extends BaseController {
    
    @Autowired
    DeviceInfoConfig deviceInfoConfig;
    
    @Autowired
    ChromeVersionsConfig chromeVersionsConfig;
    
    @GetMapping("/getRandomDeviceInfo")
    @ResponseBody
    public R<?> getRandomDeviceInfo() {
        return R.judgeNonNull(deviceInfoConfig.getRandomDeviceInfo());
    }
    
    @GetMapping("/getRandomChromeVersion")
    @ResponseBody
    public R<?> getRandomChromeVersion() {
        return R.judgeNonNull(chromeVersionsConfig.getRandomChromeVersion());
    }

}
