feat:完善项目管理
This commit is contained in:
@ -1,13 +1,33 @@
|
||||
package controller
|
||||
|
||||
type Docking struct{}
|
||||
import (
|
||||
"SciencesServer/app/api/website/model"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
)
|
||||
|
||||
type DockingHandle func()
|
||||
type Docking struct {
|
||||
*session.Enterprise
|
||||
local string
|
||||
}
|
||||
|
||||
func (c *Docking) Message() {
|
||||
type DockingHandle func(session *session.Enterprise, local string) *Docking
|
||||
|
||||
// Form 联系客服对接
|
||||
func (c *Docking) Form() error {
|
||||
mServiceDocking := model.NewServiceDocking()
|
||||
|
||||
if c.Enterprise != nil {
|
||||
mServiceDocking.UID = c.UID
|
||||
}
|
||||
return model2.Create(mServiceDocking.ServiceDocking)
|
||||
}
|
||||
|
||||
func NewDocking() DockingHandle {
|
||||
return nil
|
||||
return func(session *session.Enterprise, local string) *Docking {
|
||||
return &Docking{
|
||||
Enterprise: session,
|
||||
local: local,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
25
app/api/website/controller/message.go
Normal file
25
app/api/website/controller/message.go
Normal file
@ -0,0 +1,25 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"SciencesServer/app/api/website/model"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
)
|
||||
|
||||
type Message struct{}
|
||||
|
||||
type MessageHandle func() *Message
|
||||
|
||||
// Form 留言发起
|
||||
func (c *Message) Form(name, mobile, content string) error {
|
||||
mServiceMessage := model.NewServiceMessage()
|
||||
mServiceMessage.Name = name
|
||||
mServiceMessage.Mobile = mobile
|
||||
mServiceMessage.Content = content
|
||||
return model2.Create(mServiceMessage.ServiceMessage)
|
||||
}
|
||||
|
||||
func NewMessage() MessageHandle {
|
||||
return func() *Message {
|
||||
return &Message{}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user