You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
580 B
25 lines
580 B
// Code scaffolded by goctl. Safe to edit.
|
|
// goctl 1.9.2
|
|
|
|
package role
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/youruser/base/internal/logic/role"
|
|
"github.com/youruser/base/internal/svc"
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
)
|
|
|
|
// 获取角色列表
|
|
func GetRoleListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
l := role.NewGetRoleListLogic(r.Context(), svcCtx)
|
|
resp, err := l.GetRoleList()
|
|
if err != nil {
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
|
} else {
|
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
}
|
|
}
|
|
}
|
|
|