Merge remote-tracking branch 'origin/main' into mtest 1

This commit is contained in:
Leufolium 2024-11-01 16:28:07 +08:00
commit 0277f51c12
4 changed files with 31 additions and 0 deletions

View File

@ -70,6 +70,7 @@ const (
OfficialEmailKey = "official_email"
SmsSplitRatioKey = "sms_split_ratio"
NotifBannerInfoKey = "notif_banner_info"
IsIosInstallButtonVisibleKey = "is_ios_install_button_visible"
)
// del_flag

View File

@ -92,3 +92,14 @@ func OpGetBannerInfo(ctx *gin.Context) {
ReplyOk(ctx, list)
}
func OpGetIsIosInstallButtonVisible(ctx *gin.Context) {
isVisible, ec := service.DefaultConfigService.OpGetIsIosInstallButtonVisible(ctx)
if ec != errcode.ErrCodeOk {
logger.Error("OpGetIsIosInstallButtonVisible fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, isVisible)
}

View File

@ -316,6 +316,10 @@ func Init(r *gin.Engine) {
apiRavenIQTestVisitGroup.POST("create", middleware.JSONParamValidator(Raven_IQ_test_visitproto.ApiCreateReq{}), ApiCreateRavenIQTestVisit)
apiRavenIQTestVisitGroup.POST("count", middleware.JSONParamValidator(Raven_IQ_test_visitproto.ApiCountReq{}), ApiGetRavenIQTestVisitCount)
// ios安装按钮
apiAppGroup := r.Group("/api/app", PrepareToC())
apiAppGroup.POST("is_ios_install_button_visible", middleware.JSONParamValidator(base.BaseRequest{}), OpGetIsIosInstallButtonVisible)
// =============================== 以下是服务,只允许内网调用 ===============================
// op相关直接调用服务不调用gateway

View File

@ -231,3 +231,18 @@ func (s *ConfigService) OpGetBannerInfo(ctx *gin.Context) (list []string, ec err
return
}
func (s *ConfigService) OpGetIsIosInstallButtonVisible(ctx *gin.Context) (isVisible int64, ec errcode.ErrCode) {
ec = errcode.ErrCodeOk
isIosInstallButtonVisible, err := apollo.GetIntValue(consts.IsIosInstallButtonVisibleKey, apollo.ApolloOpts().SetNamespace("application"))
if err != nil {
logger.Error("Apollo read failed : %v", err)
ec = errcode.ErrCodeApolloReadFail
return
}
isVisible = int64(isIosInstallButtonVisible)
return
}