huangyan 1 рік тому
батько
коміт
b66e16c3fa

+ 30 - 30
docs/docs.go

@@ -15,36 +15,6 @@ const docTemplate = `{
     "host": "{{.Host}}",
     "basePath": "{{.BasePath}}",
     "paths": {
-        "/app/address/add": {
-            "post": {
-                "consumes": [
-                    "application/json"
-                ],
-                "tags": [
-                    "公共接口"
-                ],
-                "summary": "设备数据列表",
-                "parameters": [
-                    {
-                        "description": "请求参数",
-                        "name": "req",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/swagger.SnDataListReqVO"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "成功响应的结构体",
-                        "schema": {
-                            "$ref": "#/definitions/swagger.PageListResponse"
-                        }
-                    }
-                }
-            }
-        },
         "/app/auth/login": {
             "post": {
                 "consumes": [
@@ -204,6 +174,36 @@ const docTemplate = `{
                 }
             }
         },
+        "/app/common/sensorDataList": {
+            "get": {
+                "consumes": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "设备数据列表",
+                "parameters": [
+                    {
+                        "description": "请求参数",
+                        "name": "req",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/swagger.SnDataListReqVO"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "成功响应的结构体",
+                        "schema": {
+                            "$ref": "#/definitions/swagger.PageListResponse"
+                        }
+                    }
+                }
+            }
+        },
         "/app/driver/carInfo": {
             "post": {
                 "consumes": [

+ 30 - 30
docs/swagger.json

@@ -4,36 +4,6 @@
         "contact": {}
     },
     "paths": {
-        "/app/address/add": {
-            "post": {
-                "consumes": [
-                    "application/json"
-                ],
-                "tags": [
-                    "公共接口"
-                ],
-                "summary": "设备数据列表",
-                "parameters": [
-                    {
-                        "description": "请求参数",
-                        "name": "req",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/swagger.SnDataListReqVO"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "成功响应的结构体",
-                        "schema": {
-                            "$ref": "#/definitions/swagger.PageListResponse"
-                        }
-                    }
-                }
-            }
-        },
         "/app/auth/login": {
             "post": {
                 "consumes": [
@@ -193,6 +163,36 @@
                 }
             }
         },
+        "/app/common/sensorDataList": {
+            "get": {
+                "consumes": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "设备数据列表",
+                "parameters": [
+                    {
+                        "description": "请求参数",
+                        "name": "req",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/swagger.SnDataListReqVO"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "成功响应的结构体",
+                        "schema": {
+                            "$ref": "#/definitions/swagger.PageListResponse"
+                        }
+                    }
+                }
+            }
+        },
         "/app/driver/carInfo": {
             "post": {
                 "consumes": [

+ 19 - 19
docs/swagger.yaml

@@ -881,25 +881,6 @@ definitions:
 info:
   contact: {}
 paths:
-  /app/address/add:
-    post:
-      consumes:
-      - application/json
-      parameters:
-      - description: 请求参数
-        in: body
-        name: req
-        required: true
-        schema:
-          $ref: '#/definitions/swagger.SnDataListReqVO'
-      responses:
-        "200":
-          description: 成功响应的结构体
-          schema:
-            $ref: '#/definitions/swagger.PageListResponse'
-      summary: 设备数据列表
-      tags:
-      - 公共接口
   /app/auth/login:
     post:
       consumes:
@@ -1001,6 +982,25 @@ paths:
       summary: 省市区列表
       tags:
       - 公共接口
+  /app/common/sensorDataList:
+    get:
+      consumes:
+      - application/json
+      parameters:
+      - description: 请求参数
+        in: body
+        name: req
+        required: true
+        schema:
+          $ref: '#/definitions/swagger.SnDataListReqVO'
+      responses:
+        "200":
+          description: 成功响应的结构体
+          schema:
+            $ref: '#/definitions/swagger.PageListResponse'
+      summary: 设备数据列表
+      tags:
+      - 公共接口
   /app/driver/carInfo:
     post:
       consumes:

+ 1 - 0
go.sum

@@ -162,6 +162,7 @@ github.com/gin-contrib/pprof v1.4.0 h1:XxiBSf5jWZ5i16lNOPbMTVdgHBdhfGRD5PZ1LWazz
 github.com/gin-contrib/pprof v1.4.0/go.mod h1:RrehPJasUVBPK6yTUwOl8/NP6i0vbUgmxtis+Z5KE90=
 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.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
 github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U=
 github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
 github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=

+ 0 - 1
internal/server/adapter/adapter.go

@@ -20,7 +20,6 @@ func HttpRoutes() func(r *gin.Engine) {
 	return func(r *gin.Engine) {
 		//Swagger文档
 		swagger.RegisterSwagger(r)
-
 		// 用户端
 		app := r.Group("/clodLogistic/api/v1/app")
 		auth.Register(app)

+ 2 - 8
internal/server/adapter/http/v1/common/api.go

@@ -30,11 +30,9 @@ func NewApi() Api {
 
 // provinceList
 // @Tags 公共接口
-// @BasePath /clodLogistic/app/api/v1
 // @Summary 省市区列表
 // @Success 200 {object}  commonsrv.ProvinceListRespVO "成功响应的结构体"
 // @Accept application/json
-// @Authorization
 // @Router /app/common/provinceList [get]
 func (api Api) provinceList(c *gin.Context) {
 	srv := commonsrv.NewCommonService(dao.NewDataStore(global.CommonConnectRepoInst.StoreDB))
@@ -48,13 +46,11 @@ func (api Api) provinceList(c *gin.Context) {
 
 // sensorDataList
 // @Tags 公共接口
-// @BasePath /clodLogistic/app/api/v1
 // @Summary 设备数据列表
 // @Success 200 {object}  swagger.PageListResponse "成功响应的结构体"
-// @Param  req body swagger.SnDataListReqVO true "请求参数"
+// @Param  req body  swagger.SnDataListReqVO true "请求参数"
 // @Accept application/json
-// @Authorization Bearer
-// @Router /app/address/add [post]
+// @Router /app/common/sensorDataList [get]
 func (api Api) sensorDataList(c *gin.Context) {
 	req := devicesrv.SnDataListReqVO{}
 	if err := c.BindJSON(&req); err != nil {
@@ -78,12 +74,10 @@ func (api Api) sensorDataList(c *gin.Context) {
 
 // logisticList
 // @Tags 公共接口
-// @BasePath /clodLogistic/app/api/v1
 // @Summary 物流公司列表
 // @Success 200 {object}  swagger.PageListResponse "成功响应的结构体"
 // @Param  req body swagger.LogisticListReqVO true "请求参数"
 // @Accept application/json
-// @Authorization Bearer
 // @Router /app/common/logisticList [get]
 func (api Api) logisticList(c *gin.Context) {
 	req := commonsrv.LogisticListReqVO{}

+ 0 - 5
internal/server/adapter/http/v1/swagger/swagger.go

@@ -7,11 +7,6 @@ import (
 	ginSwagger "github.com/swaggo/gin-swagger"
 )
 
-// swagger1.go
-type SwaggerDocV1 struct {
-	BasePath string `json:"basePath"`
-}
-
 // RegisterSwagger 注册Swagger
 func RegisterSwagger(r *gin.Engine) {
 	// API文档访问地址: http://host/swagger/index.html