调整路由以符合 RESTful 规范,新增 API Token 撤销功能
This commit is contained in:
@@ -97,7 +97,7 @@ func (h *BatchHandler) ListBatches(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Success 200 {object} model.Response{data=model.FileBatch}
|
||||
// @Failure 404 {object} model.Response
|
||||
// @Router /admin/batch/{batch_id} [get]
|
||||
// @Router /admin/batches/{batch_id} [get]
|
||||
func (h *BatchHandler) GetBatch(c *gin.Context) {
|
||||
id := c.Param("batch_id")
|
||||
var batch model.FileBatch
|
||||
@@ -119,7 +119,7 @@ func (h *BatchHandler) GetBatch(c *gin.Context) {
|
||||
// @Param request body UpdateBatchRequest true "修改内容"
|
||||
// @Success 200 {object} model.Response{data=model.FileBatch}
|
||||
// @Failure 400 {object} model.Response
|
||||
// @Router /admin/batch/{batch_id} [put]
|
||||
// @Router /admin/batches/{batch_id} [put]
|
||||
func (h *BatchHandler) UpdateBatch(c *gin.Context) {
|
||||
id := c.Param("batch_id")
|
||||
var batch model.FileBatch
|
||||
@@ -159,7 +159,7 @@ func (h *BatchHandler) UpdateBatch(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Success 200 {object} model.Response
|
||||
// @Failure 500 {object} model.Response
|
||||
// @Router /admin/batch/{batch_id} [delete]
|
||||
// @Router /admin/batches/{batch_id} [delete]
|
||||
func (h *BatchHandler) DeleteBatch(c *gin.Context) {
|
||||
idStr := c.Param("batch_id")
|
||||
id, _ := strconv.ParseUint(idStr, 10, 32)
|
||||
|
||||
Reference in New Issue
Block a user