Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
971eda99
Commit
971eda99
authored
Feb 15, 2017
by
lee_mingzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
803d5ac4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+6
-1
UserExtInfo.java
src/main/java/cn/quantgroup/xyqb/entity/UserExtInfo.java
+2
-4
IAddressService.java
...java/cn/quantgroup/xyqb/service/user/IAddressService.java
+1
-0
AddressServiceImpl.java
...quantgroup/xyqb/service/user/impl/AddressServiceImpl.java
+4
-3
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
971eda99
...
@@ -200,7 +200,10 @@ public class InnerController {
...
@@ -200,7 +200,10 @@ public class InnerController {
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
}
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userId
);
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userId
);
return
JsonResult
.
buildErrorStateResult
(
null
,
ContactRet
.
contacts2ContactRets
(
contacts
));
if
(
null
==
contacts
||
contacts
.
size
()
==
0
)
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
null
,
ContactRet
.
contacts2ContactRets
(
contacts
));
}
}
@RequestMapping
(
"/contact/save/contacts"
)
@RequestMapping
(
"/contact/save/contacts"
)
...
@@ -257,6 +260,7 @@ public class InnerController {
...
@@ -257,6 +260,7 @@ public class InnerController {
addressObj
.
setProvince
(
province
);
addressObj
.
setProvince
(
province
);
addressObj
.
setCreatedAt
(
now
);
addressObj
.
setCreatedAt
(
now
);
addressObj
.
setUpdateAt
(
now
);
addressObj
.
setUpdateAt
(
now
);
addressService
.
saveAddress
(
addressObj
);
return
JsonResult
.
buildSuccessResult
(
null
,
AddressRet
.
address2AddressRet
(
addressObj
));
return
JsonResult
.
buildSuccessResult
(
null
,
AddressRet
.
address2AddressRet
(
addressObj
));
}
}
...
@@ -273,6 +277,7 @@ public class InnerController {
...
@@ -273,6 +277,7 @@ public class InnerController {
if
(
info
==
null
)
{
if
(
info
==
null
)
{
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
info
=
new
UserExtInfo
();
info
=
new
UserExtInfo
();
info
.
setUserId
(
userId
);
info
.
setCreatedAt
(
now
);
info
.
setCreatedAt
(
now
);
info
.
setUpdateAt
(
now
);
info
.
setUpdateAt
(
now
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/entity/UserExtInfo.java
View file @
971eda99
...
@@ -3,10 +3,7 @@ package cn.quantgroup.xyqb.entity;
...
@@ -3,10 +3,7 @@ package cn.quantgroup.xyqb.entity;
import
cn.quantgroup.xyqb.entity.enumerate.*
;
import
cn.quantgroup.xyqb.entity.enumerate.*
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.*
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
...
@@ -20,6 +17,7 @@ public class UserExtInfo implements Serializable {
...
@@ -20,6 +17,7 @@ public class UserExtInfo implements Serializable {
private
static
final
long
serialVersionUID
=
-
1L
;
private
static
final
long
serialVersionUID
=
-
1L
;
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
Long
id
;
private
Long
id
;
@Column
(
name
=
"user_id"
)
@Column
(
name
=
"user_id"
)
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IAddressService.java
View file @
971eda99
...
@@ -8,4 +8,5 @@ import cn.quantgroup.xyqb.entity.Address;
...
@@ -8,4 +8,5 @@ import cn.quantgroup.xyqb.entity.Address;
public
interface
IAddressService
{
public
interface
IAddressService
{
Address
findByUserId
(
Long
userId
);
Address
findByUserId
(
Long
userId
);
Address
saveAddress
(
Address
address
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/AddressServiceImpl.java
View file @
971eda99
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.UserExtInfo
;
import
cn.quantgroup.xyqb.repository.IAddressRepository
;
import
cn.quantgroup.xyqb.repository.IAddressRepository
;
import
cn.quantgroup.xyqb.repository.IUserExtInfoRepository
;
import
cn.quantgroup.xyqb.service.user.IAddressService
;
import
cn.quantgroup.xyqb.service.user.IAddressService
;
import
cn.quantgroup.xyqb.service.user.IUserExtInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -25,4 +22,8 @@ public class AddressServiceImpl implements IAddressService {
...
@@ -25,4 +22,8 @@ public class AddressServiceImpl implements IAddressService {
return
addressRepository
.
findByUserId
(
userId
);
return
addressRepository
.
findByUserId
(
userId
);
}
}
@Override
public
Address
saveAddress
(
Address
address
)
{
return
addressRepository
.
save
(
address
);
}
}
}
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