by Robin at 20241101

This commit is contained in:
Leufolium 2024-11-01 16:09:59 +08:00
parent 2ec7324d45
commit 1abe2c1cfb
4 changed files with 31 additions and 0 deletions

View File

@ -69,6 +69,7 @@ const (
SmsSplitRatioKey = "sms_split_ratio"
RavenIQTestEmailConfigKey = "Raven_IQ_test_email_config"
OfficialEmailKey = "official_email"
IsIosInstallButtonVisibleKey = "is_ios_install_button_visible"
)
// del_flag

View File

@ -81,3 +81,14 @@ func OpGetIsMomentImageEncryptEnabled(ctx *gin.Context) {
ReplyOk(ctx, isEnabled)
}
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

@ -306,6 +306,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

@ -215,3 +215,18 @@ func (s *ConfigService) OpGetIsMomentImageEncryptEnabled(ctx *gin.Context) (isEn
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
}