wuww
2025-04-11 4dfc75b7061bee39968df9e94ee0f56bc003f5fd
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package com.se.nsl.controller;
 
 
import com.se.nsl.domain.EntityTypeInfo;
import com.se.nsl.domain.LoginParams;
import com.se.nsl.domain.vo.R;
import com.se.nsl.service.ProjectRelatedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@Api(tags = "实体库相关接口")
@CrossOrigin(origins = "*")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/v1")
public class ProjectRelatedController extends BaseController {
 
    @Resource
    private ProjectRelatedService projectRelatedService;
 
 
    /**
     * 获取公钥
     *
     * @Cacheable 添加缓存,相同条件的查询不再查询数据库,而是从缓存中查询;
     * @CachePut 每次都会访问数据库,并更新缓存;
     * @CacheEvict 清除缓存
     * <p>
     * 注解中参数说明:
     * cacheNames/value:指定缓存组件的名字;
     * key:缓存数据使用的key;可以用它来指定。默认是使用方法参数的值  1-方法全参 2-方法参数的某几个 3-key(SpEL)
     * keyGenerator:key的生成器;可以自己指定key的生成器的组件id
     * cacheManager:指定缓存管理器;或者cacheResolver指定获取解析器
     * condition:指定符合条件的情况下才缓存;
     * unless:否定缓存;当unless指定的条件为true,方法的返回值就不会被缓存;可以获取到结果进行判断
     * sync:是否使用异步模式
     */
    @ApiOperation("0-获取公钥")
//    @Cacheable(cacheNames="api",value="cachespace=30", key = "#root.methodName")
    @GetMapping("/get-public-key")
    public Object getPublicKey() {
        return projectRelatedService.getPublicKey();
    }
 
    /**
     * 登录实体库
     */
    @ApiOperation("1-登录实体库")
//    @Cacheable(cacheNames = "api", key = "#loginParams")
    @PostMapping("/login-entity")
    public R<Object> loginEntity(@RequestBody LoginParams loginParams) {
        return success(projectRelatedService.loginEntity(loginParams));
    }
 
 
    /**
     * 获取访问实体库的token
     */
    @ApiOperation("1-获取访问实体库的token")
    @GetMapping("/entity-public-key")
    public R<Object> getEntityPublicKey() {
        return success(projectRelatedService.getEntityPublicKey());
    }
 
 
    /**
     * 获取访问实体库数据库列表
     */
    @ApiOperation("2-获取访问实体库数据库列表")
    @GetMapping("/db-list")
    public R<Object> getDbLits() {
        return success(projectRelatedService.getDbLits());
    }
 
    /**
     * 查询实体库不同类型的信息
     */
    @ApiOperation("3-查询实体库不同类型的信息")
    @GetMapping("/entity-type-info")
    public Object getEntityTypeInfo(EntityTypeInfo entityTypeInfo) {
        return projectRelatedService.getEntityTypeInfo(entityTypeInfo);
    }
 
    /**
     * 查询实体库不同类型的信息
     */
    @ApiOperation("4-查询实体库不同类型的信息-管线")
    @GetMapping("/entity-pipe-info")
    public Object getEntityPipeInfo(EntityTypeInfo entityTypeInfo) {
        return projectRelatedService.getEntityPipeInfo(entityTypeInfo);
    }
 
 
}