cooperation_controller.go 3.0 KB
package mobile_client

import (
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/service"
)

// Controller
type CooperationController struct {
	baseController
}

/*****   CompanyDividends 企业端分红  *****/
func (controller *CooperationController) GetDividendContracts() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.GetDividendContractsCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.GetDividendContracts(cmd)
	controller.Response(data, err)
}

func (controller *CooperationController) DividendsStatistics() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.DividendsStatisticsCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.DividendsStatistics(cmd)
	controller.Response(data, err)
}

func (controller *CooperationController) SearchDividendsEstimates() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.SearchDividendsEstimatesCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.SearchDividendsEstimates(cmd)
	controller.Response(data, err)
}

/*****   CompanyStatistics 企业端统计  *****/

func (controller *CooperationController) IndexStatistics() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.IndexStatisticsCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.IndexStatistics(cmd)
	controller.Response(data, err)
}

func (controller *CooperationController) CooperationPersonStatistics() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.CooperationPersonStatisticsCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.CooperationPersonStatistics(cmd)
	controller.Response(data, err)
}

func (controller *CooperationController) GoodsStatistics() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.GoodsStatisticsCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.GoodsStatistics(cmd)
	controller.Response(data, err)
}

func (controller *CooperationController) CooperationDividendsStatistics() {
	svr := service.CompanyStatisticsService{}
	cmd := &command.CooperationDividendsStatisticsCommand{}
	err := controller.Unmarshal(cmd)
	if err != nil {
		controller.Response(nil, err)
		return
	}
	cmd.Operator = controller.GetOperator()
	data, err := svr.CooperationDividendsStatistics(cmd)
	controller.Response(data, err)
}