Initial commit

This commit is contained in:
GeekROS
2024-03-03 22:59:18 +08:00
commit cec0aae8e3
69 changed files with 2687 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
/**
******************************************************************************
* @file config.go
* @author MakerYang
******************************************************************************
*/
package Config
import "time"
var Get = &config{}
type config struct {
Service service `json:"service"`
Database database `json:"database"`
Hash hash `json:"hash"`
}
type service struct {
Mode string `json:"mode"`
HttpPort int `json:"http_port"`
ReadTimeout time.Duration `json:"read_timeout"`
WriteTimeout time.Duration `json:"write_timeout"`
}
type database struct {
Type string `json:"type"`
User string `json:"user"`
Password string `json:"password"`
Host string `json:"host"`
Name string `json:"name"`
}
type hash struct {
Salt string `json:"salt"`
}
func Init() {
Get.Service.Mode = "debug"
Get.Service.HttpPort = 7000
Get.Service.ReadTimeout = 60 * time.Second
Get.Service.WriteTimeout = 60 * time.Second
Get.Database.Name = "database"
Get.Database.Type = "mysql"
Get.Database.Host = "localhost"
Get.Database.User = "root"
Get.Database.Password = "88888888"
Get.Hash.Salt = "game_$@#godot_@$salt_$@$service%#^#%@%#"
}

View File

@@ -0,0 +1,61 @@
/**
******************************************************************************
* @file controller.go
* @author MakerYang
******************************************************************************
*/
package Controller
import (
"Game/framework/config"
"Game/framework/controller/ping"
"context"
"fmt"
"github.com/gin-gonic/gin"
"github.com/gookit/color"
"log"
"net/http"
"os"
"os/signal"
"time"
)
func router() *gin.Engine {
router := gin.New()
gin.SetMode(Config.Get.Service.Mode)
router.GET("/ping", PingController.Ping)
return router
}
func Init() {
routers := router()
var HttpServer = &http.Server{
Addr: fmt.Sprintf(":%d", Config.Get.Service.HttpPort),
Handler: routers,
ReadTimeout: Config.Get.Service.ReadTimeout,
WriteTimeout: Config.Get.Service.WriteTimeout,
MaxHeaderBytes: 1 << 20,
}
go func() {
if err := HttpServer.ListenAndServe(); err != nil {
}
}()
log.Println("[game]", color.Green.Text("server..."))
quit := make(chan os.Signal)
signal.Notify(quit, os.Interrupt)
<-quit
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := HttpServer.Shutdown(ctx); err != nil {
}
}

View File

@@ -0,0 +1,18 @@
/**
******************************************************************************
* @file ping.go
* @author MakerYang
******************************************************************************
*/
package PingController
import (
"Game/framework/utils"
"github.com/gin-gonic/gin"
)
func Ping(c *gin.Context) {
Utils.Success(c, Utils.EmptyData{})
return
}

View File

