package controller import ( "github.com/gin-gonic/gin" "github.com/json-iterator/go" "github.com/v2rayA/v2rayA/common" "github.com/v2rayA/v2rayA/db/configure" "github.com/v2rayA/v2rayA/server/service" ) func GetSharingAddress(ctx *gin.Context) { var w configure.NodeRef err := jsoniter.Unmarshal([]byte(ctx.Query("touch")), &w) if err != nil { common.ResponseError(ctx, badRequest("touch", "query parameter \"touch\" must be a JSON server or subscription item")) return } addr, err := service.GetSharingAddress(&w) if err != nil { common.ResponseError(ctx, logError(err)) return } common.ResponseSuccess(ctx, gin.H{"sharingAddress": addr}) }