add
This commit is contained in:
@ -354,4 +354,15 @@ public interface RedisService {
|
||||
* @return // List<clazz>
|
||||
*/
|
||||
<T> List<T> getObjectList(String key, Class<T> clazz);
|
||||
|
||||
/**
|
||||
* hGetObject
|
||||
*
|
||||
* @param key key
|
||||
* @param hashKey hashKey
|
||||
* @param clazz clazz
|
||||
* @param <T> T
|
||||
* @return clazz
|
||||
*/
|
||||
<T> T hGetObject(String key, String hashKey, Class<T> clazz);
|
||||
}
|
||||
|
@ -229,6 +229,12 @@ public class RedisServiceImpl implements RedisService {
|
||||
return (List<T>) get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T hGetObject(String key, String hashKey, Class<T> clazz) {
|
||||
return (T) hGet(key, hashKey);
|
||||
}
|
||||
|
||||
private String handleKey(String key) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("tenant_").append(BaseContext.getTenantId()).append(":").append(key);
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.qiaoba.common.web.utils;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.qiaoba.common.base.result.AjaxResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -18,4 +21,8 @@ public class ResponseUtil {
|
||||
response.getWriter().write(msg);
|
||||
}
|
||||
|
||||
public static void errorAuth(HttpServletResponse response, Integer code, String msg) throws IOException {
|
||||
AjaxResult result = AjaxResult.error(code, msg);
|
||||
response(response, JSONUtil.toJsonStr(result));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user