作者 tangxuhui

添加json解析错误输出

... ... @@ -27,6 +27,8 @@ func (controller *CooperationApplicationController) ListCooperationApplication()
err := controller.Unmarshal(listCooperationApplicationQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationApplicationQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationApplicationService.ListCooperationApplication(listCooperationApplicationQuery)
... ... @@ -39,6 +41,8 @@ func (controller *CooperationApplicationController) AuditCooperationApplication(
err := controller.Unmarshal(auditCooperationApplicationCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
auditCooperationApplicationCommand.Operator = controller.GetOperator()
data, err := cooperationApplicationService.AuditCooperationApplication(auditCooperationApplicationCommand)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *CooperationContractController) CreateCooperationContract() {
err := controller.Unmarshal(createCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createCooperationContractCommand.Operator = controller.GetOperator()
data, err := cooperationContractService.CreateCooperationContract(createCooperationContractCommand)
... ... @@ -29,6 +31,8 @@ func (controller *CooperationContractController) UpdateCooperationContract() {
err := controller.Unmarshal(updateCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
contractId, _ := controller.GetInt(":contractId")
updateCooperationContractCommand.Operator = controller.GetOperator()
... ... @@ -53,6 +57,8 @@ func (controller *CooperationContractController) ListCooperationContract() {
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.ListCooperationContract(listCooperationContractQuery)
... ... @@ -65,6 +71,8 @@ func (controller *CooperationContractController) EnableCooperationContract() {
err := controller.Unmarshal(enableCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
controller.Response(data, err)
... ... @@ -76,6 +84,8 @@ func (controller *CooperationContractController) SearchCooperationContractsByUnd
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.SearchCooperationContractsByUndertake(listCooperationContractQuery)
... ... @@ -88,6 +98,8 @@ func (controller *CooperationContractController) RemoveCooperationContract() {
err := controller.Unmarshal(removeCooperationContractCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
data, err := cooperationContractService.RemoveCooperationContract(removeCooperationContractCommand)
controller.Response(data, err)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *CooperationModeController) CreateCooperationMode() {
err := controller.Unmarshal(createCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createCooperationModeCommand.Operator = controller.GetOperator()
data, err := cooperationModeService.CreateCooperationMode(createCooperationModeCommand)
... ... @@ -29,6 +31,8 @@ func (controller *CooperationModeController) UpdateCooperationMode() {
err := controller.Unmarshal(updateCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
modeId, _ := controller.GetInt(":modeId")
updateCooperationModeCommand.Operator = controller.GetOperator()
... ... @@ -53,6 +57,8 @@ func (controller *CooperationModeController) RemoveCooperationMode() {
err := controller.Unmarshal(removeCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeCooperationModeCommand.Operator = controller.GetOperator()
... ... @@ -66,6 +72,8 @@ func (controller *CooperationModeController) SearchCooperationMode() {
err := controller.Unmarshal(listCooperationModeQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationModeQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery)
... ... @@ -78,6 +86,8 @@ func (controller *CooperationModeController) ListCooperationMode() {
err := controller.Unmarshal(listCooperationModeQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationModeQuery.Operator = controller.GetOperator()
listCooperationModeQuery.PageNumber = 1
... ... @@ -92,6 +102,8 @@ func (controller *CooperationModeController) EnableCooperationMode() {
err := controller.Unmarshal(removeCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeCooperationModeCommand.Operator = controller.GetOperator()
... ...
... ... @@ -17,6 +17,8 @@ func (controller *CooperationProjectController) CreateCooperationProject() {
err := controller.Unmarshal(createCooperationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createCooperationProjectCommand.Operator = controller.GetOperator()
data, err := cooperationProjectService.CreateCooperationProject(createCooperationProjectCommand)
... ... @@ -29,6 +31,8 @@ func (controller *CooperationProjectController) UpdateCooperationProject() {
err := controller.Unmarshal(updateCooperationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
projectId := controller.GetString(":projectId")
updateCooperationProjectCommand.CooperationProjectId = projectId
... ... @@ -55,6 +59,8 @@ func (controller *CooperationProjectController) ListCooperationProject() {
err := controller.Unmarshal(listCooperationProjectQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationProjectQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationProjectService.ListCooperationProject(listCooperationProjectQuery)
... ... @@ -67,6 +73,8 @@ func (controller *CooperationProjectController) SelectorCooperationProject() {
err := controller.Unmarshal(listCooperationProjectQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationProjectQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationProjectService.ListCooperationProjectSelector(listCooperationProjectQuery)
... ... @@ -79,6 +87,8 @@ func (controller *CooperationProjectController) EndCooperationProject() {
err := controller.Unmarshal(endCooperationProjectCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
endCooperationProjectCommand.Operator = controller.GetOperator()
data, err := cooperationProjectService.EndCooperationProject(endCooperationProjectCommand)
... ...
... ... @@ -18,6 +18,8 @@ func (controller *CreditAccountController) ListCreditAccount() {
err := controller.Unmarshal(listQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listQuery.Operator = controller.GetOperator()
cnt, data, err := creditAccountService.ListCreditAccount(listQuery)
... ... @@ -43,6 +45,8 @@ func (controller *CreditAccountController) PayCreditAccount() {
err := controller.Unmarshal(payCreditAccountCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
payCreditAccountCommand.Operator = controller.GetOperator()
data, err := creditAccountService.PayCreditAccount(payCreditAccountCommand)
... ... @@ -56,6 +60,8 @@ func (controller *CreditAccountController) RemoveCreditAccount() {
err := controller.Unmarshal(removeCreditAccountCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeCreditAccountCommand.Operator = controller.GetOperator()
data, err := creditAccountService.RemoveCreditAccount(removeCreditAccountCommand)
... ...
... ... @@ -18,6 +18,8 @@ func (controller *DividendsEstimateController) CancelDividendsEstimate() {
err := controller.Unmarshal(cancelDividendsEstimateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
cancelDividendsEstimateCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.CancelDividendsEstimate(cancelDividendsEstimateCommand)
... ... @@ -31,6 +33,8 @@ func (controller *DividendsEstimateController) SearchDividendsEstimate() {
err := controller.Unmarshal(searchDividendsEstimateQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsEstimateQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsEstimateService.SearchDividendsEstimate(searchDividendsEstimateQuery)
... ... @@ -44,6 +48,8 @@ func (controller *DividendsEstimateController) SearchDividendsIncentives() {
err := controller.Unmarshal(searchDividendsIncentivesQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsIncentivesQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsEstimateService.SearchDividendsIncentives(searchDividendsIncentivesQuery)
... ... @@ -57,6 +63,8 @@ func (controller *DividendsEstimateController) SearchMoneyIncentives() {
err := controller.Unmarshal(searchMoneyIncentivesQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchMoneyIncentivesQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsEstimateService.SearchMoneyIncentives(searchMoneyIncentivesQuery)
... ... @@ -70,6 +78,8 @@ func (controller *DividendsEstimateController) EstimateMoneyIncentives() {
err := controller.Unmarshal(estimateMoneyIncentivesCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
estimateMoneyIncentivesCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.EstimateMoneyIncentives(estimateMoneyIncentivesCommand)
... ... @@ -83,6 +93,8 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() {
err := controller.Unmarshal(estimateDividendsIncentivesCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
estimateDividendsIncentivesCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand)
... ... @@ -96,6 +108,8 @@ func (controller *DividendsEstimateController) MoneyIncentivesSelector() {
err := controller.Unmarshal(moneyIncentivesSelectorQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
moneyIncentivesSelectorQuery.Operator = controller.GetOperator()
data, err := dividendsEstimateService.MoneyIncentivesSelector(moneyIncentivesSelectorQuery)
... ... @@ -109,6 +123,8 @@ func (controller *DividendsEstimateController) ConfimDividendsEstimate() {
err := controller.Unmarshal(confimDividendsEstimateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
confimDividendsEstimateCommand.Operator = controller.GetOperator()
data, err := dividendsEstimateService.ConfimDividendsEstimate(confimDividendsEstimateCommand)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *DividendsOrderController) CreateDividendsOrder() {
err := controller.Unmarshal(createDividendsOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createDividendsOrderCommand.Operator = controller.GetOperator()
data, err := dividendsOrderService.CreateDividendsOrder(createDividendsOrderCommand)
... ... @@ -29,6 +31,8 @@ func (controller *DividendsOrderController) UpdateDividendsOrder() {
err := controller.Unmarshal(updateDividendsOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
orderId, _ := controller.GetInt(":orderId")
updateDividendsOrderCommand.Operator = controller.GetOperator()
... ... @@ -43,6 +47,8 @@ func (controller *DividendsOrderController) RemoveDividendsOrder() {
err := controller.Unmarshal(removeDividendsOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeDividendsOrderCommand.Operator = controller.GetOperator()
... ... @@ -66,6 +72,8 @@ func (controller *DividendsOrderController) SearchDividendsOrder() {
err := controller.Unmarshal(searchDividendsOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery)
... ...
... ... @@ -17,6 +17,8 @@ func (controller *DividendsReturnedOrderController) CreateDividendsReturnedOrder
err := controller.Unmarshal(createDividendsReturnedOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
createDividendsReturnedOrderCommand.Operator = controller.GetOperator()
data, err := dividendsReturnedOrderService.CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand)
... ... @@ -29,6 +31,8 @@ func (controller *DividendsReturnedOrderController) UpdateDividendsReturnedOrder
err := controller.Unmarshal(updateDividendsReturnedOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
projectId, _ := controller.GetInt(":projectId")
updateDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId
... ... @@ -43,6 +47,8 @@ func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder
err := controller.Unmarshal(removeDividendsReturnedOrderCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
removeDividendsReturnedOrderCommand.Operator = controller.GetOperator()
data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand)
... ... @@ -65,6 +71,8 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder
err := controller.Unmarshal(searchDividendsReturnedOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
searchDividendsReturnedOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
... ... @@ -77,6 +85,8 @@ func (controller *DividendsReturnedOrderController) SelectorDividendsOrder() {
err := controller.Unmarshal(selectorDividendsOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
selectorDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SelectorDividendsOrder(selectorDividendsOrderQuery)
... ...