Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fuzzBackEnd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钱炳权
fuzzBackEnd
Commits
805d86fb
Commit
805d86fb
authored
Aug 21, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务删除未完成
parent
3786ab39
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
9 deletions
+78
-9
MissionInfoController.java
...roll/controller/dataController/MissionInfoController.java
+23
-2
MissionInfoMapper.java
...va/com/example/fuzzControll/mapper/MissionInfoMapper.java
+2
-0
MissionInfoService.java
.../com/example/fuzzControll/service/MissionInfoService.java
+5
-0
MissionInfoServiceImpl.java
...ple/fuzzControll/service/impl/MissionInfoServiceImpl.java
+28
-0
TestMissionServiceImpl.java
...ple/fuzzControll/service/impl/TestMissionServiceImpl.java
+1
-1
MissionInfoMapper.xml
...tegration/src/main/resources/mapper/MissionInfoMapper.xml
+4
-0
MissionInfoController.java
...e/fuzzbackendmaster/controller/MissionInfoController.java
+9
-5
TestMissionController.java
...e/fuzzbackendmaster/controller/TestMissionController.java
+1
-1
FuzzIntegrationFileApi.java
...ple/fuzzbackendmaster/service/FuzzIntegrationFileApi.java
+5
-0
No files found.
fuzzIntegration/src/main/java/com/example/fuzzControll/controller/dataController/MissionInfoController.java
View file @
805d86fb
...
...
@@ -2,10 +2,12 @@ package com.example.fuzzControll.controller.dataController;
import
com.example.fuzzControll.mapper.MissionInfoMapper
;
import
com.example.fuzzControll.domain.vo.AjaxResult
;
import
com.example.fuzzControll.service.MissionInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.IOException
;
...
...
@@ -16,7 +18,8 @@ import java.io.IOException;
public
class
MissionInfoController
{
@Autowired
MissionInfoMapper
missionInfoMapper
;
@Autowired
MissionInfoService
missionInfoService
;
/**
* 查看任务信息
*/
...
...
@@ -26,7 +29,25 @@ public class MissionInfoController {
return
AjaxResult
.
success
(
missionInfoMapper
.
selectMissionInfoList
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxResult
.
error
(
"SelectMissionInfoList error!"
);
return
AjaxResult
.
error
(
"任务获取失败!"
);
}
}
/**
* 跟据任务id删除任务
*/
@RequestMapping
(
value
=
"/delMissionInfo"
,
method
=
RequestMethod
.
GET
)
public
AjaxResult
delMissionInfoById
(
@RequestParam
int
id
)
{
try
{
Boolean
flag
=
missionInfoService
.
delMissionInfoById
(
id
);
if
(
flag
)
{
return
AjaxResult
.
success
();
}
else
{
throw
new
RuntimeException
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxResult
.
error
(
"任务删除失败!"
);
}
}
}
fuzzIntegration/src/main/java/com/example/fuzzControll/mapper/MissionInfoMapper.java
View file @
805d86fb
...
...
@@ -19,4 +19,6 @@ public interface MissionInfoMapper {
boolean
insertMission
(
MissionInfo
missionInfo
);
void
updateMission
(
MissionInfo
missionInfo
);
Boolean
delMissionInfoById
(
int
id
);
}
fuzzIntegration/src/main/java/com/example/fuzzControll/service/MissionInfoService.java
0 → 100644
View file @
805d86fb
package
com
.
example
.
fuzzControll
.
service
;
public
interface
MissionInfoService
{
boolean
delMissionInfoById
(
int
id
);
}
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/MissionInfoServiceImpl.java
0 → 100644
View file @
805d86fb
package
com
.
example
.
fuzzControll
.
service
.
impl
;
import
com.example.fuzzControll.exception.mysqlException.MysqlException
;
import
com.example.fuzzControll.mapper.MissionInfoMapper
;
import
com.example.fuzzControll.service.MissionInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
(
"MissionInfoService"
)
@Slf4j
public
class
MissionInfoServiceImpl
implements
MissionInfoService
{
@Autowired
MissionInfoMapper
missionInfoMapper
;
@Override
@Transactional
(
rollbackFor
=
MysqlException
.
class
)
public
boolean
delMissionInfoById
(
int
id
)
{
/*删除任务需要同步删除测试里面的字段数据*/
try
{
missionInfoMapper
.
delMissionInfoById
(
id
);
//给mission整一个fatherid
return
true
;
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/TestMissionServiceImpl.java
View file @
805d86fb
...
...
@@ -273,7 +273,7 @@ public class TestMissionServiceImpl implements TestMissionService {
subThread
.
setUncaughtExceptionHandler
(
new
MyExceptionHandler
());
subThread
.
start
();
// subThread.join();
Thread
.
sleep
(
1000
*
10
);
//暂停3s,让系统运行至指令完全运行 todo跟据系统运行设定时间
Thread
.
sleep
(
1000
*
7
);
//暂停3s,让系统运行至指令完全运行 todo跟据系统运行设定时间
if
(
"error"
.
equals
(
SystemRunningParams
.
ThreadState
.
get
(
subThread
)))
{
//使用join串行就无法停止
throw
new
Exception
();
}
...
...
fuzzIntegration/src/main/resources/mapper/MissionInfoMapper.xml
View file @
805d86fb
...
...
@@ -44,6 +44,10 @@
</set>
where id = #{id}
</update>
<delete
id=
"delMissionInfoById"
>
DELETE FROM missionInfo
WHERE id = #{id}
</delete>
<select
id=
"selectByMissionId"
resultMap=
"MissionInfoInVo"
>
<include
refid=
"selectMissionInfoInDataBase"
/>
where id = #{id}
...
...
fuzzbackendmaster/src/main/java/com/example/fuzzbackendmaster/controller/MissionInfoController.java
View file @
805d86fb
...
...
@@ -3,10 +3,7 @@ package com.example.fuzzbackendmaster.controller;
import
com.example.fuzzbackendmaster.pojo.vo.AjaxResult
;
import
com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.IOException
;
...
...
@@ -21,7 +18,14 @@ public class MissionInfoController {
* 查看任务信息
*/
@RequestMapping
(
value
=
"/getList"
,
method
=
RequestMethod
.
GET
)
public
AjaxResult
getMissionInfo
()
throws
IOException
{
public
AjaxResult
getMissionInfo
()
{
return
fuzzIntegrationFileApi
.
selectMissionInfoList
();
}
/**
* 删除任务
*/
@RequestMapping
(
value
=
"/delMissionInfo"
,
method
=
RequestMethod
.
GET
)
public
AjaxResult
delMissionInfoById
(
@RequestParam
int
id
)
{
return
fuzzIntegrationFileApi
.
delMissionInfoById
(
id
);
}
}
fuzzbackendmaster/src/main/java/com/example/fuzzbackendmaster/controller/TestMissionController.java
View file @
805d86fb
...
...
@@ -16,7 +16,7 @@ public class TestMissionController {
@Autowired
FuzzIntegrationFileApi
fuzzIntegrationFileApi
;
/**
*
新建
测试
*
启动
测试
*/
@RequestMapping
(
value
=
"/startmission"
,
method
=
RequestMethod
.
GET
)
public
AjaxResult
getAll
(
@RequestParam
int
id
)
{
...
...
fuzzbackendmaster/src/main/java/com/example/fuzzbackendmaster/service/FuzzIntegrationFileApi.java
View file @
805d86fb
...
...
@@ -188,4 +188,9 @@ public interface FuzzIntegrationFileApi {
*/
@RequestMapping
(
value
=
"/testmission/startmission"
,
method
=
RequestMethod
.
GET
)
AjaxResult
startmission
(
@RequestParam
int
id
);
/**
* 删除任务
*/
@RequestMapping
(
value
=
"/mission/delMissionInfo"
,
method
=
RequestMethod
.
GET
)
AjaxResult
delMissionInfoById
(
@RequestParam
int
id
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment