package shop.alien.second.controller;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiSort;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import shop.alien.entity.result.R;
import shop.alien.entity.store.vo.LifeMessageVo;
import shop.alien.second.feign.AlienStoreFeign;
import shop.alien.util.common.JwtUtil;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@Api(tags = {"二手平台-测试"})
@ApiSort(1)
@CrossOrigin
@RestController
@RequestMapping("/testCon")
@RequiredArgsConstructor
public class TestController {

    private final AlienStoreFeign alienStoreFeign;

    @GetMapping("/test")
    public String test() {
        JSONObject data = JwtUtil.getCurrentUserInfo();
        if (null != data) {
            int userId = data.getInteger("userId");
        }
        System.out.println(111);
        System.out.println(data);

        JSONObject iPage = alienStoreFeign.getMessageList("user_13942852153", 1, "");
        System.out.println(222);
        System.out.println(iPage);

        return "hello world";
    }

}
