siked vor 1 Jahr
Commit
f29d3fc0bc
100 geänderte Dateien mit 5115 neuen und 0 gelöschten Zeilen
  1. 8 0
      .idea/.gitignore
  2. 25 0
      .idea/deployment.xml
  3. 8 0
      .idea/modules.xml
  4. 9 0
      .idea/yunlot_public.iml
  5. 72 0
      RunCode/README.MD
  6. 22 0
      RunCode/RunCode.go
  7. 36 0
      RunCode/config/docker_config (复件).json
  8. 20 0
      RunCode/config/docker_config.json
  9. 13 0
      RunCode/config/docker_configx.json
  10. 31 0
      RunCode/config/main.txt
  11. 101 0
      RunCode/config/main.txt_C.go
  12. 69 0
      RunCode/config/main.txt_test.go.txt
  13. 86 0
      RunCode/context/context.go
  14. 244 0
      RunCode/ctl/controller.go
  15. 269 0
      RunCode/service/docker.go
  16. 34 0
      RunCode/打包镜像.MD
  17. 31 0
      TimeTask/OrmLog.go
  18. 6 0
      TimeTask/TimeTask.go
  19. 10 0
      Z_Build.bat
  20. 25 0
      conf/app.conf
  21. 31 0
      conf/config.go
  22. 273 0
      controllers/ProductProt.go
  23. 52 0
      controllers/RunCode.go
  24. 25 0
      controllers/UpFile.go
  25. 68 0
      controllers/User.go
  26. 15 0
      controllers/default.go
  27. 78 0
      go.mod
  28. 438 0
      go.sum
  29. 1 0
      lastupdate.tmp
  30. 61 0
      lib/Aes.go
  31. 51 0
      lib/Message_Sand.go
  32. 58 0
      lib/MinuteToDataTime.go
  33. 41 0
      lib/Qiniu.go
  34. 271 0
      lib/TcpServerLib/binaryReadWrite.go
  35. 16 0
      lib/TcpServerLib/define.go
  36. 73 0
      lib/TcpServerLib/packet.go
  37. 107 0
      lib/TcpServerLib/session.go
  38. 85 0
      lib/TcpServerLib/tcpServer.go
  39. 526 0
      lib/lib.go
  40. 0 0
      logs/Data/logx.log
  41. 124 0
      logs/LogPrintln.go
  42. 0 0
      logs/Mqtt/logx.log
  43. 0 0
      logs/Orm/logx.log
  44. 1 0
      logs/logx/logx.log
  45. 0 0
      logs/logxE/logx.log
  46. 53 0
      main.go
  47. 76 0
      models/Account/Tokey.go
  48. 107 0
      models/Account/User.go
  49. 70 0
      models/GTime.go
  50. 57 0
      models/Product/ProductLang.go
  51. 45 0
      models/Product/ProductMode.go
  52. 152 0
      models/Product/ProductProt.go
  53. 33 0
      models/System/Logs.go
  54. 22 0
      routers/Product.go
  55. 16 0
      routers/RunCode.go
  56. 39 0
      routers/User.go
  57. 10 0
      routers/router.go
  58. 40 0
      tests/Cgo/aaaa.go
  59. 12 0
      tests/Message_Sand_test.go
  60. 9 0
      tests/default_test.go
  61. 43 0
      tests/deom_test.go
  62. 64 0
      tests/go_test.go
  63. 56 0
      tests/json_key_test.go
  64. 37 0
      tests/json_test.go
  65. 0 0
      tests/logs/Data/logx.log
  66. 0 0
      tests/logs/Mqtt/logx.log
  67. 0 0
      tests/logs/Orm/logx.log
  68. 58 0
      tests/logs/logx/logx.log
  69. 0 0
      tests/logs/logxE/logx.log
  70. 11 0
      tests/main.txt_C_test.go
  71. 35 0
      tests/maspac_test.go
  72. 0 0
      tests/memory.prof
  73. 148 0
      tests/mongodb_test.go
  74. 30 0
      tests/plugin_test.go
  75. 30 0
      tests/tcp_test.go
  76. 0 0
      tests/yunlot-pxxxx-v1.19-01.so
  77. 88 0
      tests/zhuan_test.go
  78. 6 0
      views/index.tpl
  79. BIN
      yunlot_public
  80. BIN
      yunlot_public.tar.gz
  81. BIN
      yunlot_public.tar/yunlot_public.tar
  82. 4 0
      yunlot_public.tar/yunlot_public/.md
  83. 23 0
      yunlot_public.tar/yunlot_public/Handle/MqttServer/.md
  84. 1 0
      yunlot_public.tar/yunlot_public/Handle/MqttServer/PaxHeaders.0/.md
  85. 1 0
      yunlot_public.tar/yunlot_public/PaxHeaders.0/.md
  86. 34 0
      yunlot_public.tar/yunlot_public/RunCode/.MD
  87. 1 0
      yunlot_public.tar/yunlot_public/RunCode/PaxHeaders.0/.MD
  88. 72 0
      yunlot_public.tar/yunlot_public/RunCode/README.MD
  89. 1 0
      yunlot_public.tar/yunlot_public/RunCode/config/PaxHeaders.0/docker_config ().json
  90. 36 0
      yunlot_public.tar/yunlot_public/RunCode/config/docker_config ().json
  91. 13 0
      yunlot_public.tar/yunlot_public/RunCode/config/docker_config.json
  92. 31 0
      yunlot_public.tar/yunlot_public/RunCode/config/main.txt
  93. 10 0
      yunlot_public.tar/yunlot_public/Z_Build.bat
  94. 15 0
      yunlot_public.tar/yunlot_public/conf/app.conf
  95. 0 0
      yunlot_public.tar/yunlot_public/logs/Data/logx.log
  96. 0 0
      yunlot_public.tar/yunlot_public/logs/Mqtt/logx.log
  97. 0 0
      yunlot_public.tar/yunlot_public/logs/Orm/logx.log
  98. 1 0
      yunlot_public.tar/yunlot_public/logs/logx/logx.log
  99. 0 0
      yunlot_public.tar/yunlot_public/logs/logxE/logx.log
  100. 11 0
      yunlot_public.tar/yunlot_public/tests/C/hello.c

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/

+ 25 - 0
.idea/deployment.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="PublishConfigData" autoUpload="Always" serverName="Alot" remoteFilesAllowedToDisappearOnAutoupload="false">
+    <serverData>
+      <paths name="Alot">
+        <serverdata>
+          <mappings>
+            <mapping deploy="/home/bzd/GolandProjects/Yunlot_Public" local="$PROJECT_DIR$" web="/" />
+          </mappings>
+          <excludedPaths>
+            <excludedPath local="true" path="$PROJECT_DIR$/.idea" />
+          </excludedPaths>
+        </serverdata>
+      </paths>
+      <paths name="huitong">
+        <serverdata>
+          <mappings>
+            <mapping local="$PROJECT_DIR$" web="/" />
+          </mappings>
+        </serverdata>
+      </paths>
+    </serverData>
+    <option name="myAutoUpload" value="ALWAYS" />
+  </component>
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/yunlot_public.iml" filepath="$PROJECT_DIR$/.idea/yunlot_public.iml" />
+    </modules>
+  </component>
+</project>

+ 9 - 0
.idea/yunlot_public.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="Go" enabled="true" />
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 72 - 0
RunCode/README.MD

@@ -0,0 +1,72 @@
+### Cloud-Run-Code
+
+> 在线运行代码
+> 服务依赖docker环境
+> 
+```shell
+    go run main.go --port=端口号 --config=配置文件路径
+```
+
+#### 手动其他添加语言
+编辑`docker_config.json`文件 添加对应 key value 即可
+
+```json
+{
+  "docker_runner": {
+    "go": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "golang:1.18.0-alpine3.15",
+      "cmd": "go run main.go"
+    }  
+  }  
+}
+```
+`docker_runner`字段说明
+
+| 字段名 | 说明 |
+|-------|------|
+| ext | 文件后续 |
+| filename | 容器中运行的文件名 |
+| image | 镜像名 |
+| cmd | 启动容器后运行的命令 |
+
+#### 接口说明
+
+获取所有支持的语言列表
+
+`GET /languages`
+```json
+[
+  "go",
+  "python",
+  "php",
+  "java",
+  "node"
+]
+```
+
+`POST /run?lang={lang}`
+* 参数说明 lang : 为 languages 接口返回的列表
+* 请求体:具体代码
+```json
+{
+  "lang": "{lang}",
+  "message": "execute success",
+  "result": "hello world"
+}
+```
+
+### **Ubuntu**
+Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
+
+
+sudo vim /etc/default/grub
+替换:  GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
+sudo update-grub
+reboot
+
+
+
+
+

+ 22 - 0
RunCode/RunCode.go

@@ -0,0 +1,22 @@
+package RunCode
+
+import (
+	service "Yunlot/RunCode/service"
+	"log"
+)
+
+func RunCode_Inte() {
+	println("==========代码编译==========")
+	//var port = "9999"
+	err := service.InitDockerRunner("./RunCode/config/docker_config.json")
+	if err != nil {
+		log.Fatalf("initilize service failure docker_config.json: %s", err)
+	}
+
+	//http.HandleFunc("/languages", ctl.LanguagesController)
+	//http.HandleFunc("/run", ctl.RunController)
+	//addr := net.JoinHostPort("", port)
+	//log.Println("running to " + addr)
+	//log.Fatalln(http.ListenAndServe(addr, nil))
+
+}

+ 36 - 0
RunCode/config/docker_config (复件).json

@@ -0,0 +1,36 @@
+{
+  "timeout": 5,
+  "docker_base": "run -i --cpus=1 -m=512M --rm --network none -v {tmp_file}:/usr/src/myapp/{runner_filename} -w /usr/src/myapp {image} sh -c",
+  "docker_runner": {
+    "php": {
+      "ext": "php",
+      "filename": "app.php",
+      "image": "php:7.4.28-zts-alpine",
+      "cmd": "php app.php"
+    },
+    "node": {
+      "ext": "js",
+      "filename": "app.js",
+      "image": "node:17.8.0-alpine",
+      "cmd": "node app.js"
+    },
+    "python": {
+      "ext": "py",
+      "filename": "app.py",
+      "image": "python:3.9.12-alpine3.15",
+      "cmd":"python app.py"
+    },
+    "java": {
+      "ext": "java",
+      "filename": "Main.java",
+      "image": "openjdk:11-jdk-oraclelinux7",
+      "cmd": "javac Main.java && java Main"
+    },
+    "go": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "golang:1.18.0-alpine3.15",
+      "cmd": "go run main.go"
+    }
+  }
+}

+ 20 - 0
RunCode/config/docker_config.json

@@ -0,0 +1,20 @@
+{
+  "timeout": 30,
+  "docker_base": "run -i --cpus=1 -m=512M --rm --network none -v {Analysis_Dir}:/usr/src/myapp/so -v {tmp_file}:/usr/src/myapp/{runner_filename} -w /usr/src/myapp {image} sh -c",
+  "docker_runner": {
+    "Goland": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "yunlot-golang:v1.5",
+      "cmd": "/usr/local/go/bin/./go run main.go",
+      "build": "/usr/local/go/bin/./go build -buildmode=plugin -o so/{name}.so main.go"
+    },
+    "C": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "yunlot-golang:v1.5",
+      "cmd": "/usr/local/go/bin/./go run main.go",
+      "build": "/usr/local/go/bin/./go build -buildmode=plugin -o so/{name}.so main.go"
+    }
+  }
+}

+ 13 - 0
RunCode/config/docker_configx.json

@@ -0,0 +1,13 @@
+{
+  "timeout": 30,
+  "docker_base": "run -i --cpus=1 -m=512M --rm --network none --mount source=yunlotso,target=/usr/src/myapp/so -v {tmp_file}:/usr/src/myapp/{runner_filename} -w /usr/src/myapp {image} sh -c",
+  "docker_runner": {
+    "Goland": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "yunlot-golang:v1.5",
+      "cmd": "/usr/local/go/bin/./go run main.go",
+      "build": "/usr/local/go/bin/./go build -buildmode=plugin -o so/{name}.so main.go"
+    }
+  }
+}

+ 31 - 0
RunCode/config/main.txt

