package org.jeecg.modules.stm.api;

import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/jflow")

public class JFlowAPIController {
    @Autowired
    private RedisUtil redisUtil;

    @GetMapping(value = "/getUserTokey")
    public  Result<?> getUserTokey(@RequestParam(name="Token",required=true) String Token) {
        Object username = redisUtil.get(Token);
        if(username==null){
            return Result.OK("");
        }
        Object tokenpt = redisUtil.get( "pt_"+username.toString());
        System.out.println("getUserTokey "+tokenpt.toString());
        redisUtil.set("TokenUser",username.toString());

        return Result.OK(tokenpt);
    }


}

