From cec9784afbf47044e8eae1d1d09ca6e6a492787a Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期四, 23 十月 2025 16:01:02 +0800
Subject: [PATCH] 接口调用日志记录
---
src/main/java/com/zy/system/controller/ApiController.java | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/main/java/com/zy/system/controller/ApiController.java b/src/main/java/com/zy/system/controller/ApiController.java
index 126983d..6511967 100644
--- a/src/main/java/com/zy/system/controller/ApiController.java
+++ b/src/main/java/com/zy/system/controller/ApiController.java
@@ -29,11 +29,11 @@
@RequestMapping(value = "/api/list/auth")
@ManagerAuth
- public R list(@RequestParam(defaultValue = "1")Integer curr,
- @RequestParam(defaultValue = "10")Integer limit,
- @RequestParam(required = false)String orderByField,
- @RequestParam(required = false)String orderByType,
- @RequestParam Map<String, Object> param){
+ public R list(@RequestParam(defaultValue = "1") Integer curr,
+ @RequestParam(defaultValue = "10") Integer limit,
+ @RequestParam(required = false) String orderByField,
+ @RequestParam(required = false) String orderByType,
+ @RequestParam Map<String, Object> param) {
excludeTrash(param);
EntityWrapper<Api> wrapper = new EntityWrapper<>();
convert(param, wrapper);
@@ -41,8 +41,8 @@
return R.ok(apiService.selectPage(new Page<>(curr, limit), wrapper));
}
- private void convert(Map<String, Object> map, EntityWrapper wrapper){
- for (Map.Entry<String, Object> entry : map.entrySet()){
+ private void convert(Map<String, Object> map, EntityWrapper wrapper) {
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
if (entry.getKey().endsWith(">")) {
wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue())));
} else if (entry.getKey().endsWith("<")) {
@@ -56,10 +56,10 @@
@RequestMapping(value = "/api/edit/auth")
@ManagerAuth
public R edit(Api api) {
- if (Cools.isEmpty(api)){
+ if (Cools.isEmpty(api)) {
return R.error();
}
- if (null == api.getId()){
+ if (null == api.getId()) {
apiService.insert(api);
} else {
apiService.updateById(api);
@@ -74,10 +74,10 @@
return R.ok();
}
- @RequestMapping(value = "/api/update/auth")
+ @RequestMapping(value = "/api/update/auth")
@ManagerAuth
- public R update(Api api){
- if (Cools.isEmpty(api) || null==api.getId()){
+ public R update(Api api) {
+ if (Cools.isEmpty(api) || null == api.getId()) {
return R.error();
}
apiService.updateById(api);
@@ -86,8 +86,8 @@
@RequestMapping(value = "/api/delete/auth")
@ManagerAuth
- public R delete(Integer[] ids){
- if (Cools.isEmpty(ids)){
+ public R delete(Integer[] ids) {
+ if (Cools.isEmpty(ids)) {
return R.error();
}
apiService.deleteBatchIds(Arrays.asList(ids));
@@ -96,7 +96,7 @@
@RequestMapping(value = "/api/export/auth")
@ManagerAuth
- public R export(@RequestBody JSONObject param){
+ public R export(@RequestBody JSONObject param) {
List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
EntityWrapper<Api> wrapper = new EntityWrapper<>();
Map<String, Object> map = excludeTrash(param.getJSONObject("api"));
@@ -112,7 +112,7 @@
wrapper.like("id", condition);
Page<Api> page = apiService.selectPage(new Page<>(0, 10), wrapper);
List<Map<String, Object>> result = new ArrayList<>();
- for (Api api : page.getRecords()){
+ for (Api api : page.getRecords()) {
Map<String, Object> map = new HashMap<>();
map.put("id", api.getId());
map.put("value", api.getId());
--
Gitblit v1.9.1