@@ -0,0 +1,31 @@
+
+func main() {
+
+	// -------------------------------设备->平台
+	T_byte := []byte(T_string)
+	if Data_hex {
+		T_byte, _ = hex.DecodeString(T_string)
+	}
+	// 设备->平台(发送)
+	if len(T_string) != 0{
+		data_ := T(Topic, T_byte)
+		fmt.Print("|-=&" + data_)
+	}else{
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 平台->设备(接收):
+	if len(R_string) != 0{
+		topic_, data_ := R("{$sn}", R_string)
+		fmt.Print("|-=&" + topic_)
+		if Data_hex {
+			fmt.Print("|-=&" + strings.ToUpper(hex.EncodeToString(data_)))
+		}else {
+			fmt.Print("|-=&" + string(data_))
+		}
+
+	}else{
+		fmt.Print("|-=&" + "无参数")
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 返回数据: 1、 设备发送数据解析到平台json     2、topic     3、平台处理后返回给设备数据
+}

+ 101 - 0
RunCode/config/main.txt_C.go

@@ -0,0 +1,101 @@
+package main
+
+/*
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define LEN 1024
+
+// 设备->平台
+void T(const char *t, const char *b, char **r_b) {
+    size_t len1 = strlen(t);
+    size_t len2 = strlen(b);
+    *r_b = (char *)malloc(len1 + len2 + 1);
+    strcpy(*r_b, t);
+    strcat(*r_b, b);
+}
+
+void R(const char *t,  const char *b, char **r_t, char **r_b) {
+    size_t len1 = strlen(t);
+    size_t len2 = strlen(b);
+    *r_t = (char *)malloc(len1 + 1);
+    *r_b = (char *)malloc(len2 + 1);
+    strcpy(*r_t, t);
+    strcpy(*r_b, b);
+}
+
+*/
+import "C"
+
+/////-------
+import (
+	"encoding/hex"
+	"fmt"
+	"strings"
+	"unsafe"
+)
+
+/*
+设备->平台
+*/
+func T(t string, b []byte) string {
+	var r_b *C.char
+	C.T(C.CString(t), C.CString(string(b)), &r_b)
+	r_b_ := C.GoString(r_b)
+	C.free(unsafe.Pointer(r_b)) // Free the memory allocated in C code
+	return r_b_
+}
+
+/*
+平台->设备
+*/
+func R(sn string, b string) (string, []byte) {
+	var r_t, r_b *C.char
+	C.R(C.CString(sn), C.CString(b), &r_t, &r_b)
+	r_t_ := C.GoString(r_t)
+	r_b_ := C.GoString(r_b)
+	C.free(unsafe.Pointer(r_t)) // Free the memory allocated in C code
+	C.free(unsafe.Pointer(r_b)) // Free the memory allocated in C code
+
+	return r_t_, []byte(r_b_)
+}
+
+// ---DATA---
+var Data_hex = false
+var Topic = "/topic/snxxx1"
+var T_string = "A456"
+var R_string = "495051"
+
+// ///-------
+func main() {
+
+	// -------------------------------设备->平台
+	T_byte := []byte(T_string)
+	if Data_hex {
+		T_byte, _ = hex.DecodeString(T_string)
+	}
+	// 设备->平台(发送)
+	if len(T_string) != 0 {
+		data_ := T(Topic, T_byte)
+		fmt.Print("|-=&" + data_)
+	} else {
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 平台->设备(接收):
+	if len(R_string) != 0 {
+		topic_, data_ := R("{$sn}", R_string)
+		fmt.Print("|-=&" + topic_)
+		if Data_hex {
+			fmt.Print("|-=&" + strings.ToUpper(hex.EncodeToString(data_)))
+		} else {
+			fmt.Print("|-=&" + string(data_))
+		}
+
+	} else {
+		fmt.Print("|-=&" + "无参数")
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 返回数据: 1、 设备发送数据解析到平台json     2、topic     3、平台处理后返回给设备数据
+}

+ 69 - 0
RunCode/config/main.txt_test.go.txt

@@ -0,0 +1,69 @@
+package main
+
+import (
+	"testing"
+)
+
+/////-------
+import (
+	"encoding/hex"
+	"fmt"
+	"strings"
+)
+
+/*
+设备->平台
+*/
+func T(t string, b []byte) string {
+	return string(b)
+}
+
+/*
+平台->设备
+*/
+func R(sn string, b string) (string, []byte) {
+	t := sn
+	return t, []byte(b)
+}
+
+var Data_hex = true
+var Topic = "/topic/snxxx1"
+var T_string = "A456"
+var R_string = "495051"
+
+/////-------
+
+func main() {
+
+	// -------------------------------设备->平台
+	T_byte := []byte(T_string)
+	if Data_hex {
+		T_byte, _ = hex.DecodeString(T_string)
+	}
+	// 设备->平台(发送)
+	if len(T_string) != 0 {
+		data_ := T(Topic, T_byte)
+		fmt.Print("|-=&" + data_)
+	} else {
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 平台->设备(接收):
+	if len(R_string) != 0 {
+		topic_, data_ := R(Topic, R_string)
+		fmt.Print("|-=&" + topic_)
+		if Data_hex {
+			fmt.Print("|-=&" + strings.ToUpper(hex.EncodeToString(data_)))
+		} else {
+			fmt.Print("|-=&" + string(data_))
+		}
+
+	} else {
+		fmt.Print("|-=&" + "无参数")
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 返回数据: 1、 设备发送数据解析到平台json     2、topic     3、平台处理后返回给设备数据
+}
+
+func Test_Runcode(t *testing.T) {
+	main()
+}

+ 86 - 0
RunCode/context/context.go

@@ -0,0 +1,86 @@
+package context
+
+import (
+	"encoding/json"
+	"net/http"
+	"strings"
+)
+
+type Result struct {
+	Code    int    `json:"code,omitempty"`
+	Lang    string `json:"lang,omitempty"`
+	Message string `json:"message,omitempty"`
+	T       string `json:"t,omitempty"`
+	R       string `json:"r,omitempty"`
+	Topic   string `json:"topic,omitempty"`
+}
+
+type Result_b struct {
+	Code    int    `json:"code,omitempty"`
+	Lang    string `json:"lang,omitempty"`
+	Message string `json:"message,omitempty"`
+	T       string `json:"t,omitempty"`
+	R       string `json:"r,omitempty"`
+	Topic   string `json:"topic,omitempty"`
+}
+
+type Context struct {
+	Writer http.ResponseWriter
+	Req    *http.Request
+}
+
+func (c *Context) IsGet() bool {
+	return c.Method() == http.MethodGet
+}
+
+func (c *Context) IsPost() bool {
+	return c.Method() == http.MethodPost
+}
+
+func (c *Context) Method() string {
+	return strings.ToUpper(c.Req.Method)
+}
+
+func (c *Context) NotAllow() {
+	c.Writer.WriteHeader(http.StatusMethodNotAllowed)
+}
+
+func (c *Context) JSON(code int, data interface{}) error {
+	c.Writer.Header().Add("Content-Type", "application/json")
+	content, _ := json.Marshal(data)
+	c.res(code, content)
+	return nil
+}
+
+func (c *Context) RunOK(lang, message, T, R, Topic string) {
+	_ = c.JSON(http.StatusOK, &Result{200, lang, message, T, R, Topic})
+}
+
+func (c *Context) Bad(message string) {
+	c.RunRet(http.StatusBadRequest, message)
+}
+
+func (c *Context) Error(message string) {
+	c.RunRet(http.StatusInternalServerError, message)
+}
+
+func (c *Context) Timeout(message string) {
+	c.RunRet(http.StatusRequestTimeout, message)
+}
+
+func (c *Context) RunRet(code int, message string) {
+	_ = c.JSON(200, &Result{code, "", message, "", "", ""})
+}
+
+func (c *Context) res(code int, data []byte) {
+	c.Writer.WriteHeader(code)
+	_, _ = c.Writer.Write(data)
+}
+
+func (c *Context) Get(key string, def string) string {
+	val := c.Req.URL.Query().Get(key)
+	if val == "" {
+		return def
+	}
+	return val
+}

+ 244 - 0
RunCode/ctl/controller.go

@@ -0,0 +1,244 @@
+package ctl
+
+import (
+	"Yunlot/RunCode/context"
+	service "Yunlot/RunCode/service"
+	"Yunlot/logs"
+	"Yunlot/models/Product"
+	context2 "context"
+	"fmt"
+	context1 "github.com/beego/beego/v2/server/web/context"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+var Go_Main string
+var Go_MainDATA = "\n// ---DATA---\nvar Data_hex = false\nvar Topic = \"/topic/snxxx1\"\nvar T_string = \"A456\"\nvar R_string = \"495051\"\n"
+
+func init() {
+	// 获取 执行文件
+	content, err := os.ReadFile("./RunCode/config/main.txt")
+	if err != nil {
+		panic(any(err))
+	}
+	//fmt.Println(string(content))
+	Go_Main = string(content)
+}
+
+// LanguagesController Get /languages
+func LanguagesController(writer http.ResponseWriter, request *http.Request) {
+	ctx := &context.Context{Writer: writer, Req: request}
+	if !ctx.IsGet() {
+		ctx.NotAllow()
+		return
+	}
+	var languages []string
+	for lang := range service.DockerRunner.Runners {
+		languages = append(languages, lang)
+	}
+	_ = ctx.JSON(http.StatusOK, languages)
+	return
+}
+
+// 根据不同语言生成代码   run 运行/编译
+func CreateCode(run bool, lang_int int, code string) string {
+	switch lang_int {
+	case 1: //Goland
+		if run {
+			code = "package main\n" + code + Go_Main
+		} else {
+			code = "package main\n" + code + Go_MainDATA + strings.Replace(Go_Main, "func main()", "func mainxx()", -1)
+		}
+		break
+	case 2: // C
+
+		zongjian := "\n*/\nimport \"C\"\n\n/////-------\nimport (\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\n/*\n设备->平台\n*/\nfunc T(t string, b []byte) string {\n\tvar r_b *C.char\n\tC.T(C.CString(t), C.CString(string(b)), &r_b)\n\tr_b_ := C.GoString(r_b)\n\tC.free(unsafe.Pointer(r_b)) // Free the memory allocated in C code\n\treturn r_b_\n}\n\n/*\n平台->设备\n*/\nfunc R(sn string, b string) (string, []byte) {\n\tvar r_t,r_b *C.char\n\tC.R(C.CString(sn), C.CString(b), &r_t, &r_b)\n\tr_t_ := C.GoString(r_t)\n\tr_b_ := C.GoString(r_b)\n\tC.free(unsafe.Pointer(r_t)) // Free the memory allocated in C code\n\tC.free(unsafe.Pointer(r_b)) // Free the memory allocated in C code\n\n\treturn r_t_, []byte(r_b_)\n}\n"
+		if run {
+			code_list := strings.Split(code, "// ---DATA---")
+			if len(code_list) != 2 {
+				logs.Println("len(code_list) != 2,没找到 【// ---DATA---】 ")
+				return code
+			}
+			code = "package main\n/*\n" + code_list[0] + zongjian + code_list[1] + Go_Main
+		} else {
+			code = "package main\n/*\n" + code + zongjian + Go_MainDATA + strings.Replace(Go_Main, "func main()", "func mainxx()", -1)
+		}
+		break
+	}
+
+	return code
+}
+
+// RunController Post /run?lang={lang}
+func RunController(writer http.ResponseWriter, request *http.Request) {
+	ctx := &context.Context{Writer: writer, Req: request}
+	if !ctx.IsPost() {
+		ctx.NotAllow()
+		return
+	}
+	lang_int, err := strconv.Atoi(ctx.Get("lang", ""))
+	if err != nil {
+		ctx.Bad("lang 参数不能为空!")
+		return
+	}
+	lang := Product.ProductLangFind(lang_int)
+
+	if lang == "" {
+		ctx.Bad("lang 参数不能为空!")
+		return
+	} else {
+		if !service.DockerRunner.RunnerExists(lang) {
+			ctx.Bad(lang + "语言编译异常!")
+			return
+		}
+		body, _ := ioutil.ReadAll(request.Body)
+		if len(body) == 0 {
+			ctx.Bad("Body 内容为空!")
+			return
+		}
+
+		// 生成代码
+		code := CreateCode(true, lang_int, string(body))
+		cancelCtx, cancelFn := context2.WithTimeout(context2.Background(), time.Second*time.Duration(service.DockerRunner.Timeout))
+		defer cancelFn()
+
+		content, err := service.DockerRunner.Exec(cancelCtx, lang, code)
+		if err == nil {
+			content_list := strings.Split(string(content), "|-=&")
+			fmt.Println("content_list:", content_list)
+			if len(content_list) != 4 {
+				ctx.Error("解析错误!!!" + string(content))
+				return
+			}
+			ctx.RunOK(lang, "success", content_list[1], content_list[3], content_list[2])
+			return
+		}
+		if err == service.TimeoutError {
+			ctx.Timeout("运行超时!")
+			return
+		}
+
+		ctx.Error(string(content))
+	}
+}
+
+// RunController Post /run?lang={lang}
+func BuildController(Output *context1.BeegoOutput, writer http.ResponseWriter, request *http.Request) {
+	ctx := &context.Context{Writer: writer, Req: request}
+	if !ctx.IsPost() {
+		ctx.NotAllow()
+		return
+	}
+
+	lang_int, err := strconv.Atoi(ctx.Get("lang", ""))
+	if err != nil {
+		ctx.Bad("lang 参数不能为空!")
+		return
+	}
+	lang := Product.ProductLangFind(lang_int)
+
+	if lang == "" {
+		ctx.Bad("lang 参数不能为空!")
+		return
+	} else {
+		if !service.DockerRunner.RunnerExists(lang) {
+			ctx.Bad(lang + "语言编译异常!")
+			return
+		}
+		body, _ := ioutil.ReadAll(request.Body)
+		if len(body) == 0 {
+			ctx.Bad("Body 内容为空!")
+			return
+		}
+		// 生成代码
+		code := CreateCode(false, lang_int, string(body))
+		//code := "package main\n" + string(body) + strings.Replace(Go_Main, "func main()", "func mainxx()", -1)
+		cancelCtx, cancelFn := context2.WithTimeout(context2.Background(), time.Second*time.Duration(service.DockerRunner.Timeout))
+		defer cancelFn()
+
+		name_so := time.Now().UnixMilli()
+		//fmt.Println("code:",code)
+		content, err := service.DockerRunner.Build(cancelCtx, name_so, lang, code)
+		fmt.Println("content:", content)
+		if len(content) > 0 {
+			ctx.Error(string(content))
+			return
+		}
+		if err == nil {
+			ctx.RunOK(lang, fmt.Sprintf("%d", name_so), "", "", "")
+			return
+		}
+		// 编译超时
+		//if err == service.TimeoutError {
+		//	ctx.Timeout("运行超时!")
+		//	return
+		//}
+
+		ctx.Error("E:" + string(content))
+	}
+}
+
+func BuildGenerate(ProductProtr *Product.ProductProt) {
+
+	lang := Product.ProductLangFind(ProductProtr.T_lang)
+
+	if lang == "" {
+		ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 找不到编译语言 \n"
+		ProductProtr.T_State = 3
+		ProductProtr.Update("T_State", "T_log")
+		return
+	}
+
+	if !service.DockerRunner.RunnerExists(lang) {
+		ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 编译语言异常 \n"
+		ProductProtr.T_State = 3
+		ProductProtr.Update("T_State", "T_log")
+		return
+	}
+	body := ProductProtr.T_text
+	if len(body) == 0 {
+		ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 内容为空 \n"
+		ProductProtr.T_State = 3
+		ProductProtr.Update("T_State", "T_log")
+		return
+	}
+	// 生成代码
+	code := CreateCode(false, ProductProtr.T_lang, body)
+
+	cancelCtx, cancelFn := context2.WithTimeout(context2.Background(), time.Second*time.Duration(service.DockerRunner.Timeout))
+	defer cancelFn()
+
+	name_so := time.Now().UnixMilli()
+	//fmt.Println("code:",code)
+	content, err := service.DockerRunner.Build(cancelCtx, name_so, lang, code)
+	fmt.Println("content:", content)
+	if len(content) > 0 {
+		ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 编译异常:" + string(content) + " \n|-&"
+		ProductProtr.T_State = 3
+		ProductProtr.Update("T_State", "T_log")
+		return
+	}
+	if err == nil {
+		ProductProtr.T_analysis = fmt.Sprintf("%d", name_so)
+		ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 编译成功! \n|-&"
+		ProductProtr.T_State = 1
+		ProductProtr.Update("T_analysis", "T_State", "T_log")
+		return
+
+	}
+	// 编译超时
+	//if err == service.TimeoutError {
+	//	ctx.Timeout("运行超时!")
+	//	return
+	//}
+
+	ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 编译异常:" + string(content) + " \n"
+	ProductProtr.T_State = 3
+	ProductProtr.Update("T_State", "T_log")
+	return
+
+}

+ 269 - 0
RunCode/service/docker.go

@@ -0,0 +1,269 @@
+package RunCode_service
+
+import (
+	"Yunlot/conf"
+	"bytes"
+	context2 "context"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"os"
+	"os/exec"
+	"regexp"
+	"strings"
+	"time"
+)
+
+var TimeoutError = errors.New("execute timeout")
+var Success = errors.New("success")
+var Exited = errors.New("exited")
+
+var DockerRunner dockerRunner
+
+func InitDockerRunner(config string) error {
+	log.SetPrefix("[cloud-run-code]")
+	dockerPath, err := exec.LookPath("docker")
+	//dockerPath := "/usr/bin/docker"
+	println("dockerPath:", dockerPath)
+
+	content, err := ioutil.ReadFile(config)
+	if err != nil {
+		return err
+	}
+	println("config  OK!")
+	err = json.Unmarshal(content, &DockerRunner)
+	if err != nil {
+		return err
+	}
+	println("json.Unmarshal  OK!")
+	DockerRunner.DockerPath = dockerPath
+	if err := DockerRunner.InstallImages(); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+type DRunner struct {
+	Ext      string `json:"ext"`
+	Filename string `json:"filename"`
+	Image    string `json:"image"`
+	Cmd      string `json:"cmd"`
+	Build    string `json:"build"`
+}
+
+func (dr *DRunner) InstallImage() ([]byte, error) {
+	cmd := exec.Command("docker", "pull", dr.Image)
+	var out bytes.Buffer
+	var stderr bytes.Buffer
+	cmd.Stdout = &out
+	cmd.Stderr = &stderr
+	if err := cmd.Run(); err != nil {
+		return stderr.Bytes(), err
+	}
+	return out.Bytes(), nil
+}
+
+type dockerRunner struct {
+	Timeout    int                 `json:"timeout"`
+	TmpPath    string              `json:"tmp_path"`
+	DockerBase string              `json:"docker_base"`
+	Runners    map[string]*DRunner `json:"docker_runner"`
+	DockerPath string
+}
+
+func (dr dockerRunner) RunnerExists(runner string) bool {
+	if _, ok := dr.Runners[runner]; ok {
+		return true
+	}
+	return false
+}
+
+func (dr dockerRunner) getDockerImages() (map[string]interface{}, error) {
+	cmd := exec.Command("docker", "images")
+	var out bytes.Buffer
+	cmd.Stdout = &out
+	if err := cmd.Run(); err != nil {
+		return nil, err
+	}
+	lines := strings.Split(out.String(), "\n")
+	var images = make(map[string]interface{})
+	regexpC, _ := regexp.Compile("[\\w+\\-\\/\\_\\.]+")
+	for i, line := range lines {
+		if i == 0 {
+			continue
+		}
+		columns := regexpC.FindAllStringSubmatch(line, -1)
+		if len(columns) == 0 {
+			continue
+		}
+		images[columns[0][0]+":"+columns[1][0]] = struct{}{}
+	}
+	return images, nil
+}
+
+func (dr dockerRunner) InstallImages() error {
+	if images, err := dr.getDockerImages(); err != nil {
+		return err
+	} else {
+		for lang, conf := range dr.Runners {
+			if _, ok := images[conf.Image]; ok {
+				log.Println(lang + " dependent image " + conf.Image + " exists skip.")
+			} else {
+				//pull image
+				log.Println(lang + " pull docker image " + conf.Image)
+				if res, err := conf.InstallImage(); err != nil {
+					log.Println("pull image " + conf.Image + " failure: " + string(res))
+				} else {
+					log.Println("pull docker image " + conf.Image + " success. ")
+				}
+			}
+		}
+		log.Println("tip:If the installation fails, please use the \"docker pull\" command or run this script again after finding out the reason.")
+		return nil
+	}
+}
+
+func (dr dockerRunner) Exec(ctx context2.Context, runnerName string, code string) (result []byte, err error) {
+	runner, _ := dr.Runners[runnerName]
+	tmpFileName := fmt.Sprintf("%d.%s_", time.Now().UnixMilli(), runner.Ext)
+	var tmpFile *os.File
+	if tmpFile, err = os.CreateTemp("", tmpFileName); err != nil {
+		return nil, err
+	}
+	_, _ = tmpFile.WriteString(code)
+	log.Println("tmp file path: " + tmpFile.Name())
+	defer func() {
+		//println("删除:", tmpFile.Name())
+		//_ = syscall.Unlink(tmpFile.Name())
+	}()
+	cmdStr := strings.Clone(dr.DockerBase)
+	cmdStr = strings.Replace(cmdStr, "{tmp_file}", tmpFile.Name(), 1)
+	cmdStr = strings.Replace(cmdStr, "{runner_filename}", runner.Filename, 1)
+	cmdStr = strings.Replace(cmdStr, "{image}", runner.Image, 1)
+	cmdStr = strings.Replace(cmdStr, "{Analysis_Dir}", conf.Analysis_Dir, 1)
+	args := strings.Split(cmdStr, " ")
+	args = append(args, runner.Cmd)
+	fmt.Println("args:", args)
+	result, err = dr.ExecDocker(ctx, args)
+	return
+}
+
+func (dr dockerRunner) ExecDocker(ctx context2.Context, args []string) (result []byte, err error) {
+	cmd := exec.CommandContext(ctx, dr.DockerPath, args...)
+	var out bytes.Buffer
+	var stderr bytes.Buffer
+	cmd.Stdout = &out
+	cmd.Stderr = &stderr
+	if err = cmd.Start(); err != nil {
+		return
+	}
+	chErr := make(chan error)
+	go func() {
+		for {
+			select {
+			case <-ctx.Done():
+				chErr <- TimeoutError
+				_ = cmd.Process.Kill()
+				return
+			default:
+				if state, err := cmd.Process.Wait(); err != nil {
+					chErr <- err
+					return
+				} else {
+					if state.Success() {
+						chErr <- Success
+						return
+					}
+					if state.Exited() {
+						chErr <- Exited
+						return
+					}
+				}
+			}
+		}
+	}()
+
+	err = <-chErr
+	if err == Success || err == Exited {
+		err = nil
+	}
+	if stderr.Len() > 0 {
+		return stderr.Bytes(), err
+	}
+	return out.Bytes(), err
+}
+
+func (dr dockerRunner) Build(ctx context2.Context, namerand int64, runnerName string, code string) (result []byte, err error) {
+	runner, _ := dr.Runners[runnerName]
+
+	tmpFileName := fmt.Sprintf("%d.%s_", namerand, runner.Ext)
+	var tmpFile *os.File
+	if tmpFile, err = os.CreateTemp("", tmpFileName); err != nil {
+		return nil, err
+	}
+	_, _ = tmpFile.WriteString(code)
+	log.Println("tmp file path: " + tmpFile.Name())
+	defer func() {
+		//println("删除:", tmpFile.Name())
+		//_ = syscall.Unlink(tmpFile.Name())
+	}()
+	cmdStr := strings.Clone(dr.DockerBase)
+	cmdStr = strings.Replace(cmdStr, "{tmp_file}", tmpFile.Name(), 1)
+	cmdStr = strings.Replace(cmdStr, "{runner_filename}", runner.Filename, 1)
+	cmdStr = strings.Replace(cmdStr, "{image}", runner.Image, 1)
+	cmdStr = strings.Replace(cmdStr, "{Analysis_Dir}", conf.Analysis_Dir, 1)
+	args := strings.Split(cmdStr, " ")
+	args = append(args, strings.Replace(runner.Build, "{name}", fmt.Sprintf("%d", namerand), 1))
+	fmt.Println("args:", args)
+	result, err = dr.ExecDocker_Build(ctx, args)
+	return
+
+}
+
+func (dr dockerRunner) ExecDocker_Build(ctx context2.Context, args []string) (result []byte, err error) {
+	cmd := exec.CommandContext(ctx, dr.DockerPath, args...)
+	var out bytes.Buffer
+	var stderr bytes.Buffer
+	cmd.Stdout = &out
+	cmd.Stderr = &stderr
+	if err = cmd.Start(); err != nil {
+		return
+	}
+	chErr := make(chan error)
+	go func() {
+		for {
+			select {
+			case <-ctx.Done():
+				chErr <- TimeoutError
+				_ = cmd.Process.Kill()
+				return
+			default:
+				if state, err := cmd.Process.Wait(); err != nil {
+					chErr <- err
+					return
+				} else {
+					if state.Success() {
+						chErr <- Success
+						return
+					}
+					if state.Exited() {
+						chErr <- Exited
+						return
+					}
+				}
+			}
+		}
+	}()
+
+	err = <-chErr
+	if err == Success || err == Exited || err == TimeoutError {
+		err = nil
+	}
+	if stderr.Len() > 0 {
+		return stderr.Bytes(), err
+	}
+	return out.Bytes(), err
+}

+ 34 - 0
RunCode/打包镜像.MD

@@ -0,0 +1,34 @@
+
+
+docker pull centos8
+docker run -t -i centos:8 /bin/bash
+
+    cd /etc/yum.repos.d/
+    sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
+    sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
+    yum makecache
+    yum update -y
+    yum install -y wget
+    yum -y install gcc  
+    yum -y install gcc-c++ 
+    wget https://dl.google.com/go/go1.19.1.linux-amd64.tar.gz
+    tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz
+    // echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
+    vim /etc/profile
+
+        #go语言安装主根目录
+        export GOROOT=/usr/local/go #替换你的目录
+        #GOPATH 是自己的go项目路径,自定义设置
+        export GOPATH=/Users/ding/go_workspace #替换你的目录
+        #GOBIN 当我们使用go install命令编译后并且安装的二进制程序目录
+        export GOBIN=$GOPATH/bin
+        # 启用 Go Modules 功能
+        export GO111MODULE=on
+        # 配置 GOPROXY 环境变量
+        export GOPROXY=https://goproxy.cn,direct
+        export PATH=$PATH:$GOROOT/bin:$GOBIN
+
+    source /etc/profile
+
+docker commit 3674ff56646a yunlot-golang:v1.x
+

+ 31 - 0
TimeTask/OrmLog.go

@@ -0,0 +1,31 @@
+package TimeTask
+
+//var OrmLogOrmLog *os.File
+//// ORM 日志清理
+//func OrmLog()  {
+//	crontab := cron.New(cron.WithSeconds())
+//	ss := "1 1 1 * * *"
+//	_, err := crontab.AddFunc(ss, OrmLog_MonitorScanStatus)
+//	if err != nil {
+//		fmt.Printf("err: %v\n", err)
+//		fmt.Println("初始化成功")
+//	}
+//	crontab.Start()
+//	defer crontab.Stop()
+//	select {}
+//}
+//func OrmLog_MonitorScanStatus()  {
+//
+//	fmt.Println("------- ORM 日志清理 --------")
+//	Data, err := ioutil.ReadFile(OrmLogOrmLog.Name())
+//	if err != nil {
+//		fmt.Printf("文件打开失败=%v\n", err)
+//		return
+//	}
+//	err = ioutil.WriteFile("logs/orm/logx_"+time.Now().Format("2006-01-02") +".log", Data, 0666)
+//	if err != nil {
+//		fmt.Printf("文件打开失败=%v\n", err)
+//	}
+//	fmt.Println("清空:",os.Truncate(OrmLogOrmLog.Name(), 0))
+//
+//}

+ 6 - 0
TimeTask/TimeTask.go

@@ -0,0 +1,6 @@
+package TimeTask
+
+func Init() {
+	//go OrmLog()
+
+}

+ 10 - 0
Z_Build.bat

@@ -0,0 +1,10 @@
+cd %~dp0
+set CGO_ENABLED=0
+set GOARCH=amd64
+set GOOS=linux
+set GOPATH=C:\Users\SIKED\go
+set GO111MODULE=auto
+set GOROOT=C:\Program Files\Go
+
+
+go build -o yunlot_public main.go

+ 25 - 0
conf/app.conf

@@ -0,0 +1,25 @@
+appname = Yunlot_public
+httpport = 6310
+runmode = dev
+
+# 数据解析加载目录
+Analysis_Dir = "/var/lib/docker/volumes/yunlotso/_data/"
+
+
+# Mysql
+MysqlServer_UrlPort = "127.0.0.1:3306"
+MysqlServer_Database = "yunlot_public"
+MysqlServer_Username = "Yunlot_public"
+MysqlServer_Password = "tmAbdx7TMkyP8ECJ"
+MysqlServer_MaxIdleConnections = 10
+MysqlServer_MaxOpenConnections = 200
+
+
+
+# 静态资源
+Qiniu_AccessKey = "-8ezB_d-8-eUFTMvhOGbGzgeQRPeKQnaQ3DBcUxo"
+Qiniu_SecretKey = "KFhkYxTAJ2ZPN3ZS3euTsfWk8-C92rKgkhAMkDRN"
+Qiniu_BUCKET = "bzdstandardoss"  #桶名称
+Qiniu_Dir = "UpFile" #上传保存路径
+Qiniu_Url = "http://xxx.com" #上传保存路径
+

+ 31 - 0
conf/config.go

@@ -0,0 +1,31 @@
+package conf
+
+import (
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+func init() {
+
+}
+
+var HTTPPort, _ = beego.AppConfig.Int("HTTPPort")
+var AppName, _ = beego.AppConfig.String("appname")
+
+// 数据解析加载目录
+var Analysis_Dir, _ = beego.AppConfig.String("Analysis_Dir")
+
+// Mysql
+
+var MysqlServer_UrlPort, _ = beego.AppConfig.String("MysqlServer_UrlPort")
+var MysqlServer_Database, _ = beego.AppConfig.String("MysqlServer_Database")
+var MysqlServer_Username, _ = beego.AppConfig.String("MysqlServer_Username")
+var MysqlServer_Password, _ = beego.AppConfig.String("MysqlServer_Password")
+var MysqlServer_MaxIdleConnections, _ = beego.AppConfig.Int("MysqlServer_MaxIdleConnections")
+var MysqlServer_MaxOpenConnections, _ = beego.AppConfig.Int("MysqlServer_MaxOpenConnections")
+
+// Qiniu
+var Qiniu_AccessKey, _ = beego.AppConfig.String("Qiniu_AccessKey")
+var Qiniu_SecretKey, _ = beego.AppConfig.String("Qiniu_SecretKey")
+var Qiniu_BUCKET, _ = beego.AppConfig.String("Qiniu_BUCKET")
+var Qiniu_Dir, _ = beego.AppConfig.String("Qiniu_Dir")
+var Qiniu_Url, _ = beego.AppConfig.String("Qiniu_Url")

+ 273 - 0
controllers/ProductProt.go

@@ -0,0 +1,273 @@
+package controllers
+
+import (
+	"Yunlot/RunCode/ctl"
+	"Yunlot/conf"
+	"Yunlot/lib"
+	"Yunlot/logs"
+	"Yunlot/models/Product"
+	"archive/zip"
+	"bytes"
+	"encoding/json"
+	beego "github.com/beego/beego/v2/server/web"
+	"io"
+	"os"
+	"time"
+)
+
+type ProductProtController struct {
+	beego.Controller
+}
+
+func (c *ProductProtController) ProductModeLists() {
+
+	ProductModeLists_r, Total := Product.ProductModeLists()
+
+	c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: lib.C_Page(ProductModeLists_r, 0, 0, Total)}
+	c.ServeJSON()
+	return
+}
+func (c *ProductProtController) ProductLangList() {
+
+	ProductProt_r, Total := Product.ProductLangLists()
+
+	c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: lib.C_Page(ProductProt_r, 0, 0, Total)}
+	c.ServeJSON()
+	return
+}
+func (c *ProductProtController) Get() {
+
+	ProductProt := Product.ProductProt{}
+	c.ParseForm(&ProductProt)
+
+	if !ProductProt.Read_ID() {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "ID E!"}
+		c.ServeJSON()
+		return
+	}
+
+	c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: ProductProt}
+	c.ServeJSON()
+	return
+}
+
+func (this *ProductProtController) Download() {
+
+	ProductProt := Product.ProductProt{}
+	this.ParseForm(&ProductProt)
+
+	if !ProductProt.Read_ID() {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "ID E!"}
+		this.ServeJSON()
+		return
+	}
+
+	if len(ProductProt.T_analysis) == 0 {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_analysis == 0 E!"}
+		this.ServeJSON()
+		return
+	}
+
+	ProductProt.T_log = time.Now().Format("2006-01-02 15:04:05") + " 导出协议包! \n"
+	data, err := json.Marshal(ProductProt)
+	if err != nil {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "ProductProt json E!"}
+		this.ServeJSON()
+		return
+	}
+
+	// 创建一个新的zip文件
+	buf := new(bytes.Buffer)
+	zipWriter := zip.NewWriter(buf)
+
+	// 添加文件到zip
+	file1, err := zipWriter.Create("ProductProt.json")
+	if err != nil {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "ProductProt E!"}
+		this.ServeJSON()
+		return
+	}
+	file1.Write(data)
+
+	//向 zip 文件中添加一个文件,返回一个待压缩的文件内容应写入的 Writer
+	w, err := zipWriter.Create(ProductProt.T_analysis + ".so")
+	if err != nil {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_analysis Create E!"}
+		this.ServeJSON()
+		return
+	}
+	logs.Println(conf.Analysis_Dir + ProductProt.T_analysis + ".so")
+	// 打开待压缩的文件
+	f, err := os.Open(conf.Analysis_Dir + ProductProt.T_analysis + ".so")
+	if err != nil {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_analysis Dir E!"}
+		this.ServeJSON()
+		return
+	}
+	defer f.Close()
+
+	//需要压缩更多文件到压缩包的话,只需要重复第三步即可,只需要更换下文件名
+	if _, err := io.Copy(w, f); err != nil {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_analysis Copy E!"}
+		this.ServeJSON()
+		return
+	}
+
+	// 关闭zip writer
+	err = zipWriter.Close()
+	if err != nil {
+		this.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "zipWriter E!"}
+		this.ServeJSON()
+		return
+	}
+
+	// 设置响应头
+	this.Ctx.Output.Header("Content-Disposition", "attachment; filename="+ProductProt.T_name+".sozip")
+	this.Ctx.Output.Header("Content-Type", "application/sozip")
+
+	// 将zip文件内容作为响应返回
+	io.Copy(this.Ctx.ResponseWriter, buf)
+
+	return
+}
+
+func (c *ProductProtController) List() {
+
+	PageIndex, _ := c.GetInt("PageIndex", 0)
+	PageSize, _ := c.GetInt("PageSize", 10)
+
+	ProductProtr := Product.ProductProt{}
+	c.ParseForm(&ProductProtr)
+
+	is, user_r := lib.Verification(c.Ctx.GetCookie("T_tokey"), c.GetString("T_tokey"))
+	if !is {
+		// 公共库
+		ProductProtr.T_uuid = ""
+		ProductProtr.T_State = 1
+
+		ProductProt_r, Total := ProductProtr.Lists(PageIndex, PageSize)
+		c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: lib.C_Page(ProductProt_r, PageIndex, PageSize, Total)}
+		c.ServeJSON()
+		return
+	}
+
+	ProductProtr.T_uuid = user_r.T_uuid
+	// 内部管理员时,UUID 为空,查看全部
+	if user_r.T_user == "11111111111" {
+		ProductProtr.T_uuid = ""
+	}
+
+	ProductProt_r, Total := ProductProtr.Lists(PageIndex, PageSize)
+
+	c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: lib.C_Page(ProductProt_r, PageIndex, PageSize, Total)}
+	c.ServeJSON()
+	return
+}
+
+func (c *ProductProtController) Update() {
+	is, user_r := lib.Verification(c.Ctx.GetCookie("T_tokey"), c.GetString("T_tokey"))
+	if !is {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_tokey!"}
+		c.ServeJSON()
+		return
+	}
+
+	// 为空时 添加
+	if c.GetString("Id") == "" {
+
+		ProductProt_r := Product.ProductProt{}
+		c.ParseForm(&ProductProt_r)
+
+		// 没有就添加
+		ProductProt_r.T_uuid = user_r.T_uuid
+		ProductProt_r.T_State = 2 //  2 等待审核
+		ProductProt_r.T_log = time.Now().Format("2006-01-02 15:04:05") + " 开发者添加 |-&"
+		ProductProt_r.Add()
+
+		c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: ProductProt_r}
+		c.ServeJSON()
+		return
+	}
+
+	ProductProtr := Product.ProductProt{Id: c.GetString("Id")}
+	if !ProductProtr.Read_ID() {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "Id E!"}
+		c.ServeJSON()
+		return
+	}
+
+	c.ParseForm(&ProductProtr)
+
+	//println("T_State:",c.GetString("T_State"))
+	if user_r.T_user == "11111111111" && c.GetString("T_State") != "" {
+
+		ProductProtr = Product.ProductProt{Id: c.GetString("Id")}
+		if !ProductProtr.Read_ID() {
+			c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "Id E!"}
+			c.ServeJSON()
+			return
+		}
+
+		T_State_int, _ := c.GetInt("T_State")
+		ProductProtr.T_State = T_State_int
+		// 管理员
+		if ProductProtr.T_State == 1 {
+			ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 审核通过 |-&"
+
+			go ctl.BuildGenerate(&ProductProtr)
+
+		} else if ProductProtr.T_State == 3 {
+			ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 审核失败 |-&"
+		}
+		if !ProductProtr.Update("T_State", "T_log") {
+			c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "E!"}
+			c.ServeJSON()
+			return
+		}
+
+	} else {
+		// 用户
+		ProductProtr.T_log += time.Now().Format("2006-01-02 15:04:05") + " 开发者修改 |-&"
+		ProductProtr.T_State = 2
+		if !ProductProtr.Update("T_name", "T_mode", "T_lang", "T_analysis", "T_text", "T_describe", "T_State", "T_log") {
+			c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "E!"}
+			c.ServeJSON()
+			return
+		}
+	}
+
+	c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!", Data: ProductProtr}
+	c.ServeJSON()
+	return
+}
+
+func (c *ProductProtController) Delete() {
+	is, user_r := lib.Verification(c.Ctx.GetCookie("T_tokey"), c.GetString("T_tokey"))
+	if !is {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_tokey!"}
+		c.ServeJSON()
+		return
+	}
+	ProductProtr := Product.ProductProt{}
+	c.ParseForm(&ProductProtr)
+	if !ProductProtr.Read_ID() {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "ID E!"}
+		c.ServeJSON()
+		return
+	}
+	if ProductProtr.T_uuid != user_r.T_uuid {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_tokey!"}
+		c.ServeJSON()
+		return
+	}
+
+	if !ProductProtr.Delete() {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "E!"}
+		c.ServeJSON()
+		return
+	}
+
+	c.Data["json"] = lib.JSONR{Code: lib.Success, Msg: "ok!"}
+	c.ServeJSON()
+	return
+}

