Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
momo 2023-11-07 18:41:08 +08:00
commit 3641a40a69
3 changed files with 4 additions and 0 deletions

View File

@ -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"` //
}

View File

@ -26,5 +26,6 @@ func (u *FsFeishuUserModel) CreateOrUpdate(ctx context.Context, appId, openId st
}
return err
}
data.Ctime = nil
return u.Update(ctx, data)
}

View File

@ -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,
})