fix (接口定义): 优化操作历史查询缓慢问题
--bug=1007003 --user=赵勇 【github#6347】查询变更历史,出现慢查询,查询5分钟 才查出结果 https://www.tapd.cn/55049933/s/1058794
This commit is contained in:
parent
aff4b551f2
commit
ed512308e5
|
@ -72,6 +72,12 @@
|
|||
LEFT JOIN workspace w on t2.workspace_id = w.id
|
||||
<where>
|
||||
t.oper_type in ('UPDATE','BATCH_UPDATE')
|
||||
<if test="request.modules != null and request.modules.size > 0 ">
|
||||
and t.oper_module in
|
||||
<foreach collection="request.modules" item="module" separator="," open="(" close=")">
|
||||
#{module}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.oper_content is not null
|
||||
<if test="request.sourceId != null and request.sourceId != ''">
|
||||
and t.source_id like #{request.sourceId, jdbcType=VARCHAR}
|
||||
|
|
|
@ -30,9 +30,9 @@ public class OperatingLogController {
|
|||
}
|
||||
|
||||
|
||||
@GetMapping("/get/source/{id}")
|
||||
public List<OperatingLogDTO> findBySourceId(@PathVariable String id) {
|
||||
return operatingLogService.findBySourceId(id);
|
||||
@PostMapping("/get/source")
|
||||
public List<OperatingLogDTO> findBySourceId(@RequestBody OperatingLogRequest request) {
|
||||
return operatingLogService.findBySourceId(request);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,9 +47,8 @@ public class OperatingLogService {
|
|||
return dto;
|
||||
}
|
||||
|
||||
public List<OperatingLogDTO> findBySourceId(String id) {
|
||||
OperatingLogRequest request = new OperatingLogRequest();
|
||||
request.setSourceId("%" + id + "%");
|
||||
public List<OperatingLogDTO> findBySourceId(OperatingLogRequest request) {
|
||||
request.setSourceId("%" + request.getSourceId() + "%");
|
||||
List<OperatingLogDTO> logWithBLOBs = extOperatingLogMapper.findBySourceId(request);
|
||||
List<OperatingLogDTO> dtos = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(logWithBLOBs)) {
|
||||
|
|
|
@ -30,4 +30,6 @@ public class OperatingLogRequest implements Serializable {
|
|||
|
||||
private List<String> projectIds;
|
||||
|
||||
private List<String> modules;
|
||||
|
||||
}
|
|
@ -451,4 +451,5 @@ SELECT id, follow_people
|
|||
FROM test_case
|
||||
WHERE follow_people IS NOT NULL AND follow_people != '';
|
||||
ALTER TABLE test_case DROP COLUMN follow_people;
|
||||
|
||||
-- 操作日志类型增加普通索引
|
||||
ALTER TABLE `operating_log` ADD INDEX oper_module_index ( `oper_module` );
|
||||
|
|
|
@ -865,7 +865,7 @@ export default {
|
|||
})
|
||||
},
|
||||
openHis() {
|
||||
this.$refs.changeHistory.open(this.currentScenario.id);
|
||||
this.$refs.changeHistory.open(this.currentScenario.id, ["接口自动化", "Api automation", "接口自動化"]);
|
||||
},
|
||||
setModule(id, data) {
|
||||
this.currentScenario.apiScenarioModuleId = id;
|
||||
|
|
|
@ -294,7 +294,7 @@ export default {
|
|||
methods: {
|
||||
hasPermission,
|
||||
openHis(row) {
|
||||
this.$refs.changeHistory.open(row.id);
|
||||
this.$refs.changeHistory.open(row.id,["接口定义用例" , "接口定義用例" , "Api definition case"]);
|
||||
},
|
||||
handleRunBatch() {
|
||||
this.$emit('batchRun');
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
},
|
||||
methods: {
|
||||
openHis(){
|
||||
this.$refs.changeHistory.open(this.basisData.id);
|
||||
this.$refs.changeHistory.open(this.basisData.id,["接口定义" , "接口定義" , "Api definition"]);
|
||||
},
|
||||
callback() {
|
||||
this.validated = true;
|
||||
|
|
|
@ -254,7 +254,7 @@
|
|||
},
|
||||
methods: {
|
||||
openHis(){
|
||||
this.$refs.changeHistory.open(this.httpForm.id);
|
||||
this.$refs.changeHistory.open(this.httpForm.id,["接口定义" , "接口定義" , "Api definition"]);
|
||||
},
|
||||
mockSetting() {
|
||||
if(this.basisData.id){
|
||||
|
|
|
@ -80,7 +80,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
openHis(){
|
||||
this.$refs.changeHistory.open(this.basisData.id);
|
||||
this.$refs.changeHistory.open(this.basisData.id,["接口定义" , "接口定義" , "Api definition"]);
|
||||
},
|
||||
callback() {
|
||||
this.validated = true;
|
||||
|
|
|
@ -143,7 +143,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
openHis(){
|
||||
this.$refs.changeHistory.open(this.basisData.id);
|
||||
this.$refs.changeHistory.open(this.basisData.id,["接口定义" , "接口定義" , "Api definition"]);
|
||||
},
|
||||
callback() {
|
||||
this.validated = true;
|
||||
|
|
|
@ -74,8 +74,8 @@ export default {
|
|||
handleClose() {
|
||||
this.infoVisible = false;
|
||||
},
|
||||
getDetails(id) {
|
||||
this.result = this.$get("/operating/log/get/source/" + id, response => {
|
||||
getDetails(id, modules) {
|
||||
this.result = this.$post("/operating/log/get/source/", {sourceId: id, modules: modules}, response => {
|
||||
let data = response.data;
|
||||
this.loading = false;
|
||||
if (data) {
|
||||
|
@ -83,10 +83,10 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
open(id) {
|
||||
open(id, modules) {
|
||||
this.infoVisible = true;
|
||||
this.loading = true;
|
||||
this.getDetails(id);
|
||||
this.getDetails(id, modules);
|
||||
},
|
||||
openDetail(row, value) {
|
||||
value.createUser = row.details.createUser;
|
||||
|
|
|
@ -171,7 +171,7 @@ export default {
|
|||
});
|
||||
},
|
||||
openHis() {
|
||||
this.$refs.changeHistory.open(this.test.id);
|
||||
this.$refs.changeHistory.open(this.test.id,["性能测试" , "性能測試" , "Performance test"]);
|
||||
},
|
||||
importAPITest() {
|
||||
let apiTest = this.$store.state.test;
|
||||
|
|
|
@ -360,7 +360,7 @@
|
|||
},
|
||||
methods: {
|
||||
openHis() {
|
||||
this.$refs.changeHistory.open(this.form.id);
|
||||
this.$refs.changeHistory.open(this.form.id,["测试用例" , "測試用例" , "Test case"]);
|
||||
},
|
||||
setModule(id, data) {
|
||||
this.form.module = id;
|
||||
|
|
Loading…
Reference in New Issue