Files

33 lines
709 B
Go
Raw Normal View History

package controller
2021-12-16 09:44:59 +08:00
import (
"SciencesServer/app/api/website/model"
model2 "SciencesServer/app/common/model"
"SciencesServer/app/session"
)
2021-12-16 09:44:59 +08:00
type Docking struct {
*session.Enterprise
2022-01-20 17:22:05 +08:00
tenantID uint64
2021-12-16 09:44:59 +08:00
}
2022-01-20 17:22:05 +08:00
type DockingHandle func(session *session.Enterprise, tenantID uint64) *Docking
2021-12-16 09:44:59 +08:00
// Form 联系客服对接
2022-01-20 17:22:05 +08:00
func (c *Docking) Form(ip string) error {
2021-12-16 09:44:59 +08:00
mServiceDocking := model.NewServiceDocking()
2022-01-20 17:22:05 +08:00
mServiceDocking.TenantID = c.tenantID
mServiceDocking.UID = c.UID
mServiceDocking.IP = ip
2021-12-16 09:44:59 +08:00
return model2.Create(mServiceDocking.ServiceDocking)
}
func NewDocking() DockingHandle {
2022-01-20 17:22:05 +08:00
return func(session *session.Enterprise, tenantID uint64) *Docking {
2021-12-16 09:44:59 +08:00
return &Docking{
Enterprise: session,
}
}
}