初次提交代码

This commit is contained in:
2026-01-11 15:33:22 +08:00
commit 6603c6f4a1
455 changed files with 32175 additions and 0 deletions
@@ -0,0 +1,22 @@
package com.common.controller;
import com.common.entity.DeviceDevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.data.redis.core.RedisTemplate;
@RestController
@RequestMapping("/api/cache")
public class CacheController {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@GetMapping("/key/{key}")
public DeviceDevice getCacheValue(@PathVariable String key) {
// 这里先尝试作为字符串键获取
System.out.println("key:" +key);
//System.out.println(redisTemplate.opsForHash().entries(key).toString());
return (DeviceDevice) redisTemplate.opsForValue().get(key);
}
}