|
|
|
@ -0,0 +1,53 @@
|
|
|
|
|
package com.mashibing.common.clients;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author heqijun
|
|
|
|
|
* @ClassName: BeaconCacheClient
|
|
|
|
|
* @Description: 公共依赖中缓存接口父接口
|
|
|
|
|
* @date 2025/6/8 16:08
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public interface BeaconCacheClient {
|
|
|
|
|
|
|
|
|
|
@GetMapping("cache/get/{key}")
|
|
|
|
|
String get(@PathVariable String key);
|
|
|
|
|
|
|
|
|
|
@GetMapping("cache/set/{key}/{value}")
|
|
|
|
|
void set(@PathVariable String key, @PathVariable String value);
|
|
|
|
|
|
|
|
|
|
@GetMapping("cache/hget/{key}")
|
|
|
|
|
Map hget(@PathVariable String key);
|
|
|
|
|
|
|
|
|
|
@GetMapping("cache/hget/{key}/{field}")
|
|
|
|
|
Object hget(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);
|
|
|
|
|
|
|
|
|
|
@GetMapping("cache/hgetString/{key}/{field}")
|
|
|
|
|
String hgetString(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);
|
|
|
|
|
|
|
|
|
|
@PostMapping("cache/hset/{key}")
|
|
|
|
|
void hset(@PathVariable String key, @RequestBody Map hash);
|
|
|
|
|
|
|
|
|
|
@PostMapping("cache/sadd/{key}")
|
|
|
|
|
void sadd(@PathVariable(value = "key") String key, @RequestBody Map<String, Object>... value);
|
|
|
|
|
|
|
|
|
|
@PostMapping("cache/smember/{key}")
|
|
|
|
|
Set smember(@PathVariable(value = "key") String key);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 大批量写入String数据
|
|
|
|
|
*
|
|
|
|
|
* @param map key是key,value是value
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("cache/pipeline/string")
|
|
|
|
|
void pipelineString(@RequestBody Map<String, String> map);
|
|
|
|
|
|
|
|
|
|
}
|