许鹏程
2024-12-24 ece081f1f221d7e8063b655a9722d425b329dcb0
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
39
package com.product;
 
import com.product.core.cache.util.RedisUtil;
import com.product.core.config.Global;
import com.product.module.sys.version.ApiVersion;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * @Author cheng
 * @Date 2024/12/19 16:45
 * @Desc
 */
@RestController
@RequestMapping("/api/test")
public class TestController {
 
 
 
 
    @GetMapping("/get/{version}")
    @ApiVersion(1)
    public String get() {
        String result = Global.getSystemConfig("product-server.nacos2", "null");
//        获取springboot中的变量
 
 
//        RedisUtil.addSet("test:123", "test");
        RedisUtil.delSetAimValue("test:123", "test");
 
 
//        返回json字符串 自己拼接
        return "{\\\"result\\\":\\\"" + result + "\\\" }";
    }
 
}