@@ -69,8 +69,10 @@ func (h *WebsiteConfigHandler) RegisterGinRoutes(engine *gin.Engine) {
6969 adminGroup .GET ("/check-initialization" , apiwrap .Wrap (h .GetInitStatus ))
7070 adminGroup .POST ("/initialization" , apiwrap .WrapWithBody (h .InitializeWebsite ))
7171
72+ // 站长信息
73+ routerGroup .GET ("/owner" , apiwrap .Wrap (h .GetWebsiteOwnerConfig ))
74+
7275 // website
73- routerGroup .GET ("/website" , apiwrap .Wrap (h .GetWebsiteConfig ))
7476 adminGroup .GET ("/website" , apiwrap .Wrap (h .AdminGetWebsiteConfig ))
7577 adminGroup .GET ("/website/meta" , apiwrap .Wrap (h .AdminGetWebsiteConfig4Meta ))
7678 adminGroup .PUT ("/website" , apiwrap .WrapWithBody (h .AdminUpdateWebsiteConfig ))
@@ -144,6 +146,14 @@ func (h *WebsiteConfigHandler) toWebsiteConfigVO(webMasterCfg *domain.WebsiteCon
144146 }
145147}
146148
149+ func (h * WebsiteConfigHandler ) toWebsiteOwnerVO (webMasterCfg * domain.WebsiteConfig ) OwnerConfigVO {
150+ return OwnerConfigVO {
151+ WebsiteOwner : webMasterCfg .WebsiteOwner ,
152+ WebsiteOwnerProfile : webMasterCfg .WebsiteOwnerProfile ,
153+ WebsiteOwnerAvatar : webMasterCfg .WebsiteOwnerAvatar ,
154+ }
155+ }
156+
147157func (h * WebsiteConfigHandler ) toNoticeConfigVO (noticeCfg * domain.NoticeConfig ) NoticeConfigVO {
148158 return NoticeConfigVO {Title : noticeCfg .Title , Content : noticeCfg .Content , PublishTime : noticeCfg .PublishTime .Unix ()}
149159}
@@ -629,12 +639,12 @@ func (h *WebsiteConfigHandler) AdminUpdateIntroduction4FriendConfig(ctx *gin.Con
629639 return apiwrap .SuccessResponse (), h .serv .UpdateIntroduction4FriendConfig (ctx , gkit .GetValueOrDefault (req .Introduction ))
630640}
631641
632- func (h * WebsiteConfigHandler ) GetWebsiteConfig (ctx * gin.Context ) (* apiwrap.ResponseBody [WebsiteConfigVO ], error ) {
642+ func (h * WebsiteConfigHandler ) GetWebsiteOwnerConfig (ctx * gin.Context ) (* apiwrap.ResponseBody [OwnerConfigVO ], error ) {
633643 config , err := h .serv .GetWebSiteConfig (ctx )
634644 if err != nil {
635645 return nil , err
636646 }
637- return apiwrap .SuccessResponseWithData (h .toWebsiteConfigVO (config )), nil
647+ return apiwrap .SuccessResponseWithData (h .toWebsiteOwnerVO (config )), nil
638648}
639649
640650func (h * WebsiteConfigHandler ) GetCommonConfig (ctx * gin.Context ) (* apiwrap.ResponseBody [CommonConfigVO ], error ) {
@@ -654,9 +664,12 @@ func (h *WebsiteConfigHandler) GetCommonConfig(ctx *gin.Context) (*apiwrap.Respo
654664
655665func (h * WebsiteConfigHandler ) toMetaConfigVO (wc * domain.WebsiteConfig ) WebsiteConfigMetaVO {
656666 return WebsiteConfigMetaVO {
657- WebsiteName : wc .WebsiteName ,
658- WebsiteIcon : wc .WebsiteIcon ,
659- WebsiteOwner : wc .WebsiteOwner ,
667+ WebsiteName : wc .WebsiteName ,
668+ WebsiteIcon : wc .WebsiteIcon ,
669+ WebsiteOwner : wc .WebsiteOwner ,
670+ WebsiteOwnerProfile : wc .WebsiteOwnerProfile ,
671+ WebsiteOwnerAvatar : wc .WebsiteOwnerAvatar ,
672+ WebsiteRuntime : wc .WebsiteRuntime .Unix (),
660673 }
661674}
662675
0 commit comments