baseController.go 907 字节
package web_client

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

type baseController struct {
	beego.BaseController
}

func (controller *baseController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
	dataMap := map[string]interface{}{
		"totalRow":   count,
		"pageNumber": pageNumber,
		"list":       data,
	}
	controller.Response(dataMap, err)
}

func (controller *baseController) GetUserId() int64 {
	return 1
}

func (controller *baseController) GetCompanyId() int64 {
	return 1
}

func (controller *baseController) GetUserBaseId() int64 {
	return 1
}

func (controller *baseController) GetOrgId() int64 {
	return 1
}

func (controller *baseController) GetOperator() domain.Operator {
	return domain.Operator{
		UserId:     1,
		CompanyId:  1,
		OrgId:      1,
		UserBaseId: 1,
	}
}