user_controller.go 728 字节
package controllers

import (
	"github.com/linmadan/egglib-go/web/beego"
	"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/user"
	"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/user/query"
	"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
)

type UserController struct {
	beego.BaseController
}

// ListUsers 搜索用户
func (controller *UserController) ListUsers() {
	listUserQuery := &query.ListUserQuery{}
	_ = controller.Unmarshal(listUserQuery)
	userAuth := controller.Ctx.Input.GetData(domain.UserAuth{}).(*domain.UserAuth)
	listUserQuery.CompanyId = userAuth.CompanyId
	resp, err := (&user.UserService{}).ListUsers(listUserQuery)
	controller.Response(resp, err)
}