-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Update codebase from v2.7.8 to v2.7.9.
+ Update translations.
- Loading branch information
Showing
88 changed files
with
3,253 additions
and
1,778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package example | ||
|
||
import ( | ||
"github.com/flipped-aurora/gin-vue-admin/server/global" | ||
common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" | ||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response" | ||
"github.com/flipped-aurora/gin-vue-admin/server/model/example" | ||
"github.com/gin-gonic/gin" | ||
"go.uber.org/zap" | ||
) | ||
|
||
type AttachmentCategoryApi struct{} | ||
|
||
// GetCategoryList | ||
// @Tags GetCategoryList | ||
// @Summary 媒体库分类列表 | ||
// @Security AttachmentCategory | ||
// @Produce application/json | ||
// @Success 200 {object} response.Response{data=example.ExaAttachmentCategory,msg=string} "媒体库分类列表" | ||
// @Router /attachmentCategory/getCategoryList [get] | ||
func (a *AttachmentCategoryApi) GetCategoryList(c *gin.Context) { | ||
res, err := attachmentCategoryService.GetCategoryList() | ||
if err != nil { | ||
global.GVA_LOG.Error("获取分类列表失败!", zap.Error(err)) | ||
response.FailWithMessage("获取分类列表失败", c) | ||
return | ||
} | ||
response.OkWithData(res, c) | ||
} | ||
|
||
// AddCategory | ||
// @Tags AddCategory | ||
// @Summary 添加媒体库分类 | ||
// @Security AttachmentCategory | ||
// @accept application/json | ||
// @Produce application/json | ||
// @Param data body example.ExaAttachmentCategory true "媒体库分类数据"// @Success 200 {object} response.Response{msg=string} "添加媒体库分类" | ||
// @Router /attachmentCategory/addCategory [post] | ||
func (a *AttachmentCategoryApi) AddCategory(c *gin.Context) { | ||
var req example.ExaAttachmentCategory | ||
if err := c.ShouldBindJSON(&req); err != nil { | ||
global.GVA_LOG.Error("参数错误!", zap.Error(err)) | ||
response.FailWithMessage("参数错误", c) | ||
return | ||
} | ||
|
||
if err := attachmentCategoryService.AddCategory(&req); err != nil { | ||
global.GVA_LOG.Error("创建/更新失败!", zap.Error(err)) | ||
response.FailWithMessage("创建/更新失败:"+err.Error(), c) | ||
return | ||
} | ||
response.OkWithMessage("创建/更新成功", c) | ||
} | ||
|
||
// DeleteCategory | ||
// @Tags DeleteCategory | ||
// @Summary 删除分类 | ||
// @Security AttachmentCategory | ||
// @accept application/json | ||
// @Produce application/json | ||
// @Param data body common.GetById true "分类id" | ||
// @Success 200 {object} response.Response{msg=string} "删除分类" | ||
// @Router /attachmentCategory/deleteCategory [post] | ||
func (a *AttachmentCategoryApi) DeleteCategory(c *gin.Context) { | ||
var req common.GetById | ||
if err := c.ShouldBindJSON(&req); err != nil { | ||
response.FailWithMessage("参数错误", c) | ||
return | ||
} | ||
|
||
if req.ID == 0 { | ||
response.FailWithMessage("参数错误", c) | ||
return | ||
} | ||
|
||
if err := attachmentCategoryService.DeleteCategory(&req.ID); err != nil { | ||
response.FailWithMessage("删除失败", c) | ||
return | ||
} | ||
|
||
response.OkWithMessage("删除成功", c) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.