diff --git a/cv/cp_cv/space.go b/cv/cp_cv/space.go index 4ab3f4ed8e704c2ccab63736e500ca6dc997c701..e04c5886697a69ea1c12a03c7e617c73f6396b44 100644 --- a/cv/cp_cv/space.go +++ b/cv/cp_cv/space.go @@ -32,8 +32,10 @@ type CvCpLevel struct { // 资源等级 type CvResLevel struct { - Level cp_e.CpLevel `json:"level"` // 等级 - Icon string `json:"icon"` // 等级icon图 + Level cp_e.CpLevel `json:"level"` // 等级 + Icon string `json:"icon"` // 等级icon图 + StartPoints uint32 `json:"startPoints"` // 上个等级所需CP值 + EndPoints uint32 `json:"endPoints,omitempty"` // 下个等级所需CP值 } // 特权信息 @@ -57,12 +59,12 @@ type CvSpace struct { } var CvResLevelList = []CvResLevel{ - {cp_e.CpLevel0, cp_e.CpLevelIcon[cp_e.CpLevel0]}, - {cp_e.CpLevel1, cp_e.CpLevelIcon[cp_e.CpLevel1]}, - {cp_e.CpLevel2, cp_e.CpLevelIcon[cp_e.CpLevel2]}, - {cp_e.CpLevel3, cp_e.CpLevelIcon[cp_e.CpLevel3]}, - {cp_e.CpLevel4, cp_e.CpLevelIcon[cp_e.CpLevel4]}, - {cp_e.CpLevel5, cp_e.CpLevelIcon[cp_e.CpLevel5]}, + {cp_e.CpLevel0, cp_e.CpLevelIcon[cp_e.CpLevel0], cp_e.CpLevelPoints[cp_e.CpLevel0], cp_e.CpLevelPoints[cp_e.CpLevel1]}, + {cp_e.CpLevel1, cp_e.CpLevelIcon[cp_e.CpLevel1], cp_e.CpLevelPoints[cp_e.CpLevel1], cp_e.CpLevelPoints[cp_e.CpLevel2]}, + {cp_e.CpLevel2, cp_e.CpLevelIcon[cp_e.CpLevel2], cp_e.CpLevelPoints[cp_e.CpLevel2], cp_e.CpLevelPoints[cp_e.CpLevel3]}, + {cp_e.CpLevel3, cp_e.CpLevelIcon[cp_e.CpLevel3], cp_e.CpLevelPoints[cp_e.CpLevel3], cp_e.CpLevelPoints[cp_e.CpLevel4]}, + {cp_e.CpLevel4, cp_e.CpLevelIcon[cp_e.CpLevel4], cp_e.CpLevelPoints[cp_e.CpLevel4], cp_e.CpLevelPoints[cp_e.CpLevel5]}, + {cp_e.CpLevel5, cp_e.CpLevelIcon[cp_e.CpLevel5], cp_e.CpLevelPoints[cp_e.CpLevel5], cp_e.CpLevelPoints[cp_e.CpLevelMax]}, } var ( diff --git a/route/cp_r/space.go b/route/cp_r/space.go index ae96ef54c79c42790b743898c5fd1289d3e4da9e..5171c13c60e3c6b84b7797302e35faf3a6ef030b 100644 --- a/route/cp_r/space.go +++ b/route/cp_r/space.go @@ -76,6 +76,8 @@ func CpSpace(c *gin.Context) (*mycontext.MyContext, error) { } if cpLevel != cp_e.CpLevelMax { nextPoints = cp_e.CpLevelPoints[cpLevel+1] + } else { + nextPoints = cp_e.CpLevelPoints[cp_e.CpLevelMax] } userPrivileges, err := cp_m.MGetUserSvipPrivilege(model, []uint64{userId}) if err != nil {