From b226fe7b5c6040a15c2fdc0af2aa01f5b6c020c1 Mon Sep 17 00:00:00 2001 From: openihu Date: Tue, 13 Sep 2022 11:22:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E8=84=9A?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=8F=8A=E8=A1=8C=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/footer_content.tmpl | 10 +++++----- templates/base/footer_content_fluid.tmpl | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 templates/base/footer_content_fluid.tmpl diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index bcf46f9f05..aec7b8d61a 100755 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -20,7 +20,7 @@ {{.i18n.Tr "custom.Platform_Tutorial"}} - {{if .EnableSwagger}} API{{end}} + {{if .EnableSwagger}} API{{end}} {{if .IsSigned}} {{.i18n.Tr "custom.foot.advice_feedback"}} {{else}} - {{.i18n.Tr "custom.foot.advice_feedback"}} + {{.i18n.Tr "custom.foot.advice_feedback"}} {{end}} {{template "custom/extra_links_footer" .}} diff --git a/templates/base/footer_content_fluid.tmpl b/templates/base/footer_content_fluid.tmpl index 29395a0457..24b18e94d3 100755 --- a/templates/base/footer_content_fluid.tmpl +++ b/templates/base/footer_content_fluid.tmpl @@ -26,12 +26,12 @@ {{end}} - {{.i18n.Tr "custom.Platform_Tutorial"}} + {{.i18n.Tr "custom.Platform_Tutorial"}} {{if .EnableSwagger}} API{{end}} {{if .IsSigned}} {{.i18n.Tr "custom.foot.advice_feedback"}} {{else}} - {{.i18n.Tr "custom.foot.advice_feedback"}} + {{.i18n.Tr "custom.foot.advice_feedback"}} {{end}} {{template "custom/extra_links_footer" .}} -- 2.34.1 From f03249a8528cd2c7e63e207e4fdc9afae855587b Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 15 Sep 2022 09:40:25 +0800 Subject: [PATCH 3/4] #1249 Optimized the generation of serial numbers --- services/reward/serial.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/reward/serial.go b/services/reward/serial.go index 349da12660..a4679ebd46 100644 --- a/services/reward/serial.go +++ b/services/reward/serial.go @@ -11,7 +11,7 @@ import ( func GetSerialNoByRedis() (string, error) { now := time.Now() - r := int64(rand.Intn(4)) + 1 + r := int64(rand.Intn(3)) + 1 n, err := redis_client.IncrBy(redis_key.RewardSerialCounter(now), r) if err != nil { log.Error("GetSerialNoByRedis RewardSerialCounter error. %v", err) @@ -20,5 +20,9 @@ func GetSerialNoByRedis() (string, error) { if n == r { redis_client.Expire(redis_key.RewardSerialCounter(now), 2*time.Minute) } + //when the counter n exceeds 1000, the length of the serial number will become longer + if n > 1000 { + return now.Format("200601021504") + fmt.Sprintf("%d", n) + fmt.Sprint(rand.Intn(10)), nil + } return now.Format("200601021504") + fmt.Sprintf("%03d", n) + fmt.Sprint(rand.Intn(10)), nil } -- 2.34.1 From 6b5eed268bdfd16d79fbbbd16c69829cf53f9606 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 15 Sep 2022 09:43:09 +0800 Subject: [PATCH 4/4] #1249 Optimized the generation of serial numbers --- services/reward/serial.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/reward/serial.go b/services/reward/serial.go index a4679ebd46..a1e3d4c7e7 100644 --- a/services/reward/serial.go +++ b/services/reward/serial.go @@ -21,7 +21,7 @@ func GetSerialNoByRedis() (string, error) { redis_client.Expire(redis_key.RewardSerialCounter(now), 2*time.Minute) } //when the counter n exceeds 1000, the length of the serial number will become longer - if n > 1000 { + if n >= 1000 { return now.Format("200601021504") + fmt.Sprintf("%d", n) + fmt.Sprint(rand.Intn(10)), nil } return now.Format("200601021504") + fmt.Sprintf("%03d", n) + fmt.Sprint(rand.Intn(10)), nil -- 2.34.1