|
|
package web_client
|
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/service"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
|
|
)
|
|
|
|
|
|
type DividendsReturnedOrderController struct {
|
|
|
baseController
|
|
|
}
|
|
|
|
|
|
func (controller *DividendsReturnedOrderController) CreateDividendsReturnedOrder() {
|
|
|
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
|
|
|
createDividendsReturnedOrderCommand := &command.CreateDividendsReturnedOrderCommand{}
|
|
|
err := controller.Unmarshal(createDividendsReturnedOrderCommand)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug("json err:" + err.Error())
|
|
|
}
|
|
|
createDividendsReturnedOrderCommand.Operator = controller.GetOperator()
|
|
|
data, err := dividendsReturnedOrderService.CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
|
|
|
|
|
func (controller *DividendsReturnedOrderController) UpdateDividendsReturnedOrder() {
|
|
|
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
|
|
|
updateDividendsReturnedOrderCommand := &command.UpdateDividendsReturnedOrderCommand{}
|
|
|
err := controller.Unmarshal(updateDividendsReturnedOrderCommand)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug("json err:" + err.Error())
|
|
|
}
|
|
|
projectId, _ := controller.GetInt(":projectId")
|
|
|
updateDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId
|
|
|
updateDividendsReturnedOrderCommand.Operator = controller.GetOperator()
|
|
|
data, err := dividendsReturnedOrderService.UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
|
|
|
|
|
func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder() {
|
|
|
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
|
|
|
removeDividendsReturnedOrderCommand := &command.RemoveDividendsReturnedOrderCommand{}
|
|
|
err := controller.Unmarshal(removeDividendsReturnedOrderCommand)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug("json err:" + err.Error())
|
|
|
}
|
|
|
projectId, _ := controller.GetInt(":projectId")
|
|
|
removeDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId
|
|
|
removeDividendsReturnedOrderCommand.Operator = controller.GetOperator()
|
|
|
data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
|
|
|
|
|
func (controller *DividendsReturnedOrderController) GetDividendsReturnedOrder() {
|
|
|
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
|
|
|
getDividendsReturnedOrderQuery := &query.GetDividendsReturnedOrderQuery{}
|
|
|
projectId, _ := controller.GetInt(":projectId")
|
|
|
getDividendsReturnedOrderQuery.DividendsReturnedOrderID = projectId
|
|
|
getDividendsReturnedOrderQuery.Operator = controller.GetOperator()
|
|
|
data, err := dividendsReturnedOrderService.GetDividendsReturnedOrder(getDividendsReturnedOrderQuery)
|
|
|
controller.Response(data, err)
|
|
|
}
|
|
|
|
|
|
func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder() {
|
|
|
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
|
|
|
searchDividendsReturnedOrderQuery := &query.SearchDividendsReturnedOrderQuery{}
|
|
|
err := controller.Unmarshal(searchDividendsReturnedOrderQuery)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug("json err:" + err.Error())
|
|
|
}
|
|
|
searchDividendsReturnedOrderQuery.Operator = controller.GetOperator()
|
|
|
cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
|
|
|
controller.returnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber)
|
|
|
} |
...
|
...
|
|