dev stock stragety

This commit is contained in:
yanweidong
2026-01-26 17:38:06 +08:00
parent d2a3d60183
commit 7efdead5bf
20 changed files with 540 additions and 665 deletions

View File

@@ -0,0 +1,12 @@
package apps
import "github.com/gin-gonic/gin"
func Home(c *gin.Context) {
data := gin.H{
"Title": "Welcome to " + c.Request.Host,
"Message": "This is " + c.Request.Host + " index page.",
}
c.HTML(200, "apps-home.html", data)
}

View File

@@ -0,0 +1,17 @@
package apps
import "github.com/gin-gonic/gin"
var (
data = gin.H{
"Title": "重生之我在A股开超市",
}
)
func StockHome(c *gin.Context) {
c.HTML(200, "stock-home.html", data)
}
func StrategyBy(c *gin.Context) {
c.HTML(200, "strategy-by.html", data)
}

View File

@@ -0,0 +1,8 @@
package auth
import (
"github.com/gin-gonic/gin"
)
func Login(c *gin.Context) {
}

View File

@@ -0,0 +1,29 @@
package auth
import (
"git.apinb.com/bsm-sdk/core/infra"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
)
// 退出登录处理
func Logout(c *gin.Context) {
session := sessions.Default(c)
// 清除会话中的token
session.Delete("MgtSession")
// 设置会话立即过期
session.Options(sessions.Options{
MaxAge: -1, // 立即过期
Path: "/",
})
// 保存会话更改
if err := session.Save(); err != nil {
infra.Response.Error(c, err)
return
}
infra.Response.Success(c, "Logged out successfully")
}

View File

@@ -0,0 +1,14 @@
package auth
import (
"github.com/gin-gonic/gin"
)
func SignIn(c *gin.Context) {
data := gin.H{
"Title": "Welcome to " + c.Request.Host,
"Message": "This is " + c.Request.Host + " index page.",
}
c.HTML(200, "index.html", data)
}