Skip to content

Commit 5d33ec8

Browse files
authored
Merge pull request #1952 from kyubibii/main
fix(topup): add currency symbol to amounts in RechargeCard
2 parents 8a01f09 + f44f682 commit 5d33ec8

File tree

13 files changed

+10203
-2
lines changed

13 files changed

+10203
-2
lines changed

controller/misc.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,28 @@ func GetAbout(c *gin.Context) {
147147
return
148148
}
149149

150+
func GetUserAgreement(c *gin.Context) {
151+
common.OptionMapRWMutex.RLock()
152+
defer common.OptionMapRWMutex.RUnlock()
153+
c.JSON(http.StatusOK, gin.H{
154+
"success": true,
155+
"message": "",
156+
"data": common.OptionMap["UserAgreement"],
157+
})
158+
return
159+
}
160+
161+
func GetPrivacyPolicy(c *gin.Context) {
162+
common.OptionMapRWMutex.RLock()
163+
defer common.OptionMapRWMutex.RUnlock()
164+
c.JSON(http.StatusOK, gin.H{
165+
"success": true,
166+
"message": "",
167+
"data": common.OptionMap["PrivacyPolicy"],
168+
})
169+
return
170+
}
171+
150172
func GetMidjourney(c *gin.Context) {
151173
common.OptionMapRWMutex.RLock()
152174
defer common.OptionMapRWMutex.RUnlock()

model/option.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ func InitOptionMap() {
6161
common.OptionMap["SMTPToken"] = ""
6262
common.OptionMap["SMTPSSLEnabled"] = strconv.FormatBool(common.SMTPSSLEnabled)
6363
common.OptionMap["Notice"] = ""
64+
common.OptionMap["UserAgreement"] = ""
65+
common.OptionMap["PrivacyPolicy"] = ""
6466
common.OptionMap["About"] = ""
6567
common.OptionMap["HomePageContent"] = ""
6668
common.OptionMap["Footer"] = common.Footer

router/api-router.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ func SetApiRouter(router *gin.Engine) {
2020
apiRouter.GET("/models", middleware.UserAuth(), controller.DashboardListModels)
2121
apiRouter.GET("/status/test", middleware.AdminAuth(), controller.TestStatus)
2222
apiRouter.GET("/notice", controller.GetNotice)
23+
apiRouter.GET("/user-agreement", controller.GetUserAgreement)
24+
apiRouter.GET("/privacy-policy", controller.GetPrivacyPolicy)
2325
apiRouter.GET("/about", controller.GetAbout)
2426
//apiRouter.GET("/midjourney", controller.GetMidjourney)
2527
apiRouter.GET("/home_page_content", controller.GetHomePageContent)

0 commit comments

Comments
 (0)