广告平台(站长下代理使用)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hdl_set_center.go 1.2 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/md"
  5. "applet/app/svc"
  6. "applet/app/utils"
  7. db "code.fnuoos.com/zhimeng/model.git/src"
  8. "code.fnuoos.com/zhimeng/model.git/src/super/model"
  9. "github.com/gin-gonic/gin"
  10. )
  11. // ShareIndex
  12. // @Summary 邀请链接
  13. // @Tags 基本配置-邀请链接
  14. // @Description 邀请链接界面接口
  15. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  16. // @Accept json
  17. // @Produce json
  18. // @Success 200 {object} md.ShareIndexResp
  19. // @Failure 400 {object} md.Response "具体错误"
  20. // @Router /api/setCenter/share/index [GET]
  21. func ShareIndex(c *gin.Context) {
  22. masterId := svc.GetMasterId(c)
  23. medium := new(model.UserAppDomain)
  24. _, err := db.Db.Where("type =?", "medium").And("uuid =?", masterId).And("is_ssl =1").Get(medium)
  25. if err != nil {
  26. e.OutErr(c, e.ERR_DB_ORM, err.Error())
  27. return
  28. }
  29. mediumDomain := ""
  30. if medium != nil {
  31. mediumDomain = medium.Domain
  32. }
  33. user := svc.GetUser(c)
  34. e.OutSuc(c, md.ShareIndexResp{
  35. MasterId: masterId,
  36. MediumDomain: "http://" + mediumDomain + "/#/?agent_id=" + utils.IntToStr(user.AgentId),
  37. }, nil)
  38. return
  39. }