From 9852e9aa54408c29e05dbcd603a10ffc09acd40b Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 09 十一月 2023 14:02:16 +0800 Subject: [PATCH] 增加设置是否跳过设置工艺参数接口 --- api/v1/device.go | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/api/v1/device.go b/api/v1/device.go index 6f16b3a..eb079eb 100644 --- a/api/v1/device.go +++ b/api/v1/device.go @@ -56,6 +56,32 @@ ctx.Ok() } +// SetDeviceConfig +// @Tags 璁惧 +// @Summary 璁剧疆璁惧涓�浜涢厤缃� +// @Produce application/json +// @Param object body request.DeviceConfig true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} "鎴愬姛" +// @Router /v1/device/config [post] +func (slf *DeviceApi) config(c *gin.Context) { + var params request.DeviceConfig + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + if conf.Conf.CurrentDeviceID == "" { + ctx.FailWithMsg(ecode.UnknownErr, "褰撳墠璁惧涓虹┖锛岃妫�鏌�") + return + } + err := service.UpdateDevice(conf.Conf.CurrentDeviceID, params.NeedSetProcessParams) + if err != nil { + logx.Errorf("save device config err:%v", err) + ctx.Fail(ecode.DBErr) + return + } + ctx.Ok() +} + // DeviceList // @Tags 璁惧 // @Summary 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛� -- Gitblit v1.8.0