zhangqian
2023-11-01 372e5032b10eddc00b7a87a862a71dea6705609c
update doc
6个文件已修改
27 ■■■■■ 已修改文件
api/v1/device.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/task.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/index.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 {
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)
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"
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"
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: 通道号。不传取全部的
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")
    //{