From 41ac67f13587ff76631167d6050c3f27f7b97c2a Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期二, 15 十月 2019 18:55:21 +0800
Subject: [PATCH] rm no use config
---
controllers/task.go | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/controllers/task.go b/controllers/task.go
index ccd33ca..f27e9d0 100644
--- a/controllers/task.go
+++ b/controllers/task.go
@@ -256,7 +256,7 @@
func (tc TaskController) SaveTaskSdkRule(c *gin.Context) {
var rules TaskSdkRules
err := c.BindJSON(&rules)
- if err !=nil {
+ if err !=nil || rules.TaskId == "" || rules.SdkId == "" || len(rules.Rules) == 0 {
util.ResponseFormat(c,code.RequestParamError,"鍙傛暟鏈夎")
return
}
@@ -277,15 +277,16 @@
// @Param id query string true "id"
// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}"
// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}"
-// @Router /data/api-v/task/deleteTaskSdkRuleById [post]
-func (tc TaskController) DeleteTaskSdkRuleById(c *gin.Context) {
- id := c.PostForm("id")
- if id == "" {
+// @Router /data/api-v/task/deleteTaskSdkRule [post]
+func (tc TaskController) DeleteTaskSdkRule(c *gin.Context) {
+ taskId := c.PostForm("taskId")
+ sdkId := c.PostForm("sdkId")
+ if taskId == "" || sdkId == "" {
util.ResponseFormat(c,code.RequestParamError,"鍙傛暟鏈夎")
return
}
var api dbapi.TaskSdkRuleApi
- if api.DeleteTaskSdkRuleById(id) {
+ if api.DeleteTaskSdkRule(taskId, sdkId) {
util.ResponseFormat(c,code.Success,"鍒犻櫎鎴愬姛")
} else {
util.ResponseFormat(c,code.ComError, "鍒犻櫎澶辫触")
--
Gitblit v1.8.0