| | |
| | | import com.yeshi.fanli.exception.user.ThreeSaleException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.tb.TaoBaoUnionAuthRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | |
| | | UserInfo temp = userInfoMapper.selectByPrimaryKey(form.getId());
|
| | | COSManager cosManager = COSManager.getInstance();
|
| | | InputStream inputStream = HttpUtil.getAsInputStream(temp.getPortrait());
|
| | | String uploadFile = cosManager.uploadFile(inputStream, UUID.randomUUID().toString()).getUrl();
|
| | | String uploadFile = cosManager.uploadFile(inputStream, FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString()).getUrl();
|
| | | UserInfo updateTemp = new UserInfo(temp.getId());
|
| | | updateTemp.setPortrait(uploadFile);
|
| | | userInfoMapper.updateByPrimaryKeySelective(updateTemp);
|
| | |
| | | find.setWxUnionId(weiXinUser.getUnionid());
|
| | | String wxHeadImg = COSManager.getInstance()
|
| | | .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString())
|
| | | FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString())
|
| | | .getUrl();
|
| | | find.setPortrait(wxHeadImg);
|
| | | find.setWxPic(wxHeadImg);
|
| | |
| | | Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
|
| | |
|
| | | // 执行上传
|
| | | String filePath = "/img/user/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String filePath =FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
|
| | |
|
| | | // 删除本地图片
|
| | |
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | |
|
| | | // 删除原头像
|
| | | if (!StringUtil.isNullOrEmpty(portrait) && portrait.contains("/img/user/")) {
|
| | | if (!StringUtil.isNullOrEmpty(portrait)) {
|
| | | COSManager.getInstance().deleteFile(portrait);
|
| | | }
|
| | |
|