forked from rongchao/epmet-cloud-rizhao
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
48 lines
1.0 KiB
/**
|
|
* Copyright (c) 2018 人人开源 All rights reserved.
|
|
*
|
|
* https://www.renren.io
|
|
*
|
|
* 版权所有,侵权必究!
|
|
*/
|
|
|
|
package com.epmet.redis;
|
|
|
|
import com.epmet.commons.tools.redis.RedisKeys;
|
|
import com.epmet.commons.tools.redis.RedisUtils;
|
|
import com.epmet.entity.SysResourceEntity;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 资源管理
|
|
*
|
|
* @author Mark sunlightcs@gmail.com
|
|
* @since 1.0.0
|
|
*/
|
|
@Component
|
|
public class SysResourceRedis {
|
|
@Autowired
|
|
private RedisUtils redisUtils;
|
|
|
|
public void delete() {
|
|
String key = RedisKeys.getSysResourceKey();
|
|
|
|
redisUtils.delete(key);
|
|
}
|
|
|
|
public void set(List<SysResourceEntity> list){
|
|
String key = RedisKeys.getSysResourceKey();
|
|
|
|
redisUtils.set(key, list);
|
|
}
|
|
|
|
public List<SysResourceEntity> get(){
|
|
String key = RedisKeys.getSysResourceKey();
|
|
|
|
return (List<SysResourceEntity>)redisUtils.get(key);
|
|
}
|
|
|
|
}
|
|
|