package org.jeecg.modules.alUser.controller;

import com.alibaba.fastjson.JSONObject;
import com.xkcoding.http.HttpUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.alUser.service.UserService;
import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author scott
 * @since 2018-12-17
 */
@RestController
@RequestMapping("/index")
@Api(tags = "首页等展示接口")
@Slf4j
public class IndexController {
    @Autowired
    private IHanHaiMemberService iHanHaiMemberService;
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private UserService userService;


    @ApiOperation(value = "铝价接口")
    @RequestMapping(value = "/alprice", method = RequestMethod.POST)
    public Result<JSONObject> alprice() {
        String s = HttpUtil.get("https://www.alphavantage.co/query?function=ALUMINUM&interval=monthly&apikey=AH6NDLVPBHJ8K7OM");
        JSONObject jsonObject = JSONObject.parseObject(s);
        return Result.ok(jsonObject);
    }


}
