Commit 7df494af by 杨树贤

修改忽略

parent da52d17e
...@@ -2,5 +2,5 @@ LC_spapi.* ...@@ -2,5 +2,5 @@ LC_spapi.*
/.idea /.idea
/.vscode /.vscode
/logs /logs
/*.exe LC_soapi.exe
/*.exe~ LC_soapi.exe~
\ No newline at end of file \ No newline at end of file
The file could not be displayed because it is too large.
The file could not be displayed because it is too large.
...@@ -4,6 +4,7 @@ RUN_MODE = debug ...@@ -4,6 +4,7 @@ RUN_MODE = debug
[app] [app]
PAGE_SIZE = 10 PAGE_SIZE = 10
JWT_SECRET = 23347$040412 JWT_SECRET = 23347$040412
Name = 搜索接口
[server] [server]
HttpPort = 8000 HttpPort = 8000
......
...@@ -8,11 +8,13 @@ require ( ...@@ -8,11 +8,13 @@ require (
github.com/go-ini/ini v1.51.1 github.com/go-ini/ini v1.51.1
github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-redis/redis/v7 v7.0.0-beta.5 github.com/go-redis/redis/v7 v7.0.0-beta.5
github.com/ichunt2019/logger v1.0.5
github.com/json-iterator/go v1.1.9 // indirect github.com/json-iterator/go v1.1.9 // indirect
github.com/leodido/go-urn v1.2.0 // indirect github.com/leodido/go-urn v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect github.com/mattn/go-isatty v0.0.11 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/syyongx/php2go v0.9.4
golang.org/x/sys v0.0.0-20200102141924-c96a22e43c9c // indirect golang.org/x/sys v0.0.0-20200102141924-c96a22e43c9c // indirect
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
gopkg.in/yaml.v2 v2.2.7 // indirect gopkg.in/yaml.v2 v2.2.7 // indirect
......
...@@ -58,6 +58,8 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ ...@@ -58,6 +58,8 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ichunt2019/logger v1.0.5 h1:85C6kJCH9xlbLt1VmwHp/8iScm+bIlenK6nanWwwq/o=
github.com/ichunt2019/logger v1.0.5/go.mod h1:5IWMrrqJIWwOIGav9ACWOI+KOuYeteUvOei4zubclwg=
github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64 h1:8I4kQ5M5OjZKNsgRUs20soTdIoo1GbiGApV31kJ9e6Y= github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64 h1:8I4kQ5M5OjZKNsgRUs20soTdIoo1GbiGApV31kJ9e6Y=
github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc= github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc=
...@@ -110,6 +112,8 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy ...@@ -110,6 +112,8 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/swaggo/gin-swagger v1.0.1-0.20190110070702-0c6fcfd3c7f3/go.mod h1:FQlm07YuT1glfN3hQiO11UQ2m39vOCZ/aa3WWr5E+XU= github.com/swaggo/gin-swagger v1.0.1-0.20190110070702-0c6fcfd3c7f3/go.mod h1:FQlm07YuT1glfN3hQiO11UQ2m39vOCZ/aa3WWr5E+XU=
github.com/swaggo/swag v1.4.0/go.mod h1:hog2WgeMOrQ/LvQ+o1YGTeT+vWVrbi0SiIslBtxKTyM= github.com/swaggo/swag v1.4.0/go.mod h1:hog2WgeMOrQ/LvQ+o1YGTeT+vWVrbi0SiIslBtxKTyM=
github.com/syyongx/php2go v0.9.4 h1:qUtETTHzqHzxZK8plkbkb0YawD8bpLpxNsbzHQmb22Y=
github.com/syyongx/php2go v0.9.4/go.mod h1:meN2eIhhUoxOd2nMxbpe8g6cFPXI5O9/UAAuz7oDdzw=
github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893 h1:x+HNL/+eUTIzieDdCKbl6QjneUXKuiiTBvC9s5USpT0= github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893 h1:x+HNL/+eUTIzieDdCKbl6QjneUXKuiiTBvC9s5USpT0=
github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893/go.mod h1:uxu5UY2ovkuRPWKQ8Q7JG0JbSivrISjdPzZQKeo74mA= github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893/go.mod h1:uxu5UY2ovkuRPWKQ8Q7JG0JbSivrISjdPzZQKeo74mA=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
......
...@@ -2,6 +2,7 @@ package main ...@@ -2,6 +2,7 @@ package main
import ( import (
"LC_soapi/pkg/gredis" "LC_soapi/pkg/gredis"
"LC_soapi/pkg/logger"
"LC_soapi/pkg/setting" "LC_soapi/pkg/setting"
"LC_soapi/routers" "LC_soapi/routers"
"fmt" "fmt"
...@@ -13,6 +14,7 @@ import ( ...@@ -13,6 +14,7 @@ import (
func init() { func init() {
setting.Setup() setting.Setup()
gredis.Setup() gredis.Setup()
logger.Setup()
} }
func main() { func main() {
......
package logger package logger
import (
"time"
)
type ErrorLog struct {
Msg string
FileName string
LineNo int
Code int
Method string
TimeStamp int
DateTimeStr string
App string
ServerIp string
}
//上报请求日志
func ReportErrorLog(msg string,code int) {
var errLog ErrorLog
errLog.TimeStamp = int(time.Now().Unix())
errLog.DateTimeStr = time.Now().Format("2006-01-02 15:04:05")
errLog.App = "Search"
errLog.ServerIp = "2123"
}
package api package api
import ( import (
"LC_soapi/pkg/gredis" "LC_soapi/service/self_service"
"fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
//Search 自营搜索 //Search 自营搜索
func Search(c *gin.Context) { func Search(c *gin.Context) {
brands, err := gredis.HGet("LC_Self_Brand1","5423") //先去处理请求参数
if err != nil { params := self_service.GetSearchParams(c)
c.JSON(500,err) fmt.Println(params)
return
}
c.JSON(200,brands) c.JSON(200, nil)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment