-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
7,199 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,8 @@ | |
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
.idea | ||
logs/* | ||
./wow_api | ||
wow_api.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Segment | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# wow_api | ||
# wow_api | ||
|
||
## 宏工具(macro tool) | ||
|
||
这是一个为魔兽世界玩家制作的游戏工具,该工具提供给玩家一个分享游戏中宏命令的平台,也同时提供给玩家以搜索功能。 | ||
|
||
This is a game tool for World of Warcraft players that provides players with a platform to share macro commands in the game, as well as a search function. | ||
|
||
### 功能(function) | ||
- 快速创建(fast create) | ||
|
||
- 提供给对游戏中宏命令感兴趣,却不懂的玩家,融合搜索和自动生成的功能,返回给玩家一个命令列表以供选择。 | ||
- Players who are interested in the macro commands in the game but do not understand, combine the search and auto-generated functions, and return a list of commands to the player for selection. | ||
|
||
- 手动组合(create by hand) | ||
|
||
- 提供给熟悉游戏的玩家,通过工具,手动组合出自己所需的命令。 | ||
- Provided to players who are familiar with the game, through the tools, manually combine the commands they need. | ||
|
||
- 分享及搜索(share and search) | ||
|
||
- 提供给玩家一个分享自己收集的宏命令的功能,同时也可以搜索其他玩家分享的宏命令。 | ||
-Provides the player with the ability to share the macro commands they have collected, as well as the macro commands shared by other players. | ||
|
||
## 魔兽世界插件开发api(api document) | ||
|
||
这是一个为魔兽世界插件开发者提供api查询的平台。 | ||
|
||
### 功能(function) | ||
- 游戏内部api查询 | ||
- 游戏内部事件event查询 | ||
- 游戏内部合法宏命令查询 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package database | ||
|
||
import "time" | ||
|
||
type ApiUnverify struct { | ||
ID int `gorm:"column:id" json:"id"` | ||
ApiID int `json:"apiID" gorm:"column:api_id"` | ||
Type string `json:"type" gorm:"column:type"` | ||
Name string `json:"name" gorm:"column:name"` | ||
NameCn string `json:"nameCn" gorm:"column:name_cn"` | ||
Desc string `json:"desc" gorm:"column:desc"` | ||
InfoDesc string `json:"infoDesc" gorm:"column:info_desc"` | ||
CreateTime string `json:"createTime" gorm:"column:create_time"` | ||
IsHandle uint8 `json:"isHandle" gorm:"column:is_handle"` | ||
} | ||
|
||
type ApiUnit struct { | ||
// 主键ID | ||
ID uint64 `grom:"primary_key;column:id" json:"id"` | ||
// 英文名称 | ||
Name string `grom:"column:name" json:"name"` | ||
// 中文名称 | ||
NameCn string `grom:"column:name_cn" json:"nameCn"` | ||
// 描述 | ||
Desc string `grom:"column:desc" json:"desc"` | ||
// 父级ID | ||
ParentID uint64 `grom:"column:parent_id" json:"parentId"` | ||
// 删除标识 | ||
Enabled uint8 `grom:"column:enabled" json:"enabled"` | ||
// 创建时间 | ||
CreateTime time.Time `grom:"column:create_time" json:"createTime"` | ||
// 更新时间 | ||
UpdateTime time.Time `grom:"column:update_time" json:"updateTime"` | ||
} | ||
|
||
type ApiItem struct { | ||
ApiUnit | ||
ApiID int32 `gorm:"column:api_id" json:"apiId"` | ||
Type uint8 `gorm:"column:type" json:"type"` | ||
} | ||
|
||
type SimpleApiItem struct { | ||
// api ID | ||
ID int32 `gorm:"column:id" json:"id"` | ||
// 英文名称 | ||
Name string `grom:"column:name" json:"name"` | ||
// 中文名称 | ||
NameCn string `grom:"column:name_cn" json:"nameCn"` | ||
// 描述 | ||
Desc string `grom:"column:desc" json:"desc"` | ||
} | ||
|
||
type SearchApiItem struct { | ||
SimpleApiItem | ||
Type string `json:"type"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package database | ||
|
||
type ApiLoginLog struct { | ||
ID int `json:"id" gorm:"column:id"` | ||
IP string `json:"ip" gorm:"column:ip"` | ||
Method string `json:"method" gorm:"column:method"` | ||
LoginDate string `json:"loginDate" gorm:"column:login_date"` | ||
Count int `json:"count" gorm:"column:count"` | ||
Type uint8 `gorm:"column:type" json:"type"` | ||
CreateTime string `json:"createTime" gorm:"column:create_time"` | ||
UpdateTime string `json:"updateTime" gorm:"column:update_time"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package database | ||
|
||
import "time" | ||
|
||
type Macros struct { | ||
ID int64 `gorm:"column:id" json:"id"` | ||
UpdateTime time.Time `gorm:"column:updatetime" json:"updatetime"` | ||
IsVerify uint8 `gorm:"column:is_verify" json:"isVerify"` | ||
MasteryID int64 `gorm:"column:mastery_id" json:"masteryId"` | ||
ProfessionID int64 `gorm:"column:profession_id" json:"professionId"` | ||
|
||
SimpleMacro | ||
} | ||
|
||
type SimpleMacro struct { | ||
Title string `gorm:"column:title" json:"title"` | ||
Macro string `gorm:"column:macro" json:"macro"` | ||
Author string `gorm:"column:author" json:"author"` | ||
} | ||
|
||
type Profession struct { | ||
PID int64 `gorm:"column:pid" json:"pid"` | ||
Version int8 `gorm:"column:version" json:"version"` | ||
SimpleProfession | ||
} | ||
|
||
type SimpleProfession struct { | ||
ID int64 `gorm:"column:id" json:"id"` | ||
Name string `gorm:"column:name" json:"name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package database | ||
|
||
import "time" | ||
|
||
type MacrosOld60 struct { | ||
SimpleMacro60 | ||
ID int64 `gorm:"column:id" json:"id"` | ||
UpdateTime time.Time `gorm:"column:updatetime" json:"updatetime"` | ||
IsVerify uint8 `gorm:"column:is_verify" json:"isVerify"` | ||
MasteryID int64 `gorm:"column:mastery_id" json:"masteryId"` | ||
ProfessionID int64 `gorm:"column:profession_id" json:"professionId"` | ||
} | ||
|
||
type SimpleMacro60 struct { | ||
Title string `gorm:"column:title" json:"title"` | ||
Macro string `gorm:"column:macro" json:"macro"` | ||
Author string `gorm:"column:author" json:"author"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package global | ||
|
||
import ( | ||
"github.com/rifflock/lfshook" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
var Config = struct { | ||
// 系统 | ||
ListenHost string | ||
ListenPort int32 | ||
ApiRootPath string | ||
// 数据库 | ||
DbHost string | ||
DbPort int32 | ||
DbUser string | ||
DbPwd string | ||
DbName string | ||
// 日志 | ||
IsSaveLog bool | ||
LogPath string | ||
Log *logrus.Logger | ||
LogLevel logrus.Level | ||
// 基础验证 | ||
VerifyCode string | ||
// 统计天数 | ||
ChartDay int64 | ||
}{ | ||
ListenHost: "127.0.0.1", | ||
ListenPort: 8002, | ||
DbHost: "127.0.0.1", | ||
DbPort: 3306, | ||
DbUser: "xxx", | ||
DbPwd: "xxx", | ||
DbName: "wow_hong", | ||
IsSaveLog: false, | ||
Log: logrus.New(), | ||
LogPath: "./logs/log.txt", | ||
LogLevel: logrus.DebugLevel, | ||
VerifyCode: "testcode", | ||
ChartDay: 20, | ||
} | ||
|
||
func init() { | ||
if Config.IsSaveLog { | ||
pathMap := lfshook.PathMap{ | ||
logrus.InfoLevel: Config.LogPath, | ||
logrus.ErrorLevel: Config.LogPath, | ||
logrus.WarnLevel: Config.LogPath, | ||
} | ||
Config.Log.Hooks.Add(lfshook.NewHook( | ||
pathMap, | ||
&logrus.JSONFormatter{}, | ||
)) | ||
} | ||
|
||
Config.Log.Level = Config.LogLevel | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module github.com/illidan33/wow_tools | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/gin-gonic/gin v1.7.2 | ||
github.com/go-playground/validator/v10 v10.6.1 // indirect | ||
github.com/go-sql-driver/mysql v1.4.1 | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/illidan33/wow_api v0.0.0-20200902012123-54b9c81760ff | ||
github.com/jinzhu/gorm v1.9.10 | ||
github.com/json-iterator/go v1.1.11 // indirect | ||
github.com/kr/pretty v0.2.1 // indirect | ||
github.com/leodido/go-urn v1.2.1 // indirect | ||
github.com/mattn/go-isatty v0.0.13 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 | ||
github.com/sirupsen/logrus v1.2.0 | ||
github.com/ugorji/go v1.2.6 // indirect | ||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect | ||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect | ||
golang.org/x/text v0.3.6 // indirect | ||
google.golang.org/protobuf v1.27.1 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
) |
Oops, something went wrong.