Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
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
mengmeng
pension
Commits
a5a3d57f
Commit
a5a3d57f
authored
May 07, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.用户地址 添加”我的地址“接口
2.用户地址 添加接口对创建日期添加
parent
47e0b594
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
application.yml
hmit-admin/src/main/resources/application.yml
+1
-1
PensionConsigneeController.java
...s/serviceOrder/controller/PensionConsigneeController.java
+20
-9
PensionConsigneeServiceImpl.java
...erviceOrder/service/impl/PensionConsigneeServiceImpl.java
+2
-0
No files found.
hmit-admin/src/main/resources/application.yml
View file @
a5a3d57f
...
...
@@ -4,7 +4,7 @@ server:
uri-encoding
:
UTF-8
max-threads
:
1000
min-spare-threads
:
30
port
:
808
0
port
:
808
8
connection-timeout
:
5000ms
servlet
:
context-path
:
/hmit-admin
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionConsigneeController.java
View file @
a5a3d57f
...
...
@@ -87,7 +87,6 @@ public class PensionConsigneeController {
return
new
Result
();
}
@Deprecated
@DeleteMapping
@ApiOperation
(
"删除"
)
public
Result
delete
(
@RequestBody
Long
[]
ids
){
...
...
@@ -109,18 +108,30 @@ public class PensionConsigneeController {
@Login
@GetMapping
(
"findMyAddress"
)
@ApiOperation
(
"查询本人收货地址"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
//TODO 分页
public
Result
<
List
<
PensionConsigneeDTO
>>
findMyAddress
(
@ApiIgnore
@LoginUser
UserEntity
user
,
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
public
Result
<
List
<
PensionConsigneeDTO
>>
findMyAddress
(
@ApiIgnore
@LoginUser
UserEntity
user
){
List
<
PensionConsigneeDTO
>
pensionConsigneeDTOList
=
pensionConsigneeService
.
findByUserId
(
user
.
getId
());
return
new
Result
<
List
<
PensionConsigneeDTO
>>().
ok
(
pensionConsigneeDTOList
);
}
@Login
@PostMapping
(
"addMyAddress"
)
@ApiOperation
(
"添加我的收货地址"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"username"
,
value
=
"用户姓名"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"mobile"
,
value
=
"用户手机号"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"province"
,
value
=
"省份"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"city"
,
value
=
"城市"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"district"
,
value
=
"区县"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"address"
,
value
=
"详细地址"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"zip"
,
value
=
"邮编"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
"ifDefault"
,
value
=
"是否默认,传0则非默认,1则设为为默认,用户第一个地址传0或1均为即为默认地址"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
})
public
Result
addMyAddress
(
@ApiIgnore
@LoginUser
UserEntity
user
,
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
params
.
put
(
"userId"
,
user
.
getId
());
pensionConsigneeService
.
addUserAddress
(
params
);
return
new
Result
();
}
@PostMapping
(
"addUserAddress"
)
@ApiOperation
(
"根据用户Id添加收货地址"
)
@ApiImplicitParams
({
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionConsigneeServiceImpl.java
View file @
a5a3d57f
...
...
@@ -13,6 +13,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -67,6 +68,7 @@ public class PensionConsigneeServiceImpl extends CrudServiceImpl<PensionConsigne
params
.
get
(
"address"
).
toString
(),
params
.
get
(
"zip"
).
toString
(),
ifDefault
,
1
);
PensionConsigneeDTO
pensionConsigneeDTO
=
new
PensionConsigneeDTO
();
BeanUtils
.
copyProperties
(
addressDTO
,
pensionConsigneeDTO
);
pensionConsigneeDTO
.
setCreateDate
(
new
Date
());
save
(
pensionConsigneeDTO
);
}
}
\ No newline at end of file
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