| | |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | return new AppUserClient() { |
| | | @Override |
| | | public AppUser getAppUserById(Long id) { |
| | | log.error("根据id获取用户失败:" + cause.getMessage()); |
| | | log.error("根据id获取用户失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("根据id获取用户失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Void> editAppUserById(AppUser appUser) { |
| | | log.error("编辑用户信息失败:{}", cause.getMessage()); |
| | | return R.fail("编辑用户信息失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Long> getCouponCount(Long userId, Integer couponId) { |
| | | log.error("获取优惠券数量失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取优惠券数量失败"); |
| | | } |
| | | |
| | | @GetMapping("/appUserShop/shop/{userId}") |
| | | @Override |
| | | public R<List<AppUserShop>> getAppUserShop(Long userId) { |
| | | log.error("获取用户门店信息失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取用户门店信息失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getUserAncestorList(Long id) { |
| | | log.error("获取用户祖籍列表失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取用户祖籍列表失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<AppUser> getSuperiorLeader(Long id) { |
| | | return R.fail("获取直帮上级用户失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getTopUsers() { |
| | | log.error("获取用户列表失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取用户列表失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Long> getVipCount(Long userId, Integer vipId) { |
| | | log.error("获取直推会员数失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取直推会员数失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getAppUserByName(String name) { |
| | | return R.fail("根据用户名称模糊搜索用户列表失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getAppUserByPhone(String phone) { |
| | | return R.fail("根据用户电话模糊搜索用户列表失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<Void> addAppUserShop(AppUserShop appUserShop) { |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<AppUser> getAppUserByPhone1(String phone) { |
| | | return R.fail("通过手机号查询用户失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> setLowerUserShop(Long userId, Integer shopId) { |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public List<AppUser> listByIds(List<Long> list) { |
| | | log.error("获取用户失败: "+cause.getMessage()); |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public void vipUpgrade(Long appUserId) { |
| | | R.fail("检查会员等级变更失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void vipDemotion(Long appUserId) { |
| | | R.fail("检查会员等级降级失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void demotionDetection() { |
| | | R.fail("用户降级检测失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R clearBindShop(Integer shopId) { |
| | | return R.fail("清空绑定门店的用户门店数据失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |