|
@@ -28,43 +28,43 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class SysConfigController {
|
|
public class SysConfigController {
|
|
|
|
|
|
|
|
- private final SysConfigService sysConfigService;
|
|
|
|
|
|
|
+ private final SysConfigService sysConfigService;
|
|
|
|
|
|
|
|
private final HelpQuestionMapper helpQuestionMapper;
|
|
private final HelpQuestionMapper helpQuestionMapper;
|
|
|
|
|
|
|
|
private final BeanSearcher beanSearcher;
|
|
private final BeanSearcher beanSearcher;
|
|
|
|
|
|
|
|
- @GetMapping("/get")
|
|
|
|
|
- public Result<SysConfig> get(String key){
|
|
|
|
|
- SysConfig sysConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, key).last(" limit 1"));
|
|
|
|
|
|
|
+ @GetMapping("/get")
|
|
|
|
|
+ public Result<SysConfig> get(String key) {
|
|
|
|
|
+ SysConfig sysConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, key).last(" limit 1"));
|
|
|
|
|
|
|
|
- if (sysConfig == null) {
|
|
|
|
|
- throw new BusinessRuntimeException("配置不存在");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (sysConfig == null) {
|
|
|
|
|
+ throw new BusinessRuntimeException("配置不存在");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @PostMapping("/post")
|
|
|
|
|
- public Result<SysConfig> post(@RequestBody SysConfig sysConfig){
|
|
|
|
|
- sysConfigService.save(sysConfig);
|
|
|
|
|
|
|
+ @PostMapping("/post")
|
|
|
|
|
+ public Result<SysConfig> post(@RequestBody SysConfig sysConfig) {
|
|
|
|
|
+ sysConfigService.save(sysConfig);
|
|
|
|
|
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @PutMapping("/update")
|
|
|
|
|
- public Result<SysConfig> update(@RequestBody SysConfig sysConfig){
|
|
|
|
|
- sysConfigService.updateById(sysConfig);
|
|
|
|
|
|
|
+ @PutMapping("/update")
|
|
|
|
|
+ public Result<SysConfig> update(@RequestBody SysConfig sysConfig) {
|
|
|
|
|
+ sysConfigService.updateById(sysConfig);
|
|
|
|
|
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(sysConfig);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @DeleteMapping("/delete/{id}")
|
|
|
|
|
- public Result<String> update(@PathVariable Long id){
|
|
|
|
|
- sysConfigService.removeById(id);
|
|
|
|
|
|
|
+ @DeleteMapping("/delete/{id}")
|
|
|
|
|
+ public Result<String> update(@PathVariable Long id) {
|
|
|
|
|
+ sysConfigService.removeById(id);
|
|
|
|
|
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 问题分类列表
|
|
* 问题分类列表
|
|
@@ -83,4 +83,16 @@ public class SysConfigController {
|
|
|
});
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 问题详情
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/question/detail")
|
|
|
|
|
+ private Result<HelpQuestion> getQuestionById(Long id) {
|
|
|
|
|
+ if (id == null || id < 1) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("id error");
|
|
|
|
|
+ }
|
|
|
|
|
+ HelpQuestion helpQuestion = helpQuestionMapper.selectById(id);
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(helpQuestion);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|