package com.lovecoding.redis.redisdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @Autowired
    RedisService redisService;

    @RequestMapping("/t1")
    public String t1(){
        System.out.println(  "Hello Redis"  );
        return "Hello Redis";
    }

    @RequestMapping("/user/login")
    public String t2( String token ){

        redisService.set( "token:" + token,  token  );

        return "User Login";
    }
}