@@ -0,0 +1,74 @@
/**
******************************************************************************
* @file database.go
* @author MakerYang
******************************************************************************
*/
package Database
import (
"Game/framework/config"
"fmt"
"github.com/gookit/color"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"log"
"time"
)
var Get *gorm.DB
type DefaultField struct {
CreateAt int `gorm:"Column:create_at" json:"create_at"`
UpdateAt int `gorm:"Column:update_at" json:"update_at"`
DeleteAt int `gorm:"Column:delete_at" json:"delete_at"`
}
func Init() {
var err error
Get, err = gorm.Open(Config.Get.Database.Type, fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", Config.Get.Database.User, Config.Get.Database.Password, Config.Get.Database.Host, Config.Get.Database.Name))
if err != nil {
log.Println("[database]", color.Red.Text(err.Error()))
}
if Config.Get.Service.Mode == "release" {
Get.LogMode(false)
} else {
Get.LogMode(true)
}
gorm.DefaultTableNameHandler = func(db *gorm.DB, defaultTableName string) string {
return defaultTableName
}
Get.SingularTable(true)
Get.Callback().Create().Replace("gorm:update_time_stamp", func(scope *gorm.Scope) {
if !scope.HasError() {
nowTime := time.Now().Unix()
if createTimeField, ok := scope.FieldByName("CreateAt"); ok {
if createTimeField.IsBlank {
err := createTimeField.Set(nowTime)
if err != nil {
}
}
}
if modifyTimeField, ok := scope.FieldByName("UpdateAt"); ok {
if modifyTimeField.IsBlank {
err := modifyTimeField.Set(nowTime)
if err != nil {
}
}
}
}
})
Get.DB().SetMaxIdleConns(1000)
Get.DB().SetMaxOpenConns(10000)
Get.DB().SetConnMaxLifetime(time.Second * 45)
}

View File

@@ -0,0 +1,65 @@
/**
******************************************************************************
* @file interface.go
* @author MakerYang
******************************************************************************
*/
package Database
import (
"github.com/jinzhu/gorm"
"time"
)
type Base struct {
TableName string
}
func New(table string) *Base {
return &Base{
TableName: table,
}
}
func (base *Base) CreateData(data interface{}) error {
err := Get.Table(base.TableName).Create(data).Error
return err
}
func (base *Base) UpdateData(query interface{}, data map[string]interface{}) error {
data["update_at"] = time.Now().Unix()
err := Get.Table(base.TableName).Where(query).Updates(data).Error
return err
}
func (base *Base) ExprData(query interface{}, field string, operation string, data int) error {
err := Get.Table(base.TableName).Where(query).Update(field, gorm.Expr(field+" "+operation+" ?", data)).Error
return err
}
func (base *Base) GetData(dataStruct interface{}, query interface{}, order string) error {
err := Get.Table(base.TableName).Where(query).Order(order).First(dataStruct).Error
return err
}
func (base *Base) ListData(dataStruct interface{}, query interface{}, order string, limit int) error {
err := Get.Table(base.TableName).Where(query).Order(order).Limit(limit).Find(dataStruct).Error
return err
}
func (base *Base) PageData(dataStruct interface{}, query interface{}, order string, limit int, page int) error {
err := Get.Table(base.TableName).Where(query).Order(order).Limit(limit).Offset(page * limit).Find(dataStruct).Error
return err
}
func (base *Base) CountData(query interface{}) (int, error) {
count := 0
err := Get.Table(base.TableName).Where(query).Count(&count).Error
return count, err
}
func (base *Base) DeleteData(dataStruct interface{}, query interface{}) error {
err := Get.Table(base.TableName).Where(query).Delete(dataStruct).Error
return err
}

View File

@@ -0,0 +1,23 @@
/**
******************************************************************************
* @file framework.go
* @author MakerYang
******************************************************************************
*/
package Framework
import (
"Game/framework/config"
"Game/framework/controller"
"Game/framework/database"
)
func Init() {
// 初始化配置
Config.Init()
// 初始化数据库
Database.Init()
// 初始化控制器
Controller.Init()
}

View File

@@ -0,0 +1,3 @@
package Utils
type EmptyData struct{}

View File

@@ -0,0 +1,27 @@
package Utils
import (
"Game/framework/config"
"github.com/speps/go-hashids"
)
func EncodeId(len int, id ...int) string {
hd := hashids.NewData()
hd.Salt = Config.Get.Hash.Salt
hd.MinLength = len
h := hashids.NewWithData(hd)
e, _ := h.Encode(id)
return e
}
func DecodeId(len int, encodedId string) ([]int, error) {
hd := hashids.NewData()
hd.Salt = Config.Get.Hash.Salt
hd.MinLength = len
h := hashids.NewWithData(hd)
d, err := h.DecodeWithError(encodedId)
if err != nil {
return nil, err
}
return d, nil
}

View File

@@ -0,0 +1,49 @@
package Utils
import "strings"
func CheckUserAgent(userAgent string) bool {
Status := false
if strings.Contains(userAgent, "GodotEngine") {
Status = true
}
return Status
}
func CheckGame(token string) (int, int, bool) {
Status := false
GameId := 0
GameAccountId := 0
if token != "" {
tokenMap, _ := DecodeId(128, token)
if len(tokenMap) == 2 {
GameId = tokenMap[0]
GameAccountId = tokenMap[1]
Status = true
}
}
if GameId == 0 || GameAccountId == 0 {
Status = false
}
return GameId, GameAccountId, Status
}
func CheckUser(token string) (int, bool) {
Status := false
Uid := 0
if token != "" {
tokenMap, _ := DecodeId(32, token)
if len(tokenMap) == 3 {
Uid = tokenMap[0]
Status = true
}
}
return Uid, Status
}

View File

@@ -0,0 +1,17 @@
package Utils
import "gopkg.in/gomail.v2"
func SendMail(to string, subject string, content string) bool {
status := true
mail := gomail.NewMessage()
mail.SetHeader("From", mail.FormatAddress("open@wileho.com", "GEEKROS"))
mail.SetHeader("To", to)
mail.SetHeader("Subject", subject)
mail.SetBody("text/html", content)
send := gomail.NewDialer("smtp.qq.com", 587, "open@wileho.com", "")
if err := send.DialAndSend(mail); err != nil {
status = false
}
return status
}

View File

@@ -0,0 +1,27 @@
package Utils
import (
"regexp"
"strings"
)
func FilterMarkdown(input string) string {
quoteBlockRegex := regexp.MustCompile(`^\s*>[ \t]*(.*)$`)
lines := strings.Split(input, "\n")
var quoteLines []string
for _, line := range lines {
if quoteBlockRegex.MatchString(line) {
match := quoteBlockRegex.FindStringSubmatch(line)
quoteLines = append(quoteLines, match[1])
}
}
return strings.Join(quoteLines, "")
}
func FilterSummary(input string, maxLength int) string {
text := strings.TrimSpace(input)
if len(text) <= maxLength {
return text
}
return text[:maxLength]
}

View File

@@ -0,0 +1,22 @@
/**
******************************************************************************
* @file md5.go
* @author MakerYang
******************************************************************************
*/
package Utils
import (
"crypto/md5"
"encoding/hex"
)
func MD5Hash(text string) string {
hash := md5.Sum([]byte(text))
return hex.EncodeToString(hash[:])
}
func VerifyPassword(storedPassword, inputPassword string) bool {
return MD5Hash(inputPassword) == storedPassword
}

View File

@@ -0,0 +1,18 @@
package Utils
import (
"math/rand"
"time"
)
func CreateOrderNum() string {
str := "0123456789"
bytes := []byte(str)
result := make([]byte, 0)
r := rand.New(rand.NewSource(time.Now().UnixNano()))
for i := 0; i < 8; i++ {
result = append(result, bytes[r.Intn(len(bytes))])
}
order := time.Now().Format("20060102150405") + string(result)
return order
}

View File

@@ -0,0 +1,69 @@
package Utils
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"net/http"
"regexp"
)
func MobileFormat(str string) string {
re, _ := regexp.Compile("(\\d{3})(\\d{6})(\\d{2})")
return re.ReplaceAllString(str, "$1******$3")
}
func SendMessage(form string, phone string, info string) bool {
status := true
if form == "" || phone == "" || info == "" {
status = false
return status
}
desc := ""
if form == "express" {
desc = "【GEEKROS】Hi" + info + " 你在GEEKROS的订单已经发货请留意快递信息及时查收。"
}
if form == "account" {
desc = "【GEEKROS】你的验证码为" + info + " 有效期10分钟工作人员绝不会索取此验证码切勿告知他人。"
}
apiUrl := "https://smssh1.253.com/msg/v1/send/json"
params := make(map[string]interface{})
params["account"] = ""
params["password"] = ""
params["phone"] = phone
params["msg"] = desc
params["report"] = "false"
bytesData, err := json.Marshal(params)
if err != nil {
status = false
return status
}
reader := bytes.NewReader(bytesData)
request, err := http.NewRequest("POST", apiUrl, reader)
if err != nil {
status = false
return status
}
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
client := http.Client{}
resp, err := client.Do(request)
if err != nil {
status = false
return status
}
respBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
status = false
return status
}
log.Println("[PhoneMessage]", string(respBytes))
return true
}

