| | |
| | | |
| | | 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, ¶ms) |
| | | if !ok { |
| | |
| | | // @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, ¶ms) |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/device/set": { |
| | | "/v1/device/setCurrentDeviceId": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/task/listByChannel": { |
| | | "/v1/task/list": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/device/set": { |
| | | "/v1/device/setCurrentDeviceId": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/task/listByChannel": { |
| | | "/v1/task/list": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | summary: 获取当前面板绑定的设备列表 |
| | | tags: |
| | | - Device |
| | | /v1/device/set: |
| | | /v1/device/setCurrentDeviceId: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | |
| | | summary: 获取任务 |
| | | tags: |
| | | - Task |
| | | /v1/task/listByChannel: |
| | | /v1/task/list: |
| | | get: |
| | | parameters: |
| | | - description: 通道号。不传取全部的 |
| | |
| | | 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") |
| | | //{ |