go-common/app/admin/main/macross/service/publish.go

25 lines
531 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package service
import (
"context"
"go-common/app/admin/main/macross/model/publish"
"go-common/library/log"
)
// Dashborad insert dashboard info and logs.
func (s *Service) Dashborad(c context.Context, d *publish.Dashboard) (err error) {
var id int64
if id, err = s.dao.Dashborad(c, d); err != nil {
log.Error("Dashborad() error(%v)", err)
return
}
if len(d.Logs) > 0 && id > 0 {
if _, err = s.dao.DashboradLogs(c, id, d.Logs); err != nil {
log.Error("DashboradLogs() error(%v)", err)
return
}
}
return
}