View File

@@ -0,0 +1,7 @@
package Utils
import "fmt"
func PriceConvert(num int) string {
return fmt.Sprintf("%.2f", float64(num)/100)
}

View File

@@ -0,0 +1,20 @@
package Utils
import (
"fmt"
"math/rand"
"time"
)
func RandInt(min, max int) int {
if min >= max || min == 0 || max == 0 {
return max
}
return rand.Intn(max-min) + min
}
func RandCode() string {
randNumber := rand.New(rand.NewSource(time.Now().UnixNano()))
code := fmt.Sprintf("%06v", randNumber.Int31n(1000000))
return code
}

View File

@@ -0,0 +1,105 @@
package Utils
import (
"encoding/json"
"github.com/gin-gonic/gin"
"log"
"net/http"
"os"
"strconv"
"time"
)
type logData struct {
Timestamp int64 `json:"timestamp"`
TimestampFormat string `json:"timestamp_format"`
ClientMethod string `json:"client_method"`
ClientIp string `json:"client_ip"`
ClientParameter string `json:"client_parameter"`
ServerParameter string `json:"server_parameter"`
ServerUrl string `json:"server_url"`
ServerName string `json:"server_name"`
ServerYear string `json:"server_year"`
ServerMonth string `json:"server_month"`
ServerDay string `json:"server_day"`
ServerTime string `json:"server_time"`
TimeLength string `json:"time_length"`
}
func recordLog(c *gin.Context, serverParameter string) {
data := &logData{}
data.Timestamp = time.Now().Unix()
data.TimestampFormat = time.Now().Format("2006-01-02 15:04:05")
data.ClientMethod = c.Request.Method
data.ClientIp = c.ClientIP()
if data.ClientMethod == "GET" {
data.ClientParameter = c.Request.RequestURI
}
if data.ClientMethod == "POST" {
clientParam, err := json.Marshal(c.Request.PostForm)
if err != nil {
data.ClientParameter = ""
}
if err == nil {
data.ClientParameter = string(clientParam)
}
}
scheme := "http://"
if c.Request.TLS != nil {
scheme = "https://"
}
serverUrl := scheme + c.Request.Host + c.Request.URL.Path
serverName, _ := os.Hostname()
data.ServerUrl = serverUrl
data.ServerName = serverName
data.ClientParameter = c.GetString("client_parameter")
data.ServerParameter = serverParameter
data.ServerYear = time.Now().Format("2006")
data.ServerMonth = time.Now().Format("01")
data.ServerDay = time.Now().Format("02")
data.ServerTime = time.Now().Format("15:04:05")
data.TimeLength = strconv.FormatFloat(float64(time.Now().UnixNano())/1000000-c.GetFloat64("start_time"), 'f', 2, 64)
dataString, _ := json.Marshal(data)
log.Println("[Log]", string(dataString))
}
func Success(c *gin.Context, data interface{}) {
c.JSON(http.StatusOK, gin.H{
"code": 0,
"msg": "success",
"data": data,
})
logJson, _ := json.Marshal(gin.H{"code": 0, "msg": "success", "data": data})
recordLog(c, string(logJson))
}
func Error(c *gin.Context, data interface{}) {
c.JSON(http.StatusOK, gin.H{
"code": 10000,
"msg": "error",
"data": data,
})
logJson, _ := json.Marshal(gin.H{"code": 10000, "msg": "error", "data": data})
recordLog(c, string(logJson))
}
func Warning(c *gin.Context, code int, msg string, data interface{}) {
c.JSON(http.StatusOK, gin.H{
"code": code,
"msg": msg,
"data": data,
})
logJson, _ := json.Marshal(gin.H{"code": code, "msg": msg, "data": data})
recordLog(c, string(logJson))
}
func AuthError(c *gin.Context, code int, msg string, data interface{}) {
c.JSON(http.StatusUnauthorized, gin.H{
"code": code,
"msg": msg,
"data": data,
})
logJson, _ := json.Marshal(gin.H{"code": code, "msg": msg, "data": data})
recordLog(c, string(logJson))
}

