33 lines
709 B
Go
33 lines
709 B
Go
package controller
|
|
|
|
import (
|
|
"SciencesServer/app/api/website/model"
|
|
model2 "SciencesServer/app/common/model"
|
|
"SciencesServer/app/session"
|
|
)
|
|
|
|
type Docking struct {
|
|
*session.Enterprise
|
|
tenantID uint64
|
|
}
|
|
|
|
type DockingHandle func(session *session.Enterprise, tenantID uint64) *Docking
|
|
|
|
// Form 联系客服对接
|
|
func (c *Docking) Form(ip string) error {
|
|
mServiceDocking := model.NewServiceDocking()
|
|
mServiceDocking.TenantID = c.tenantID
|
|
mServiceDocking.UID = c.UID
|
|
mServiceDocking.IP = ip
|
|
|
|
return model2.Create(mServiceDocking.ServiceDocking)
|
|
}
|
|
|
|
func NewDocking() DockingHandle {
|
|
return func(session *session.Enterprise, tenantID uint64) *Docking {
|
|
return &Docking{
|
|
Enterprise: session,
|
|
}
|
|
}
|
|
}
|