| | |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Api(tags = {"登录注册-小程序"}) |
| | | @RestController |
| | | @RequestMapping("/app-user") |
| | | @Slf4j |
| | | public class AppUserController extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | .like(AppUser::getName, name)); |
| | | return R.ok(list); |
| | | } |
| | | /** |
| | | * 根据用户名称模糊搜索用户列表,不过滤状态 |
| | | */ |
| | | @GetMapping("/getAppUserByNameNoFilter") |
| | | public R<List<AppUser>> getAppUserByNameNoFilter(@RequestParam("name") String name) { |
| | | List<AppUser> list = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .like(AppUser::getName, name)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据用户电话模糊搜索用户列表 |
| | |
| | | public R<List<AppUser>> getAppUserByPhone(@RequestParam("phone") String phone) { |
| | | List<AppUser> list = appUserService.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getDelFlag, 0).eq(AppUser::getStatus, 1) |
| | | .like(AppUser::getPhone, phone)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 更具用户电话模糊查询用户列表,不过滤状态 |
| | | */ |
| | | @GetMapping("/getAppUserByPhoneNoFilter") |
| | | public R<List<AppUser>> getAppUserByPhoneNoFilter(@RequestParam("phone") String phone) { |
| | | List<AppUser> list = appUserService.getAppUserByPhoneNoFilter(phone); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | AppUser byId = appUserService.getById(id); |
| | | byId.setStatus(status); |
| | | appUserService.updateById(byId); |
| | | loginout(id); |
| | | if (status == 2){ |
| | | loginout(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (!CollectionUtils.isEmpty(keys)) { |
| | | for (String key : keys) { |
| | | LoginUser user = redisService.getCacheObject(key); |
| | | if (user == null || user.getUserid() == null) { |
| | | continue; |
| | | } |
| | | if (user.getUserid().equals(userId)) { |
| | | redisService.deleteObject(key); |
| | | break; |
| | |
| | | @ApiOperation(value = "用户列表-绑定下级列表", tags = {"管理后台"}) |
| | | public R<Page<AppUser>> bottom(Long id, Integer pageNum, Integer pageSize) { |
| | | //绑定下级 |
| | | Page<AppUser> page = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).page(Page.of(pageNum, pageSize)); |
| | | Page<AppUser> page = appUserService.lambdaQuery() |
| | | .eq(AppUser::getInviteUserId, id) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .eq(AppUser::getStatus, 1) |
| | | .page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | |
| | | } |