publish.go 531 B

123456789101112131415161718192021222324
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/main/macross/model/publish"
  5. "go-common/library/log"
  6. )
  7. // Dashborad insert dashboard info and logs.
  8. func (s *Service) Dashborad(c context.Context, d *publish.Dashboard) (err error) {
  9. var id int64
  10. if id, err = s.dao.Dashborad(c, d); err != nil {
  11. log.Error("Dashborad() error(%v)", err)
  12. return
  13. }
  14. if len(d.Logs) > 0 && id > 0 {
  15. if _, err = s.dao.DashboradLogs(c, id, d.Logs); err != nil {
  16. log.Error("DashboradLogs() error(%v)", err)
  17. return
  18. }
  19. }
  20. return
  21. }