common_sms_code_handler.go 827 字节
package common

import (
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/common"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
)

func CommonSmsCodeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		var req types.CommonSmsCodeRequest
		if err := httpx.Parse(r, &req); err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
			return
		}

		l := common.NewCommonSmsCodeLogic(r.Context(), svcCtx)
		resp, err := l.CommonSmsCode(&req)
		result.HttpResult(r, w, resp, err)
	}
}