修改
This commit is contained in:
commit
1ebbdece8b
File diff suppressed because it is too large
Load Diff
@ -21,6 +21,8 @@ func BundleRouter(r *gin.RouterGroup) {
|
|||||||
bundleClientNoAuthRoute.POST("export/work-cast-info", bundle.ExportWorkCastInfo)
|
bundleClientNoAuthRoute.POST("export/work-cast-info", bundle.ExportWorkCastInfo)
|
||||||
bundleClientNoAuthRoute.POST("export/bundle-price-info", bundle.ExportBundlePriceInfo)
|
bundleClientNoAuthRoute.POST("export/bundle-price-info", bundle.ExportBundlePriceInfo)
|
||||||
bundleClientNoAuthRoute.POST("survey/is-send", bundle.IsSendSurvey)
|
bundleClientNoAuthRoute.POST("survey/is-send", bundle.IsSendSurvey)
|
||||||
|
bundleClientNoAuthRoute.POST("survey/bundleInfo", bundle.QuestionnaireSurveyBundleInfo)
|
||||||
|
bundleClientNoAuthRoute.POST("survey/create", bundle.QuestionnaireSurveyCreate)
|
||||||
}
|
}
|
||||||
bundleClientRoute := bundleRoute.Group("system")
|
bundleClientRoute := bundleRoute.Group("system")
|
||||||
{
|
{
|
||||||
@ -59,8 +61,6 @@ func BundleRouter(r *gin.RouterGroup) {
|
|||||||
survey := bundleClientRoute.Group("survey")
|
survey := bundleClientRoute.Group("survey")
|
||||||
{
|
{
|
||||||
survey.POST("list", bundle.QuestionnaireSurveyList)
|
survey.POST("list", bundle.QuestionnaireSurveyList)
|
||||||
survey.POST("bundleInfo", bundle.QuestionnaireSurveyBundleInfo)
|
|
||||||
survey.POST("create", bundle.QuestionnaireSurveyCreate)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package bundle
|
package bundle
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
@ -20,16 +21,26 @@ func IsSendSurvey(c *gin.Context) {
|
|||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(c, req)
|
res, err := service.BundleProvider.SendQuestionnaireSurvey(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func QuestionnaireSurveyList(c *gin.Context) {
|
func QuestionnaireSurveyList(c *gin.Context) {
|
||||||
var req bundle.GetQuestionnaireSurveyListResponse
|
var req bundle.GetQuestionnaireSurveyListRequest
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(c, req)
|
res, err := service.BundleProvider.GetQuestionnaireSurveyList(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func QuestionnaireSurveyBundleInfo(c *gin.Context) {
|
func QuestionnaireSurveyBundleInfo(c *gin.Context) {
|
||||||
@ -38,7 +49,12 @@ func QuestionnaireSurveyBundleInfo(c *gin.Context) {
|
|||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(c, req)
|
res, err := service.BundleProvider.GetQuestionnaireSurveyInfo(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func QuestionnaireSurveyCreate(c *gin.Context) {
|
func QuestionnaireSurveyCreate(c *gin.Context) {
|
||||||
@ -47,7 +63,7 @@ func QuestionnaireSurveyCreate(c *gin.Context) {
|
|||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
address, err := utils.ReverseGeo("31.367784", "120.647276", "ZhCN")
|
address, err := utils.ReverseGeo(req.Longitude, req.Latitude, "ZhCN")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, errors.New("获取地址失败"))
|
service.Error(c, errors.New("获取地址失败"))
|
||||||
return
|
return
|
||||||
@ -97,4 +113,10 @@ func QuestionnaireSurveyCreate(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
fmt.Println(outputUrl)
|
fmt.Println(outputUrl)
|
||||||
service.Success(c, req)
|
service.Success(c, req)
|
||||||
|
res, err := service.BundleProvider.CreateQuestionnaireSurveyAnswer(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user