+ 52 - 0
controllers/RunCode.go

@@ -0,0 +1,52 @@
+package controllers
+
+import (
+	"Yunlot/RunCode/ctl"
+	"Yunlot/conf"
+	"Yunlot/lib"
+	"Yunlot/logs"
+	"fmt"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+type RuncodeController struct {
+	beego.Controller
+}
+
+func (c *RuncodeController) Languages() {
+
+	ctl.LanguagesController(c.Ctx.ResponseWriter, c.Ctx.Request)
+
+}
+
+func (c *RuncodeController) Run() {
+
+	ctl.RunController(c.Ctx.ResponseWriter, c.Ctx.Request)
+
+}
+
+func (c *RuncodeController) Build() {
+
+	ctl.BuildController(c.Ctx.Output, c.Ctx.ResponseWriter, c.Ctx.Request)
+
+}
+
+func (c *RuncodeController) Download() {
+	T_describe, err := c.GetInt("T_describe")
+	if err != nil {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_describe!"}
+		c.ServeJSON()
+		return
+
+	}
+	if T_describe <= 0 {
+		c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "T_describe!"}
+		c.ServeJSON()
+		return
+	}
+
+	filePath := conf.Analysis_Dir + fmt.Sprintf("%d.so", T_describe) // 替换为实际的文件路径
+	logs.Println("filePath:", filePath)
+	c.Ctx.Output.Download(filePath, fmt.Sprintf("%d.so", T_describe))
+	return
+}

+ 25 - 0
controllers/UpFile.go

