by Robin at 20241101
This commit is contained in:
parent
2ec7324d45
commit
1abe2c1cfb
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue