package marketing import( "spaceofcheng/services/models/marketing" "spaceofcheng/services/models/model" "spaceofcheng/services/utils" ) // MarketingServ 系统处理 type WorkServ struct { ctx *utils.Context dao *marketing.WorkDAO } // NewMarketingServ 初始化 func NewWorkServ(ctx *utils.Context) *WorkServ { return &WorkServ{ ctx: ctx, dao: marketing.NewWorkDAO(ctx), } } // 保存 Work func (s *WorkServ) SaveWork(work model.SysActivityAction) (*model.SysActivityAction, error){ if work.ActivityId == "" { return nil, utils.LogError("营销编号为空!") } newInfo,err := s.dao.AddWork(work) if err != nil { return nil, err } return newInfo,nil }