修改功能查找接口
This commit is contained in:
parent
d1a2ab79c9
commit
5bb65f7d42
|
|
@ -53,15 +53,13 @@ func FindFuncModel(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "message": "success", "data": funcModels})
|
c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "message": "success", "data": funcModels})
|
||||||
} else if req.ModelID != 0 {
|
} else {
|
||||||
funcModels, err3 := service.FindFuncModelByUserID(userID)
|
funcModels, err3 := service.FindFuncModelByUserID(userID)
|
||||||
if err3 != nil {
|
if err3 != nil {
|
||||||
c.JSON(http.StatusOK, gin.H{"error": err3.Error(), "code": proto.FuncModelSearchFailed, "message": "failed"})
|
c.JSON(http.StatusOK, gin.H{"error": err3.Error(), "code": proto.FuncModelSearchFailed, "message": "failed"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "message": "success", "data": funcModels})
|
c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "message": "success", "data": funcModels})
|
||||||
} else {
|
|
||||||
c.JSON(http.StatusOK, gin.H{"error": "type error", "code": proto.FuncModelSearchFailed, "message": "failed"})
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
c.JSON(http.StatusOK, gin.H{"error": err.Error(), "code": proto.ParameterError, "message": "failed"})
|
c.JSON(http.StatusOK, gin.H{"error": err.Error(), "code": proto.ParameterError, "message": "failed"})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue