baseController.go 854 字节
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{}{
		"grid": map[string]interface{}{
			"total": count,
			"list":  data,
		},
	}
	controller.Response(dataMap, err)
}

func (controller *baseController) GetOperator() domain.Operator {

	// tk, _ := middleware.FormCtxLoginToken(controller.Ctx)
	// operator := domain.Operator{
	// 	UserId:     tk.UserId,
	// 	CompanyId:  tk.CompanyId,
	// 	OrgId:      tk.OrgId,
	// 	UserBaseId: tk.UserBaseId,
	// }
	return domain.Operator{
		UserId:     9,
		CompanyId:  23,
		OrgId:      45,
		UserBaseId: 1,
	}
}