From fc91703f3cbee4dac9e56c3da694fccb386f4ce3 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期三, 29 七月 2020 19:30:54 +0800 Subject: [PATCH] add showInstallInfo --- controllers/sdk.go | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/controllers/sdk.go b/controllers/sdk.go index d236603..3327309 100644 --- a/controllers/sdk.go +++ b/controllers/sdk.go @@ -275,6 +275,26 @@ } // @Security ApiKeyAuth +// @Summary 涓婁紶瀹屾垚鑾峰彇瀹夎淇℃伅 +// @Description 涓婁紶瀹屾垚鑾峰彇瀹夎淇℃伅 +// @Produce json +// @Tags 绠楁硶 +// @Param identifier formData string true "鏁翠釜鏂囦欢鐨勫敮涓�鏍囪瘑锛岀洰鍓嶆槸md5" +// @Success 200 {string} json "{"code":200, msg:"", success:true}" +// @Failure 500 {string} json "{"code":500, msg:"", success:false}" +// @Router /data/api-v/sdk/showInstallInfo [post] +func (sc SdkController) ShowInstallInfo(c *gin.Context) { + identifier := c.Request.FormValue("identifier") + var sv service.SdkInstallService + b,d := sv.ShowInstallInfo(identifier) + if b { + util.ResponseFormat(c,code.Success, d) + } else { + util.ResponseFormat(c,code.ComError, "鑾峰彇澶辫触") + } +} + +// @Security ApiKeyAuth // @Summary 涓婁紶瀹屾垚寮�濮嬪畨瑁� // @Description 涓婁紶瀹屾垚寮�濮嬪畨瑁� // @Produce json @@ -327,19 +347,21 @@ // @Produce json // @Tags 绠楁硶 // @Param code query string true "婵�娲荤爜" +// @Param sdkId query string true "绠楁硶id" // @Success 200 {string} json "{"code":200, msg:"", success:true}" // @Failure 500 {string} json "{"code":500, msg:"", success:false}" // @Router /data/api-v/sdk/active [get] func (sc SdkController) Active(c *gin.Context) { cod := c.GetString("code") - if cod == "" { - util.ResponseFormat(c, code.RequestParamError, "婵�娲荤爜涓嶈兘涓虹┖") + sdkId := c.GetString("sdkId") + if cod == "" || sdkId == "" { + util.ResponseFormat(c, code.RequestParamError, "婵�娲荤爜鍜岀畻娉昳d涓嶈兘涓虹┖") return } var sv service.SdkInstallService - err := sv.Active(cod) + d, err := sv.Active(cod, sdkId) if err == nil { - util.ResponseFormat(c,code.Success, "婵�娲绘垚鍔�") + util.ResponseFormat(c,code.Success, d) } else { util.ResponseFormat(c,code.ComError, err.Error()) } -- Gitblit v1.8.0