工业级运维app手机api
xufenglei
2017-11-03 eb48246d98cdf77e7ef65b64a2349d2974c6538a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.moral.monitor.controller;
 
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
@RestController
public class TestController {
 
    @Resource
    RabbitTemplate rabbitTemplate;
 
    @Resource
    RedisTemplate<String, String> redisTemplate;
 
    @RequestMapping("/test/hello")
    public String hello() {
 
        return "123";
    }
 
    @RequestMapping("/test/set")
    public String set() {
 
        redisTemplate.opsForValue().set("1234567890", "xxxxxxxxxxx123#");
 
        return "123";
    }
 
    @RequestMapping("/test/get")
    public String get() {
 
        return redisTemplate.opsForValue().get("1234567890");
    }
}