SysBaseConfigController.java
2.0 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
package com.skua.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.modules.system.entity.SysBaseConfig;
import com.skua.modules.system.service.ISysBaseConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <pre>
* 基础信息配置
* </pre>
* @author 谢超
* @version V1.0, 2022-06-16 14:00:00
*/
@Slf4j
@Api(tags="基础信息配置")
@RestController
@RequestMapping("/system/sysBaseConfig")
public class SysBaseConfigController {
@Autowired
private ISysBaseConfigService sysBaseConfigService;
/**
* <pre>
* 新增或更新
* </pre>
* @param sysBaseConfig
* @return
* @author xiechao
*/
@AutoLog(value = "基础信息配置-编辑")
@ApiOperation(value="基础信息配置-编辑", notes="基础信息配置-编辑")
@PostMapping(value = "/addOrEdit")
public Result<SysBaseConfig> addOrEdit(@RequestBody SysBaseConfig sysBaseConfig) {
Result<SysBaseConfig> result = new Result<SysBaseConfig>();
sysBaseConfigService.saveOrUpdate(sysBaseConfig);
result.success("更新成功!");
return result;
}
/**
* <pre>
* 查询基础配置信息
* </pre>
* @return
* @author xiechao
*/
@AutoLog(value = "基础信息配置-查询基础配置信息")
@ApiOperation(value="基础信息配置-查询基础配置信息", notes="基础信息配置-查询基础配置信息")
@GetMapping(value = "/getSysBaseConfig")
public Result<SysBaseConfig> getSysBaseConfig() {
Result<SysBaseConfig> result = new Result<>();
SysBaseConfig sysBaseConfig = sysBaseConfigService.getOne(new QueryWrapper<>());
if (sysBaseConfig == null){
sysBaseConfig = new SysBaseConfig();
}
result.setResult(sysBaseConfig);
result.setSuccess(true);
return result;
}
}