package com.fjhx.victoriatourist.controller.jd;

import com.alibaba.fastjson2.JSONObject;
import com.fjhx.victoriatourist.service.jd.JdApiService;
import com.ruoyi.system.utils.ConfigUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * <p>
 * 京东API 前端控制器
 * </p>
 *
 * @author
 * @since 2023-11-03
 */
@Slf4j
@RestController
@RequestMapping("/open/jd")
public class JdApiController {

    @Autowired
    private JdApiService jdApiService;

    /**
     * 京东登录回调
     */
    @RequestMapping("/callback")
    public void callback(@RequestParam Map<String, String> inputValue) {
        String inputValJson = JSONObject.toJSONString(inputValue);
        log.info("京东回调鉴权信息：{}", inputValJson);
        ConfigUtil.set("jd_callback_json", inputValJson);
        //获取token
//        jdApiService.getAccessTokenByCode(inputValue.get("code"));
    }



}