@@ -0,0 +1,25 @@
+package controllers
+
+import (
+	"Yunlot/lib"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+type UpFileController struct {
+	beego.Controller
+}
+
+// 列表 -
+func (c *UpFileController) ConfigUpFileToken() {
+	// 验证登录 User_r, User_x
+	//b_, User_r, _ := lib.Verification(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
+	//if !b_ {
+	//	c.Data["json"] = lib.JSONS{Code: 302, Msg: "请重新登录!"}
+	//	c.ServeJSON()
+	//	return
+	//}
+
+	c.Data["json"] = lib.JSONR{Code: 200, Msg: "ok!", Data: lib.UploadToken(c.GetString("T_suffix"))}
+	c.ServeJSON()
+	return
+}

+ 68 - 0
controllers/User.go

@@ -0,0 +1,68 @@
+package controllers
+
+import (
+	"Yunlot/lib"
+	"Yunlot/logs"
+	"Yunlot/models/Account"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+type UserController struct {
+	beego.Controller
+}
+
+//验证码
+func (c *UserController) SandVerify() {
+	bzd_phone := c.GetString("phone")
+
+	_, is := Account.Redis_Verify_Get(bzd_phone)
+	if is {
+		c.Data["json"] = lib.JSONR{Code: 201, Msg: "不能重复发送!"}
+		c.ServeJSON()
+		return
+	}
+
+	Code := lib.Message_Sand_Verify(bzd_phone)
+	logs.Println(bzd_phone, Code)
+	//Code := "123"
+	Account.Redis_Verify_Set(bzd_phone, Code)
+
+	c.Data["json"] = lib.JSONR{Code: 200, Msg: "ok!"}
+	c.ServeJSON()
+	return
+}
+
+// 验证登录
+func (c *UserController) Register() {
+	bzd_phone := c.GetString("phone")
+	bzd_Code := c.GetString("code")
+
+	r, is := Account.Redis_Verify_Get(bzd_phone)
+	if !is {
+		c.Data["json"] = lib.JSONR{Code: 201, Msg: "验证码错误!"}
+		c.ServeJSON()
+		return
+	}
+	println(r)
+	if r != bzd_Code {
+		c.Data["json"] = lib.JSONR{Code: 202, Msg: "验证码错误!"}
+		c.ServeJSON()
+		return
+	}
+	User_r := Account.User{T_user: bzd_phone}
+
+	if !User_r.Read() {
+		User_r.T_uuid = lib.GetRandstring(8, "", 0)
+		User_r.T_State = 1
+		User_r.Add()
+
+	}
+
+	Account.Redis_Verify_DelK(bzd_phone) //  删除验证码
+
+	User_r.T_tokey = Account.Add_Tokey(User_r.T_uuid)
+
+	c.Data["json"] = lib.JSONR{Code: 200, Msg: "ok!", Data: User_r}
+	c.ServeJSON()
+	return
+}

+ 15 - 0
controllers/default.go

@@ -0,0 +1,15 @@
+package controllers
+
+import (
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+type MainController struct {
+	beego.Controller
+}
+
+func (c *MainController) Get() {
+	c.Data["Website"] = "beego.me"
+	c.Data["Email"] = "astaxie@gmail.com"
+	c.TplName = "index.tpl"
+}

+ 78 - 0
go.mod

@@ -0,0 +1,78 @@
+module Yunlot
+
+go 1.19
+
+require (
+	github.com/astaxie/beego v1.12.3
+	github.com/beego/beego/v2 v2.0.1
+	github.com/davecgh/go-spew v1.1.1
+	github.com/gin-gonic/gin v1.9.1
+	github.com/go-sql-driver/mysql v1.6.0
+	github.com/mattn/go-sqlite3 v2.0.3+incompatible
+	github.com/nats-io/nats.go v1.16.0
+	github.com/qiniu/go-sdk/v7 v7.18.2
+	github.com/satori/go.uuid v1.2.0
+	github.com/thinkeridea/go-extend v1.3.2
+	github.com/vmihailenco/msgpack/v5 v5.4.0
+	github.com/yosssi/gmq v0.0.1
+	go.mongodb.org/mongo-driver v1.12.0
+	golang.org/x/text v0.13.0
+)
+
+require (
+	github.com/google/go-cmp v0.5.9 // indirect
+	github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
+)
+
+require (
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/bytedance/sonic v1.10.0 // indirect
+	github.com/cespare/xxhash/v2 v2.1.1 // indirect
+	github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
+	github.com/chenzhuoyu/iasm v0.9.0 // 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.15.3 // indirect
+	github.com/goccy/go-json v0.10.2 // indirect
+	github.com/golang/protobuf v1.5.0 // indirect
+	github.com/golang/snappy v0.0.1 // indirect
+	github.com/hashicorp/golang-lru v0.5.4 // indirect
+	github.com/json-iterator/go v1.1.12 // indirect
+	github.com/klauspost/compress v1.14.4 // indirect
+	github.com/klauspost/cpuid/v2 v2.2.5 // indirect
+	github.com/leodido/go-urn v1.2.4 // indirect
+	github.com/mattn/go-isatty v0.0.19 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
+	github.com/mitchellh/mapstructure v1.3.3 // indirect
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v1.0.2 // indirect
+	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
+	github.com/nats-io/nats-server/v2 v2.8.4 // indirect
+	github.com/nats-io/nkeys v0.3.0 // indirect
+	github.com/nats-io/nuid v1.0.1 // indirect
+	github.com/pelletier/go-toml/v2 v2.1.0 // indirect
+	github.com/pkg/errors v0.9.1 // indirect
+	github.com/prometheus/client_golang v1.7.0 // indirect
+	github.com/prometheus/client_model v0.2.0 // indirect
+	github.com/prometheus/common v0.10.0 // indirect
+	github.com/prometheus/procfs v0.1.3 // indirect; indirectS
+	github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
+	github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+	github.com/ugorji/go/codec v1.2.11 // indirect
+	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
+	github.com/xdg-go/scram v1.1.2 // indirect
+	github.com/xdg-go/stringprep v1.0.4 // indirect
+	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
+	golang.org/x/arch v0.5.0 // indirect
+	golang.org/x/crypto v0.13.0 // indirect
+	golang.org/x/mod v0.10.0 // indirect
+	golang.org/x/net v0.15.0 // indirect
+	golang.org/x/sync v0.2.0 // indirect
+	golang.org/x/sys v0.14.0 // indirect
+	golang.org/x/tools v0.9.3 // indirect
+	google.golang.org/protobuf v1.31.0 // indirect
+	gopkg.in/yaml.v2 v2.2.8 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)

+ 438 - 0
go.sum

@@ -0,0 +1,438 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
+github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
+github.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ=
+github.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA=
+github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE=
+github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
+github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
+github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
+github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
+github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
+github.com/bytedance/sonic v1.10.0 h1:qtNZduETEIWJVIyDl01BeNxur2rW9OwTQ/yBqFRkKEk=
+github.com/bytedance/sonic v1.10.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
+github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
+github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
+github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
+github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
+github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=
+github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
+github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
+github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
+github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
+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/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
+github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
+github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
+github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+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/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
+github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
+github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
+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.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
+github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
+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.8.0/go.mod h1:9JhgTzTaE31GZDpH/HSvHiRJrJ3iKAgqqH0Bl/Ocjdk=
+github.com/go-playground/validator/v10 v10.15.3 h1:S+sSpunYjNPDuXkWbK+x+bA7iXiW296KG4dL3X7xUZo=
+github.com/go-playground/validator/v10 v10.15.3/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
+github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
+github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
+github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
+github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+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/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
+github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
+github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
+github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4=
+github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
+github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
+github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
+github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
+github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
+github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
+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.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
+github.com/lib/pq v1.0.0/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 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
+github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
+github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
+github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
+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 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+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/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
+github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I=
+github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4=
+github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4=
+github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g=
+github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
+github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8=
+github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
+github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
+github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
+github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
+github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
+github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
+github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
+github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
+github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
+github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
+github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
+github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
+github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
+github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/qiniu/dyn v1.3.0/go.mod h1:E8oERcm8TtwJiZvkQPbcAh0RL8jO1G0VXJMW3FAWdkk=
+github.com/qiniu/go-sdk/v7 v7.18.2 h1:vk9eo5OO7aqgAOPF0Ytik/gt7CMKuNgzC/IPkhda6rk=
+github.com/qiniu/go-sdk/v7 v7.18.2/go.mod h1:nqoYCNo53ZlGA521RvRethvxUDvXKt4gtYXOwye868w=
+github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs=
+github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
+github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
+github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
+github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
+github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
+github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
+github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
+github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
+github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/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.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+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.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
+github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
+github.com/thinkeridea/go-extend v1.3.2 h1:0ZImRXpJc+wBNIrNEMbTuKwIvJ6eFoeuNAewvzONrI0=
+github.com/thinkeridea/go-extend v1.3.2/go.mod h1:xqN1e3y1PdVSij1VZp6iPKlO8I4jLbS8CUuTySj981g=
+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 v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
+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/vmihailenco/msgpack/v5 v5.4.0 h1:hRM0digJwyR6vll33NNAwCFguy5JuBD6jxDmQP3l608=
+github.com/vmihailenco/msgpack/v5 v5.4.0/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
+github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
+github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
+github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
+github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
+github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
+github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
+github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
+github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
+github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
+github.com/yosssi/gmq v0.0.1 h1:GhlDVaAQoi3Mvjul/qJXXGfL4JBeE0GQwbWp3eIsja8=
+github.com/yosssi/gmq v0.0.1/go.mod h1:mReykazh0U1JabvuWh1PEbzzJftqOQWsjr0Lwg5jL1Y=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
+go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
+go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE=
+go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0=
+go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
+go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
+go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
+go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
+golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y=
+golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
+golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
+golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
+golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
+golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
+golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
+golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
+golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
+golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
+golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
+honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
+rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

+ 1 - 0
lastupdate.tmp

@@ -0,0 +1 @@
+{"/home/bzd/GolandProjects/Yunlot/controllers":1692783046317946375}

+ 61 - 0
lib/Aes.go

@@ -0,0 +1,61 @@
+package lib
+
+import (
+	"bytes"
+	"crypto/aes"
+	"crypto/cipher"
+	"encoding/base64"
+)
+
+func AesEncryptCBC(orig string, key string) string {
+	// 转成字节数组
+	origData := []byte(orig)
+	k := []byte(key)
+	// 分组秘钥
+	// NewCipher该函数限制了输入k的长度必须为16, 24或者32
+	block, _ := aes.NewCipher(k)
+	// 获取秘钥块的长度
+	blockSize := block.BlockSize()
+	// 补全码
+	origData = PKCS7Padding(origData, blockSize)
+	// 加密模式
+	blockMode := cipher.NewCBCEncrypter(block, k[:blockSize])
+	// 创建数组
+	cryted := make([]byte, len(origData))
+	// 加密
+	blockMode.CryptBlocks(cryted, origData)
+	return base64.StdEncoding.EncodeToString(cryted)
+}
+func AesDecryptCBC(cryted string, key string) string {
+	// 转成字节数组
+	crytedByte, _ := base64.StdEncoding.DecodeString(cryted)
+	k := []byte(key)
+	// 分组秘钥
+	block, _ := aes.NewCipher(k)
+	// 获取秘钥块的长度
+	blockSize := block.BlockSize()
+	// 加密模式
+	blockMode := cipher.NewCBCDecrypter(block, k[:blockSize])
+	// 创建数组
+	orig := make([]byte, len(crytedByte))
+	// 解密
+	blockMode.CryptBlocks(orig, crytedByte)
+	// 去补全码
+	orig = PKCS7UnPadding(orig)
+	return string(orig)
+}
+
+// 补码
+// AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。
+func PKCS7Padding(ciphertext []byte, blocksize int) []byte {
+	padding := blocksize - len(ciphertext)%blocksize
+	padtext := bytes.Repeat([]byte{byte(padding)}, padding)
+	return append(ciphertext, padtext...)
+}
+
+// 去码
+func PKCS7UnPadding(origData []byte) []byte {
+	length := len(origData)
+	unpadding := int(origData[length-1])
+	return origData[:(length - unpadding)]
+}

+ 51 - 0
lib/Message_Sand.go

@@ -0,0 +1,51 @@
+package lib
+
+import (
+	"bytes"
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"math/rand"
+	"mime/multipart"
+	"net/http"
+	"time"
+)
+
+const (
+	API    = "https://api-v4.mysubmail.com/sms/xsend"
+	APPID  = "100848***"
+	APPKEY = "e9b9802ea6445b2a5ad27203322d733a"
+)
+
+func Message_Sand_Verify(PhoneNumbers string) string {
+	rand.Seed(time.Now().UnixNano())
+
+	// 生成4位数验证码
+	var code string
+	for i := 0; i < 4; i++ {
+		code += fmt.Sprintf("%d", rand.Intn(10)) // 生成0-9之间的随机数并转换为字符串拼接到验证码中
+	}
+
+	vars := make(map[string]string)
+	vars["code"] = code
+	postdata := make(map[string]string)
+	postdata["appid"] = APPID
+	postdata["signature"] = APPKEY
+	postdata["project"] = "7qCjA2"
+	postdata["to"] = PhoneNumbers
+	bs, _ := json.Marshal(vars)
+	postdata["vars"] = string(bs)
+	body := &bytes.Buffer{}
+	writer := multipart.NewWriter(body)
+	for key, val := range postdata {
+		_ = writer.WriteField(key, val)
+	}
+	contentType := writer.FormDataContentType()
+	writer.Close()
+	resp, _ := http.Post(API, contentType, body)
+	result, _ := ioutil.ReadAll(resp.Body)
+	fmt.Println(string(result))
+	return code
+}
+
+// 	println(lib.Message_Sand("18777951277","SMS_215350603","{\"code\":\"1111\"}"))

+ 58 - 0
lib/MinuteToDataTime.go

@@ -0,0 +1,58 @@
+package lib
+
+import (
+	"strconv"
+)
+
+/*
+时间常量
+*/
+const (
+	//定义每分钟的秒数
+	SecondsPerMinute = 60
+	//定义每小时的秒数
+	SecondsPerHour = SecondsPerMinute * 60
+	//定义每天的秒数
+	SecondsPerDay = SecondsPerHour * 24
+)
+
+/*
+时间转换函数
+*/
+func resolveTime(seconds int) (day int, hour int, minute int, second int) {
+	//秒
+	second = seconds % 60
+
+	//天
+	day = seconds / SecondsPerDay
+	seconds -= day * SecondsPerDay
+
+	//时
+	hour = seconds / SecondsPerHour
+	seconds -= hour * SecondsPerHour
+
+	//分
+	minute = seconds / SecondsPerMinute
+	seconds -= minute * SecondsPerHour
+
+	return
+}
+
+func MinuteToDataTime(t int) string {
+	str := ""
+	day, hour, minute, second := resolveTime(t)
+	if day > 0 {
+		str += strconv.Itoa(day) + "天 "
+	}
+	if hour > 0 {
+		str += strconv.Itoa(hour) + "小时 "
+	}
+	if minute > 0 {
+		str += strconv.Itoa(minute) + "分钟 "
+	}
+	if second > 0 {
+		str += strconv.Itoa(second) + "秒"
+	}
+
+	return str
+}

+ 41 - 0
lib/Qiniu.go

@@ -0,0 +1,41 @@
+package lib
+
+// 存储相关功能的引入包只有这两个,后面不再赘述
+
+// 存储相关功能的引入包只有这两个,后面不再赘述
+import (
+	"Yunlot/conf"
+	"github.com/qiniu/go-sdk/v7/auth/qbox"
+	"github.com/qiniu/go-sdk/v7/storage"
+	uuid "github.com/satori/go.uuid"
+	"strconv"
+	"time"
+)
+
+var Qiniu *qbox.Mac
+
+func init() {
+	Qiniu = qbox.NewMac(conf.Qiniu_AccessKey, conf.Qiniu_SecretKey)
+}
+
+func UploadToken(T_suffix string) string {
+	Tokey := strconv.FormatInt(time.Now().Unix(), 10) + uuid.NewV4().String()
+	if len(T_suffix) == 0 {
+		T_suffix = ".png"
+	}
+	putPolicy := storage.PutPolicy{
+		Scope:      conf.Qiniu_BUCKET,
+		InsertOnly: 1,    // 仅能以新增模式上传文件。
+		Expires:    7200, //示例2小时有效期
+		ReturnBody: `{"key":"` + conf.Qiniu_Url + `/$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)"}`,
+		//{"key":"github-x.png","hash":"FqKXVdTvIx_mPjOYdjDyUSy_H1jr","fsize":6091,"bucket":"if-pbl","name":"github logo"}
+		//{"key":"` + conf.Oss + `/$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}
+		ForceSaveKey: true,
+		SaveKey:      conf.Qiniu_Dir + "/" + Tokey + "." + T_suffix,
+		FsizeLimit:   1024 * 1024 * 10, // 10M
+		//MimeLimit:    "image/*",
+	}
+
+	upToken := putPolicy.UploadToken(Qiniu)
+	return upToken
+}

+ 271 - 0
lib/TcpServerLib/binaryReadWrite.go

@@ -0,0 +1,271 @@
+package TcpServerLib
+
+import (
+	"encoding/binary"
+	"errors"
+)
+
+func packetTotalSize(data []byte) int16 {
+	totalsize := binary.LittleEndian.Uint16(data)
+	return int16(totalsize)
+}
+
+// 출처: https://github.com/gonet2/agent
+type RawPacketData struct {
+	pos   int
+	data  []byte
+	order binary.ByteOrder
+}
+
+func MakeReader(buffer []byte, isLittleEndian bool) RawPacketData {
+	if isLittleEndian {
+		return RawPacketData{data: buffer, order: binary.LittleEndian}
+	}
+	return RawPacketData{data: buffer, order: binary.BigEndian}
+}
+
+func MakeWriter(buffer []byte, isLittleEndian bool) RawPacketData {
+	if isLittleEndian {
+		return RawPacketData{data: buffer, order: binary.LittleEndian}
+	}
+	return RawPacketData{data: buffer, order: binary.BigEndian}
+}
+
+func (p *RawPacketData) Data() []byte {
+	return p.data
+}
+
+func (p *RawPacketData) Length() int {
+	return len(p.data)
+}
+
+// =============================================== Readers
+func (p *RawPacketData) ReadBool() (ret bool, err error) {
+	b, _err := p.ReadByte()
+
+	if b != byte(1) {
+		return false, _err
+	}
+
+	return true, _err
+}
+
+func (p *RawPacketData) ReadS8() (ret int8, err error) {
+	_ret, _err := p.ReadByte()
+	ret = int8(_ret)
+	err = _err
+	return
+}
+
+func (p *RawPacketData) ReadU16() (ret uint16, err error) {
+	if p.pos+2 > len(p.data) {
+		err = errors.New("read uint16 failed")
+		return
+	}
+	buf := p.data[p.pos : p.pos+2]
+	ret = p.order.Uint16(buf)
+	p.pos += 2
+	return
+}
+
+func (p *RawPacketData) ReadS16() (ret int16, err error) {
+	_ret, _err := p.ReadU16()
+	ret = int16(_ret)
+	err = _err
+	return
+}
+
+func (p *RawPacketData) ReadU32() (ret uint32, err error) {
+	if p.pos+4 > len(p.data) {
+		err = errors.New("read uint32 failed")
+		return
+	}
+
+	buf := p.data[p.pos : p.pos+4]
+	ret = p.order.Uint32(buf)
+	p.pos += 4
+	return
+}
+
+func (p *RawPacketData) ReadS32() (ret int32, err error) {
+	_ret, _err := p.ReadU32()
+	ret = int32(_ret)
+	err = _err
+	return
+}
+
+func (p *RawPacketData) ReadU64() (ret uint64, err error) {
+	if p.pos+8 > len(p.data) {
+		err = errors.New("read uint64 failed")
+		return
+	}
+
+	buf := p.data[p.pos : p.pos+8]
+	ret = p.order.Uint64(buf)
+	p.pos += 8
+	return
+}
+
+func (p *RawPacketData) ReadS64() (ret int64, err error) {
+	_ret, _err := p.ReadU64()
+	ret = int64(_ret)
+	err = _err
+	return
+}
+
+func (p *RawPacketData) ReadByte() (ret byte, err error) {
+	if p.pos >= len(p.data) {
+		err = errors.New("read byte failed")
+		return
+	}
+
+	ret = p.data[p.pos]
+	p.pos++
+	return
+}
+
+func (p *RawPacketData) ReadBytes(readSize int) (refSlice []byte) {
+	refSlice = p.data[p.pos : p.pos+readSize]
+	p.pos += readSize
+	return
+}
+
+func (p *RawPacketData) ReadString() (ret string, err error) {
+	if p.pos+2 > len(p.data) {
+		err = errors.New("read string header failed")
+		return
+	}
+
+	size, _ := p.ReadU16()
+	if p.pos+int(size) > len(p.data) {
+		err = errors.New("read string Data failed")
+		return
+	}
+
+	bytes := p.data[p.pos : p.pos+int(size)]
+	p.pos += int(size)
+	ret = string(bytes)
+	return
+}
+
+/*
+func (p *RawPacketData) ReadFloat32() (ret float32, err error) {
+	bits, _err := p.ReadU32()
+	if _err != nil {
+		return float32(0), _err
+	}
+
+	ret = math.Float32frombits(bits)
+	if math.IsNaN(float64(ret)) || math.IsInf(float64(ret), 0) {
+		return 0, nil
+	}
+
+	return ret, nil
+}
+
+func (p *RawPacketData) ReadFloat64() (ret float64, err error) {
+	bits, _err := p.ReadU64()
+	if _err != nil {
+		return float64(0), _err
+	}
+
+	ret = math.Float64frombits(bits)
+	if math.IsNaN(ret) || math.IsInf(ret, 0) {
+		return 0, nil
+	}
+
+	return ret, nil
+}
+*/
+
+// ================================================ Writers
+func (p *RawPacketData) WriteS8(v int8) {
+	p.data[p.pos] = (byte)(v)
+	p.pos++
+}
+
+func (p *RawPacketData) WriteU16(v uint16) {
+	p.order.PutUint16(p.data[p.pos:], v)
+	p.pos += 2
+}
+
+func (p *RawPacketData) WriteS16(v int16) {
+	p.WriteU16(uint16(v))
+}
+
+func (p *RawPacketData) WriteBytes(v []byte) {
+	copy(p.data[p.pos:], v)
+	p.pos += len(v)
+}
+
+func (p *RawPacketData) WriteU32(v uint32) {
+	p.order.PutUint32(p.data[p.pos:], v)
+	p.pos += 4
+}
+
+func (p *RawPacketData) WriteS32(v int32) {
+	p.WriteU32(uint32(v))
+}
+
+func (p *RawPacketData) WriteU64(v uint64) {
+	p.order.PutUint64(p.data[p.pos:], v)
+	p.pos += 8
+}
+
+func (p *RawPacketData) WriteS64(v int64) {
+	p.WriteU64(uint64(v))
+}
+
+func (p *RawPacketData) WriteString(v string) {
+	copyLen := copy(p.data[p.pos:], v)
+	p.pos += copyLen
+}
+
+/*
+func (p *RawPacketData) WriteZeros(n int) {
+	for i := 0; i < n; i++ {
+		p.Data = append(p.Data, byte(0))
+	}
+}
+
+func (p *RawPacketData) WriteBool(v bool) {
+	if v {
+		p.Data = append(p.Data, byte(1))
+	} else {
+		p.Data = append(p.Data, byte(0))
+	}
+}
+
+func (p *RawPacketData) WriteByte(v byte) {
+	p.Data = append(p.Data, v)
+}
+
+func (p *RawPacketData) WriteBytes(v []byte) {
+	p.WriteU16(uint16(len(v)))
+	p.Data = append(p.Data, v...)
+}
+
+func (p *RawPacketData) WriteRawBytes(v []byte) {
+	p.Data = append(p.Data, v...)
+}
+
+func (p *RawPacketData) WriteString(v string) {
+	bytes := []byte(v)
+	p.WriteU16(uint16(len(bytes)))
+	p.Data = append(p.Data, bytes...)
+}
+
+func (p *RawPacketData) WriteU24(v uint32) {
+	p.Data = append(p.Data, byte(v>>16), byte(v>>8), byte(v))
+}
+
+func (p *RawPacketData) WriteFloat32(f float32) {
+	v := math.Float32bits(f)
+	p.WriteU32(v)
+}
+
+func (p *RawPacketData) WriteFloat64(f float64) {
+	v := math.Float64bits(f)
+	p.WriteU64(v)
+}
+*/

+ 16 - 0
lib/TcpServerLib/define.go

@@ -0,0 +1,16 @@
+package TcpServerLib
+
+const (
+	MAX_RECEIVE_BUFFER_SIZE = 4012
+	HEADER_SIZE             = 4
+	MAX_PACKET_SIZE         = 1024
+)
+
+const (
+	NET_ERROR_NONE                                   = 0
+	NET_ERROR_RECV_MAKE_PACKET_TOO_LARGE_PACKET_SIZE = 1
+)
+const (
+	NET_CLOSE_REMOTE                   = 1
+	NET_CLOSE_RECV_TOO_SMALL_RECV_DATA = 2
+)

+ 73 - 0
lib/TcpServerLib/packet.go

@@ -0,0 +1,73 @@
+package TcpServerLib
+
+// protocol Id
+const (
+	Pkt_ID_Echo_Req = 101
+	Pkt_ID_Echo_Res = 102
+
+	Pkt_ID_LoginReq = 201
+	Pkt_ID_LoginRes = 202
+
+	Pkt_ID_NewRoomReq = 203
+	Pkt_ID_NewRoomRes = 204
+
+	Pkt_ID_EnterRoomReq = 206
+	Pkt_ID_EnterRoomRes = 207
+
+	Pkt_ID_LeaveRoomReq = 209
+	Pkt_ID_LeaveRoomRes = 210
+
+	Pkt_ID_ChatRoomReq = 214
+	Pkt_ID_ChatRoomRes = 215
+	Pkt_ID_ChatRoomNtf = 216
+)
+
+type PacketHeader struct {
+	TotalSize int16
+	Id        int16
+}
+
+func DecodingPacketHeader(header *PacketHeader, data []byte) {
+	reader := MakeReader(data, true)
+	header.TotalSize, _ = reader.ReadS16()
+	header.Id, _ = reader.ReadS16()
+}
+
+func EncodingPacketHeader(writer *RawPacketData, totalSize int16, pktId int16, packetType int8) {
+	writer.WriteS16(totalSize)
+	writer.WriteS16(pktId)
+}
+
+type RoomChatReqPacket struct {
+	MsgLength int16
+	Msgs      []byte
+}
+
+func (request RoomChatReqPacket) EncodingPacket(packetId int16) ([]byte, int16) {
+
+	totalSize := HEADER_SIZE + 2 + int16(request.MsgLength)
+	sendBuf := make([]byte, totalSize)
+	writer := MakeWriter(sendBuf, true)
+	EncodingPacketHeader(&writer, totalSize, packetId, 0)
+
+	writer.WriteS16(request.MsgLength)
+	writer.WriteBytes(request.Msgs)
+	return sendBuf, totalSize
+}
+
+func (request *RoomChatReqPacket) DecodingPacketPre(Data []byte) bool {
+	bodyLength := len(Data)
+	if bodyLength < 2 {
+		return false
+	}
+
+	reader := MakeReader(Data, true)
+	request.MsgLength, _ = reader.ReadS16()
+
+	if bodyLength != int((2 + request.MsgLength)) {
+		return false
+	}
+
+	request.Msgs = Data[2:]
+	return true
+}

+ 107 - 0
lib/TcpServerLib/session.go

@@ -0,0 +1,107 @@
+package TcpServerLib
+
+import (
+	"net"
+)
+
+// Session holds info about connection
+type Session struct {
+	conn       net.Conn
+	Server     *server
+	Device_Sn  string
+	Verify_num int
+}
+
+func (session *Session) handleTcpRead() {
+	session.Server.onNewClientCallback(session)
+
+	//var startRecvPos int16
+	//var result int
+	recviveBuff := make([]byte, MAX_RECEIVE_BUFFER_SIZE)
+
+	for {
+		recvBytes, err := session.conn.Read(recviveBuff)
+
+		if err != nil {
+			/*logs.PrintlnError("TCP - handleTcpRead",err)
+			continue;*/
+			//logs.PrintlnError("TCP - handleTcpRead",err)
+			session.closeProcess(NET_CLOSE_REMOTE)
+			return
+		}
+		//logs.Println("recvBytes:",recvBytes)
+		session.Server.onNewMessage(session, recviveBuff[:recvBytes])
+		//
+		//if recvBytes < HEADER_SIZE {
+		//	session.closeProcess(NET_CLOSE_RECV_TOO_SMALL_RECV_DATA)
+		//	return
+		//}
+		//
+		//readAbleByte := int16(startRecvPos) + int16(recvBytes)
+		//startRecvPos, result = session.makePacket(readAbleByte, recviveBuff)
+		//if result != NET_ERROR_NONE {
+		//	session.closeProcess(result)
+		//	return
+		//}
+
+	}
+}
+
+func (session *Session) closeProcess(reason int) {
+	session.conn.Close()
+	session.Server.onClientConnectionClosed(session, reason)
+}
+
+func (session *Session) makePacket(readAbleByte int16, recviveBuff []byte) (int16, int) {
+	var startRecvPos int16 = 0
+	var readPos int16
+
+	for {
+		if readAbleByte < HEADER_SIZE {
+			break
+		}
+
+		requireDataSize := packetTotalSize(recviveBuff[readPos:])
+
+		if requireDataSize > readAbleByte {
+			break
+		}
+
+		if requireDataSize > MAX_PACKET_SIZE {
+			return startRecvPos, NET_ERROR_RECV_MAKE_PACKET_TOO_LARGE_PACKET_SIZE
+		}
+
+		ltvPacket := recviveBuff[readPos:(readPos + requireDataSize)]
+		readPos += requireDataSize
+		readAbleByte -= requireDataSize
+
+		session.Server.onNewMessage(session, ltvPacket)
+	}
+
+	if readAbleByte > 0 {
+		copy(recviveBuff, recviveBuff[readPos:(readPos+readAbleByte)])
+	}
+
+	startRecvPos = readAbleByte
+	return startRecvPos, NET_ERROR_NONE
+}
+
+// Send text message to client
+func (session *Session) Send(message string) error {
+	_, err := session.conn.Write([]byte(message))
+	return err
+}
+
+// Send bytes to client
+func (session *Session) SendBytes(b []byte) error {
+	_, err := session.conn.Write(b)
+	return err
+}
+
+func (session *Session) Conn() net.Conn {
+	return session.conn
+}
+
+func (session *Session) Close() error {
+	return session.conn.Close()
+}

+ 85 - 0
lib/TcpServerLib/tcpServer.go

@@ -0,0 +1,85 @@
+package TcpServerLib
+
+import (
+	"github.com/davecgh/go-spew/spew"
+	"log"
+	"net"
+	"runtime"
+)
+
+// TCP server
+type server struct {
+	address                  string // Address to open connection: localhost:9999
+	onNewClientCallback      func(c *Session)
+	onClientConnectionClosed func(c *Session, closeCase int)
+	onNewMessage             func(c *Session, packetData []byte)
+}
+
+// Called right after server starts listening new client
+func (s *server) OnNewClient(callback func(c *Session)) {
+	s.onNewClientCallback = callback
+}
+
+// Called right after connection closed
+func (s *server) OnClientConnectionClosed(callback func(c *Session, closeCase int)) {
+	s.onClientConnectionClosed = callback
+}
+
+// Called when Session receives new message
+func (s *server) OnNewMessage(callback func(c *Session, packetData []byte)) {
+	s.onNewMessage = callback
+}
+
+// Creates new tcp server instance
+func NewServer(address string) *server {
+	log.Println("Creating server with address", address)
+	server := &server{
+		address: address,
+	}
+
+	server.OnNewClient(func(c *Session) {})
+	server.OnNewMessage(func(c *Session, packetData []byte) {})
+	server.OnClientConnectionClosed(func(c *Session, closeCase int) {})
+
+	return server
+}
+
+// Start network server
+func (s *server) Listen() {
+	listener, err := net.Listen("tcp", s.address)
+	if err != nil {
+		log.Fatal("Error starting TCP server.")
+	}
+	defer listener.Close()
+
+	for {
+		conn, _ := listener.Accept()
+		client := &Session{
+			conn:   conn,
+			Server: s,
+		}
+
+		go client.handleTcpRead()
+	}
+}
+
+// 출처: https://github.com/gonet2/agent
+func PrintPanicStack(extras ...interface{}) {
+	if x := recover(); x != any(nil) {
+		log.Printf("%v", x)
+
+		i := 0
+		funcName, file, line, ok := runtime.Caller(i)
+
+		for ok {
+			log.Printf("PrintPanicStack. [func]: %s, [file]: %s, [line]: %d\n", runtime.FuncForPC(funcName).Name(), file, line)
+
+			i++
+			funcName, file, line, ok = runtime.Caller(i)
+		}
+
+		for k := range extras {
+			log.Printf("EXRAS#%v DATA:%v\n", k, spew.Sdump(extras[k]))
+		}
+	}
+}

+ 526 - 0
lib/lib.go

@@ -0,0 +1,526 @@
+package lib
+
+import (
+	"Yunlot/lib/TcpServerLib"
+	"Yunlot/logs"
+	"Yunlot/models/Account"
+	"bytes"
+	"crypto/sha256"
+	"encoding/hex"
+	"encoding/json"
+	"fmt"
+	"github.com/nats-io/nats.go"
+	"github.com/thinkeridea/go-extend/exunicode/exutf8"
+	"github.com/yosssi/gmq/mqtt"
+	"github.com/yosssi/gmq/mqtt/client"
+	"golang.org/x/text/encoding/simplifiedchinese"
+	"golang.org/x/text/transform"
+	"io/ioutil"
+	"math/rand"
+	"plugin"
+	"reflect"
+	"runtime"
+	"strconv"
+	"strings"
+	"time"
+	"unicode/utf8"
+)
+
+var Nats *nats.Conn
+var MqttClient *client.Client
+var TopicMap map[string]bool
+var PluginMap map[string]*plugin.Plugin
+var TcpMap map[string]*TcpServerLib.Session
+
+func init() {
+	TopicMap = make(map[string]bool)
+	PluginMap = make(map[string]*plugin.Plugin)
+	TcpMap = make(map[string]*TcpServerLib.Session)
+}
+
+const Success = 200
+const Error = 201
+
+type JSONR struct {
+	//必须的大写开头
+	Code int16
+	Msg  string
+	Data interface{} // 泛型
+}
+type JSONS struct {
+	//必须的大写开头
+	List      interface{}
+	Total     int16
+	PageIndex int
+	PageSize  int
+}
+
+func C_Page(list interface{}, PageIndex, PageSize int, Total int64) (Jsons JSONS) {
+	Jsons.List = list
+	Jsons.Total = int16(Total)
+	Jsons.PageIndex = PageIndex
+	Jsons.PageSize = PageSize
+	//Jsons.PageSize = int16(math.Ceil(float64(Total) / float64(PageSize)))
+	return Jsons
+}
+
+func Strval(value interface{}) string {
+	var key string
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		ft := value.(float64)
+		key = strconv.FormatFloat(ft, 'f', -1, 64)
+	case float32:
+		ft := value.(float32)
+		key = strconv.FormatFloat(float64(ft), 'f', -1, 64)
+	case int:
+		it := value.(int)
+		key = strconv.Itoa(it)
+	case uint:
+		it := value.(uint)
+		key = strconv.Itoa(int(it))
+	case int8:
+		it := value.(int8)
+		key = strconv.Itoa(int(it))
+	case uint8:
+		it := value.(uint8)
+		key = strconv.Itoa(int(it))
+	case int16:
+		it := value.(int16)
+		key = strconv.Itoa(int(it))
+	case uint16:
+		it := value.(uint16)
+		key = strconv.Itoa(int(it))
+	case int32:
+		it := value.(int32)
+		key = strconv.Itoa(int(it))
+	case uint32:
+		it := value.(uint32)
+		key = strconv.Itoa(int(it))
+	case int64:
+		it := value.(int64)
+		key = strconv.FormatInt(it, 10)
+	case uint64:
+		it := value.(uint64)
+		key = strconv.FormatUint(it, 10)
+	case string:
+		key = value.(string)
+	case []byte:
+		key = string(value.([]byte))
+	default:
+		newValue, _ := json.Marshal(value)
+		key = string(newValue)
+	}
+
+	return key
+}
+
+func To_int(value interface{}) int {
+	var key int
+	if value == nil {
+		return key
+	}
+	switch value.(type) {
+	case float64:
+		key = int(value.(float64))
+	case float32:
+		key = int(value.(float32))
+	case int:
+		key = int(value.(int))
+	case uint:
+		key = int(value.(uint))
+	case int8:
+		key = int(value.(int8))
+	case uint8:
+		key = int(value.(uint8))
+	case int16:
+		key = int(value.(int16))
+	case uint16:
+		key = int(value.(uint16))
+	case int32:
+		key = int(value.(int32))
+	case uint32:
+		key = int(value.(uint32))
+	case int64:
+		key = int(value.(int64))
+	case uint64:
+		key = int(value.(uint64))
+	case string:
+		key, _ = strconv.Atoi(value.(string))
+	case []byte:
+		key, _ = strconv.Atoi(string(value.([]byte)))
+	default:
+		newValue, _ := json.Marshal(value)
+		key, _ = strconv.Atoi(string(newValue))
+	}
+	return key
+}
+func To_int64(value interface{}) int64 {
+	var key int64
+	if value == nil {
+		return key
+	}
+	switch value.(type) {
+	case float64:
+		key = int64(value.(float64))
+	case float32:
+		key = int64(value.(float32))
+	case int:
+		key = int64(value.(int))
+	case uint:
+		key = int64(value.(uint))
+	case int8:
+		key = int64(value.(int8))
+	case uint8:
+		key = int64(value.(uint8))
+	case int16:
+		key = int64(value.(int16))
+	case uint16:
+		key = int64(value.(uint16))
+	case int32:
+		key = int64(value.(int32))
+	case uint32:
+		key = int64(value.(uint32))
+	case int64:
+		key = int64(value.(int64))
+	case uint64:
+		key = int64(value.(uint64))
+	case string:
+		key, _ = strconv.ParseInt(value.(string), 10, 64)
+	case []byte:
+		key, _ = strconv.ParseInt(string(value.([]byte)), 10, 64)
+	default:
+		newValue, _ := json.Marshal(value)
+		key, _ = strconv.ParseInt(string(newValue), 10, 64)
+	}
+	return key
+}
+
+func To_float32(value interface{}) float32 {
+	var key float32
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		key = float32(value.(float64))
+	case float32:
+		key = float32(value.(float32))
+	case int:
+		key = float32(value.(int))
+	case uint:
+		key = float32(value.(uint))
+	case int8:
+		key = float32(value.(int8))
+	case uint8:
+		key = float32(value.(uint8))
+	case int16:
+		key = float32(value.(int16))
+	case uint16:
+		key = float32(value.(uint16))
+	case int32:
+		key = float32(value.(int32))
+	case uint32:
+		key = float32(value.(uint32))
+	case int64:
+		key = float32(value.(int64))
+	case uint64:
+		key = float32(value.(uint64))
+	case string:
+		key_float64, _ := strconv.ParseFloat(value.(string), 32/64)
+		key = float32(key_float64)
+	case []byte:
+		key_float64, _ := strconv.ParseFloat(string(value.([]byte)), 32/64)
+		key = float32(key_float64)
+	default:
+		newValue, _ := json.Marshal(value)
+		key_float64, _ := strconv.ParseFloat(string(newValue), 32/64)
+		key = float32(key_float64)
+	}
+
+	key_float64, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", key), 32/64)
+	key = float32(key_float64)
+
+	return key
+}
+
+func To_string(value interface{}) string {
+	var key string
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		ft := value.(float64)
+		key = strconv.FormatFloat(ft, 'f', -1, 64)
+	case float32:
+		ft := value.(float32)
+		key = strconv.FormatFloat(float64(ft), 'f', -1, 64)
+	case int:
+		it := value.(int)
+		key = strconv.Itoa(it)
+	case uint:
+		it := value.(uint)
+		key = strconv.Itoa(int(it))
+	case int8:
+		it := value.(int8)
+		key = strconv.Itoa(int(it))
+	case uint8:
+		it := value.(uint8)
+		key = strconv.Itoa(int(it))
+	case int16:
+		it := value.(int16)
+		key = strconv.Itoa(int(it))
+	case uint16:
+		it := value.(uint16)
+		key = strconv.Itoa(int(it))
+	case int32:
+		it := value.(int32)
+		key = strconv.Itoa(int(it))
+	case uint32:
+		it := value.(uint32)
+		key = strconv.Itoa(int(it))
+	case int64:
+		it := value.(int64)
+		key = strconv.FormatInt(it, 10)
+	case uint64:
+		it := value.(uint64)
+		key = strconv.FormatUint(it, 10)
+	case string:
+		key = value.(string)
+	case []byte:
+		key = string(value.([]byte))
+	default:
+		newValue, _ := json.Marshal(value)
+		key = string(newValue)
+	}
+	return key
+}
+
+func Random(min, max int) int {
+	rand.Seed(time.Now().Unix()) //Seed生成的随机数
+	return rand.Intn(max-min) + min
+}
+
+// 取文本(字符串)中间
+func GetBetweenStr(str, start, end string) string {
+	n := strings.Index(str, start)
+	if n == -1 {
+		n = 0
+	} else {
+		n = n + len(start) // 增加了else,不加的会把start带上
+	}
+	str = string([]byte(str)[n:])
+	m := strings.Index(str, end)
+	if m == -1 {
+		m = len(str)
+	}
+	str = string([]byte(str)[:m])
+	return str
+}
+
+// getYearMonthToDay 查询指定年份指定月份有多少天
+// @params year int 指定年份
+// @params month int 指定月份
+func GetYearMonthToDay(year int, month int) int {
+	// 有31天的月份
+	day31 := map[int]bool{
+		1:  true,
+		3:  true,
+		5:  true,
+		7:  true,
+		8:  true,
+		10: true,
+		12: true,
+	}
+	if day31[month] == true {
+		return 31
+	}
+	// 有30天的月份
+	day30 := map[int]bool{
+		4:  true,
+		6:  true,
+		9:  true,
+		11: true,
+	}
+	if day30[month] == true {
+		return 30
+	}
+	// 计算是平年还是闰年
+	if (year%4 == 0 && year%100 != 0) || year%400 == 0 {
+		// 得出2月的天数
+		return 29
+	}
+	// 得出2月的天数
+	return 28
+}
+
+func Decimal(value float64) float64 {
+	value, _ = strconv.ParseFloat(fmt.Sprintf("%.1f", value), 64)
+	return value
+}
+
+func Strconv_Atoi(string string) int {
+	int, _ := strconv.Atoi(string)
+	return int
+}
+
+// 获取正在运行的函数名
+func FuncName() string {
+	pc := make([]uintptr, 1)
+	runtime.Callers(2, pc)
+	f := runtime.FuncForPC(pc[0])
+	return f.Name()
+}
+
+func Limit_len(str string, lenx int) string {
+	if utf8.RuneCountInString(str) > lenx {
+		return exutf8.RuneSubString(str, 0, lenx-3) + "..."
+	}
+	return exutf8.RuneSubString(str, 0, lenx)
+}
+
+func Utf8ToGbk(s []byte) ([]byte, error) {
+	reader := transform.NewReader(bytes.NewReader(s), simplifiedchinese.GBK.NewEncoder())
+	d, e := ioutil.ReadAll(reader)
+	if e != nil {
+		return nil, e
+	}
+	return d, nil
+}
+
+// #取得随机字符串:通过打乱slice来操作
+func GetRandstring(length int, char string, rand_x int64) string {
+	if length < 1 {
+		return ""
+	}
+
+	if len(char) <= 6 || len(char) <= length {
+		char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+	}
+
+	charArr := strings.Split(char, "")
+	ran := rand.New(rand.NewSource(time.Now().Unix() + rand_x))
+
+	l := len(charArr)
+	for i := l - 1; i > 0; i-- {
+		r := ran.Intn(i)
+		charArr[r], charArr[i] = charArr[i], charArr[r]
+	}
+	rchar := charArr[:length]
+	return strings.Join(rchar, "")
+}
+
+// Sha256加密
+func Sha256(src string) string {
+	m := sha256.New()
+	m.Write([]byte(src))
+	res := hex.EncodeToString(m.Sum(nil))
+	return res
+}
+
+// 判断时间是当年的第几周
+func WeekByDate() string {
+	t := time.Now()
+	yearDay := t.YearDay()
+	yearFirstDay := t.AddDate(0, 0, -yearDay+1)
+	firstDayInWeek := int(yearFirstDay.Weekday())
+
+	//今年第一周有几天
+	firstWeekDays := 1
+	if firstDayInWeek != 0 {
+		firstWeekDays = 7 - firstDayInWeek + 1
+	}
+	var week int
+	if yearDay <= firstWeekDays {
+		week = 1
+	} else {
+		week = (yearDay-firstWeekDays)/7 + 2
+	}
+	return fmt.Sprintf("%d%02d", t.Year(), week) // 202253
+}
+
+// 登录验证
+func Verification(GetCookie string, GetString string) (bool, Account.User) {
+
+	// 自适应 参数
+	User_tokey := GetCookie
+	if len(User_tokey) == 0 {
+		User_tokey = GetString
+	}
+
+	if len(User_tokey) == 0 {
+		return false, Account.User{}
+	}
+
+	T_uuid, is := Account.Redis_Tokey_Get(User_tokey)
+	if !is {
+		return false, Account.User{}
+	}
+
+	admin_r := Account.User{T_uuid: T_uuid}
+
+	if !admin_r.Read() {
+		return false, Account.User{}
+	}
+	//log.Println("登录 Admin_name 为:", admin_r.Admin_name)
+	return true, admin_r
+}
+
+// 发送数据
+func Mqtt_publish(topic string, b []byte) {
+	TopicMap[topic] = true
+	// Publish a message.
+	err := MqttClient.Publish(&client.PublishOptions{
+		QoS:       mqtt.QoS0,
+		TopicName: []byte(topic),
+		Message:   b,
+	})
+
+	logs.PrintlnMqtt("Mqtt-> " + topic + ":" + string(b))
+	if err != nil {
+		logs.PrintlnError("MqttServer", "发送消息失败 [Mqtt_publish]", "-> "+topic+" "+string(b))
+	}
+
+}
+
+// 获取json指定参数   [AAAA BBBB],0,JSON    !!!如果失败,返回已找到的全部json
+func Json_key(topicNameList []string, topicNameI int, articleSlide map[string]interface{}) interface{} {
+	if len(topicNameList) > topicNameI {
+		a, is := articleSlide[topicNameList[topicNameI]]
+		if !is {
+			return articleSlide
+		}
+		if reflect.TypeOf(a).String() == "map[string]interface {}" {
+			return Json_key(topicNameList, topicNameI+1, a.(map[string]interface{}))
+		}
+	}
+
+	if len(topicNameList) == topicNameI {
+		return articleSlide
+	}
+
+	return articleSlide[topicNameList[topicNameI]]
+}
+
+// 发送数据
+func TCP_publish(T_sn string, byte_r []byte) {
+
+	logs.PrintlnMqtt("TCP-> " + T_sn + ":" + string(byte_r))
+
+	if v, is := TcpMap[T_sn]; is {
+		err := v.Send(string(byte_r))
+		if err != nil {
+			logs.PrintlnError("TCP", "发送消息失败 [TCP_publish]", "-> "+T_sn+" "+string(byte_r))
+		}
+	} else {
+		logs.PrintlnError("TCP", "TcpMap[T_sn] 不存在,发送消息失败 [TCP_publish]", "-> "+T_sn+" "+string(byte_r))
+	}
+
+}

