package contact_field_template

import (
	"net/http"

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

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

// swagger:route post /contact_field_template contact_field_template GetContactFieldTemplateById
//
// Get contact_field_template by ID | 通过ID获取 ContactFieldTemplate
//
// Get contact_field_template by ID | 通过ID获取 ContactFieldTemplate
//
// Responses:
//  200: ContactFieldTemplateInfoResp

func GetContactFieldTemplateByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := contact_field_template.NewGetContactFieldTemplateByIdLogic(r.Context(), svcCtx)
		resp, err := l.GetContactFieldTemplateById()
		if err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
		} else {
			httpx.OkJsonCtx(r.Context(), w, resp)
		}
	}
}
