yinbentan
2024-06-28 1003bcc738159a9dd0dbc0934279ed94a1a72535
controllers/department.go
@@ -16,12 +16,13 @@
type DepartmentController struct{}
// Add
// @Tags      部门信息
// @Summary   添加部门信息
// @Produce   application/json
// @Param     object  body  request.AddDepartment true  "部门信息信息"
// @Success   200 {object} util.Response "成功"
// @Router    /api-s/v1/organize/department [post]
//
//   @Tags      部门信息
//   @Summary   添加部门信息
//   @Produce   application/json
//   @Param      object   body      request.AddDepartment   true   "部门信息信息"
//   @Success   200      {object}   util.Response         "成功"
//   @Router      /api-wms/v1/organize/department [post]
func (slf DepartmentController) Add(c *gin.Context) {
   var reqParams request.AddDepartment
   var params models.Department
@@ -47,12 +48,13 @@
}
// Update
// @Tags      部门信息
// @Summary   编辑部门信息
// @Produce   application/json
// @Param     object  body request.UpdateDepartment true  "部门信息信息"
// @Success   200 {object} util.Response "成功"
// @Router    /api-s/v1/organize/department/{id} [put]
//
//   @Tags      部门信息
//   @Summary   编辑部门信息
//   @Produce   application/json
//   @Param      object   body      request.UpdateDepartment   true   "部门信息信息"
//   @Success   200      {object}   util.Response            "成功"
//   @Router      /api-wms/v1/organize/department/{id} [put]
func (slf DepartmentController) Update(c *gin.Context) {
   idStr := c.Param("id")
   if idStr == "0" || idStr == "" {
@@ -136,12 +138,13 @@
}
// List
// @Tags      部门信息
// @Summary   查询部门信息列表
// @Produce   application/json
// @Param     object  query    request.GetDepartmentList true  "查询参数"
// @Success   200   {object}  util.ResponseList{data=[]models.Department}  "成功"
// @Router    /api-s/v1/organize/department [get]
//
//   @Tags      部门信息
//   @Summary   查询部门信息列表
//   @Produce   application/json
//   @Param      object   query      request.GetDepartmentList               true   "查询参数"
//   @Success   200      {object}   util.ResponseList{data=[]models.Department}   "成功"
//   @Router      /api-wms/v1/organize/department [get]
func (slf DepartmentController) List(c *gin.Context) {
   var params request.GetDepartmentList
   if err := c.ShouldBindQuery(&params); err != nil {
@@ -177,12 +180,13 @@
}
// Delete
// @Tags      部门信息
// @Summary   编辑部门信息
// @Produce   application/json
// @Param     object  body request.UpdateDepartment true  "部门信息信息"
// @Success   200 {object} util.Response "成功"
// @Router    /api-s/v1/organize/department/{id} [delete]
//
//   @Tags      部门信息
//   @Summary   编辑部门信息
//   @Produce   application/json
//   @Param      object   body      request.UpdateDepartment   true   "部门信息信息"
//   @Success   200      {object}   util.Response            "成功"
//   @Router      /api-wms/v1/organize/department/{id} [delete]
func (slf DepartmentController) Delete(c *gin.Context) {
   idStr := c.Param("id")
   if idStr == "0" || idStr == "" {