init
This commit is contained in:
@@ -15,12 +15,15 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.User;
|
||||
import com.ruoyi.xq.service.UserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户管理
|
||||
@@ -46,6 +49,22 @@ public class UserController extends BaseController {
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@GetMapping("/getByUsercode")
|
||||
public R<User> getByUsercode(String usercode){
|
||||
return R.ok(userService.getByUsercode(usercode));
|
||||
}
|
||||
|
||||
@GetMapping("/listByUserCode")
|
||||
public R<List<String>> listByUserCode(String usercode, int limit){
|
||||
if(limit == 0){
|
||||
limit = 40;
|
||||
}
|
||||
List<User> users = userService.list(Wrappers.lambdaQuery(User.class)
|
||||
.select(User::getUsercode)
|
||||
.like(StringUtils.isNotEmpty(usercode), User::getUsercode, usercode)
|
||||
.last("limit " + limit));
|
||||
return R.ok(users.stream().map(User::getUsercode).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户管理详细信息
|
||||
|
||||
Reference in New Issue
Block a user