fix struct
This commit is contained in:
@@ -3,24 +3,23 @@ package impl
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/cache/redis"
|
||||
"git.apinb.com/bsm-sdk/core/with"
|
||||
"git.apinb.com/pro/rbac2/internal/config"
|
||||
"git.apinb.com/dataset/stock/internal/config"
|
||||
"github.com/allegro/bigcache/v3"
|
||||
"git.apinb.com/bsm-sdk/core/with"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
RedisService *redis.RedisClient // Redis 客户端服务
|
||||
RedisService *redis.RedisClient // Redis 客户端服务
|
||||
DBService *gorm.DB
|
||||
MemoryService *bigcache.BigCache // 内存缓存服务
|
||||
)
|
||||
|
||||
// NewImpl 初始化各类服务实例
|
||||
func NewImpl() {
|
||||
// 初始化内存缓存
|
||||
MemorySerice = with.Memory(nil)
|
||||
MemoryService = with.Memory(nil)
|
||||
// 初始化 Redis 缓存
|
||||
RedisService = with.RedisCache(config.Spec.Cache)
|
||||
// 初始化数据库服务
|
||||
DBService = with.Databases(config.Spec.Databases, nil) // model
|
||||
// 初始化日志服务
|
||||
with.Logger(config.Spec.Log)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package logic
|
||||
package a
|
||||
|
||||
import tushare "github.com/ShawnRong/tushare-go"
|
||||
|
||||
@@ -6,6 +6,6 @@ var (
|
||||
TushareClient *tushare.TuShare
|
||||
)
|
||||
|
||||
func NewApiClient(){
|
||||
func NewApiClient() {
|
||||
TushareClient = tushare.New("你的token")
|
||||
}
|
||||
}
|
||||
16
internal/logic/hello/ping.go
Normal file
16
internal/logic/hello/ping.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package hello
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func Ping(ctx *gin.Context) {
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"PING": "PONG",
|
||||
"TIMESEQ": time.Now().Nanosecond(),
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -3,13 +3,7 @@ package routers
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/middleware"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/application"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/hello"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/permission"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/pub"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/role"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/user"
|
||||
"git.apinb.com/dataset/stock/internal/logic/hello"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -32,6 +26,5 @@ func registerAnonymous(v1_key string, engine *gin.Engine) {
|
||||
}
|
||||
|
||||
func registerRouters(v1_key string, engine *gin.Engine) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user