28 lines
622 B
Go
28 lines
622 B
Go
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, email, company, content string) error {
|
|
mServiceMessage := model.NewServiceMessage()
|
|
mServiceMessage.Name = name
|
|
mServiceMessage.Mobile = mobile
|
|
mServiceMessage.Email = email
|
|
mServiceMessage.Company = company
|
|
mServiceMessage.Content = content
|
|
return model2.Create(mServiceMessage.ServiceMessage)
|
|
}
|
|
|
|
func NewMessage() MessageHandle {
|
|
return func() *Message {
|
|
return &Message{}
|
|
}
|
|
}
|