|
1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 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/model"
- "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)
- medium := new(model.UserAppDomain)
- _, err := db.Db.Where("type =?", "medium").And("uuid =?", masterId).And("is_ssl =1").Get(medium)
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- mediumDomain := ""
- if medium != nil {
- mediumDomain = medium.Domain
- }
- user := svc.GetUser(c)
- e.OutSuc(c, md.ShareIndexResp{
- MasterId: masterId,
- MediumDomain: "http://" + mediumDomain + "/#/?agent_id=" + utils.IntToStr(user.AgentId),
- }, nil)
- return
- }
|