修改功能查找接口

This commit is contained in:
junleea 2025-03-24 13:52:23 +08:00
parent d1a2ab79c9
commit 5bb65f7d42
1 changed files with 1 additions and 3 deletions

View File

@ -53,15 +53,13 @@ func FindFuncModel(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{"code": proto.SuccessCode, "message": "success", "data": funcModels})
} else if req.ModelID != 0 {
} else {
funcModels, err3 := service.FindFuncModelByUserID(userID)
if err3 != nil {
c.JSON(http.StatusOK, gin.H{"error": err3.Error(), "code": proto.FuncModelSearchFailed, "message": "failed"})
return
}
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 {
c.JSON(http.StatusOK, gin.H{"error": err.Error(), "code": proto.ParameterError, "message": "failed"})