refactor: reorganize modules and add Linux build tooling

This commit is contained in:
2026-08-09 12:41:08 +08:00
parent 86024fa81d
commit 5cc5fd92ed
1461 changed files with 4054 additions and 4724 deletions

View File

@@ -0,0 +1,25 @@
package data
import (
"bsm/full/module/base/initial/internal/impl"
"bsm/full/module/base/initial/internal/models"
"git.apinb.com/bsm-sdk/core/vars"
)
func GetCountryByCache() ([]*models.InitialCountry, error) {
var country []*models.InitialCountry
cacheKey := impl.RedisService.BuildKey("country")
err := impl.RedisService.Get(cacheKey, &country)
if err == nil {
return country, nil
}
err = impl.DBService.Where("enabled = ?", true).
Order("sort_order ASC, name ASC").
Find(&country).Error
err = impl.RedisService.Set(cacheKey, country, vars.DefaultTTL)
return country, err
}