From ff21b6b424f2003770a84fa89948a8a21bb730ef Mon Sep 17 00:00:00 2001 From: JNG <365252428@qq.com> Date: Thu, 12 Mar 2026 09:30:53 +0800 Subject: [PATCH] Update questionnaireSurvey.go --- pkg/service/bundle/questionnaireSurvey.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/service/bundle/questionnaireSurvey.go b/pkg/service/bundle/questionnaireSurvey.go index 22165158..a882bfb9 100644 --- a/pkg/service/bundle/questionnaireSurvey.go +++ b/pkg/service/bundle/questionnaireSurvey.go @@ -12,6 +12,7 @@ import ( "time" m "fonchain-fiee/pkg/model" + "github.com/gin-gonic/gin" "github.com/google/uuid" ) @@ -64,6 +65,10 @@ func QuestionnaireSurveyCreate(c *gin.Context) { service.Error(c, err) return } + if req.Longitude == "" || req.Latitude == "" { + service.Error(c, errors.New("获取定位失败")) + return + } address, err := utils.ReverseGeo(req.Longitude, req.Latitude, "ZhCN") if err != nil { service.Error(c, errors.New("获取地址失败"))