Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
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 6231f07a
authored
Jul 26, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新接口参数
1 parent
c4a1ce01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
project-interface/src/main/java/com/dituhui/pea/pojo/BlockSyncRequest.java
project-order/src/main/java/com/dituhui/pea/order/controller/BlockController.java
project-interface/src/main/java/com/dituhui/pea/pojo/BlockSyncRequest.java
0 → 100644
View file @
6231f07
package
com
.
dituhui
.
pea
.
pojo
;
import
lombok.Data
;
@Data
public
class
BlockSyncRequest
{
String
blockId
;
Long
area
;
RegionDTO
region
;
}
project-order/src/main/java/com/dituhui/pea/order/controller/BlockController.java
View file @
6231f07
...
...
@@ -3,14 +3,14 @@ package com.dituhui.pea.order.controller;
import
org.apache.commons.lang.StringUtils
;
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.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.service.IBlockService
;
import
com.dituhui.pea.pojo.
RegionDTO
;
import
com.dituhui.pea.pojo.
BlockSyncRequest
;
/**
* 服务范围相关接口
...
...
@@ -32,18 +32,17 @@ public class BlockController {
* @return
*/
@PostMapping
(
"/syncBlock"
)
public
Result
<
Boolean
>
synchronizeBlock
(
@RequestParam
String
blockId
,
@RequestParam
Long
area
,
@RequestParam
RegionDTO
region
)
{
if
(
StringUtils
.
isBlank
(
blockId
))
{
public
Result
<
Boolean
>
synchronizeBlock
(
@RequestBody
BlockSyncRequest
request
)
{
if
(
request
==
null
||
StringUtils
.
isBlank
(
request
.
getBlockId
()))
{
return
Result
.
failure
(
"缺少参数blockId"
);
}
if
(
null
==
re
gion
)
{
if
(
null
==
re
quest
.
getRegion
()
)
{
return
Result
.
failure
(
"缺少参数region"
);
}
Result
<
Boolean
>
res
=
null
;
try
{
res
=
blockService
.
synchronizeBlock
(
blockId
,
area
,
region
);
res
=
blockService
.
synchronizeBlock
(
request
.
getBlockId
(),
request
.
getArea
(),
request
.
getRegion
()
);
}
catch
(
BusinessException
e
)
{
return
Result
.
failure
(
e
.
getMessage
());
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment