Student-Management-System-Backend icon indicating copy to clipboard operation
Student-Management-System-Backend copied to clipboard

Golang 练手项目。一个简易学生管理系统,仅后端。

Results 1 Student-Management-System-Backend issues
Sort by recently updated
recently updated
newest added

根据id查询学院的接口, /api/v1/departments, 未对 id 值进行校验,请求如 http://127.0.0.1:3000/api/v1/departments/-,会继续查询数据库并退出程序,fix如下: // 对已经转换的string再尝试反转换成float64,防止输入非整数数据 _, erro := strconv.ParseFloat(id, 64) if erro != nil { result = gin.H{ "status": "failed", "data": "参数错误", } c.JSON(http.StatusBadRequest, result) return }