作者 tangxuhui

补充路由

... ... @@ -110,7 +110,7 @@ func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstim
return newDividendsEstimateService
}
func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(queryParam query.MoneyIncentiveSelectorQuery) (interface{}, error) {
func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(queryParam *query.MoneyIncentiveSelectorQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
queryParam.Operator)
resultContract, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
... ... @@ -133,7 +133,7 @@ func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(
for _, v := range contractData.MoneyIncentivesRules {
r := dto.MoneyIncentivesRule{
MoneyIncentivesStage: v.MoneyIncentivesStage,
MoneyIncentivesStageStart: int(v.MoneyIncentivesTime.Unix()),
MoneyIncentivesStageStart: int(v.MoneyIncentivesTime.UnixNano() / 1e6),
}
rules = append(rules, r)
}
... ...
... ... @@ -88,3 +88,16 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() {
data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand)
controller.Response(data, err)
}
//MoneyIncentivesSelector
func (controller *DividendsEstimateController) MoneyIncentivesSelector() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
moneyIncentivesSelectorQuery := &query.MoneyIncentiveSelectorQuery{}
err := controller.Unmarshal(moneyIncentivesSelectorQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
moneyIncentivesSelectorQuery.Operator = controller.GetOperator()
data, err := dividendsEstimateService.MoneyIncentivesSelector(moneyIncentivesSelectorQuery)
controller.Response(data, err)
}
... ...
... ... @@ -12,4 +12,5 @@ func init() {
web.Router("/v1/web/dividends-estimate/money-incentives/search", &web_client.DividendsEstimateController{}, "Post:SearchMoneyIncentives")
web.Router("/v1/web/dividends-estimate/money-incentives/estimate", &web_client.DividendsEstimateController{}, "Post:EstimateMoneyIncentives")
web.Router("/v1/web/dividends-estimate/dividends-incentives/estimate", &web_client.DividendsEstimateController{}, "Post:EstimateDividendsIncentives")
web.Router("/v1/web/dividends-estimate/money-incentives/selector", &web_client.DividendsEstimateController{}, "Post:MoneyIncentivesSelector")
}
... ...