View File

@@ -0,0 +1,33 @@
package Utils
import (
"strconv"
"time"
)
func TimeFormat(unix int) (string, string) {
timeInt := time.Unix(int64(unix), 0)
return timeInt.Format("2006年01月02日"), timeInt.Format("2006-01-02 15:04:05")
}
func DateFormat(times int) string {
createTime := time.Unix(int64(times), 0)
now := time.Now().Unix()
difTime := now - int64(times)
str := ""
if difTime < 60 {
str = "刚刚"
} else if difTime < 3600 {
M := difTime / 60
str = strconv.Itoa(int(M)) + "分钟前"
} else if difTime < 3600*24 {
H := difTime / 3600
str = strconv.Itoa(int(H)) + "小时前"
} else {
str = createTime.Format("2006-01-02 15:04:05")
}
return str
}

42
server/go.mod Normal file
View File

@@ -0,0 +1,42 @@
module Game
go 1.19
require (
github.com/gin-gonic/gin v1.9.1
github.com/gookit/color v1.5.4
github.com/jinzhu/gorm v1.9.16
github.com/speps/go-hashids v1.0.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
)
require (
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

126
server/go.sum Normal file
View File

@@ -0,0 +1,126 @@
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w=
github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/speps/go-hashids v1.0.0 h1:jdFC07PrExRM4Og5Ev4411Tox75aFpkC77NlmutadNI=
github.com/speps/go-hashids v1.0.0/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

15
server/main.go Normal file
View File

@@ -0,0 +1,15 @@
/**
******************************************************************************
* @file main.go
* @author MakerYang
******************************************************************************
*/
package main
import "Game/framework"
func main() {
// 初始化核心框架
Framework.Init()
}