Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
2a294a45
Commit
2a294a45
authored
Jun 10, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加短板和短板目录crud接口
parent
4fe84716
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
ShortboardRuleCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
+76
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
0 → 100644
View file @
2a294a45
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRule
;
import
com.keymobile.indicators.service.hytobacco.ShortboardCatalogService
;
import
com.keymobile.indicators.service.hytobacco.ShortboardRuleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"短板筛选规则CRUD"
})
@RestController
@RequestMapping
(
value
=
"/shortboardRule"
)
public
class
ShortboardRuleCtrl
{
@Autowired
private
ShortboardCatalogService
shortboardCatalogService
;
@Autowired
private
ShortboardRuleService
shortboardRuleService
;
@ApiOperation
(
value
=
"新增/修改短板筛选规则目录"
,
notes
=
"新增/修改短板筛选规则目录"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
public
String
saveOrUpdateCatalog
(
@RequestBody
ShortboardCatalog
shortboardCatalog
)
throws
Exception
{
shortboardCatalog
=
shortboardCatalogService
.
saveOrUpdate
(
shortboardCatalog
);
return
shortboardCatalog
.
getId
();
}
@ApiOperation
(
value
=
"批量级联删除短板筛选规则目录"
,
notes
=
"批量级联删除短板筛选规则目录"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
public
void
deleteCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
shortboardCatalogService
.
recursionDelete
(
ids
);
}
@ApiOperation
(
value
=
"获取短板筛选规则目录"
,
notes
=
"获取短板筛选规则目录"
)
@PostMapping
(
value
=
"/getCatalog"
)
public
List
<
ShortboardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
@RequestParam
List
<
String
>
codes
){
return
shortboardCatalogService
.
getCatalog
(
parentId
,
codes
);
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
ShortboardRule
shortboardRule
,
@RequestParam
String
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
return
shortboardRuleService
.
saveOrUpdate
(
shortboardRule
,
catalogId
,
catalogIdPath
,
user
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
String
id
)
{
shortboardRuleService
.
delete
(
id
);
}
@ApiOperation
(
value
=
"根据短板筛选规则目录获取短板筛选规则"
,
notes
=
"根据短板筛选规则目录获取短板筛选规则"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Page
<
ShortboardRule
>
getByCatalogId
(
@RequestParam
String
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
shortboardRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
}
@ApiOperation
(
value
=
"根据id获取短板筛选规则"
,
notes
=
"根据id获取短板筛选规则"
)
@PostMapping
(
value
=
"/findById"
)
public
ShortboardRule
findById
(
@RequestParam
String
id
)
{
return
shortboardRuleService
.
getById
(
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