Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
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
曲欣亮
sentinel
Commits
f62318ab
Commit
f62318ab
authored
May 22, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
506517b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
HttpController.java
src/main/java/com/egolm/sentinel/web/HttpController.java
+1
-1
CommonService.java
...in/java/com/egolm/sentinel/web/service/CommonService.java
+1
-1
CommonServiceImpl.java
...om/egolm/sentinel/web/service/impl/CommonServiceImpl.java
+8
-2
No files found.
src/main/java/com/egolm/sentinel/web/HttpController.java
View file @
f62318ab
...
...
@@ -95,7 +95,7 @@ public class HttpController {
@ResponseBody
@PostMapping
(
"remove"
)
public
Object
remove
(
Integer
id
)
{
common
.
delete
(
id
,
THttpItem
.
class
);
common
.
delete
ById
(
id
,
THttpItem
.
class
);
this
.
deleteSchedule
(
id
);
return
Rjx
.
jsonOk
();
}
...
...
src/main/java/com/egolm/sentinel/web/service/CommonService.java
View file @
f62318ab
...
...
@@ -13,7 +13,7 @@ public interface CommonService {
void
update
(
Object
obj
);
void
delete
(
Object
id
,
Class
<?>
type
);
void
delete
ById
(
Object
id
,
Class
<?>
type
);
<
T
>
T
queryById
(
Object
id
,
Class
<
T
>
type
);
...
...
src/main/java/com/egolm/sentinel/web/service/impl/CommonServiceImpl.java
View file @
f62318ab
...
...
@@ -32,8 +32,14 @@ public class CommonServiceImpl implements CommonService {
}
@Override
public
void
delete
(
Object
id
,
Class
<?>
type
)
{
this
.
jdbcTemplate
.
delete
(
id
,
type
);
public
void
deleteById
(
Object
id
,
Class
<?>
type
)
{
Desc
desc
=
new
Desc
(
type
);
String
[]
pks
=
desc
.
getColumnPkNames
();
if
(
pks
!=
null
&&
pks
.
length
==
1
)
{
String
sql
=
"delete from "
+
desc
.
getName
()
+
" where "
+
pks
[
0
]
+
" = ?"
;
this
.
jdbcTemplate
.
executeUpdate
(
sql
,
id
);
}
}
@Override
...
...
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