Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
79b4ed18
authored
Sep 11, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
省市区
parent
166bb587
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
0 deletions
saas-module/src/main/java/com/makeit/controller/sys/SaasChinaAreaController.java
server-module/src/main/java/com/makeit/module/controller/system/ChinaAreaController.java
saas-module/src/main/java/com/makeit/controller/sys/SaasChinaAreaController.java
0 → 100644
View file @
79b4ed18
package
com
.
makeit
.
controller
.
sys
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.module.system.dto.ChinaAreaDTO
;
import
com.makeit.module.system.entity.ChinaArea
;
import
com.makeit.module.system.service.ChinaAreaService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.RestController
;
import
java.util.List
;
/**
* <p>
* 省市区表 前端控制器
* </p>
*
* @author ywc
* @since 2021-06-09
*/
@Api
(
tags
=
"租户端-省市区"
)
@RestController
@RequestMapping
(
"/sys/saas/china-area"
)
public
class
SaasChinaAreaController
{
@Autowired
private
ChinaAreaService
chinaAreaService
;
@ApiOperation
(
value
=
"列表"
,
notes
=
"列表"
)
@PostMapping
(
"list"
)
public
ApiResponseEntity
<
List
<
ChinaArea
>>
list
(
@RequestBody
ChinaAreaDTO
dto
)
{
return
ApiResponseUtils
.
success
(
chinaAreaService
.
list
(
dto
));
}
@ApiOperation
(
value
=
"树形列表"
,
notes
=
"树形列表"
)
@PostMapping
(
"tree"
)
public
ApiResponseEntity
<
List
<
ChinaArea
>>
tree
(
@RequestBody
ChinaAreaDTO
dto
)
{
List
<
ChinaArea
>
list
=
chinaAreaService
.
tree
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
@ApiOperation
(
value
=
"树形列表-有深度"
,
notes
=
"树形列表-有深度"
)
@PostMapping
(
"treeDepth"
)
public
ApiResponseEntity
<
List
<
ChinaArea
>>
treeDepth
(
@RequestBody
ChinaAreaDTO
dto
)
{
if
(
dto
.
getDepth
()
==
null
)
{
dto
.
setDepth
(
1
);
}
List
<
ChinaArea
>
list
=
chinaAreaService
.
tree
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
}
server-module/src/main/java/com/makeit/module/controller/system/ChinaAreaController.java
0 → 100644
View file @
79b4ed18
package
com
.
makeit
.
module
.
controller
.
system
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.module.system.dto.ChinaAreaDTO
;
import
com.makeit.module.system.entity.ChinaArea
;
import
com.makeit.module.system.service.ChinaAreaService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.RestController
;
import
java.util.List
;
/**
* <p>
* 省市区表 前端控制器
* </p>
*
* @author ywc
* @since 2021-06-09
*/
@Api
(
tags
=
"租户端-省市区"
)
@RestController
@RequestMapping
(
"/sys/china-area"
)
public
class
ChinaAreaController
{
@Autowired
private
ChinaAreaService
chinaAreaService
;
@ApiOperation
(
value
=
"列表"
,
notes
=
"列表"
)
@PostMapping
(
"list"
)
public
ApiResponseEntity
<
List
<
ChinaArea
>>
list
(
@RequestBody
ChinaAreaDTO
dto
)
{
return
ApiResponseUtils
.
success
(
chinaAreaService
.
list
(
dto
));
}
@ApiOperation
(
value
=
"树形列表"
,
notes
=
"树形列表"
)
@PostMapping
(
"tree"
)
public
ApiResponseEntity
<
List
<
ChinaArea
>>
tree
(
@RequestBody
ChinaAreaDTO
dto
)
{
List
<
ChinaArea
>
list
=
chinaAreaService
.
tree
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
@ApiOperation
(
value
=
"树形列表-有深度"
,
notes
=
"树形列表-有深度"
)
@PostMapping
(
"treeDepth"
)
public
ApiResponseEntity
<
List
<
ChinaArea
>>
treeDepth
(
@RequestBody
ChinaAreaDTO
dto
)
{
if
(
dto
.
getDepth
()
==
null
)
{
dto
.
setDepth
(
1
);
}
List
<
ChinaArea
>
list
=
chinaAreaService
.
tree
(
dto
);
return
ApiResponseUtils
.
success
(
list
);
}
}
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