feat:完善项目管理
This commit is contained in:
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