From 372e5032b10eddc00b7a87a862a71dea6705609c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 01 十一月 2023 10:58:15 +0800
Subject: [PATCH] update doc

---
 router/index.go   |    7 +++++++
 docs/swagger.yaml |    4 ++--
 api/v1/device.go  |    6 +++---
 docs/docs.go      |    4 ++--
 api/v1/task.go    |    2 +-
 docs/swagger.json |    4 ++--
 6 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/api/v1/device.go b/api/v1/device.go
index ab7f965..02cf81b 100644
--- a/api/v1/device.go
+++ b/api/v1/device.go
@@ -16,14 +16,14 @@
 
 type DeviceApi struct{}
 
-// Set
+// SetCurrentDeviceId
 // @Tags      璁惧
 // @Summary   璁剧疆褰撳墠璁惧id
 // @Produce   application/json
 // @Param     object  body    request.SetCurrentDevice true  "鏌ヨ鍙傛暟"
 // @Success   200   {object}  contextx.Response{}  "鎴愬姛"
-// @Router    /v1/device/set [post]
-func (slf *DeviceApi) Set(c *gin.Context) {
+// @Router    /v1/device/setCurrentDeviceId [post]
+func (slf *DeviceApi) SetCurrentDeviceId(c *gin.Context) {
 	var params request.SetCurrentDevice
 	ctx, ok := contextx.NewContext(c, &params)
 	if !ok {
diff --git a/api/v1/task.go b/api/v1/task.go
index eadab62..26cfb2d 100644
--- a/api/v1/task.go
+++ b/api/v1/task.go
@@ -420,7 +420,7 @@
 // @Produce   application/json
 // @Param     object  query    request.TaskListByChannel true  "鏌ヨ鍙傛暟"
 // @Success   200   {object}  contextx.Response{data=map[int32]response.TaskResponse}  "鎴愬姛"
-// @Router    /v1/task/listByChannel [get]
+// @Router    /v1/task/list [get]
 func (slf *TaskApi) TaskListByChannel(c *gin.Context) {
 	var params request.TaskListByChannel
 	ctx, ok := contextx.NewContext(c, &params)
diff --git a/docs/docs.go b/docs/docs.go
index 6e7c7ed..aee4b02 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -183,7 +183,7 @@
                 }
             }
         },
-        "/v1/device/set": {
+        "/v1/device/setCurrentDeviceId": {
             "post": {
                 "produces": [
                     "application/json"
@@ -587,7 +587,7 @@
                 }
             }
         },
-        "/v1/task/listByChannel": {
+        "/v1/task/list": {
             "get": {
                 "produces": [
                     "application/json"
diff --git a/docs/swagger.json b/docs/swagger.json
index 98ed7bf..6aaa0b4 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -171,7 +171,7 @@
                 }
             }
         },
-        "/v1/device/set": {
+        "/v1/device/setCurrentDeviceId": {
             "post": {
                 "produces": [
                     "application/json"
@@ -575,7 +575,7 @@
                 }
             }
         },
-        "/v1/task/listByChannel": {
+        "/v1/task/list": {
             "get": {
                 "produces": [
                     "application/json"
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index c2bc840..1e7659c 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -690,7 +690,7 @@
       summary: 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛�
       tags:
       - Device
-  /v1/device/set:
+  /v1/device/setCurrentDeviceId:
     post:
       parameters:
       - description: 鏌ヨ鍙傛暟
@@ -937,7 +937,7 @@
       summary: 鑾峰彇浠诲姟
       tags:
       - Task
-  /v1/task/listByChannel:
+  /v1/task/list:
     get:
       parameters:
       - description: 閫氶亾鍙枫�備笉浼犲彇鍏ㄩ儴鐨�
diff --git a/router/index.go b/router/index.go
index 09d6b40..f046b22 100644
--- a/router/index.go
+++ b/router/index.go
@@ -68,6 +68,13 @@
 		processModelGroup.GET("list", processModelApi.List) // 宸ヨ壓鍙傛暟鍒楄〃
 	}
 
+	deviceApi := new(v1.DeviceApi)
+	deviceGroup := v1Group.Group("device")
+	{
+		deviceGroup.GET("list", deviceApi.DeviceList)                       // 鍙�夎澶囧垪琛�
+		deviceGroup.GET("setCurrentDeviceId", deviceApi.SetCurrentDeviceId) // 鍒囨崲璁惧ID
+	}
+
 	//eventsApi := new(v1.EventsApi)
 	//eventsGroup := v1Group.Group("events")
 	//{

--
Gitblit v1.8.0