|
- 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
- }
|