1.优化
Showing
13 changed files
with
96 additions
and
135 deletions
| ... | @@ -14,6 +14,8 @@ import org.springframework.validation.annotation.Validated; | ... | @@ -14,6 +14,8 @@ import org.springframework.validation.annotation.Validated; |
| 14 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| 15 | import io.swagger.annotations.*; | 15 | import io.swagger.annotations.*; |
| 16 | 16 | ||
| 17 | import javax.validation.constraints.NotNull; | ||
| 18 | |||
| 17 | /** | 19 | /** |
| 18 | * @author XiangHan | 20 | * @author XiangHan |
| 19 | * @date 2021-10-22 | 21 | * @date 2021-10-22 |
| ... | @@ -36,7 +38,7 @@ public class MemberProfileController { | ... | @@ -36,7 +38,7 @@ public class MemberProfileController { |
| 36 | public ResultInfo update(@Validated(value = {UpdateGroup.class}) @RequestBody MemberProfile resources) { | 38 | public ResultInfo update(@Validated(value = {UpdateGroup.class}) @RequestBody MemberProfile resources) { |
| 37 | 39 | ||
| 38 | log.info("memberProfile ==>> update ==>> resources ===>> [{}]",resources); | 40 | log.info("memberProfile ==>> update ==>> resources ===>> [{}]",resources); |
| 39 | MemberProfileDTO memberProfileDTO = this.memberProfileOperationService.update(resources); | 41 | MemberProfileDTO memberProfileDTO = this.memberProfileOperationService.updateMemberProfileAndMember(resources); |
| 40 | log.info("memberProfile ==>> update ==>> result ===>> [{}]",memberProfileDTO); | 42 | log.info("memberProfile ==>> update ==>> result ===>> [{}]",memberProfileDTO); |
| 41 | 43 | ||
| 42 | return ResultInfo.success(memberProfileDTO); | 44 | return ResultInfo.success(memberProfileDTO); | ... | ... |
| 1 | package com.topdraw.business.module.member.profile.service.impl; | 1 | package com.topdraw.business.module.member.profile.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.aspect.AsyncMqSend; | ||
| 4 | import com.topdraw.business.module.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 5 | import com.topdraw.business.module.member.domain.MemberBuilder; | ||
| 6 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 7 | import com.topdraw.business.module.member.profile.domain.MemberProfileBuilder; | 5 | import com.topdraw.business.module.member.profile.domain.MemberProfileBuilder; |
| 8 | import com.topdraw.business.module.member.service.MemberService; | 6 | import com.topdraw.business.module.member.service.MemberService; |
| 9 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 7 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 10 | import com.topdraw.util.Base64Util; | 8 | import com.topdraw.util.Base64Util; |
| 11 | import com.topdraw.utils.RedisUtils; | 9 | import com.topdraw.utils.RedisUtils; |
| 12 | import com.topdraw.utils.StringUtils; | ||
| 13 | import com.topdraw.utils.ValidationUtil; | 10 | import com.topdraw.utils.ValidationUtil; |
| 14 | import com.topdraw.business.module.member.profile.repository.MemberProfileRepository; | 11 | import com.topdraw.business.module.member.profile.repository.MemberProfileRepository; |
| 15 | import com.topdraw.business.module.member.profile.service.MemberProfileService; | 12 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
| 16 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 13 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 17 | import com.topdraw.business.module.member.profile.service.mapper.MemberProfileMapper; | 14 | import com.topdraw.business.module.member.profile.service.mapper.MemberProfileMapper; |
| 18 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
| 16 | import org.apache.commons.lang3.StringUtils; | ||
| 19 | import org.springframework.beans.BeanUtils; | 17 | import org.springframework.beans.BeanUtils; |
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | import org.springframework.stereotype.Service; | 19 | import org.springframework.stereotype.Service; |
| ... | @@ -112,8 +110,11 @@ public class MemberProfileServiceImpl implements MemberProfileService { | ... | @@ -112,8 +110,11 @@ public class MemberProfileServiceImpl implements MemberProfileService { |
| 112 | public MemberProfileDTO update(MemberProfile resources) { | 110 | public MemberProfileDTO update(MemberProfile resources) { |
| 113 | 111 | ||
| 114 | log.info("MemberProfileServiceImpl ==>> update ==>> resources ===>> [{}]",resources); | 112 | log.info("MemberProfileServiceImpl ==>> update ==>> resources ===>> [{}]",resources); |
| 115 | this.redisUtils.doLock("memberProfile::update::id" + resources.getId()); | 113 | this.redisUtils.doLock("memberProfile::update::memberId" + resources.getMemberId()); |
| 116 | try { | 114 | try { |
| 115 | |||
| 116 | MemberProfileDTO _memberProfileDTO1 = this.findById(resources.getId()); | ||
| 117 | |||
| 117 | // 检查会员是否存在 | 118 | // 检查会员是否存在 |
| 118 | this.checkMember(resources); | 119 | this.checkMember(resources); |
| 119 | // 真实姓名(加密) | 120 | // 真实姓名(加密) |
| ... | @@ -124,9 +125,14 @@ public class MemberProfileServiceImpl implements MemberProfileService { | ... | @@ -124,9 +125,14 @@ public class MemberProfileServiceImpl implements MemberProfileService { |
| 124 | 125 | ||
| 125 | MemberProfile memberProfile = new MemberProfile(); | 126 | MemberProfile memberProfile = new MemberProfile(); |
| 126 | BeanUtils.copyProperties(resources,memberProfile); | 127 | BeanUtils.copyProperties(resources,memberProfile); |
| 128 | memberProfile.setCreateTime(_memberProfileDTO1.getCreateTime()); | ||
| 129 | String idCard = resources.getIdCard(); | ||
| 130 | if (StringUtils.isBlank(idCard)) { | ||
| 131 | idCard = _memberProfileDTO1.getIdCard(); | ||
| 132 | memberProfile.setIdCard(idCard); | ||
| 133 | } | ||
| 127 | MemberProfile _memberProfile = this.memberProfileRepository.save(memberProfile); | 134 | MemberProfile _memberProfile = this.memberProfileRepository.save(memberProfile); |
| 128 | 135 | ||
| 129 | |||
| 130 | MemberProfileDTO memberProfileDTO = new MemberProfileDTO(); | 136 | MemberProfileDTO memberProfileDTO = new MemberProfileDTO(); |
| 131 | BeanUtils.copyProperties(_memberProfile,memberProfileDTO); | 137 | BeanUtils.copyProperties(_memberProfile,memberProfileDTO); |
| 132 | return memberProfileDTO; | 138 | return memberProfileDTO; | ... | ... |
| ... | @@ -292,7 +292,7 @@ public class UserOperationController { | ... | @@ -292,7 +292,7 @@ public class UserOperationController { |
| 292 | if (StringUtils.isNotBlank(headimgurl)) { | 292 | if (StringUtils.isNotBlank(headimgurl)) { |
| 293 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); | 293 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); |
| 294 | String imageEncode = Base64Util.encode(headimgurlDecode); | 294 | String imageEncode = Base64Util.encode(headimgurlDecode); |
| 295 | String image = RestTemplateClient.chooseImage(imageEncode, "image"); | 295 | String image = RestTemplateClient.netImage(headimgurlDecode); |
| 296 | memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) == true ? image:headimgurlDecode); | 296 | memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) == true ? image:headimgurlDecode); |
| 297 | } | 297 | } |
| 298 | } catch (Exception e) { | 298 | } catch (Exception e) { | ... | ... |
| ... | @@ -48,7 +48,8 @@ public class MemberAddressOperationServiceImpl implements MemberAddressOperation | ... | @@ -48,7 +48,8 @@ public class MemberAddressOperationServiceImpl implements MemberAddressOperation |
| 48 | if (maxSequence < 6) { | 48 | if (maxSequence < 6) { |
| 49 | resources.setSequence(maxSequence+1); | 49 | resources.setSequence(maxSequence+1); |
| 50 | MemberAddressDTO memberAddressDTO = this.memberAddressService.create(resources); | 50 | MemberAddressDTO memberAddressDTO = this.memberAddressService.create(resources); |
| 51 | memberAddressDTO.setMemberCode(resources.getMemberCode()); | 51 | MemberDTO memberDTO = this.memberService.findById(resources.getMemberId()); |
| 52 | memberAddressDTO.setMemberCode(memberDTO.getCode()); | ||
| 52 | ((MemberAddressOperationServiceImpl) AopContext.currentProxy()).asyncMemberAddress(memberAddressDTO); | 53 | ((MemberAddressOperationServiceImpl) AopContext.currentProxy()).asyncMemberAddress(memberAddressDTO); |
| 53 | return memberAddressDTO; | 54 | return memberAddressDTO; |
| 54 | } | 55 | } | ... | ... |
| ... | @@ -13,6 +13,8 @@ import org.springframework.aop.framework.AopContext; | ... | @@ -13,6 +13,8 @@ import org.springframework.aop.framework.AopContext; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 15 | 15 | ||
| 16 | import javax.validation.constraints.NotNull; | ||
| 17 | |||
| 16 | 18 | ||
| 17 | /** | 19 | /** |
| 18 | * @author : | 20 | * @author : |
| ... | @@ -46,6 +48,11 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation | ... | @@ -46,6 +48,11 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation |
| 46 | 48 | ||
| 47 | @Override | 49 | @Override |
| 48 | public MemberProfileDTO updateMemberProfileAndMember(MemberProfile resources) { | 50 | public MemberProfileDTO updateMemberProfileAndMember(MemberProfile resources) { |
| 51 | Long id = resources.getId(); | ||
| 52 | MemberProfileDTO _memberProfile = this.memberProfileService.findById(id); | ||
| 53 | Long memberId = _memberProfile.getMemberId(); | ||
| 54 | resources.setMemberId(memberId); | ||
| 55 | |||
| 49 | MemberDTO memberDTO = this.memberService.checkMember(resources.getMemberId(), resources.getMemberCode()); | 56 | MemberDTO memberDTO = this.memberService.checkMember(resources.getMemberId(), resources.getMemberCode()); |
| 50 | resources.setMemberCode(memberDTO.getCode()); | 57 | resources.setMemberCode(memberDTO.getCode()); |
| 51 | 58 | ... | ... |
| 1 | package com.topdraw.business.process.service.member; | 1 | package com.topdraw.business.process.service.member; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.module.member.domain.Member; | ||
| 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 3 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 4 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 6 | 5 | ... | ... |
| 1 | package com.topdraw.mq.config; | 1 | package com.topdraw.mq.config; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import com.topdraw.config.LocalConstants; | ||
| 5 | import org.apache.commons.lang3.StringUtils; | ||
| 4 | import org.springframework.amqp.core.*; | 6 | import org.springframework.amqp.core.*; |
| 5 | import org.springframework.beans.factory.annotation.Value; | 7 | import org.springframework.beans.factory.annotation.Value; |
| 6 | import org.springframework.context.annotation.Bean; | 8 | import org.springframework.context.annotation.Bean; |
| ... | @@ -9,84 +11,56 @@ import org.springframework.context.annotation.Configuration; | ... | @@ -9,84 +11,56 @@ import org.springframework.context.annotation.Configuration; |
| 9 | @Configuration | 11 | @Configuration |
| 10 | public class RabbitMqConfig { | 12 | public class RabbitMqConfig { |
| 11 | 13 | ||
| 12 | /** 交换机--广播*/ | 14 | @Value("${engine.platform}") |
| 13 | public static final String UC_EXCHANGE_FANOUT = "uc.fanout"; | 15 | private String platform; |
| 14 | public static final String UC_EXCHANGE_DIRECT = "uc.direct"; | ||
| 15 | 16 | ||
| 16 | /** 队列-- */ | 17 | @Value("${engine.type}") |
| 17 | public static final String UC_QUEUE_DIRECT_BBB = "uc.route.key.direct.event.bbb"; | 18 | private String type; |
| 18 | public static final String UC_QUEUE_DIRECT_CCC = "uc.route.key.direct.event.ccc.new"; | ||
| 19 | 19 | ||
| 20 | public static final String ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT = "engine.iptv.consumer.member.direct"; | 20 | @Value("${engine.mq.exchange}") |
| 21 | private String exchange; | ||
| 21 | 22 | ||
| 22 | /** 队列-- */ | 23 | @Value("${engine.mq.routingkey}") |
| 23 | public static final String UC_QUEUE_FANOUT_IPTV = "uc.fanout.iptv"; | 24 | private String routingKey; |
| 24 | public static final String UC_QUEUE_FANOUT_WEIXIN = "uc.fanout.weixin"; | ||
| 25 | 25 | ||
| 26 | 26 | public String getExchange(){ | |
| 27 | @Bean | 27 | if (StringUtils.isEmpty(this.exchange)) { |
| 28 | FanoutExchange ucFanoutExchange(){ | 28 | this.routingKey = "uc.direct"; |
| 29 | return ExchangeBuilder.fanoutExchange(UC_EXCHANGE_FANOUT).build(); | ||
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | @Bean | 31 | return this.exchange; |
| 33 | DirectExchange ucDirectExchange(){ | ||
| 34 | return ExchangeBuilder.directExchange(UC_EXCHANGE_DIRECT).build(); | ||
| 35 | } | 32 | } |
| 36 | 33 | ||
| 37 | @Bean | 34 | public String getRoutingKey() { |
| 38 | Queue engine2IptvConsumerMember(){ return new Queue(ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT); } | 35 | if (StringUtils.isEmpty(this.routingKey)) { |
| 39 | 36 | ||
| 40 | @Bean | 37 | if (platform.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_SERVICE)) { |
| 41 | Queue ucDirectQueueCCC(){ | ||
| 42 | return new Queue(UC_QUEUE_DIRECT_CCC); | ||
| 43 | } | ||
| 44 | 38 | ||
| 45 | @Bean | 39 | if (StringUtils.isEmpty(this.type)) { |
| 46 | Queue ucDirectQueueBBB(){ | 40 | this.type = LocalConstants.ENV_VIS; |
| 47 | return new Queue(UC_QUEUE_DIRECT_BBB); | ||
| 48 | } | 41 | } |
| 49 | 42 | ||
| 50 | @Bean | ||
| 51 | Binding directExchangeBindingEngine2IptvConsumerMember(DirectExchange directExchange , Queue ucDirectQueueBBB) { | ||
| 52 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = | ||
| 53 | BindingBuilder.bind(ucDirectQueueBBB).to(directExchange); | ||
| 54 | return directExchangeRoutingKeyConfigurer.with(ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT); | ||
| 55 | } | 43 | } |
| 56 | 44 | ||
| 57 | @Bean | 45 | this.routingKey = "uc."+platform+"."+type+".direct"; |
| 58 | Binding directExchangeBindingBBB(DirectExchange directExchange , Queue ucDirectQueueBBB) { | ||
| 59 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = | ||
| 60 | BindingBuilder.bind(ucDirectQueueBBB).to(directExchange); | ||
| 61 | return directExchangeRoutingKeyConfigurer.with(UC_QUEUE_DIRECT_BBB); | ||
| 62 | } | 46 | } |
| 63 | 47 | ||
| 64 | @Bean | 48 | return routingKey; |
| 65 | Binding directExchangeBindingCCC(DirectExchange directExchange , Queue ucDirectQueueCCC) { | ||
| 66 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = | ||
| 67 | BindingBuilder.bind(ucDirectQueueCCC).to(directExchange); | ||
| 68 | return directExchangeRoutingKeyConfigurer.with(UC_QUEUE_DIRECT_CCC); | ||
| 69 | } | 49 | } |
| 70 | 50 | ||
| 71 | @Bean | 51 | @Bean |
| 72 | Queue ucFanoutQueueIptv(){ | 52 | DirectExchange directExchange(){ |
| 73 | return new Queue(UC_QUEUE_FANOUT_IPTV); | 53 | return ExchangeBuilder.directExchange(getExchange()).build(); |
| 74 | } | 54 | } |
| 75 | 55 | ||
| 76 | @Bean | 56 | @Bean |
| 77 | Queue ucFanoutQueueWeiXin(){ | 57 | Queue queue(){ return new Queue(getRoutingKey()); } |
| 78 | return new Queue(UC_QUEUE_FANOUT_WEIXIN); | ||
| 79 | } | ||
| 80 | 58 | ||
| 81 | @Bean | 59 | @Bean |
| 82 | Binding fanoutExchangeBindingIptv(FanoutExchange ucFanoutExchange , Queue ucFanoutQueueIptv) { | 60 | Binding binding(DirectExchange directExchange , Queue queue) { |
| 83 | return BindingBuilder.bind(ucFanoutQueueIptv).to(ucFanoutExchange); | 61 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = |
| 84 | } | 62 | BindingBuilder.bind(queue).to(directExchange); |
| 85 | 63 | return directExchangeRoutingKeyConfigurer.with(getRoutingKey()); | |
| 86 | @Bean | ||
| 87 | Binding fanoutExchangeBindingWeiXin(FanoutExchange ucFanoutExchange , Queue ucFanoutQueueWeiXin) { | ||
| 88 | return BindingBuilder.bind(ucFanoutQueueWeiXin).to(ucFanoutExchange); | ||
| 89 | } | 64 | } |
| 90 | 65 | ||
| 91 | |||
| 92 | } | 66 | } | ... | ... |
| ... | @@ -18,44 +18,19 @@ public class MessageProducer { | ... | @@ -18,44 +18,19 @@ public class MessageProducer { |
| 18 | @Autowired | 18 | @Autowired |
| 19 | private AmqpTemplate amqpTemplate; | 19 | private AmqpTemplate amqpTemplate; |
| 20 | 20 | ||
| 21 | @Value("#{rabbitMqConfig.getRoutingKey()}") | ||
| 22 | private String routingKey; | ||
| 21 | 23 | ||
| 22 | @Value("${engine.platform}") | ||
| 23 | private String platform; | ||
| 24 | 24 | ||
| 25 | public void sendMessage(String msg,String exchangeName){ | 25 | public void sendMessage(String msg,String exchangeName){ |
| 26 | 26 | ||
| 27 | // 管理侧 | 27 | // 管理侧 |
| 28 | if (platform.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_MANAGEMENT)) { | ||
| 29 | if (StringUtils.isEmpty(exchangeName)) { | 28 | if (StringUtils.isEmpty(exchangeName)) { |
| 30 | exchangeName = RabbitMqConfig.UC_QUEUE_DIRECT_CCC; | 29 | exchangeName = this.routingKey; |
| 31 | } | ||
| 32 | this.sendDirectMessage(msg,exchangeName); | ||
| 33 | } | 30 | } |
| 34 | 31 | ||
| 35 | // 产品侧 | ||
| 36 | if (platform.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_SERVICE)) { | ||
| 37 | if (StringUtils.isEmpty(exchangeName)) { | ||
| 38 | // exchangeName = RabbitMqConfig.UC_QUEUE_DIRECT_BBB; | ||
| 39 | exchangeName = RabbitMqConfig.ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT; | ||
| 40 | } | ||
| 41 | this.sendDirectMessage(msg,exchangeName); | 32 | this.sendDirectMessage(msg,exchangeName); |
| 42 | } | ||
| 43 | |||
| 44 | } | ||
| 45 | 33 | ||
| 46 | /** | ||
| 47 | * 广播 | ||
| 48 | * @param msg | ||
| 49 | * @param exchangeName | ||
| 50 | * @author XiangHan | ||
| 51 | * @date 2021/9/7 11:10 上午 | ||
| 52 | */ | ||
| 53 | private void sendFanoutMessage(String msg,String exchangeName) { | ||
| 54 | if (StringUtils.isEmpty(exchangeName)) { | ||
| 55 | exchangeName = RabbitMqConfig.UC_EXCHANGE_FANOUT; | ||
| 56 | } | ||
| 57 | amqpTemplate.convertAndSend(exchangeName, "", msg); | ||
| 58 | log.info("send sendFanoutMessage msg || entityType: {} || msg:{} ", msg); | ||
| 59 | } | 34 | } |
| 60 | 35 | ||
| 61 | /** | 36 | /** |
| ... | @@ -68,7 +43,7 @@ public class MessageProducer { | ... | @@ -68,7 +43,7 @@ public class MessageProducer { |
| 68 | private void sendDirectMessage(String msg,String queueName) { | 43 | private void sendDirectMessage(String msg,String queueName) { |
| 69 | 44 | ||
| 70 | amqpTemplate.convertAndSend(queueName, msg); | 45 | amqpTemplate.convertAndSend(queueName, msg); |
| 71 | log.info("send sendFanoutMessage msg || entityType: {} || msg:{} ", msg); | 46 | log.info("send sendMessage msg || routingkey: {} || msg:{} ", queueName, msg); |
| 72 | } | 47 | } |
| 73 | 48 | ||
| 74 | /** | 49 | /** | ... | ... |
| ... | @@ -42,10 +42,10 @@ public class RestTemplateClient { | ... | @@ -42,10 +42,10 @@ public class RestTemplateClient { |
| 42 | restTemplate = new RestTemplate(factory); | 42 | restTemplate = new RestTemplate(factory); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | public static String chooseImage(String base64Url, String entity) { | 45 | public static String netImage(String imageUrl) { |
| 46 | Image image = new Image(base64Url, entity); | 46 | Image image = new Image(imageUrl); |
| 47 | String entityBody = ""; | 47 | String entityBody = ""; |
| 48 | String url = BASE_URL + "/ucService/api/upload/chooseImage"; | 48 | String url = BASE_URL + "/common/upload/netImage"; |
| 49 | log.info("request uc : url is " + url + ", memberId is " + com.alibaba.fastjson.JSONObject.toJSONString(image)); | 49 | log.info("request uc : url is " + url + ", memberId is " + com.alibaba.fastjson.JSONObject.toJSONString(image)); |
| 50 | ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, image, String.class); | 50 | ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, image, String.class); |
| 51 | if (responseEntity.getStatusCode().is2xxSuccessful()) { | 51 | if (responseEntity.getStatusCode().is2xxSuccessful()) { |
| ... | @@ -61,12 +61,10 @@ public class RestTemplateClient { | ... | @@ -61,12 +61,10 @@ public class RestTemplateClient { |
| 61 | @Data | 61 | @Data |
| 62 | static class Image { | 62 | static class Image { |
| 63 | 63 | ||
| 64 | private String base64URL; | 64 | private String url; |
| 65 | private String entity; | ||
| 66 | 65 | ||
| 67 | public Image(String base64Url, String entity){ | 66 | public Image(String imageUrl){ |
| 68 | this.base64URL = base64Url; | 67 | this.url = imageUrl; |
| 69 | this.entity = entity; | ||
| 70 | } | 68 | } |
| 71 | 69 | ||
| 72 | } | 70 | } | ... | ... |
| ... | @@ -5,7 +5,7 @@ spring: | ... | @@ -5,7 +5,7 @@ spring: |
| 5 | # url: jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 5 | # url: jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 6 | # username: root | 6 | # username: root |
| 7 | # password: Tjlh@2017 | 7 | # password: Tjlh@2017 |
| 8 | url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user_iptv?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 8 | url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user_admin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 9 | username: root | 9 | username: root |
| 10 | password: root | 10 | password: root |
| 11 | 11 | ||
| ... | @@ -91,11 +91,11 @@ jwt: | ... | @@ -91,11 +91,11 @@ jwt: |
| 91 | 91 | ||
| 92 | #是否允许生成代码,生产环境设置为false | 92 | #是否允许生成代码,生产环境设置为false |
| 93 | generator: | 93 | generator: |
| 94 | enabled: true | 94 | enabled: false |
| 95 | 95 | ||
| 96 | #是否开启 swagger-ui | 96 | #是否开启 swagger-ui |
| 97 | swagger: | 97 | swagger: |
| 98 | enabled: true | 98 | enabled: false |
| 99 | 99 | ||
| 100 | file: | 100 | file: |
| 101 | path: system/file | 101 | path: system/file |
| ... | @@ -107,9 +107,13 @@ file: | ... | @@ -107,9 +107,13 @@ file: |
| 107 | 107 | ||
| 108 | engine: | 108 | engine: |
| 109 | # 部署类型 management:管理侧 service:服务侧 | 109 | # 部署类型 management:管理侧 service:服务侧 |
| 110 | platform: service | 110 | platform: management |
| 111 | # 可选参数 mobile:小屏 vis:大屏 | 111 | # 可选参数 mobile:小屏 vis:大屏 如果是管理侧,则可以无需配置 |
| 112 | type: vis | 112 | type: |
| 113 | # 自定义mq配置 | ||
| 114 | mq: | ||
| 115 | exchange: uc.direct.management | ||
| 116 | routingkey: uc.engine.service.direct | ||
| 113 | 117 | ||
| 114 | weixin: | 118 | weixin: |
| 115 | list: | 119 | list: | ... | ... |
| ... | @@ -14,32 +14,14 @@ public class MemberProfileControllerTest extends BaseTest { | ... | @@ -14,32 +14,14 @@ public class MemberProfileControllerTest extends BaseTest { |
| 14 | private MemberProfileController memberProfileController; | 14 | private MemberProfileController memberProfileController; |
| 15 | 15 | ||
| 16 | @Test | 16 | @Test |
| 17 | public void create(){ | ||
| 18 | Long memberId = 1L; | ||
| 19 | MemberProfile resources = new MemberProfile(); | ||
| 20 | resources.setMemberId(memberId); | ||
| 21 | resources.setIdCard("422827199208010713"); | ||
| 22 | resources.setBirthday(TimestampUtil.now().toString()); | ||
| 23 | resources.setGender(1); | ||
| 24 | resources.setDescription(""); | ||
| 25 | resources.setRealname(""); | ||
| 26 | resources.setConstellation(""); | ||
| 27 | resources.setProvince(""); | ||
| 28 | resources.setCity(""); | ||
| 29 | resources.setEmail(""); | ||
| 30 | resources.setDistrict(""); | ||
| 31 | String s = JSON.toJSONString(resources); | ||
| 32 | // this.memberProfileController.create(resources); | ||
| 33 | LOG.info("=====>>>"+s); | ||
| 34 | } | ||
| 35 | |||
| 36 | @Test | ||
| 37 | public void update(){ | 17 | public void update(){ |
| 38 | Long memberId = 1L; | ||
| 39 | MemberProfile resources = new MemberProfile(); | 18 | MemberProfile resources = new MemberProfile(); |
| 40 | resources.setId(1L); | 19 | resources.setId(4L); |
| 41 | resources.setMemberId(memberId); | 20 | resources.setRealname("吉贝"); |
| 42 | resources.setCity("sh"); | 21 | resources.setGender(0); |
| 22 | resources.setBirthday("1992-08-01"); | ||
| 23 | resources.setPhone("18271269120"); | ||
| 24 | resources.setAvatarUrl("upload/icon/2022-03-29/d935ff29-d214-401b-98ad-bd3ef87cafd7.jpeg"); | ||
| 43 | String s = JSON.toJSONString(resources); | 25 | String s = JSON.toJSONString(resources); |
| 44 | this.memberProfileController.update(resources); | 26 | this.memberProfileController.update(resources); |
| 45 | LOG.info("=====>>>s=====>>>" + s); | 27 | LOG.info("=====>>>s=====>>>" + s); | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.topdraw.test.business.process.rest; | ... | @@ -3,6 +3,7 @@ package com.topdraw.test.business.process.rest; |
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.topdraw.BaseTest; | 5 | import com.topdraw.BaseTest; |
| 6 | import com.topdraw.business.module.user.iptv.domain.UserTv; | ||
| 6 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 7 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 7 | import com.topdraw.business.process.domian.weixin.BindBean; | 8 | import com.topdraw.business.process.domian.weixin.BindBean; |
| 8 | import com.topdraw.business.process.domian.weixin.TvUnBindBean; | 9 | import com.topdraw.business.process.domian.weixin.TvUnBindBean; |
| ... | @@ -102,9 +103,9 @@ public class UserOperationControllerTest extends BaseTest { | ... | @@ -102,9 +103,9 @@ public class UserOperationControllerTest extends BaseTest { |
| 102 | public void createWeixinUserAndMember() { | 103 | public void createWeixinUserAndMember() { |
| 103 | try { | 104 | try { |
| 104 | String a = "{\n" + | 105 | String a = "{\n" + |
| 105 | "\"unionid\":\"oqDha5gjkNC4sivrcjbZSRq9foXM\",\n" + | 106 | "\"unionid\":\"oqDha5idQxR0WGPW2qHi-meGM6Ck\",\n" + |
| 106 | "\"appid\":\"wx37ea49702cdc693b\", \n" + | 107 | "\"appid\":\"wxfaa765183a332521\", \n" + |
| 107 | "\"openid\":\"oM3jj5ke7o68I9-mIrAuQ8StkD_0\", \n" + | 108 | "\"openid\":\"oxgff4oMXi0TSez6kYxEao98emFE\", \n" + |
| 108 | "\"authTime\":\"2022-03-22 20:10:43.47\"\n" + | 109 | "\"authTime\":\"2022-03-22 20:10:43.47\"\n" + |
| 109 | "}"; | 110 | "}"; |
| 110 | UserWeixin parse = JSONObject.parseObject(a, UserWeixin.class); | 111 | UserWeixin parse = JSONObject.parseObject(a, UserWeixin.class); |
| ... | @@ -115,4 +116,18 @@ public class UserOperationControllerTest extends BaseTest { | ... | @@ -115,4 +116,18 @@ public class UserOperationControllerTest extends BaseTest { |
| 115 | } | 116 | } |
| 116 | } | 117 | } |
| 117 | 118 | ||
| 119 | @Test | ||
| 120 | public void createTvUserAndMember() { | ||
| 121 | try { | ||
| 122 | String a = "{\n" + | ||
| 123 | " \"platformAccount\": \"xianghan03@ITV\",\n" + | ||
| 124 | " \"visUserId\": 7\n" + | ||
| 125 | "}"; | ||
| 126 | UserTv parse = JSONObject.parseObject(a, UserTv.class); | ||
| 127 | ResultInfo weixinUserAndMember = this.userOperationController.createTvUserAndMember(parse); | ||
| 128 | System.out.println(weixinUserAndMember); | ||
| 129 | } catch (Exception e) { | ||
| 130 | e.printStackTrace(); | ||
| 131 | } | ||
| 132 | } | ||
| 118 | } | 133 | } | ... | ... |
-
Please register or sign in to post a comment