实现角色接口增删改查
This commit is contained in:
20
internal/controller/role/role_v1_list.go
Normal file
20
internal/controller/role/role_v1_list.go
Normal file
@ -0,0 +1,20 @@
|
||||
package role
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/role/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
|
||||
out, err := service.Role().GetRoleList(ctx, &model.RoleListInput{Page: req.Page, Size: req.Size, Status: req.Status})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ListRes{
|
||||
List: out.List,
|
||||
Total: out.Total,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user