RedisClearCtrl.java 1.6 KB
package com.ui.ctrl;

import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.domain.RedisOperateModel;
import com.ui.model.req.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

/**
 * Created by craig.qin on 2017/11/27.
 * redis 清理缓存
 */
@RestController
@RequestMapping("/redisClear")
public class RedisClearCtrl {
    Logger log = LoggerFactory.getLogger(RedisClearCtrl.class);
    @Autowired
    private HttpRestClient httpClient;

    /*
    跳转到redis 命令操作 界面
     */
    @RequestMapping("/toRedisClear")
    public ModelAndView toRedisClear(){
        return new ModelAndView("redisoperate/redisclear");
    }


    /*
查询redis源:不同步redis
*/
    @RequestMapping("/queryNoSyncRedisList")
    @ResponseBody
    public BaseResponse queryNoSyncRedisList(){
        BaseResponse res = httpClient.defaultPost(HttpUriContants.REDIS_INFO_LIST_NO_SYNC, null, BaseResponse.class);
        return res;
    }

    @RequestMapping("/clear")
    @ResponseBody
    public BaseResponse clear(RedisOperateModel redisOperateModel){
        BaseResponse res = httpClient.defaultPost(HttpUriContants.REDIS_INFO_CLEAR, redisOperateModel, BaseResponse.class);
        return res;
    }

}