+ 0 - 0
logs/Data/logx.log


+ 124 - 0
logs/LogPrintln.go

@@ -0,0 +1,124 @@
+package logs
+
+import (
+	"fmt"
+	"github.com/astaxie/beego/logs"
+	"runtime"
+	"time"
+)
+
+var Test = true
+var logx *logs.BeeLogger
+var logxE *logs.BeeLogger
+var logxMqtt *logs.BeeLogger
+var logxData *logs.BeeLogger
+var logxOrm *logs.BeeLogger
+
+var DeviceRealLogMap map[string]DeviceRealLogR // 设备实时日志
+
+type DeviceRealLogR struct {
+	Time time.Time //
+	Data []string  // 泛型数组
+}
+
+func init() {
+	DeviceRealLogMap = make(map[string]DeviceRealLogR)
+
+	go func() {
+		for true {
+			for key, value := range DeviceRealLogMap {
+				subM := time.Now().Sub(value.Time)
+				fmt.Println(key+"日志-", subM.Minutes(), "分钟")
+				if subM.Minutes() > 3 {
+					delete(DeviceRealLogMap, key) // 删除日志
+				}
+			}
+
+			time.Sleep(time.Minute * 1)
+		}
+
+	}()
+
+	if runtime.GOOS == "windows" {
+		Test = true
+	} else {
+		Test = false
+	}
+
+	logx = logs.NewLogger()
+	logx.SetLogger(logs.AdapterFile, `{"filename":"logs/logx/logx.log"}`)
+
+	logxE = logs.NewLogger()
+	logxE.SetLogger(logs.AdapterFile, `{"filename":"logs/logxE/logx.log"}`)
+
+	logxMqtt = logs.NewLogger()
+	logxMqtt.SetLogger(logs.AdapterFile, `{"filename":"logs/Mqtt/logx.log"}`)
+
+	logxData = logs.NewLogger()
+	logxData.SetLogger(logs.AdapterFile, `{"filename":"logs/Data/logx.log"}`)
+
+	logxOrm = logs.NewLogger()
+	logxOrm.SetLogger(logs.AdapterFile, `{"filename":"logs/Orm/logx.log"}`)
+
+	//if !Test {
+	//	orm2.DebugLog = orm2.NewLog(logxOrm)
+	//}
+	//
+
+	// 测试 日志分割
+	//go func() {
+	//	t := 1
+	//	orm2.DebugLog.Println("==========DebugLog=========")
+	//	for true {
+	//		t +=1
+	//		orm2.DebugLog.Println("DebugLog:",t)
+	//		time.Sleep(time.Second * 1)
+	//	}
+	//}()
+	//go TimeTask.OrmLog_MonitorScanStatus()
+}
+
+func Println(format string, v ...interface{}) {
+
+	fmt.Println(format, v)
+	logx.Info(format, v)
+
+}
+
+func PrintlnError(format string, v ...interface{}) {
+
+	fmt.Println(format, v)
+
+	logxE.Error(format, v)
+	logx.Info(format, v)
+}
+
+func PrintlnMqtt(str string) {
+	fmt.Println(str)
+
+	logxMqtt.Info(str)
+
+}
+
+func PrintlnData(str string) {
+
+	fmt.Println(str)
+
+	logxData.Info(str)
+}
+
+//func Println(a ...interface{}) {
+//	if test {
+//		fmt.Printf("=>", a)
+//	}
+//	logx.Info(">", a)
+//}
+
+// 日志
+// logs.Println(time.Now().Format("2006-01-02 15:04:05"), "=>", a)
+
+// 重要
+// logs.Println("MqttServer", " 存在报警 跳过:", string(msg))
+
+// 严重
+// logs.Println("MqttServer", " 存在报警 跳过:", string(msg))

