Documentation ¶
Index ¶
- Variables
- type API
- func (a *API) CorpID() string
- func (a *API) GetUser(uid, at string) (*User, error)
- func (a *API) ListDepartment(id int, recursive bool) (data Departments, err error)
- func (a *API) ListUser(deptID int) (data []User, err error)
- func (a *API) StatusDepartment(data []DepartmentUp) (res []DeptRespItem, err error)
- func (a *API) StatusUser(data []UserUp) (res []UserRespItem, err error)
- func (a *API) SyncDepartment(data []DepartmentUp) (res []DeptRespItem, err error)
- func (a *API) SyncUser(data []UserUp) (res []UserRespItem, err error)
- type Department
- type DepartmentUp
- type Departments
- type DeptRespItem
- type Status
- type User
- type UserRespItem
- type UserUp
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) ListDepartment ¶
func (a *API) ListDepartment(id int, recursive bool) (data Departments, err error)
func (*API) StatusDepartment ¶
func (a *API) StatusDepartment(data []DepartmentUp) (res []DeptRespItem, err error)
StatusDepartment ...
func (*API) StatusUser ¶
func (a *API) StatusUser(data []UserUp) (res []UserRespItem, err error)
StatusUser ...
func (*API) SyncDepartment ¶
func (a *API) SyncDepartment(data []DepartmentUp) (res []DeptRespItem, err error)
SyncDepartment ...
type Department ¶
type Department struct { CorpDeptID int `json:"corpDeptCode,string,omitempty"` CorpParentID int `json:"corpParentCode,string,omitempty"` ID int `json:"deptCode,string"` ParentID int `json:"fatherCode,string"` NameCN string `json:"deptNameCn"` NameEN string `json:"deptNameEn"` Level int `json:"deptLevel,string"` Leader string `json:"managerId,omitempty"` OrderNo int `json:"orderNo,string,omitempty"` HasChild int `json:"hasChildDept,omitempty"` }
Department 部门 "deptCode": "1", "deptNameCn": "产品销售部", "deptNameEn": "Sales Dept", "fatherCode": "0", "deptLevel": "2", "orderNo": 1
func FilterDepartment ¶
func FilterDepartment(data []Department, id int) (*Department, error)
FilterDepartment Deprecated with Departments.WithID()
type DepartmentUp ¶
type DepartmentUp struct { CorpDeptID int `json:"corpDeptCode,string"` CorpParentID int `json:"corpParentCode,string"` NameCN string `json:"deptNameCn"` NameEN string `json:"deptNameEn"` Level int `json:"deptLevel,string"` Leader string `json:"managerId"` OrderNo int `json:"orderNo,string"` Valid int `json:"valid,string"` }
DepartmentUp 部门更新请求对象 "corpDeptCode": "dddddd", "corpParentCode": "ddfd", "deptNameCn": "生产部门", "deptNameEn": "produce dept", "deptLevel": "1", "managerId": "", "valid": "1", "orderNo": "1000"
type Departments ¶
type Departments []Department
func (Departments) Less ¶
func (z Departments) Less(i, j int) bool
func (Departments) Swap ¶
func (z Departments) Swap(i, j int)
func (Departments) WithID ¶
func (z Departments) WithID(id int) *Department
type DeptRespItem ¶
DeptRespItem ...
type Status ¶
type Status uint8
Status 状态
type User ¶
type User struct { CorpUID string `json:"corpUserId"` // required CorpDeptID int `json:"corpDeptCode,string"` // required UserID string `json:"userId"` // required NameCN string `json:"userNameCn"` // required NameEN string `json:"userNameEn"` // required DepartmentID int `json:"deptCode,string,omitempty"` // deptCode at welink Mobile string `json:"mobileNumber"` // required Phone string `json:"phoneNumber,omitempty"` // required Email string `json:"userEmail"` // required Gender gender.Gender `json:"sex,string,omitempty"` Status Status `json:"userStatus,omitempty"` Remark string `json:"remark,emitempty"` Address string `json:"address,emitempty"` Activated uint8 `json:"isActivated,omitempty"` Createds string `json:"creationTime,omitempty"` Updateds string `json:"lastUpdatedTime,omitempty"` IsOpenAccount int `json:"isOpenAccount,string,omitempty"` // required Valid int `json:"valid,string,string"` // required IsHideMobileNumber int `json:"isHideMobileNumber,string,omitempty"` // 1 public default, 2 hide OrderInDepts int `json:"orderInDepts,string"` }
User 用户 "code": "0", "message": "ok", "userStatus": "1", "userId": "zhangshan2@welink", "deptCode": "10001", "mobileNumber": "+86-15811847236", "userNameCn": "张三", "userNameEn": "zhangshan", "sex": "M", "corpUserId": "36188", "userEmail": "zhangshan4@126.com", "secretary": "zhangshan@welink", "phoneNumber": "0755-88888888", "address": "广东省深圳", "remark": "欢迎加入WeLink", "isActivated": 1, "creationTime": "2018-05-03 13:58:02", "lastUpdatedTime": "2018-05-03 13:58:02"
type UserRespItem ¶
UserRespItem ...