@@ -0,0 +1,41 @@ | |||||
package hdl | |||||
import ( | |||||
"applet/app/e" | |||||
"applet/app/md" | |||||
"applet/app/svc" | |||||
"applet/app/utils" | |||||
db "code.fnuoos.com/zhimeng/model.git/src" | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/implement" | |||||
"github.com/gin-gonic/gin" | |||||
) | |||||
// ShareIndex | |||||
// @Summary 邀请链接 | |||||
// @Tags 基本配置-邀请链接 | |||||
// @Description 邀请链接界面接口 | |||||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||||
// @Accept json | |||||
// @Produce json | |||||
// @Success 200 {object} md.ShareIndexResp | |||||
// @Failure 400 {object} md.Response "具体错误" | |||||
// @Router /api/setCenter/share/index [GET] | |||||
func ShareIndex(c *gin.Context) { | |||||
masterId := svc.GetMasterId(c) | |||||
userAppDomainDb := implement.NewUserAppDomainDb(db.Db) | |||||
agent, err := userAppDomainDb.GetAppDomainByType("agent", masterId) | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||||
return | |||||
} | |||||
agentDomain := "" | |||||
if agent != nil { | |||||
agentDomain = agent.Domain | |||||
} | |||||
user := svc.GetUser(c) | |||||
e.OutSuc(c, md.ShareIndexResp{ | |||||
MasterId: masterId, | |||||
AgentDomain: agentDomain + "?agent_id=" + utils.IntToStr(user.AgentId), | |||||
}, nil) | |||||
return | |||||
} |
@@ -0,0 +1,6 @@ | |||||
package md | |||||
type ShareIndexResp struct { | |||||
MasterId string `json:"master_id"` | |||||
AgentDomain string `json:"agent_domain" example:"代理分享地址"` | |||||
} |
@@ -72,6 +72,7 @@ func route(r *gin.RouterGroup) { | |||||
rDataCenter(r.Group("/dataCenter")) //数据中心 | rDataCenter(r.Group("/dataCenter")) //数据中心 | ||||
rSettleCenter(r.Group("/settleCenter")) //结算中心 | rSettleCenter(r.Group("/settleCenter")) //结算中心 | ||||
rFinancialDynamics(r.Group("/financialDynamics")) //资产动态 | rFinancialDynamics(r.Group("/financialDynamics")) //资产动态 | ||||
rSetCenter(r.Group("/setCenter")) //基本配置 | |||||
} | } | ||||
func rRole(r *gin.RouterGroup) { | func rRole(r *gin.RouterGroup) { | ||||
@@ -102,6 +103,14 @@ func rAccount(r *gin.RouterGroup) { | |||||
r.POST("/qualification/bank/save", hdl.QualificationBankSave) //资质认证-银行资质保存 | r.POST("/qualification/bank/save", hdl.QualificationBankSave) //资质认证-银行资质保存 | ||||
r.POST("/qualification/contact/save", hdl.QualificationContactSave) //资质认证-联系方式保存 | r.POST("/qualification/contact/save", hdl.QualificationContactSave) //资质认证-联系方式保存 | ||||
} | } | ||||
func rSetCenter(r *gin.RouterGroup) { | |||||
rShareSetCenter := r.Group("/share") | |||||
{ | |||||
rShareSetCenter.GET("/index", hdl.ShareIndex) | |||||
} | |||||
} | |||||
func rIndex(r *gin.RouterGroup) { | func rIndex(r *gin.RouterGroup) { | ||||
r.GET("/base", hdl.Base) //首页-基本信息 | r.GET("/base", hdl.Base) //首页-基本信息 | ||||
r.GET("/total", hdl.IndexTotal) //首页-统计数据 | r.GET("/total", hdl.IndexTotal) //首页-统计数据 | ||||