+ 0 - 0
logs/Mqtt/logx.log


+ 0 - 0
logs/Orm/logx.log


+ 1 - 0
logs/logx/logx.log

@@ -0,0 +1 @@
+2023/11/07 15:33:20.471 [I]  {"key":"ProductProt","conn":"127.0.0.1:6379","dbNum":"1","password":""}%!(EXTRA []interface {}=[])

+ 0 - 0
logs/logxE/logx.log


+ 53 - 0
main.go

@@ -0,0 +1,53 @@
+package main
+
+import (
+	"Yunlot/RunCode"
+	"Yunlot/TimeTask"
+	"Yunlot/conf"
+	"Yunlot/logs"
+
+	_ "Yunlot/routers"
+	"github.com/beego/beego/v2/adapter/orm"
+	orm2 "github.com/beego/beego/v2/client/orm"
+	beego "github.com/beego/beego/v2/server/web"
+	_ "github.com/go-sql-driver/mysql"
+	_ "github.com/mattn/go-sqlite3"
+	//_ "github.com/logoove/sqlite"
+	"strconv"
+)
+
+func init() {
+
+	//orm.RegisterDriver("sqlite", orm.DRSqlite)
+	//orm.RegisterDataBase("default", "sqlite3", "./models/data.db")
+	//orm.RunSyncdb("default", false, true)
+
+	logs.Println("MysqlServer:" + conf.MysqlServer_Username + ":" + conf.MysqlServer_Password + "@tcp(" + conf.MysqlServer_UrlPort + ")/" + conf.MysqlServer_Database + "?charset=utf8mb4&loc=Local&parseTime=True")
+
+	orm.RegisterDriver("mysql", orm.DRMySQL)
+	orm.RegisterDataBase("default", "mysql",
+		conf.MysqlServer_Username+":"+conf.MysqlServer_Password+"@tcp("+conf.MysqlServer_UrlPort+")/"+conf.MysqlServer_Database+"?charset=utf8mb4&loc=Local&parseTime=True",
+		conf.MysqlServer_MaxIdleConnections, conf.MysqlServer_MaxOpenConnections)
+	orm.RunSyncdb("default", false, true) // 创建数据库
+}
+
+func main() {
+
+	beego.BConfig.AppName = conf.AppName + "_" + strconv.Itoa(conf.HTTPPort)    // 项目名
+	beego.BConfig.ServerName = conf.AppName + "_" + strconv.Itoa(conf.HTTPPort) //server  名称
+	beego.BConfig.RunMode = "dev"                                               //  应用的运行模式
+	beego.BConfig.Listen.HTTPPort = conf.HTTPPort                               //监听端口  本地:8518  线上:8528
+	orm2.Debug = true
+	logs.Println("MqttServer", " ======= 项目启动 ========")
+	//go MqttServer2.Run_MqttServer() // MQTT 通讯
+	//go MqttServer.MqttPolling() // MQTT 设备轮询
+	//go MqttServer.DeviceMqttMap_go() //// 缓存数据发送-确保设备在休眠后 能收到数据
+
+	//go Nats.NatsInit() // Nats 通讯
+
+	go TimeTask.Init()        // 时间任务
+	go RunCode.RunCode_Inte() // 代码编译
+
+	beego.Run()
+
+}

+ 76 - 0
models/Account/Tokey.go

@@ -0,0 +1,76 @@
+package Account
+
+import (
+	"Yunlot/logs"
+	"fmt"
+	"github.com/astaxie/beego/cache"
+
+	uuid "github.com/satori/go.uuid"
+	"time"
+)
+
+var redis_Tokey cache.Cache
+
+func init() {
+	var err error
+	redis_Tokey, err = cache.NewCache("memory", `{"interval":60}`)
+	if err != nil || redis_Tokey == nil {
+		panic(any(err))
+	}
+
+	Redis_Tokey_Set("0533b4ec-049a-450f-93ec-d9984f219a66", "BOIYhGqm")
+}
+
+// ---------------- Redis -------------------
+// Redis_Set(m.T_sn,m) // Redis 更新缓存
+func Redis_Tokey_Set(key string, r string) (err error) {
+	err = redis_Tokey.Put(key, r, 24*time.Hour)
+	if err != nil {
+		logs.Println("set key:", key, ",value:", r, err)
+	}
+	return
+}
+
+// if r,is :=Redis_Get(T_sn);is{
+// return r,nil
+// }
+func Redis_Tokey_Get(key string) (r string, is bool) {
+	if redis_Tokey.IsExist(key) {
+		//println("找到key:",key)
+		v := redis_Tokey.Get(key)
+
+		Redis_Tokey_Set(key, v.(string))
+		return v.(string), true
+	}
+	//println("没有 找到key:",key)
+	return "", false
+}
+
+func Redis_DelK(key string) (err error) {
+	err = redis_Tokey.Delete(key)
+	return
+}
+
+// ---------------- 方法 -------------------
+
+// 验证 TOKEY
+func Read_Tokey(User_tokey string) (string, bool) {
+
+	return Redis_Tokey_Get(User_tokey)
+}
+
+// 添加 Tokey
+func Add_Tokey(User_uuid string) (Tokey string) {
+
+	for true {
+		Tokey = uuid.NewV4().String()
+		_, is := Redis_Tokey_Get(Tokey)
+		if !is {
+			break
+		}
+		fmt.Print("申请 TOKEY 重复!重新生成。", Tokey)
+	}
+	Redis_Tokey_Set(Tokey, User_uuid)
+
+	return Tokey
+}

+ 107 - 0
models/Account/User.go

@@ -0,0 +1,107 @@
+package Account
+
+import (
+	"Yunlot/logs"
+	"Yunlot/models"
+	"fmt"
+	"github.com/astaxie/beego/cache"
+	"github.com/beego/beego/v2/adapter/orm"
+
+	"time"
+)
+
+type User struct {
+	T_uuid  string `orm:"size(8);pk" json:"uuid"`
+	T_user  string `orm:"size(256);index" json:"user"` // 用户名  手机
+	T_tokey string `orm:"-" json:"tokey"`              // TOKEY
+
+	T_State    int         `orm:"size(200);1" json:"-"`                                           //  1 正常   2 删除\禁用
+	CreateTime models.Time `orm:"column(create_time);type(timestamp);null;auto_now_add" json:"-"` //auto_now 每次 model 保存时都会对时间自动更新
+	UpdateTime models.Time `orm:"column(update_time);type(timestamp);null;auto_now" json:"-"`     //auto_now_add 第一次保存时才设置时间
+}
+
+type VCode struct {
+	T_Code string
+}
+
+func (t *User) TableName() string {
+	return "User" // 数据库名称   // ************** 替换 FormulaList **************
+}
+
+var redis_Verify cache.Cache
+
+func init() {
+	//注册模型
+	orm.RegisterModel(new(User))
+
+	var err error
+	redis_Verify, err = cache.NewCache("memory", `{"interval":60}`)
+	if err != nil || redis_Verify == nil {
+		panic(any(err))
+	}
+}
+
+// ---------------- Redis -------------------
+// Redis_Set(m.T_sn,m) // Redis 更新缓存
+func Redis_Verify_Set(key string, r string) (err error) {
+	err = redis_Verify.Put(key, r, 5*time.Minute)
+	if err != nil {
+		logs.Println("set key:", key, ",value:", r, err)
+	}
+	return
+}
+
+// if r,is :=Redis_Get(T_sn);is{
+// return r,nil
+// }
+func Redis_Verify_Get(key string) (string, bool) {
+	if redis_Verify.IsExist(key) {
+		//println("找到key:",key)
+		v := redis_Verify.Get(key)
+		return v.(string), true
+	}
+	//println("没有 找到key:",key)
+	return "", false
+}
+
+func Redis_Verify_DelK(key string) (err error) {
+	err = redis_Verify.Delete(key)
+	return
+}
+
+// ---------------- 方法 -------------------
+
+// 获取 ById
+func (t *User) Read() bool {
+
+	o := orm.NewOrm()
+
+	err := o.Read(t, "T_uuid") // o.Read(&r,"Tokey") 如果不是 主键 就得指定字段名
+	if err != nil {
+		return false
+	}
+
+	return true
+}
+
+// 添加
+func (t *User) Add() (id int64, is bool) {
+	o := orm.NewOrm()
+
+	id, err := o.Insert(t)
+	if err != nil {
+		return 0, false
+	}
+
+	return id, true
+}
+
+// 修改
+func (t *User) Update(cols ...string) bool {
+	o := orm.NewOrm()
+	if num, err := o.Update(&t, cols...); err == nil {
+		fmt.Println("Number of records updated in database:", num)
+		return true
+	}
+	return false
+}

+ 70 - 0
models/GTime.go

@@ -0,0 +1,70 @@
+package models
+
+import (
+	"encoding/json"
+	"fmt"
+	orm2 "github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type Time struct {
+	time.Time
+}
+
+// MarshalJSON 序列化为JSON
+func (t Time) MarshalJSON() ([]byte, error) {
+	if t.IsZero() {
+		return []byte("\"\""), nil
+	}
+	stamp := fmt.Sprintf("\"%s\"", t.Format("2006-01-02 15:04:05"))
+	return []byte(stamp), nil
+}
+
+// UnmarshalJSON 反序列化为JSON
+func (t *Time) UnmarshalJSON(data []byte) error {
+	var err error
+	t.Time, err = time.Parse("2006-01-02 15:04:05", string(data)[1:20])
+	return err
+}
+
+func (t *Time) String() string {
+	data, _ := json.Marshal(t)
+	return string(data)
+}
+
+func (t *Time) FieldType() int {
+	return orm2.TypeDateTimeField
+}
+
+func (t *Time) SetRaw(value interface{}) error {
+	switch value.(type) {
+	case time.Time:
+		t.Time = value.(time.Time)
+	}
+	return nil
+}
+
+func (t *Time) RawValue() interface{} {
+	str := t.Format("2006-01-02 15:04:05")
+	if str == "0001-01-01 00:00:00" {
+		return nil
+	}
+	return str
+}
+
+func (t *Time) NowDbTime() Time {
+	dbTime := Time{}
+	dbTime.Time = time.Now()
+	return dbTime
+}
+func (t *Time) AddDates(years int, months int, days int) Time {
+	dbTime := Time{}
+	dbTime.Time = t.Time.AddDate(years, months, days)
+	return dbTime
+}
+func TimeParse(value string) (Time, error) {
+	dbTime := Time{}
+	times, err := time.Parse("2006-01-02 15:04:05", value)
+	dbTime.Time = times
+	return dbTime, err
+}

+ 57 - 0
models/Product/ProductLang.go

@@ -0,0 +1,57 @@
+package Product
+
+// 产品语言
+type ProductLang struct {
+	Id     int    `json:"Id"`
+	T_name string `json:"T_name"` // 协议语言
+	T_code string `json:"T_code"` // 代码
+}
+
+var ProductLangList = []ProductLang{}
+
+// ---------------- 方法 -------------------
+func init() {
+	Add(ProductLang{
+		Id:     1,
+		T_name: "Goland",
+		T_code: "import (\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n/*\n设备->平台\n*/\nfunc T(t string, b []byte) (string) {\n\treturn string(b)\n}\n\n\n/*\n平台->设备\n*/\nfunc R(sn string, b string) (string,[]byte){\n\tt := \"/\"+sn+\"/r\"\n\treturn t,[]byte(b)\n}",
+	})
+	Add(ProductLang{
+		Id:     2,
+		T_name: "C",
+		T_code: "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#define LEN 1024\n\n// 设备->平台\nvoid T(const char *t, const char *b, char **r_b) {\n    size_t len1 = strlen(t);\n    size_t len2 = strlen(b);\n    *r_b = (char *)malloc(len1 + len2 + 1);\n    strcpy(*r_b, t);\n    strcat(*r_b, b);\n}\n\nvoid R(const char *t,  const char *b, char **r_t, char **r_b) {\n    size_t len1 = strlen(t);\n    size_t len2 = strlen(b);\n    *r_t = (char *)malloc(len1 + 1);\n    *r_b = (char *)malloc(len2 + 1);\n    strcpy(*r_t, t);\n    strcpy(*r_b, b);\n}",
+	})
+	//Add(ProductLang{
+	//	Id:     3,
+	//	T_name: "Python",
+	//})
+	//Add(ProductLang{
+	//	Id:     4,
+	//	T_name: "JavaScript",
+	//})
+
+}
+
+// 添加
+func Add(t ProductLang) {
+	ProductLangList = append(ProductLangList, t)
+
+}
+
+// 获取列表
+func ProductLangLists() (r []ProductLang, Total int64) {
+
+	return ProductLangList, int64(len(ProductLangList))
+}
+
+func ProductLangFind(id int) string {
+	// 遍历数组,查询数组中的元素
+	for _, v := range ProductLangList {
+
+		// 判断数组元素是否符合条件
+		if v.Id == id {
+			return v.T_name
+		}
+	}
+	return ""
+}

+ 45 - 0
models/Product/ProductMode.go

@@ -0,0 +1,45 @@
+package Product
+
+import (
+	"Yunlot/models"
+	"github.com/beego/beego/v2/adapter/orm"
+	orm2 "github.com/beego/beego/v2/client/orm"
+)
+
+// 产品协议
+type ProductMode struct {
+	Id         int    `orm:"column(ID);size(11);auto;pk" json:"Id" form:"Id"`
+	T_name     string `orm:"size(200);index" json:"T_name" form:"T_name"`                // 协议名称  Mqtt
+	T_describe string `orm:"type(text);default('')" json:"T_describe" form:"T_describe"` // 描述内容
+	T_file     string `orm:"type(text);default('')" json:"T_file" form:"T_file"`         //文件地址
+
+	T_State    int         `orm:"size(1);default(1)" json:"T_State"`                                   //  1 正常   0 删除
+	CreateTime models.Time `orm:"column(create_time);type(timestamp);null;auto_now_add" json:"-"`      //auto_now 每次 model 保存时都会对时间自动更新
+	UpdateTime models.Time `orm:"column(update_time);type(timestamp);null;auto_now" json:"UpdateTime"` //auto_now_add 第一次保存时才设置时间
+}
+
+func (t *ProductMode) TableName() string {
+	return "ProductMode" // 数据库名称   // ************** 替换 FormulaList **************
+}
+
+func init() {
+	//注册模型
+	orm.RegisterModel(new(ProductMode))
+
+}
+
+// 获取列表
+func ProductModeLists() (r []ProductMode, Total int64) {
+
+	o := orm.NewOrm()
+	// 也可以直接使用 Model 结构体作为表名
+	qs := o.QueryTable(new(ProductMode))
+
+	// 筛选参数
+	cond := orm.NewCondition()
+
+	// 执行
+	qs.SetCond((*orm2.Condition)(cond)).OrderBy("-Id").All(&r)
+
+	return r, 0
+}

+ 152 - 0
models/Product/ProductProt.go

