26 lines
540 B
Go
26 lines
540 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, 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{}
|
|
}
|
|
}
|