| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package com.malk.minglei.dto;
- import com.fasterxml.jackson.annotation.JsonProperty;
- import javax.validation.constraints.NotBlank;
- import javax.validation.constraints.Max;
- import javax.validation.constraints.Min;
- import javax.validation.constraints.NotNull;
- import javax.validation.constraints.Pattern;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * 按部门查询钉钉成员的请求模型。
- */
- public class DepartmentUserQueryRequest {
- @NotBlank
- @Pattern(regexp = "\\s*[1-9]\\d*\\s*(,\\s*[1-9]\\d*\\s*)*", message = "dept_Id must be comma-separated positive integers")
- @JsonProperty("dept_Id")
- private String departmentId;
- @NotNull
- @Min(value = 0, message = "type must be 0 or 1")
- @Max(value = 1, message = "type must be 0 or 1")
- private Integer type;
- public List<Long> getDepartmentIds() {
- List<Long> departmentIds = new ArrayList<Long>();
- for (String value : departmentId.split(",")) {
- departmentIds.add(Long.parseLong(value.trim()));
- }
- return departmentIds;
- }
- public void setDepartmentId(String departmentId) {
- this.departmentId = departmentId;
- }
- /**
- * 返回部门查询范围:0 表示包含子部门,1 表示仅当前部门。
- *
- * @return 部门查询范围标识
- */
- public int getType() {
- return type;
- }
- /**
- * 设置部门查询范围,由请求体中的 type 字段绑定。
- *
- * @param type 0 表示包含子部门,1 表示仅当前部门
- */
- public void setType(Integer type) {
- this.type = type;
- }
- }
|