@@ -0,0 +1,152 @@
+package Product
+
+import (
+	"Yunlot/lib"
+	"Yunlot/logs"
+	"Yunlot/models"
+	"github.com/beego/beego/v2/adapter/orm"
+	orm2 "github.com/beego/beego/v2/client/orm"
+)
+
+// 产品协议
+type ProductProt struct {
+	Id         string `orm:"size(8);pk" json:"Id" form:"Id"`
+	T_uuid     string `orm:"size(8);index" json:"-" form:"T_uuid"`                       // 用户识别码(8位) ,管理员可以为空
+	T_name     string `orm:"size(20);index" json:"T_name" form:"T_name"`                 // 协议名称 20 字符
+	T_mode     int    `orm:"size(1);default(1)" json:"T_mode" form:"T_mode"`             //接入方式  1:Mqtt  2:tcp    6:http
+	T_lang     int    `orm:"size(1);default(1)" json:"T_lang" form:"T_lang"`             //编程语言 0: 无解析   1: go   2: C
+	T_analysis string `orm:"type(text);default('')" json:"T_analysis" form:"-"`          //数据解析
+	T_text     string `orm:"type(text);default('')" json:"T_text" form:"T_text"`         // 代码内容
+	T_describe string `orm:"type(text);default('')" json:"T_describe" form:"T_describe"` // 描述内容
+	T_vote     int64  `orm:"default(1)" json:"T_vote" form:"T_vote"`                     // 查看人气
+
+	T_State    int         `orm:"size(1);default(2)" json:"T_State"`                                   //  1 正常   2 等待审核  3 审核失败
+	T_log      string      `orm:"type(text);default('')" json:"T_log"`                                 //
+	CreateTime models.Time `orm:"column(create_time);type(timestamp);null;auto_now_add" json:"-"`      //auto_now 每次 model 保存时都会对时间自动更新
+	UpdateTime models.Time `orm:"column(update_time);type(timestamp);null;auto_now" json:"UpdateTime"` //auto_now_add 第一次保存时才设置时间
+}
+
+func (t *ProductProt) TableName() string {
+	return "ProductProt" // 数据库名称   // ************** 替换 FormulaList **************
+}
+
+func init() {
+	//注册模型
+	orm.RegisterModel(new(ProductProt))
+
+}
+
+// 添加
+func (t *ProductProt) Add() (is bool) {
+	o := orm.NewOrm()
+	t.Id = lib.GetRandstring(8, "", 0)
+	_, err := o.Insert(t)
+	if err != nil {
+		return false
+	}
+	return true
+}
+
+// 获取
+func (t *ProductProt) Read() (bool bool) {
+
+	if !(len(t.T_uuid) > 0) {
+
+		return false
+	}
+	if !(len(t.T_name) > 0) {
+
+		return false
+	}
+	o := orm.NewOrm()
+	err := o.Read(t, "T_uuid", "T_name") // o.Read(&r,"Tokey") 如果不是 主键 就得指定字段名
+	if err != nil {
+		return false
+	}
+
+	return true
+}
+
+// 获取
+func (t *ProductProt) Read_ID() (bool bool) {
+
+	if !(len(t.Id) > 0) {
+		logs.Println("ProductProt.Id:", t.Id)
+		return false
+	}
+
+	o := orm.NewOrm()
+	err := o.Read(t, "Id") // o.Read(&r,"Tokey") 如果不是 主键 就得指定字段名
+	if err != nil {
+		return false
+	}
+
+	return true
+}
+
+// 修改
+func (t *ProductProt) Update(cols ...string) bool {
+	o := orm.NewOrm()
+	if num, err := o.Update(t, cols...); err == nil {
+		logs.Println("Number of records updated in database:", num)
+
+		return true
+	}
+	return false
+}
+
+// 删除
+func (t *ProductProt) Delete() bool {
+	o := orm.NewOrm()
+	if num, err := o.Delete(t); err == nil {
+		logs.Println("Number of records deleted in database:", num)
+	} else {
+		return false
+	}
+	return true
+}
+
+// 获取列表
+func (t *ProductProt) Lists(PageIndex int, PageSize int) (r []ProductProt, Total int64) {
+
+	o := orm.NewOrm()
+
+	// 也可以直接使用 Model 结构体作为表名
+	qs := o.QueryTable(new(ProductProt))
+	var offset int64
+	if PageIndex <= 1 {
+		offset = 0
+	} else {
+		offset = int64((PageIndex - 1) * PageSize)
+	}
+
+	// 筛选参数
+	cond := orm.NewCondition()
+	if len(t.T_name) > 0 {
+		cond = cond.And("T_name__icontains", t.T_name) // .AndNot("status__in", 1).Or("profile__age__gt", 2000)
+	}
+	if t.T_mode > 0 {
+		cond = cond.And("T_mode", t.T_mode) // 用户识别码
+	}
+	if t.T_lang > 0 {
+		cond = cond.And("T_lang", t.T_lang) // 用户识别码
+	}
+	if len(t.T_uuid) > 0 {
+		cond = cond.And("T_uuid", t.T_uuid) // 用户识别码
+	}
+	if t.T_State > 0 {
+		cond = cond.And("T_State", t.T_State) // 用户识别码
+	}
+
+	// 执行
+	qs.Limit(PageSize, offset).SetCond((*orm2.Condition)(cond)).OrderBy("-UpdateTime").All(&r)
+	Total, _ = qs.SetCond((*orm2.Condition)(cond)).Count()
+
+	for i, _ := range r {
+		//r[i].T_uuid = "*"
+		r[i].T_text = ""
+		r[i].T_describe = ""
+	}
+
+	return r, Total
+}

+ 33 - 0
models/System/Logs.go

