From 622c8aa10d5ec5a3b4109eacfcb3ac679d755bdd Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 19 Sep 2024 11:24:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_set_center.go | 16 ++++++++-------- app/md/md_set_center.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/hdl/hdl_set_center.go b/app/hdl/hdl_set_center.go index 4d4a021..9d960fa 100644 --- a/app/hdl/hdl_set_center.go +++ b/app/hdl/hdl_set_center.go @@ -6,7 +6,7 @@ import ( "applet/app/svc" "applet/app/utils" db "code.fnuoos.com/zhimeng/model.git/src" - "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "code.fnuoos.com/zhimeng/model.git/src/super/model" "github.com/gin-gonic/gin" ) @@ -22,20 +22,20 @@ import ( // @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) + 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 } - agentDomain := "" - if agent != nil { - agentDomain = agent.Domain + mediumDomain := "" + if medium != nil { + mediumDomain = medium.Domain } user := svc.GetUser(c) e.OutSuc(c, md.ShareIndexResp{ - MasterId: masterId, - AgentDomain: agentDomain + "?agent_id=" + utils.IntToStr(user.AgentId), + MasterId: masterId, + MediumDomain: mediumDomain + "?agent_id=" + utils.IntToStr(user.AgentId), }, nil) return } diff --git a/app/md/md_set_center.go b/app/md/md_set_center.go index 4434d8d..036db1c 100644 --- a/app/md/md_set_center.go +++ b/app/md/md_set_center.go @@ -1,6 +1,6 @@ package md type ShareIndexResp struct { - MasterId string `json:"master_id"` - AgentDomain string `json:"agent_domain" example:"代理分享地址"` + MasterId string `json:"master_id"` + MediumDomain string `json:"medium_domain" example:"媒体分享地址"` }