1.优化
Showing
8 changed files
with
70 additions
and
10 deletions
| ... | @@ -35,7 +35,7 @@ public class Member implements Serializable { | ... | @@ -35,7 +35,7 @@ public class Member implements Serializable { |
| 35 | 35 | ||
| 36 | /** 主键 */ | 36 | /** 主键 */ |
| 37 | @Id | 37 | @Id |
| 38 | @GeneratedValue(strategy = GenerationType.SEQUENCE) | 38 | @GeneratedValue(strategy = GenerationType.AUTO) |
| 39 | @Column(name = "id") | 39 | @Column(name = "id") |
| 40 | @NotNull(message = "id can't be null!!",groups = {UpdateGroup.class}) | 40 | @NotNull(message = "id can't be null!!",groups = {UpdateGroup.class}) |
| 41 | private Long id; | 41 | private Long id; | ... | ... |
| ... | @@ -37,7 +37,7 @@ public class MemberProfile implements Serializable { | ... | @@ -37,7 +37,7 @@ public class MemberProfile implements Serializable { |
| 37 | 37 | ||
| 38 | /** 主键 */ | 38 | /** 主键 */ |
| 39 | @Id | 39 | @Id |
| 40 | @GeneratedValue(strategy = GenerationType.SEQUENCE) | 40 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 41 | @Column(name = "id") | 41 | @Column(name = "id") |
| 42 | @NotNull(message = "id not be null!!" , groups = UpdateGroup.class) | 42 | @NotNull(message = "id not be null!!" , groups = UpdateGroup.class) |
| 43 | private Long id; | 43 | private Long id; | ... | ... |
| ... | @@ -24,6 +24,7 @@ import java.sql.Timestamp; | ... | @@ -24,6 +24,7 @@ import java.sql.Timestamp; |
| 24 | public class Points implements Serializable { | 24 | public class Points implements Serializable { |
| 25 | 25 | ||
| 26 | @Id | 26 | @Id |
| 27 | @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 27 | @Column(name = "id") | 28 | @Column(name = "id") |
| 28 | private Long id; | 29 | private Long id; |
| 29 | 30 | ... | ... |
| ... | @@ -37,7 +37,7 @@ public class UserTv extends AsyncMqModule implements Serializable { | ... | @@ -37,7 +37,7 @@ public class UserTv extends AsyncMqModule implements Serializable { |
| 37 | 37 | ||
| 38 | /** ID */ | 38 | /** ID */ |
| 39 | @Id | 39 | @Id |
| 40 | @GeneratedValue(strategy = GenerationType.SEQUENCE) | 40 | @GeneratedValue(strategy = GenerationType.AUTO) |
| 41 | @Column(name = "id") | 41 | @Column(name = "id") |
| 42 | private Long id; | 42 | private Long id; |
| 43 | 43 | ... | ... |
| ... | @@ -29,7 +29,7 @@ public class UserWeixin extends AsyncMqModule implements Serializable { | ... | @@ -29,7 +29,7 @@ public class UserWeixin extends AsyncMqModule implements Serializable { |
| 29 | 29 | ||
| 30 | /** ID */ | 30 | /** ID */ |
| 31 | @Id | 31 | @Id |
| 32 | @GeneratedValue(strategy = GenerationType.SEQUENCE) | 32 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 33 | @Column(name = "id") | 33 | @Column(name = "id") |
| 34 | private Long id; | 34 | private Long id; |
| 35 | 35 | ... | ... |
| 1 | package com.topdraw.business.process.service.dto; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.member.service.dto.MemberDTO; | ||
| 4 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; | ||
| 5 | import lombok.AllArgsConstructor; | ||
| 6 | import lombok.Data; | ||
| 7 | import lombok.NoArgsConstructor; | ||
| 8 | |||
| 9 | import java.io.Serializable; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @author : | ||
| 13 | * @description: | ||
| 14 | * @function : | ||
| 15 | * @date :Created in 2022/3/23 9:48 | ||
| 16 | * @version: : | ||
| 17 | * @modified By: | ||
| 18 | * @since : modified in 2022/3/23 9:48 | ||
| 19 | */ | ||
| 20 | |||
| 21 | @Data | ||
| 22 | @AllArgsConstructor | ||
| 23 | @NoArgsConstructor | ||
| 24 | public class MemberAndUserTvDTO implements Serializable { | ||
| 25 | |||
| 26 | private MemberDTO memberDTO; | ||
| 27 | private UserTvDTO userTvDTO; | ||
| 28 | } |
| 1 | package com.topdraw.business.process.service.dto; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.member.service.dto.MemberDTO; | ||
| 4 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | ||
| 5 | import lombok.AllArgsConstructor; | ||
| 6 | import lombok.Data; | ||
| 7 | import lombok.NoArgsConstructor; | ||
| 8 | |||
| 9 | import java.io.Serializable; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @author : | ||
| 13 | * @description: | ||
| 14 | * @function : | ||
| 15 | * @date :Created in 2022/3/23 9:48 | ||
| 16 | * @version: : | ||
| 17 | * @modified By: | ||
| 18 | * @since : modified in 2022/3/23 9:48 | ||
| 19 | */ | ||
| 20 | |||
| 21 | @Data | ||
| 22 | @AllArgsConstructor | ||
| 23 | @NoArgsConstructor | ||
| 24 | public class MemberAndWeixinUserDTO implements Serializable { | ||
| 25 | |||
| 26 | private MemberDTO memberDTO; | ||
| 27 | private UserWeixinDTO userWeixinDTO; | ||
| 28 | |||
| 29 | } |
| ... | @@ -11,6 +11,8 @@ import com.topdraw.business.module.user.weixin.domain.UserWeixin; | ... | @@ -11,6 +11,8 @@ import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 11 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; | 11 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; |
| 12 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | 12 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; |
| 13 | import com.topdraw.business.process.service.UserOperationService; | 13 | import com.topdraw.business.process.service.UserOperationService; |
| 14 | import com.topdraw.business.process.service.dto.MemberAndUserTvDTO; | ||
| 15 | import com.topdraw.business.process.service.dto.MemberAndWeixinUserDTO; | ||
| 14 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
| 15 | import org.springframework.beans.BeanUtils; | 17 | import org.springframework.beans.BeanUtils; |
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -31,9 +33,9 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -31,9 +33,9 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 31 | private UserWeixinService userWeixinService; | 33 | private UserWeixinService userWeixinService; |
| 32 | 34 | ||
| 33 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | 35 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) |
| 34 | public void asyncWeixinMemberAndUserWeixin4Iptv(MemberDTO memberDTO, UserWeixinDTO weixinDTO) { | 36 | public void asyncMemberAndUserWeixin4Iptv(MemberAndWeixinUserDTO memberAndWeixinUserDTO) { |
| 35 | this.saveMember(memberDTO); | 37 | this.saveMember(memberAndWeixinUserDTO.getMemberDTO()); |
| 36 | this.saveWeixin(weixinDTO); | 38 | this.saveWeixin(memberAndWeixinUserDTO.getUserWeixinDTO()); |
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | private void saveMember(MemberDTO memberDTO){ | 41 | private void saveMember(MemberDTO memberDTO){ |
| ... | @@ -43,9 +45,9 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -43,9 +45,9 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 43 | } | 45 | } |
| 44 | 46 | ||
| 45 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | 47 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) |
| 46 | public void asyncMemberAndUserTv4Iptv(MemberDTO memberDTO, UserTvDTO userTvDTO) { | 48 | public void asyncMemberAndUserTv4Iptv(MemberAndUserTvDTO memberAndUserTvDTO) { |
| 47 | this.saveMember(memberDTO); | 49 | this.saveMember(memberAndUserTvDTO.getMemberDTO()); |
| 48 | this.saveUserTv(userTvDTO); | 50 | this.saveUserTv(memberAndUserTvDTO.getUserTvDTO()); |
| 49 | } | 51 | } |
| 50 | 52 | ||
| 51 | public void asyncWeixin(UserWeixinDTO weixinDTO) { | 53 | public void asyncWeixin(UserWeixinDTO weixinDTO) { | ... | ... |
-
Please register or sign in to post a comment