diff --git a/model/gmodel/fs_feishu_user_gen.go b/model/gmodel/fs_feishu_user_gen.go index d977b02d..b1922e6a 100644 --- a/model/gmodel/fs_feishu_user_gen.go +++ b/model/gmodel/fs_feishu_user_gen.go @@ -30,6 +30,7 @@ type FsFeishuUser struct { EmployeeNo *string `gorm:"default:'';" json:"employee_no"` // EmployeeType *int64 `gorm:"default:0;" json:"employee_type"` // 0:未设置 1:正式员工 2:实习生 3:外包 4:劳务 5:顾问 Orders *[]byte `gorm:"default:'';" json:"orders"` // + JoinTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"join_time"` // Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` // } diff --git a/model/gmodel/fs_feishu_user_logic.go b/model/gmodel/fs_feishu_user_logic.go index 4cced255..b2d7f45b 100644 --- a/model/gmodel/fs_feishu_user_logic.go +++ b/model/gmodel/fs_feishu_user_logic.go @@ -26,5 +26,6 @@ func (u *FsFeishuUserModel) CreateOrUpdate(ctx context.Context, appId, openId st } return err } + data.Ctime = nil return u.Update(ctx, data) } diff --git a/server/feishu-sync/internal/logic/user_webhook.go b/server/feishu-sync/internal/logic/user_webhook.go index 9edd2fc7..3be19f97 100644 --- a/server/feishu-sync/internal/logic/user_webhook.go +++ b/server/feishu-sync/internal/logic/user_webhook.go @@ -115,6 +115,7 @@ func (l *WebhookLogic) OnUserChange(data []byte) error { return err } feiShuMsgCreateTime := time.UnixMilli(feiShuMsgCreateTimeInt64) + joinTime := time.Unix(msg.Event.Object.Joint64ime, 0) return l.svcCtx.AllModels.FsFeishuUser.CreateOrUpdate(l.ctx, msg.Header.AppId, msg.Event.Object.OpenId, &gmodel.FsFeishuUser{ AppId: &msg.Header.AppId, OpenId: &msg.Event.Object.OpenId, @@ -138,6 +139,7 @@ func (l *WebhookLogic) OnUserChange(data []byte) error { EmployeeNo: &msg.Event.Object.EmployeeNo, EmployeeType: &msg.Event.Object.EmployeeType, Orders: &orders, + JoinTime: &joinTime, Ctime: &feiShuMsgCreateTime, Utime: &feiShuMsgCreateTime, })