complete role crud
This commit is contained in:
13
common/err/common.go
Normal file
13
common/err/common.go
Normal 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
6
common/request/page.go
Normal 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
6
common/response/page.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package response
|
||||
|
||||
type PageResponse[T any] struct {
|
||||
Items []T `json:"items,omitempty"`
|
||||
Total uint64 `json:"total,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user