package cn.teammodel.controller.admin.controller;

import cn.teammodel.common.R;
import cn.teammodel.test.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class RedisController {

    private final RedisService redisService;

    @Autowired
    public RedisController(RedisService redisService) {
        this.redisService = redisService;
    }
    @PostMapping("/redis")
    public Map<Object, Object> getValueByKey(@RequestBody @Valid String key) {
        Map<Object,Object> juri = redisService.getValueByKey(key);
        return R.success(juri).getData();
    }
}
