package plat import ( "context" "dashoo.cn/common_definition/comm_def" "github.com/gogf/gf/frame/g" "github.com/gogf/gf/util/gvalid" model "dashoo.cn/micro/app/model/plat" server "dashoo.cn/micro/app/service/plat" ) type FollowUpCommentHandler struct{} // GetList 获取列表 // Swagger:FollowUpComment 跟进 评论列表 func (h *FollowUpCommentHandler) GetList(ctx context.Context, req *model.SearchPlatFollowupCommentReq, rsp *comm_def.CommonMsg) error { followupCommentService, err := server.NewFollowupCommentService(ctx) if err != nil { return err } g.Log().Info("搜索值", req) total, list, err := followupCommentService.GetList(req) if err != nil { return err } rsp.Data = g.Map{"list": list, "total": total} return nil } // Create 添加跟进评论 // Swagger:FollowUpComment 跟进 评论添加 func (h *FollowUpCommentHandler) Create(ctx context.Context, req *model.AddPlatFollowupCommentReq, rsp *comm_def.CommonMsg) error { // 参数校验 if err := gvalid.CheckStruct(ctx, req, nil); err != nil { return err } followupCommentService, err := server.NewFollowupCommentService(ctx) if err != nil { return err } err = followupCommentService.Create(req) if err != nil { return err } return nil }