Bladeren bron

update

master
shenjiachi 4 dagen geleden
bovenliggende
commit
75deac5133
2 gewijzigde bestanden met toevoegingen van 58 en 2 verwijderingen
  1. +57
    -0
      app/hdl/friend_circle/hdl_friend_circle._test.go
  2. +1
    -2
      app/hdl/hdl_home_page.go

+ 57
- 0
app/hdl/friend_circle/hdl_friend_circle._test.go Bestand weergeven

@@ -0,0 +1,57 @@
package friend_circle

import (
"code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
"fmt"
"testing"
)

func TestCreateFriendCircleIndex(t *testing.T) {
es.Init("http://123.57.140.192:9200", "elastic", "fnuo123")
err := es.CreateIndexIfNotExists(md.EggFriendCircleEsIndex, md.EggFriendCircleEsMapping)
if err != nil {
fmt.Println(err)
}
fmt.Println("success")
}

func TestCreateFriendCircleCommentLikeIndex(t *testing.T) {
es.Init("http://123.57.140.192:9200", "elastic", "fnuo123")
for i := 0; i < 10; i++ {
index := fmt.Sprintf("%s%d", md.EggFriendCircleLikeEsIndex, i)
err := es.CreateIndexIfNotExists(index, md.EggFriendCircleLikeEsMapping)
if err != nil {
fmt.Println(err)
}
}

fmt.Println("success")
}

func TestCreateFriendCircleCommentIndex(t *testing.T) {
es.Init("http://123.57.140.192:9200", "elastic", "fnuo123")
for i := 0; i < 10; i++ {
index := fmt.Sprintf("%s%d", md.EggFriendCircleCommentEsIndex, i)
err := es.CreateIndexIfNotExists(index, md.EggFriendCircleCommentEsMapping)
if err != nil {
fmt.Println(err)
}
}

fmt.Println("success")
}

func TestDeleteIndex(t *testing.T) {
es.Init("http://123.57.140.192:9200", "elastic", "fnuo123")
for i := 0; i < 10; i++ {
index := fmt.Sprintf("%s%d", md.EggFriendCircleLikeEsIndex, i)
_, err := es.DeleteIndex(index)
if err != nil {
fmt.Println(err)
return
}
}

fmt.Println("success")
}

+ 1
- 2
app/hdl/hdl_home_page.go Bestand weergeven

@@ -109,11 +109,10 @@ func HomePage(c *gin.Context) {
e.OutErr(c, e.ERR_DB_ORM, nil)
return
}
signEggEnergyValue, _ := decimal.NewFromString(signPersonalEggEnergy)
personEggEnergyValue, _ := decimal.NewFromString(personEggEnergy.Amount)
teamEggEnergyValue, _ := decimal.NewFromString(teamEggEnergy.Amount)

totalEggEnergy, _ = signEggEnergyValue.Add(personEggEnergyValue).Add(teamEggEnergyValue).Float64()
totalEggEnergy, _ = personEggEnergyValue.Add(teamEggEnergyValue).Float64()

//4、活跃积分(个人+团队)
var totalActivePoints float64


Laden…
Annuleren
Opslaan