From 965ff2530d959626409eccfb96a023bd3d0e7002 Mon Sep 17 00:00:00 2001 From: zhaomingqiang Date: Tue, 13 Apr 2021 11:51:25 +0800 Subject: [PATCH] fix bug contact service --- service/contact/v3/model.go | 111 ++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 44 deletions(-) diff --git a/service/contact/v3/model.go b/service/contact/v3/model.go index 66dfd174..c21342c7 100644 --- a/service/contact/v3/model.go +++ b/service/contact/v3/model.go @@ -149,17 +149,16 @@ func (s *Department) MarshalJSON() ([]byte, error) { } type DepartmentEvent struct { - Name string `json:"name,omitempty"` - ParentDepartmentId string `json:"parent_department_id,omitempty"` - DepartmentId string `json:"department_id,omitempty"` - OpenDepartmentId string `json:"open_department_id,omitempty"` - LeaderUserId string `json:"leader_user_id,omitempty"` - ChatId string `json:"chat_id,omitempty"` - Order int `json:"order,omitempty"` - UnitIds []string `json:"unit_ids,omitempty"` - MemberCount int `json:"member_count,omitempty"` - Status int `json:"status,omitempty"` - ForceSendFields []string `json:"-"` + Name string `json:"name,omitempty"` + ParentDepartmentId string `json:"parent_department_id,omitempty"` + DepartmentId string `json:"department_id,omitempty"` + OpenDepartmentId string `json:"open_department_id,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + ChatId string `json:"chat_id,omitempty"` + Order int `json:"order,omitempty"` + UnitIds []string `json:"unit_ids,omitempty"` + Status *DepartmentStatus `json:"status,omitempty"` + ForceSendFields []string `json:"-"` } func (s *DepartmentEvent) MarshalJSON() ([]byte, error) { @@ -207,35 +206,37 @@ func (s *Scope) MarshalJSON() ([]byte, error) { } type User struct { - UnionId string `json:"union_id,omitempty"` - UserId string `json:"user_id,omitempty"` - OpenId string `json:"open_id,omitempty"` - Name string `json:"name,omitempty"` - EnName string `json:"en_name,omitempty"` - Email string `json:"email,omitempty"` - Mobile string `json:"mobile,omitempty"` - MobileVisible bool `json:"mobile_visible,omitempty"` - Gender int `json:"gender,omitempty"` - AvatarKey string `json:"avatar_key,omitempty"` - Avatar *AvatarInfo `json:"avatar,omitempty"` - Status *UserStatus `json:"status,omitempty"` - DepartmentIds []string `json:"department_ids,omitempty"` - LeaderUserId string `json:"leader_user_id,omitempty"` - City string `json:"city,omitempty"` - Country string `json:"country,omitempty"` - WorkStation string `json:"work_station,omitempty"` - JoinTime int `json:"join_time,omitempty"` - IsTenantManager bool `json:"is_tenant_manager,omitempty"` - EmployeeNo string `json:"employee_no,omitempty"` - EmployeeType int `json:"employee_type,omitempty"` - Positions []*UserPosition `json:"positions,omitempty"` - Orders []*UserOrder `json:"orders,omitempty"` - CustomAttrs []*UserCustomAttr `json:"custom_attrs,omitempty"` - EnterpriseEmail string `json:"enterprise_email,omitempty"` - IdpType string `json:"idp_type,omitempty"` - TimeZone string `json:"time_zone,omitempty"` - Description string `json:"description,omitempty"` - ForceSendFields []string `json:"-"` + UnionId string `json:"union_id,omitempty"` + UserId string `json:"user_id,omitempty"` + OpenId string `json:"open_id,omitempty"` + Name string `json:"name,omitempty"` + EnName string `json:"en_name,omitempty"` + Email string `json:"email,omitempty"` + Mobile string `json:"mobile,omitempty"` + MobileVisible bool `json:"mobile_visible,omitempty"` + Gender int `json:"gender,omitempty"` + AvatarKey string `json:"avatar_key,omitempty"` + Avatar *AvatarInfo `json:"avatar,omitempty"` + Status *UserStatus `json:"status,omitempty"` + DepartmentIds []string `json:"department_ids,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + City string `json:"city,omitempty"` + Country string `json:"country,omitempty"` + WorkStation string `json:"work_station,omitempty"` + JoinTime int `json:"join_time,omitempty"` + IsTenantManager bool `json:"is_tenant_manager,omitempty"` + EmployeeNo string `json:"employee_no,omitempty"` + EmployeeType int `json:"employee_type,omitempty"` + Positions []*UserPosition `json:"positions,omitempty"` + Orders []*UserOrder `json:"orders,omitempty"` + CustomAttrs []*UserCustomAttr `json:"custom_attrs,omitempty"` + EnterpriseEmail string `json:"enterprise_email,omitempty"` + IdpType string `json:"idp_type,omitempty"` + TimeZone string `json:"time_zone,omitempty"` + Description string `json:"description,omitempty"` + NeedSendNotification bool `json:"need_send_notification,omitempty"` + NotificationOption *NotificationOption `json:"notification_option,omitempty"` + ForceSendFields []string `json:"-"` } func (s *User) MarshalJSON() ([]byte, error) { @@ -335,6 +336,28 @@ func (s *I18nContent) MarshalJSON() ([]byte, error) { return tools.MarshalJSON(raw, s.ForceSendFields) } +type OldDepartmentObject struct { + Status *DepartmentStatus `json:"status,omitempty"` + ForceSendFields []string `json:"-"` +} + +func (s *OldDepartmentObject) MarshalJSON() ([]byte, error) { + type cp OldDepartmentObject + raw := cp(*s) + return tools.MarshalJSON(raw, s.ForceSendFields) +} + +type OldUserObject struct { + DepartmentIds []string `json:"department_ids,omitempty"` + ForceSendFields []string `json:"-"` +} + +func (s *OldUserObject) MarshalJSON() ([]byte, error) { + type cp OldUserObject + raw := cp(*s) + return tools.MarshalJSON(raw, s.ForceSendFields) +} + type DepartmentGetResult struct { Department *Department `json:"department,omitempty"` } @@ -533,8 +556,8 @@ type DepartmentCreatedEvent struct { } type DepartmentDeletedEventData struct { - Object *DepartmentEvent `json:"object,omitempty"` - OldObject *DepartmentEvent `json:"old_object,omitempty"` + Object *DepartmentEvent `json:"object,omitempty"` + OldObject *OldDepartmentObject `json:"old_object,omitempty"` } type DepartmentDeletedEvent struct { @@ -562,8 +585,8 @@ type UserCreatedEvent struct { } type UserDeletedEventData struct { - Object *UserEvent `json:"object,omitempty"` - OldObject *UserEvent `json:"old_object,omitempty"` + Object *UserEvent `json:"object,omitempty"` + OldObject *OldUserObject `json:"old_object,omitempty"` } type UserDeletedEvent struct {