complete role crud

This commit is contained in:
yanghao05
2023-02-04 19:54:29 +08:00
parent 2fb6bba903
commit 285e1f1c51
13 changed files with 270 additions and 19 deletions

13
common/err/common.go Normal file
View File

@@ -0,0 +1,13 @@
package err
import (
"net/http"
"github.com/rogeecn/gen"
)
var (
BindBodyFailed = gen.NewBusError(http.StatusBadRequest, http.StatusBadRequest, "Body参数错误")
BindQueryFailed = gen.NewBusError(http.StatusBadRequest, http.StatusBadRequest, "Query参数错误")
BindPathFailed = gen.NewBusError(http.StatusBadRequest, http.StatusBadRequest, "Path参数错误: %s")
)

6
common/request/page.go Normal file
View File

@@ -0,0 +1,6 @@
package request
type PageFilter struct {
Page uint64 `form:"page"`
Limit uint64 `form:"limit"`
}

6
common/response/page.go Normal file
View File

@@ -0,0 +1,6 @@
package response
type PageResponse[T any] struct {
Items []T `json:"items,omitempty"`
Total uint64 `json:"total,omitempty"`
}