@@ -0,0 +1,33 @@
+package System
+
+import (
+	"github.com/beego/beego/v2/adapter/orm"
+	"time"
+)
+
+type Logs struct {
+	Id         int    `orm:"column(ID);size(11);auto;pk"`
+	Logs_class string `orm:"size(256);"`  //
+	Logs_Title string `orm:"size(256);"`  // 标题
+	Logs_Txt   string `orm:"type(text);"` // 详情
+
+	CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` //auto_now 每次 model 保存时都会对时间自动更新
+	UpdateTime time.Time `orm:"column(update_time);type(timestamp);auto_now"`     //auto_now_add 第一次保存时才设置时间
+}
+
+func (t *Logs) TableName() string {
+	return "Logs" // 数据库名称   // ************** 替换 FormulaList **************
+}
+
+func init() {
+	//注册模型
+	orm.RegisterModel(new(Logs))
+
+}
+
+// 添加  logs.Println("MqttServer","参数请求 [Rt_Parameter]","base")
+func Add_Logs(Logs_class string, Logs_Title string, Logs_Txt string) {
+	o := orm.NewOrm()
+	m := Logs{Logs_class: Logs_class, Logs_Title: Logs_Title, Logs_Txt: Logs_Txt}
+	o.Insert(&m)
+}

+ 22 - 0
routers/Product.go

@@ -0,0 +1,22 @@
+package routers
+
+import (
+	"Yunlot/controllers"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+func init() {
+	prefix := "/Product"
+
+	// 产品协议
+	beego.Router(prefix+"/ProductProt/Get", &controllers.ProductProtController{}, "*:Get")           // 获取未读消息
+	beego.Router(prefix+"/ProductProt/Download", &controllers.ProductProtController{}, "*:Download") // 获取未读消息
+	beego.Router(prefix+"/ProductProt/List", &controllers.ProductProtController{}, "*:List")         // 获取未读消息
+	//beego.Router(prefix+"/ProductProtPublic/List", &controllers.ProductProtController{}, "*:PublicList")     // 获取未读消息
+	beego.Router(prefix+"/ProductProt/Update", &controllers.ProductProtController{}, "*:Update") // 获取未读消息
+	beego.Router(prefix+"/ProductProt/Delete", &controllers.ProductProtController{}, "*:Delete") // 获取未读消息
+
+	beego.Router(prefix+"/ProductMode/List", &controllers.ProductProtController{}, "*:ProductModeLists") // 获取未读消息
+	beego.Router(prefix+"/ProductLang/List", &controllers.ProductProtController{}, "*:ProductLangList")  // 获取未读消息
+
+}

+ 16 - 0
routers/RunCode.go

@@ -0,0 +1,16 @@
+package routers
+
+import (
+	"Yunlot/controllers"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+func init() {
+
+	// 日志
+	beego.Router("/RunCode/Languages", &controllers.RuncodeController{}, "*:Languages") // 获取未读消息
+	beego.Router("/RunCode/Run", &controllers.RuncodeController{}, "*:Run")             // 获取未读消息
+	beego.Router("/RunCode/Build", &controllers.RuncodeController{}, "*:Build")         // 获取未读消息
+	beego.Router("/RunCode/Download", &controllers.RuncodeController{}, "*:Download")   // 获取未读消息
+
+}

+ 39 - 0
routers/User.go

@@ -0,0 +1,39 @@
+package routers
+
+import (
+	"Yunlot/controllers"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+func init() {
+	//   -----------3、用户管理
+	//3.1用户账户只可以由管理员添加。
+	//3.2管理员账户只可以有一个。
+	//3.3用户可添加和删除子账号。
+	//3.4用户可对子账号分配管理权限,包括:设备数据查看权限,设备运行参数修改权限。
+	//----------- beego.Router("/Register_html", &controllers.UserController{}, "*:Register_html")         // *全部;  get,post:
+	//beego.Router("/Register", &controllers.UserController{}, "*:Register") // *全部;  get,post:
+	//
+	//beego.Router("/User/User_List", &controllers.UserController{}, "*:User_List")               // 获取未读消息
+	//beego.Router("/User/User_Post", &controllers.UserController{}, "*:User_Post")               // 获取未读消息
+	//beego.Router("/User/User_Get", &controllers.UserController{}, "*:User_Get")                 // 获取未读消息
+	//beego.Router("/User/User_Post_Notice", &controllers.UserController{}, "*:User_Post_Notice") // 获取未读消息
+	beego.Router("/User/SandVerify", &controllers.UserController{}, "*:SandVerify") // 获取未读消息
+	beego.Router("/User/Register", &controllers.UserController{}, "*:Register")     // 获取未读消息
+
+	//beego.Router("/User/User_html", &controllers.UserController{}, "*:User_html")   // 获取未读消息
+	//beego.Router("/User/User_", &controllers.UserController{}, "*:User_")           // 获取未读消息
+	//beego.Router("/User/User_Info", &controllers.UserController{}, "*:User_Info")   // 获取未读消息
+	//beego.Router("/User/User_Post", &controllers.UserController{}, "*:User_Post")   // 获取未读消息
+	//beego.Router("/User/User_Del", &controllers.UserController{}, "*:User_Del")     // 获取未读消息
+	//beego.Router("/User/User_Entry", &controllers.UserController{}, "*:User_Entry") // 获取未读消息
+	//
+	//beego.Router("/User/Power", &controllers.UserController{}, "*:Power_html")      // 获取未读消息
+	//beego.Router("/User/Power_", &controllers.UserController{}, "*:Power_")         // 获取未读消息
+	//beego.Router("/User/Power_Post", &controllers.UserController{}, "*:Power_Post") // 获取未读消息
+	//beego.Router("/User/Power_Del", &controllers.UserController{}, "*:Power_Del")   // 获取未读消息
+
+	// 日志
+	//beego.Router("/User/UserLogs", &controllers.LogsController{}, "*:UserLogs") // 获取未读消息
+
+}

+ 10 - 0
routers/router.go

@@ -0,0 +1,10 @@
+package routers
+
+import (
+	"Yunlot/controllers"
+	beego "github.com/beego/beego/v2/server/web"
+)
+
+func init() {
+	beego.Router("/", &controllers.MainController{})
+}

+ 40 - 0
tests/Cgo/aaaa.go

@@ -0,0 +1,40 @@
+package Cgo
+
+/*
+// C 标志io头文件,你也可以使用里面提供的函数
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define LEN 1024
+void pri(){
+	printf("Welcome to the C World!\n");
+}
+int add(int a,int b){
+	return a+b;
+}
+char* Foo( char *input ) {
+    char* res = malloc( LEN * sizeof( char ) );
+    sprintf( res, "%s %s", input, "World!" );
+    return res;
+}
+*/
+import "C" // 切勿换行再写这个
+import (
+	"fmt"
+	"unsafe"
+)
+
+func Getpri() {
+	C.pri()
+}
+func GetAdd() {
+	fmt.Println(C.add(2, 1))
+}
+func GetFoo(a string) {
+	cs := C.CString(a)
+	res := C.Foo(cs)
+	str := C.GoString(res)
+	C.free(unsafe.Pointer(cs))
+	C.free(unsafe.Pointer(res))
+	fmt.Println(str)
+}

+ 12 - 0
tests/Message_Sand_test.go

@@ -0,0 +1,12 @@
+package test
+
+import (
+	"Yunlot/lib"
+	"testing"
+)
+
+func TestMessage_Sand(t *testing.T) {
+
+	println(lib.Message_Sand_Verify("18777951277"))
+
+}

+ 9 - 0
tests/default_test.go

@@ -0,0 +1,9 @@
+package test
+
+import (
+	"testing"
+)
+
+func TestName(t *testing.T) {
+
+}

+ 43 - 0
tests/deom_test.go

@@ -0,0 +1,43 @@
+package test
+
+import (
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"testing"
+)
+
+func TestName222(t *testing.T) {
+	//i := 2
+	//for true {
+	//	i -= 1
+	//	if i == 0 {
+	//		break;
+	//	}
+	//	time.Sleep(time.Millisecond * 10)
+	//	go gooo()
+	//}
+	gooo()
+	//time.Sleep(time.Second * 100)
+
+}
+
+func gooo() {
+
+	url := "https://mikaplus.xinglico.com/app/pay/payMember/10"
+	method := "POST"
+
+	client := &http.Client{}
+	req, err := http.NewRequest(method, url, nil)
+
+	if err != nil {
+		fmt.Println(err)
+	}
+	req.Header.Add("accesskey", "b7e942a2349e455ca594f2a3e37650c2")
+
+	res, err := client.Do(req)
+	defer res.Body.Close()
+	body, err := ioutil.ReadAll(res.Body)
+
+	fmt.Println(string(body))
+}

+ 64 - 0
tests/go_test.go

@@ -0,0 +1,64 @@
+package test
+
+import (
+	"encoding/hex"
+	"fmt"
+	"strings"
+	"testing"
+)
+
+/*
+设备<-平台
+*/
+func R(b []byte) []byte {
+	return b
+}
+
+// 设备 返回处理结果
+func R_reply(b []byte) []byte {
+	return b
+}
+
+/*
+设备->平台
+*/
+func T(b []byte) []byte {
+	return b
+}
+
+// 平台 返回处理结果
+func T_reply(b []byte) []byte {
+	return b
+}
+
+var Data_hex = true
+var R_byte = "495051"
+var T_byte = "456"
+
+func TestNameq(t *testing.T) {
+	R_ := []byte(R_byte)
+	if Data_hex {
+		R_, _ = hex.DecodeString(R_byte)
+		R_ = R(R_)
+		fmt.Print("|-=&" + strings.ToUpper(hex.EncodeToString(R_)))
+	} else {
+		R_ = R(R_)
+		fmt.Print("|-=&" + string(R_))
+	}
+
+	fmt.Print("|-=&" + string(R_reply([]byte("{\n    \"id\": \"****\",\n    \"code\":200,\n    \"data\" : {}\n}"))))
+
+	// -------------------------------
+	T_ := []byte(T_byte)
+	if Data_hex {
+		T_, _ = hex.DecodeString(T_byte)
+		T_ = T(T_)
+		fmt.Print("|-=&" + strings.ToUpper(hex.EncodeToString(T_)))
+	} else {
+		T_ = T(T_)
+		fmt.Print("|-=&" + string(T_))
+	}
+
+	fmt.Print("|-=&" + string(T_reply([]byte("{\n    \"id\": \"****\",\n    \"code\":200,\n    \"data\" : {}\n}"))))
+
+}

+ 56 - 0
tests/json_key_test.go

@@ -0,0 +1,56 @@
+package test
+
+import (
+	"Yunlot/lib"
+	"encoding/json"
+	"strings"
+	"testing"
+)
+
+func Test_jsonkey(t *testing.T) {
+
+	var data = `{
+	"clientID": "869023065073597",
+	"msgID": "24152",
+	"msgID11": "1111",
+	"msgID22": "1111",
+	"msgID33": "3333",
+	"AAAA": {
+		"typeCode": "123",
+		"typeCode2": "123",
+		"AAAA": {
+			"name": "TempSet",
+			"value": "272"
+		},
+		"BBBB": [{
+			"name": "TempSet",
+			"value": "266666"
+		}],
+		"CCCC": [{
+			"name": "TempSet",
+			"value": "2766662"
+		}]
+	},
+	"paramsb": {
+		"typeCode": "123",
+		"typeCode2": "123"
+	},
+	"paramslist": [{
+		"typeCode": "123",
+		"typeCode2": "123"
+	}]
+}`
+	var articleSlide map[string]interface{}
+	err := json.Unmarshal([]byte(data), &articleSlide)
+	if err != nil {
+
+	}
+	topicName := "/paramsb/"
+	topicName = strings.Trim(topicName, "/")
+
+	topicNameList := strings.Split(topicName, "/")
+
+	x := lib.Json_key(topicNameList, 0, articleSlide)
+	println(x)
+
+}

+ 37 - 0
tests/json_test.go

@@ -0,0 +1,37 @@
+package test
+
+import (
+	"encoding/json"
+	"fmt"
+	"testing"
+)
+
+func Test_json(t *testing.T) {
+	articleStrings := `{
+	"clientID": "869023065073597",
+	"msgID": "24152",
+	"paramsb": {
+		"typeCode": "123",
+		"typeCode2": "123"
+	},
+	"paramslist": [{
+		"typeCode": "123",
+		"typeCode2": "123"
+	}],
+	"params": [{
+		"typeCode": "123",
+		"typeCode2": "123",
+		"varData": [{
+			"name": "TempSet",
+			"value": "27"
+		}]
+	}]
+}`
+	var articleSlide map[string]interface{}
+	multiErr := json.Unmarshal([]byte(articleStrings), &articleSlide)
+	if multiErr != nil {
+		fmt.Println("转换出错:", multiErr)
+	}
+
+	println("articleSlide:", articleSlide)
+}

+ 0 - 0
tests/logs/Data/logx.log


+ 0 - 0
tests/logs/Mqtt/logx.log


+ 0 - 0
tests/logs/Orm/logx.log


+ 58 - 0
tests/logs/logx/logx.log

@@ -0,0 +1,58 @@
+2023/03/07 10:19:51.903 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/03/07 10:19:51.903 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/03/07 10:19:51.903 [I]  {"key":"redis_Device","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/03/07 10:19:51.903 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/21 17:19:36.256 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/21 17:19:36.256 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/21 17:19:36.256 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/21 17:19:36.256 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:05:00.409 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:05:00.409 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:05:00.409 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:05:00.409 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:05:37.185 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:05:37.185 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:05:37.185 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:05:37.185 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:13:41.112 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:13:41.112 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:13:41.112 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:13:41.113 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:16:44.373 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:16:44.373 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:16:44.373 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:16:44.373 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:17:30.626 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:17:30.626 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:17:30.626 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:17:30.626 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:19:40.801 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:19:40.801 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:19:40.801 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:19:40.801 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:34:14.201 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:34:14.201 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 11:34:14.201 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 11:34:14.201 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 16:41:44.915 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 16:41:44.915 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 16:41:44.915 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 16:41:44.915 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 17:46:03.197 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 17:46:03.197 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/23 17:46:03.197 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/23 17:46:03.197 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/24 09:53:34.407 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/24 09:53:34.407 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/24 09:53:34.407 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/24 09:53:34.407 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/24 09:53:47.267 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/24 09:53:47.267 [I]  {"key":"redis_Company","conn":"","dbNum":"","password":""}%!(EXTRA []interface {}=[])
+2023/04/24 09:53:47.267 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/04/24 09:53:47.267 [I]  failed to init redis%!(EXTRA []interface {}=[dial tcp: missing address])
+2023/11/03 16:19:23.700 [I]  topicNameS:%!(EXTRA []interface {}=[[ AAAA typeCode2 ]])
+2023/11/03 16:19:33.555 [I]  topicNameS[0]:%!(EXTRA []interface {}=[])
+2023/11/03 16:20:29.371 [I]  topicNameS:%!(EXTRA []interface {}=[[ AAAA typeCode2 ]])
+2023/11/10 10:27:50.229 [I]  _result.Body:%!(EXTRA []interface {}=[{"status":"error","code":101,"msg":"Incorrect APP ID or the Content-type does not match the data format"}])
+2023/11/10 10:29:19.030 [I]  _result.Body:%!(EXTRA []interface {}=[{"status":"error","code":101,"msg":"Incorrect APP ID or the Content-type does not match the data format"}])
+2023/11/10 10:31:18.321 [I]  _result.Body:%!(EXTRA []interface {}=[{"status":"error","code":101,"msg":"Incorrect APP ID or the Content-type does not match the data format"}])

+ 0 - 0
tests/logs/logxE/logx.log


+ 11 - 0
tests/main.txt_C_test.go

@@ -0,0 +1,11 @@
+package test
+
+import (
+	"Yunlot/tests/Cgo"
+	"testing"
+)
+
+func Test_Runcode(t *testing.T) {
+	Cgo.GetAdd()
+
+}

+ 35 - 0
tests/maspac_test.go

@@ -0,0 +1,35 @@
+package test
+
+import (
+	"fmt"
+	"github.com/vmihailenco/msgpack/v5"
+	"testing"
+)
+
+func TestName12(t *testing.T) {
+	type Item struct {
+		Foo1 string // 这里 必须大写,不然 不会解析
+		Foo  string // 这里 必须大写,不然 不会解析
+	}
+	b, err := msgpack.Marshal(&Item{Foo: "bar1"})
+	if err != nil {
+		panic(any(err))
+	}
+
+	type Item_a struct {
+		Foo2 string // 这里 必须大写,不然 不会解析
+		Foo  string // 这里 必须大写,不然 不会解析
+		Foo1 string // 这里 必须大写,不然 不会解析
+	}
+
+	var item Item_a
+	err = msgpack.Unmarshal(b, &item)
+	if err != nil {
+		panic(any(err))
+	}
+	fmt.Println(item)
+	fmt.Println("Foo:", item.Foo)
+	// Output:
+	//{bar1}
+	//bar1
+}

+ 0 - 0
tests/memory.prof


+ 148 - 0
tests/mongodb_test.go

@@ -0,0 +1,148 @@
+package test
+
+import (
+	"context"
+	"encoding/json"
+	"fmt"
+	"go.mongodb.org/mongo-driver/bson"
+	"go.mongodb.org/mongo-driver/mongo"
+	"go.mongodb.org/mongo-driver/mongo/options"
+
+	"log"
+	"testing"
+	"time"
+)
+
+var (
+	Mongodb_Url      = "mongodb://192.168.11.112:27017"
+	Mongodb_DB       = "yunlot"
+	Mongodb_Username = "yunlot8"
+	Mongodb_Password = "yunlot123"
+)
+
+func Connect() (*mongo.Database, error) {
+
+	credential := options.Credential{
+		Username: Mongodb_Username,
+		Password: Mongodb_Password,
+	}
+
+	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+	defer cancel()
+	client, err := mongo.Connect(ctx, options.Client().ApplyURI(Mongodb_Url).SetAuth(credential).SetMaxPoolSize(10))
+	if err != nil {
+		log.Print(err)
+	}
+
+	return client.Database(Mongodb_DB), err
+
+}
+
+func TestNamex(t *testing.T) {
+
+	// 连接到MongoDB
+	DB, err := Connect()
+	if err != nil {
+		panic(any(err))
+	}
+
+	collection := DB.Collection("aaa")
+
+	_, err = collection.InsertOne(context.TODO(), bson.D{{"text", "text"}})
+	if err != nil {
+		t.Fatalf("error inserting: %v", err)
+	}
+
+	students := []interface{}{bson.D{{"text", "2text"}}, bson.D{{"text", "1text"}}}
+	insertManyResult, err := collection.InsertMany(context.TODO(), students)
+	if err != nil {
+		panic(any(err))
+	}
+	fmt.Println("Inserted multiple documents: ", insertManyResult.InsertedIDs)
+
+}
+
+// 根据 条件、排序、分页 获取列表
+func TestMongodb_list(t *testing.T) {
+
+	// 连接到MongoDB
+	DB, err := Connect()
+	if err != nil {
+		panic(any(err))
+	}
+	collection := DB.Collection("2023445039284316_params_varData")
+
+	// 条件
+	jsonFind := `{"$or":[{"name":"TempSet"},{"value":"26"}]}`
+	// 排序
+	jsonSort := `{"value": 1}`
+	// 分页
+	page := 2     // 当前页码
+	pageSize := 2 // 每页文档数量
+
+	// 解码JSON
+	var jsonFindMap map[string]interface{}
+	err = json.Unmarshal([]byte(jsonFind), &jsonFindMap)
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	// 解码JSON
+	var jsonSortMap map[string]interface{}
+	err = json.Unmarshal([]byte(jsonSort), &jsonSortMap)
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	options := options.Find().SetSkip(int64((page - 1) * pageSize)).SetLimit(int64(pageSize))
+
+	options = options.SetSort(bson.M(jsonSortMap))
+
+	cursor, err := collection.Find(context.Background(), bson.M(jsonFindMap), options)
+	if err != nil {
+		panic(any(err))
+	}
+	defer cursor.Close(context.Background())
+
+	var results []bson.M
+	if err = cursor.All(context.Background(), &results); err != nil {
+		panic(any(err))
+	}
+
+	jsonBytes, err := json.MarshalIndent(results, "", "  ")
+	if err != nil {
+		panic(any(err))
+	}
+
+	fmt.Println(string(jsonBytes))
+
+	// 执行计数操作
+	count, err := collection.CountDocuments(context.Background(), bson.M(jsonFindMap))
+	if err != nil {
+		log.Fatal(err)
+	}
+	fmt.Println("Count:", count)
+}
+
+func Data_Add(JointTab string, bson_r *bson.M) {
+	// 连接到MongoDB
+	DB, err := Connect()
+	if err != nil {
+		panic(any(err))
+	}
+	//fmt.Println("JointTab:", JointTab)
+	collection := DB.Collection(JointTab)
+
+	_, err = collection.InsertOne(context.TODO(), bson_r)
+	if err != nil {
+		panic(any(err))
+	}
+
+	//
+	//students := []interface{}{bson.D{{"text", "2text"}}, bson.D{{"text", "1text"}}}
+	//insertManyResult, err := collection.InsertMany(context.TODO(), students)
+	//if err != nil {
+	//	panic(any(err))
+	//}
+	//fmt.Println("Inserted multiple documents: ", insertManyResult.InsertedIDs)
+}

+ 30 - 0
tests/plugin_test.go

@@ -0,0 +1,30 @@
+package test
+
+import (
+	"Yunlot/logs"
+	"plugin"
+	"testing"
+)
+
+func TestNameplugin(t *testing.T) {
+	// 根据库的存放路径加载库
+	p, err := plugin.Open("/var/lib/docker/volumes/yunlotso/_data/1698289330654.so")
+	if err != nil {
+		println(err)
+		logs.PrintlnError("打开 SO 失败:", err)
+	}
+
+	// 查找库导出信息
+	s, err := p.Lookup("T")
+	if err != nil {
+		println(err)
+		panic(any(err))
+	}
+	// 类型转换
+	f := s.(func(t string, b []byte) string)("aaaaaaa", []byte("1234567"))
+
+	// 开始处理
+	// 开始处理
+	logs.Println("协议后:", f)
+	logs.Println("首字符:", string("123"[0]))
+}

+ 30 - 0
tests/tcp_test.go

@@ -0,0 +1,30 @@
+package test
+
+import (
+	//"Yunlot/Handle/TcpServer"
+	"net"
+	"time"
+)
+import (
+	"testing"
+)
+
+func TestTCP(t *testing.T) {
+
+	//go TcpServer.TcpServer()
+	//
+
+	ln, err := net.Listen("tcp", ":111")
+	if err != nil {
+		// handle error
+	}
+	for {
+		_, err := ln.Accept()
+		if err != nil {
+			// handle error
+		}
+		//go handleConnection(conn)
+	}
+
+	time.Sleep(time.Second * 1000)
+}

+ 0 - 0
tests/yunlot-pxxxx-v1.19-01.so


+ 88 - 0
tests/zhuan_test.go

@@ -0,0 +1,88 @@
+package test
+
+import (
+	"encoding/json"
+	"fmt"
+	"go.mongodb.org/mongo-driver/bson"
+	"reflect"
+	"testing"
+)
+
+func TestZHUANHUAN(t *testing.T) {
+	// 禁止参数数组,数组只能为对象方式上传
+	articleStrings := `{
+	"A": "支付成功",
+	"B": {
+		"BA": "transaction",
+		"BB": {
+			"BBA": "1",
+			"BBB": "1"
+		},
+		"BC": [
+			{
+				"BCA": "1",
+				"BCB": "1"
+			},
+			{
+				"BCA": "1",
+				"BCB": "1"
+			}
+		],
+		"BD": "BD1",
+		"BEXXX": ["BE1","BE2","BE3"]
+	},
+	"C": "CC支付成功",
+	"d": "DD支付成功",
+	"EXXX": ["E1","E2","E3"]
+	
+}`
+	articleStrings = `{"clientID":"869023065073597","msgID":"24152","params":[{"typeCode":"123","varData":[{"name":"TempSet","value":"27"}]}]}`
+	var articleSlide map[string]interface{}
+	multiErr := json.Unmarshal([]byte(articleStrings), &articleSlide)
+	if multiErr != nil {
+		fmt.Println("转换出错:", multiErr)
+	}
+
+	fmt.Println(articleSlide)
+	AnalysisMap(articleSlide, "")
+
+}
+
+func AnalysisMap(ArticleSlide map[string]interface{}, JointTab string) {
+	//JointTab += "."
+	T_r := make(map[string]interface{})
+	for key, value := range ArticleSlide {
+		//fmt.Println(reflect.TypeOf(value).String())
+		switch reflect.TypeOf(value).String() {
+		case "map[string]interface {}":
+			AnalysisMap(value.(map[string]interface{}), JointTab+key+"_")
+			break
+		case "[]interface {}":
+			for _, valuex := range value.([]interface{}) {
+				if reflect.TypeOf(valuex).String() == "map[string]interface {}" {
+					AnalysisMap(valuex.(map[string]interface{}), JointTab+key+"_")
+				}
+			}
+			break
+		default:
+			T_r[key] = value
+			if len(JointTab) == 0 {
+				Data_Add("202300000001_"+key, &bson.M{key: value})
+			}
+			break
+		}
+	}
+	if len(JointTab) == 0 {
+		return
+	}
+	JointTab = JointTab[:len(JointTab)-1]
+	fmt.Println(JointTab, "-------")
+	bson_r := bson.M{}
+	for key, value := range T_r {
+		fmt.Println(key, "->:", value)
+		bson_r[key] = value
+	}
+
+	Data_Add("202300000001_"+JointTab, &bson_r)
+
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 6 - 0
views/index.tpl


BIN
yunlot_public


BIN
yunlot_public.tar.gz


BIN
yunlot_public.tar/yunlot_public.tar


+ 4 - 0
yunlot_public.tar/yunlot_public/.md

@@ -0,0 +1,4 @@
+
+
+# 1、安装 docker
+# 1、

+ 23 - 0
yunlot_public.tar/yunlot_public/Handle/MqttServer/.md

@@ -0,0 +1,23 @@
+###客户端认证:
+####URL: 
+    http://192.168.11.112:8080/authentication
+####请求体:
+    {
+    "clientid": "${clientid}",
+    "password": "${password}",
+    "username": "${username}"
+    }
+
+
+###客户端授权:
+####URL:
+    http://192.168.11.112:8080/Acl
+####请求体:
+    {
+    "action": "${action}",
+    "clientid": "${clientid}",
+    "mountpoint": "${mountpoint}",
+    "peerhost": "${peerhost}",
+    "topic": "${topic}",
+    "username": "${username}"
+    }

+ 1 - 0
yunlot_public.tar/yunlot_public/Handle/MqttServer/PaxHeaders.0/.md

@@ -0,0 +1 @@
+36 path=Handle/MqttServer/配置.md

+ 1 - 0
yunlot_public.tar/yunlot_public/PaxHeaders.0/.md

@@ -0,0 +1 @@
+18 path=说明.md

+ 34 - 0
yunlot_public.tar/yunlot_public/RunCode/.MD

@@ -0,0 +1,34 @@
+
+
+docker pull centos8
+docker run -t -i centos:8 /bin/bash
+
+    cd /etc/yum.repos.d/
+    sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
+    sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
+    yum makecache
+    yum update -y
+    yum install -y wget
+    yum -y install gcc  
+    yum -y install gcc-c++ 
+    wget https://dl.google.com/go/go1.19.1.linux-amd64.tar.gz
+    tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz
+    // echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
+    vim /etc/profile
+
+        #go语言安装主根目录
+        export GOROOT=/usr/local/go #替换你的目录
+        #GOPATH 是自己的go项目路径,自定义设置
+        export GOPATH=/Users/ding/go_workspace #替换你的目录
+        #GOBIN 当我们使用go install命令编译后并且安装的二进制程序目录
+        export GOBIN=$GOPATH/bin
+        # 启用 Go Modules 功能
+        export GO111MODULE=on
+        # 配置 GOPROXY 环境变量
+        export GOPROXY=https://goproxy.cn,direct
+        export PATH=$PATH:$GOROOT/bin:$GOBIN
+
+    source /etc/profile
+
+docker commit 3674ff56646a yunlot-golang:v1.x
+

+ 1 - 0
yunlot_public.tar/yunlot_public/RunCode/PaxHeaders.0/.MD

@@ -0,0 +1 @@
+32 path=RunCode/打包镜像.MD

+ 72 - 0
yunlot_public.tar/yunlot_public/RunCode/README.MD

@@ -0,0 +1,72 @@
+### Cloud-Run-Code
+
+> 在线运行代码
+> 服务依赖docker环境
+> 
+```shell
+    go run main.go --port=端口号 --config=配置文件路径
+```
+
+#### 手动其他添加语言
+编辑`docker_config.json`文件 添加对应 key value 即可
+
+```json
+{
+  "docker_runner": {
+    "go": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "golang:1.18.0-alpine3.15",
+      "cmd": "go run main.go"
+    }  
+  }  
+}
+```
+`docker_runner`字段说明
+
+| 字段名 | 说明 |
+|-------|------|
+| ext | 文件后续 |
+| filename | 容器中运行的文件名 |
+| image | 镜像名 |
+| cmd | 启动容器后运行的命令 |
+
+#### 接口说明
+
+获取所有支持的语言列表
+
+`GET /languages`
+```json
+[
+  "go",
+  "python",
+  "php",
+  "java",
+  "node"
+]
+```
+
+`POST /run?lang={lang}`
+* 参数说明 lang : 为 languages 接口返回的列表
+* 请求体:具体代码
+```json
+{
+  "lang": "{lang}",
+  "message": "execute success",
+  "result": "hello world"
+}
+```
+
+### **Ubuntu**
+Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
+
+
+sudo vim /etc/default/grub
+替换:  GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
+sudo update-grub
+reboot
+
+
+
+
+

+ 1 - 0
yunlot_public.tar/yunlot_public/RunCode/config/PaxHeaders.0/docker_config ().json

@@ -0,0 +1 @@
+51 path=RunCode/config/docker_config (复件).json

+ 36 - 0
yunlot_public.tar/yunlot_public/RunCode/config/docker_config ().json

@@ -0,0 +1,36 @@
+{
+  "timeout": 5,
+  "docker_base": "run -i --cpus=1 -m=512M --rm --network none -v {tmp_file}:/usr/src/myapp/{runner_filename} -w /usr/src/myapp {image} sh -c",
+  "docker_runner": {
+    "php": {
+      "ext": "php",
+      "filename": "app.php",
+      "image": "php:7.4.28-zts-alpine",
+      "cmd": "php app.php"
+    },
+    "node": {
+      "ext": "js",
+      "filename": "app.js",
+      "image": "node:17.8.0-alpine",
+      "cmd": "node app.js"
+    },
+    "python": {
+      "ext": "py",
+      "filename": "app.py",
+      "image": "python:3.9.12-alpine3.15",
+      "cmd":"python app.py"
+    },
+    "java": {
+      "ext": "java",
+      "filename": "Main.java",
+      "image": "openjdk:11-jdk-oraclelinux7",
+      "cmd": "javac Main.java && java Main"
+    },
+    "go": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "golang:1.18.0-alpine3.15",
+      "cmd": "go run main.go"
+    }
+  }
+}

+ 13 - 0
yunlot_public.tar/yunlot_public/RunCode/config/docker_config.json

@@ -0,0 +1,13 @@
+{
+  "timeout": 30,
+  "docker_base": "run -i --cpus=1 -m=512M --rm --network none --mount source=yunlotso,target=/usr/src/myapp/so -v {tmp_file}:/usr/src/myapp/{runner_filename} -w /usr/src/myapp {image} sh -c",
+  "docker_runner": {
+    "Goland": {
+      "ext": "go",
+      "filename": "main.go",
+      "image": "yunlot-golang:v1.5",
+      "cmd": "/usr/local/go/bin/./go run main.go",
+      "build": "/usr/local/go/bin/./go build -buildmode=plugin -o so/{name}.so main.go"
+    }
+  }
+}

+ 31 - 0
yunlot_public.tar/yunlot_public/RunCode/config/main.txt

@@ -0,0 +1,31 @@
+
+func main() {
+
+	// -------------------------------设备->平台
+	T_byte := []byte(T_string)
+	if Data_hex {
+		T_byte, _ = hex.DecodeString(T_string)
+	}
+	// 设备->平台(发送)
+	if len(T_string) != 0{
+		data_ := T(Topic, T_byte)
+		fmt.Print("|-=&" + data_)
+	}else{
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 平台->设备(接收):
+	if len(R_string) != 0{
+		topic_, data_ := R("{$sn}", R_string)
+		fmt.Print("|-=&" + topic_)
+		if Data_hex {
+			fmt.Print("|-=&" + strings.ToUpper(hex.EncodeToString(data_)))
+		}else {
+			fmt.Print("|-=&" + string(data_))
+		}
+
+	}else{
+		fmt.Print("|-=&" + "无参数")
+		fmt.Print("|-=&" + "无参数")
+	}
+	// 返回数据: 1、 设备发送数据解析到平台json     2、topic     3、平台处理后返回给设备数据
+}

+ 10 - 0
yunlot_public.tar/yunlot_public/Z_Build.bat

@@ -0,0 +1,10 @@
+cd %~dp0
+set CGO_ENABLED=0
+set GOARCH=amd64
+set GOOS=linux
+set GOPATH=C:\Users\SIKED\go
+set GO111MODULE=auto
+set GOROOT=C:\Program Files\Go
+
+
+go build -o yunlot_public main.go

+ 15 - 0
yunlot_public.tar/yunlot_public/conf/app.conf

@@ -0,0 +1,15 @@
+appname = Yunlot_public
+httpport = 6001
+runmode = dev
+
+# 数据解析加载目录
+Analysis_Dir = "/var/lib/docker/volumes/yunlotso/_data/"
+
+
+# Mysql
+MysqlServer_UrlPort = "127.0.0.1:3306"
+MysqlServer_Database = "yunlot_public"
+MysqlServer_Username = "Yunlot_public"
+MysqlServer_Password = "tmAbdx7TMkyP8ECJ"
+MysqlServer_MaxIdleConnections = 10
+MysqlServer_MaxOpenConnections = 200

+ 0 - 0
yunlot_public.tar/yunlot_public/logs/Data/logx.log


+ 0 - 0
yunlot_public.tar/yunlot_public/logs/Mqtt/logx.log


+ 0 - 0
yunlot_public.tar/yunlot_public/logs/Orm/logx.log


+ 1 - 0
yunlot_public.tar/yunlot_public/logs/logx/logx.log

@@ -0,0 +1 @@
+2023/11/07 15:33:20.471 [I]  {"key":"ProductProt","conn":"127.0.0.1:6379","dbNum":"1","password":""}%!(EXTRA []interface {}=[])

+ 0 - 0
yunlot_public.tar/yunlot_public/logs/logxE/logx.log


+ 11 - 0
yunlot_public.tar/yunlot_public/tests/C/hello.c

@@ -0,0 +1,11 @@
+#include "hello.h"
+#include <stdio.h>
+
+
+void sayHello() {
+    printf("Welcome to the C World!\n");
+}
+
+int sum(int a,int b){
+    return (a+b);
+}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.