接口日志
This commit is contained in:
@@ -9,10 +9,7 @@ import org.nl.wms.sch.service.PointService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -37,4 +34,19 @@ public class InterfaceLogController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(interfaceLogService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/delLogs")
|
||||
@Log("删除所有接口日志")
|
||||
@ApiOperation("删除所有接口日志")
|
||||
public ResponseEntity<Object> delLogs(){
|
||||
interfaceLogService.delLogs();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/logTypeList")
|
||||
@Log("查询接口日志类型下拉框")
|
||||
@ApiOperation("查询接口日志类型下拉框")
|
||||
public ResponseEntity<Object> logTypeList() {
|
||||
return new ResponseEntity<>(interfaceLogService.logTypeList(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.nl.modules.logging.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -34,4 +36,10 @@ public interface InterfaceLogService {
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
|
||||
/**
|
||||
* 删除所有日志
|
||||
*/
|
||||
void delLogs();
|
||||
|
||||
JSONArray logTypeList();
|
||||
}
|
||||
|
||||
@@ -15,16 +15,21 @@
|
||||
*/
|
||||
package org.nl.modules.logging.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.nl.modules.logging.service.InterfaceLogService;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -39,9 +44,29 @@ public class InterfaceLogServiceImpl implements InterfaceLogService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable pageable) {
|
||||
String where = "1=1";
|
||||
ResultBean rb = WQLObject.getWQLObject("sys_interface_log").pagequery(WqlUtil.getHttpContext(pageable), where, "create_time desc ");
|
||||
final JSONObject json = rb.pageResult();
|
||||
HashMap map = new HashMap();
|
||||
map.put("flag", "1");
|
||||
map.put("blurry", whereJson.get("blurry"));
|
||||
map.put("logType", whereJson.get("logType"));
|
||||
map.put("begin_time", whereJson.get("begin_time"));
|
||||
map.put("end_time", whereJson.get("end_time"));
|
||||
JSONObject json = WQL.getWO("QSCH_INTERFACE_LOGS").addParamMap(map).pageQuery(WqlUtil.getHttpContext(pageable), "create_time desc");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delLogs() {
|
||||
WQLObject logTab = WQLObject.getWQLObject("sys_interface_log");
|
||||
logTab.delete("log_id is not null");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray logTypeList() {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
InterfaceLogType[] values = InterfaceLogType.values();
|
||||
for (InterfaceLogType value : values) {
|
||||
jsonArray.add(value.getDesc());
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
[交易说明]
|
||||
交易名: 接口日志分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.blurry TYPEAS s_string
|
||||
输入.logType TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sys_interface_log
|
||||
WHERE
|
||||
1=1
|
||||
OPTION 输入.blurry <> ""
|
||||
description like "%" 输入.blurry "%"
|
||||
ENDOPTION
|
||||
OPTION 输入.logType <> ""
|
||||
log_type = 输入.logType
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
<script>
|
||||
import Search from './search'
|
||||
import { delAllInfo } from '@/api/monitor/log'
|
||||
import crudInterfaceLog from './interfaceLog'
|
||||
import CRUD, { presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
@@ -85,7 +85,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.delAllLoading = true
|
||||
delAllInfo().then(res => {
|
||||
crudInterfaceLog.delLogs().then(res => {
|
||||
this.crud.delAllLoading = false
|
||||
this.crud.dleChangePage(1)
|
||||
this.crud.delSuccessNotify()
|
||||
|
||||
@@ -7,4 +7,16 @@ export function add(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add }
|
||||
export function delLogs() {
|
||||
return request({
|
||||
url: 'api/interfaceLog/delLogs',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function getLogTypeList() {
|
||||
return request({
|
||||
url: 'api/interfaceLog/logTypeList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export default { add, delLogs, getLogTypeList }
|
||||
|
||||
@@ -8,6 +8,20 @@
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.logType"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="日志类型"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in logTypeList"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
@@ -17,8 +31,19 @@
|
||||
import { header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import { getLogTypeList } from '@/views/monitor/interfaceLog/interfaceLog'
|
||||
export default {
|
||||
components: { rrOperation, DateRangePicker },
|
||||
mixins: [header()]
|
||||
mixins: [header()],
|
||||
data() {
|
||||
return {
|
||||
logTypeList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
getLogTypeList().then(res => {
|
||||
this.logTypeList = res
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user