SysDictController.java
2.69 KB
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
/*
*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the gsc4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*
*/
package com.gsc4cloud.agentmanage.controller;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.common.feign.annotation.NoToken;
import com.gsc4cloud.agentmanage.utils.ThreadLocalCache;
import com.gsc4cloud.agentmanage.request.sys.DetailRequest;
import com.gsc4cloud.agentmanage.response.rop.LoginAccountResponse;
import com.gsc4cloud.agentmanage.anotation.RopSession;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
/**
* 字典表前端控制器
*
* @author lengleng
* @date 2025/05/30
* @since 2019-03-19
*/
@RestController
@AllArgsConstructor
@RequestMapping("/dict")
@Tag(description = "dict", name = "字典管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class SysDictController {
/**
* 通过ID查询字典信息
*
* @param id 字典ID
* @return 包含字典信息的响应对象
*/
@PostMapping("/details/byId")
@Operation(summary = "通过ID查询字典信息")
public R getById(DetailRequest detailRequest) {
System.out.println("用户信息:" + ThreadLocalCache.getLoginInfo());
return R.ok("ok");
}
@RopSession // ROPsession注解,必须要rop登录信息
@PostMapping("/details/user")
@Operation(summary = "用户信息")
public R<LoginAccountResponse> getUser(DetailRequest detailRequest) {
System.out.println("用户信息:" + ThreadLocalCache.getLoginAccountInfo());
return R.ok(ThreadLocalCache.getLoginAccountInfo());
}
@GetMapping("/sign/test")
@Operation(summary = "验签测试")
public R<String> signTest(DetailRequest detailRequest) {
return R.ok("验签成功");
}
}