31 lines
		
	
	
		
			752 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			752 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package auth
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 
 | |
| 	"github.com/zeromicro/go-zero/rest/httpx"
 | |
| 	"tianyuan-api/apps/gateway/internal/logic/auth"
 | |
| 	"tianyuan-api/apps/gateway/internal/svc"
 | |
| 	"tianyuan-api/apps/gateway/internal/types"
 | |
| 
 | |
| 	xhttp "github.com/zeromicro/x/http"
 | |
| )
 | |
| 
 | |
| func GetVerifyCodeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 | |
| 	return func(w http.ResponseWriter, r *http.Request) {
 | |
| 		var req types.GetVerifyCodeReq
 | |
| 		if err := httpx.Parse(r, &req); err != nil {
 | |
| 			xhttp.JsonBaseResponseCtx(r.Context(), w, err)
 | |
| 			return
 | |
| 		}
 | |
| 
 | |
| 		l := auth.NewGetVerifyCodeLogic(r.Context(), svcCtx)
 | |
| 		err := l.GetVerifyCode(&req)
 | |
| 		if err != nil {
 | |
| 			xhttp.JsonBaseResponseCtx(r.Context(), w, err)
 | |
| 		} else {
 | |
| 			xhttp.JsonBaseResponseCtx(r.Context(), w, nil)
 | |
| 		}
 | |
| 	}
 | |
| }
 |