package sop_task

import (
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"

	"wechat-api/internal/logic/sop_task"
	"wechat-api/internal/svc"
)

// swagger:route post /sop_task/message_var sop_task GetSopMessageVar
//
// Get sop task list | 获取Sop消息变量
//
// Get sop task list | 获取Sop消息变量
//
// Responses:
//  200: MessageVarResp

func GetSopMessageVarHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := sop_task.NewGetSopMessageVarLogic(r.Context(), svcCtx)
		resp, err := l.GetSopMessageVar()
		if err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
		} else {
			httpx.OkJsonCtx(r.Context(), w, resp)
		}
	}
}
