mirror of
https://github.com/razertory/gpt-wework
synced 2025-10-05 15:17:00 +08:00
27 lines
498 B
Go
27 lines
498 B
Go
package main
|
|
|
|
import (
|
|
"gpt-wework/service"
|
|
"os"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
func main() {
|
|
err := godotenv.Load()
|
|
if err != nil {
|
|
panic("Error loading .env file")
|
|
}
|
|
r := gin.Default()
|
|
r.GET("/ping", Ping)
|
|
r.GET("/wechat/check", service.CheckWeixinSign)
|
|
r.POST("/wechat/check", service.TalkWeixin)
|
|
r.POST("/chat", service.Chat)
|
|
r.Run(":8888")
|
|
}
|
|
|
|
func Ping(c *gin.Context) {
|
|
c.Data(200, "text/plain;charset=utf-8", []byte(os.Getenv("WEWORK_CORP_ID")))
|
|
}
|