作者 tangxuhui

更新

@@ -8,7 +8,7 @@ import ( @@ -8,7 +8,7 @@ import (
8 8
9 type GetCooperationContractQuery struct { 9 type GetCooperationContractQuery struct {
10 // 共创合约ID 10 // 共创合约ID
11 - CooperationContractId int64 `json:"cooperationContractId" valid:"Required"` 11 + CooperationContractId int `json:"cooperationContractId" valid:"Required"`
12 } 12 }
13 13
14 func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) { 14 func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) {
@@ -27,7 +27,7 @@ func (cooperationModeService *CooperationModeService) CreateCooperationMode(crea @@ -27,7 +27,7 @@ func (cooperationModeService *CooperationModeService) CreateCooperationMode(crea
27 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 27 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
28 } 28 }
29 data := struct { 29 data := struct {
30 - CooperationModeId int `json:"cooperationModeId,string," valid:"Required"` 30 + CooperationModeId int `json:"cooperationModeId,string,"`
31 command.CreateCooperationModeCommand 31 command.CreateCooperationModeCommand
32 }{ 32 }{
33 CooperationModeId: result.CooperationModeId, 33 CooperationModeId: result.CooperationModeId,
@@ -67,7 +67,6 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide @@ -67,7 +67,6 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide
67 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 67 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
68 } 68 }
69 return updateDividendsReturnedOrderCommand, nil 69 return updateDividendsReturnedOrderCommand, nil
70 -  
71 } 70 }
72 71
73 func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService { 72 func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService {
  1 +package web_client
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/service"
  8 +)
  9 +
  10 +type CooperationContractController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *CooperationContractController) CreateCooperationContract() {
  15 + cooperationContractService := service.NewCooperationContractService(nil)
  16 + createCooperationContractCommand := &command.CreateCooperationContractCommand{}
  17 + controller.Unmarshal(createCooperationContractCommand)
  18 + data, err := cooperationContractService.CreateCooperationContract(createCooperationContractCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *CooperationContractController) UpdateCooperationContract() {
  23 + cooperationContractService := service.NewCooperationContractService(nil)
  24 + updateCooperationContractCommand := &command.UpdateCooperationContractCommand{}
  25 + controller.Unmarshal(updateCooperationContractCommand)
  26 + contractId, _ := controller.GetInt(":contractId")
  27 + updateCooperationContractCommand.CooperationContract.CooperationContractId = contractId
  28 + data, err := cooperationContractService.UpdateCooperationContract(updateCooperationContractCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *CooperationContractController) GetCooperationContract() {
  33 + cooperationContractService := service.NewCooperationContractService(nil)
  34 + getCooperationContractQuery := &query.GetCooperationContractQuery{}
  35 + contractId, _ := controller.GetInt(":contractId")
  36 + getCooperationContractQuery.CooperationContractId = contractId
  37 + data, err := cooperationContractService.GetCooperationContract(getCooperationContractQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *CooperationContractController) ListCooperationContract() {
  42 + cooperationContractService := service.NewCooperationContractService(nil)
  43 + listCooperationContractQuery := &query.ListCooperationContractQuery{}
  44 + data, err := cooperationContractService.ListCooperationContract(listCooperationContractQuery)
  45 + controller.Response(data, err)
  46 +}
  47 +
  48 +func (controller *CooperationContractController) EnableCooperationContract() {
  49 + cooperationContractService := service.NewCooperationContractService(nil)
  50 + enableCooperationContractCommand := &command.EnableCooperationContractCommand{}
  51 + controller.Unmarshal(enableCooperationContractCommand)
  52 + data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
  53 + controller.Response(data, err)
  54 +}
  1 +package web_client
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/command"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/query"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/service"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  8 +)
  9 +
  10 +type CooperationModeController struct {
  11 + baseController
  12 +}
  13 +
  14 +func (controller *CooperationModeController) CreateCooperationMode() {
  15 + cooperationModeService := service.NewCooperationModeService(nil)
  16 + createCooperationModeCommand := &command.CreateCooperationModeCommand{}
  17 + err := controller.Unmarshal(createCooperationModeCommand)
  18 + if err != nil {
  19 + log.Logger.Debug("json err:" + err.Error())
  20 + }
  21 + createCooperationModeCommand.Operator = controller.GetOperator()
  22 + data, err := cooperationModeService.CreateCooperationMode(createCooperationModeCommand)
  23 + controller.Response(data, err)
  24 +}
  25 +
  26 +func (controller *CooperationModeController) UpdateCooperationMode() {
  27 + cooperationModeService := service.NewCooperationModeService(nil)
  28 + updateCooperationModeCommand := &command.UpdateCooperationModeCommand{}
  29 + err := controller.Unmarshal(updateCooperationModeCommand)
  30 + if err != nil {
  31 + log.Logger.Debug("json err:" + err.Error())
  32 + }
  33 + modeId, _ := controller.GetInt(":modeId")
  34 + updateCooperationModeCommand.Operator = controller.GetOperator()
  35 + updateCooperationModeCommand.CooperationModeId = modeId
  36 + data, err := cooperationModeService.UpdateCooperationMode(updateCooperationModeCommand)
  37 + controller.Response(data, err)
  38 +}
  39 +
  40 +func (controller *CooperationModeController) GetCooperationMode() {
  41 + cooperationModeService := service.NewCooperationModeService(nil)
  42 + getCooperationModeQuery := &query.GetCooperationModeQuery{}
  43 + modeId, _ := controller.GetInt(":modeId")
  44 + getCooperationModeQuery.CooperationModeId = modeId
  45 + getCooperationModeQuery.Operator = controller.GetOperator()
  46 + data, err := cooperationModeService.GetCooperationMode(getCooperationModeQuery)
  47 + controller.Response(data, err)
  48 +}
  49 +
  50 +func (controller *CooperationModeController) RemoveCooperationMode() {
  51 + cooperationModeService := service.NewCooperationModeService(nil)
  52 + removeCooperationModeCommand := &command.RemoveCooperationModeCommand{}
  53 + modeId, _ := controller.GetInt(":modeId")
  54 + removeCooperationModeCommand.Operator = controller.GetOperator()
  55 + removeCooperationModeCommand.CooperationModeId = modeId
  56 + data, err := cooperationModeService.RemoveCooperationMode(removeCooperationModeCommand)
  57 + controller.Response(data, err)
  58 +}
  59 +
  60 +func (controller *CooperationModeController) ListCooperationMode() {
  61 + cooperationModeService := service.NewCooperationModeService(nil)
  62 + listCooperationModeQuery := &query.ListCooperationModeQuery{}
  63 + err := controller.Unmarshal(listCooperationModeQuery)
  64 + if err != nil {
  65 + log.Logger.Debug("json err:" + err.Error())
  66 + }
  67 + listCooperationModeQuery.Operator = controller.GetOperator()
  68 + cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery)
  69 + controller.returnPageListData(cnt, data, err, listCooperationModeQuery.PageNumber)
  70 +}
  1 +package web_client
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/command"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/query"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/service"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  8 +)
  9 +
  10 +type DividendsOrderController struct {
  11 + baseController
  12 +}
  13 +
  14 +func (controller *DividendsOrderController) CreateDividendsOrder() {
  15 + dividendsOrderService := service.NewDividendsOrderService(nil)
  16 + createDividendsOrderCommand := &command.CreateDividendsOrderCommand{}
  17 + err := controller.Unmarshal(createDividendsOrderCommand)
  18 + if err != nil {
  19 + log.Logger.Debug("json err:" + err.Error())
  20 + }
  21 + data, err := dividendsOrderService.CreateDividendsOrder(createDividendsOrderCommand)
  22 + controller.Response(data, err)
  23 +}
  24 +
  25 +func (controller *DividendsOrderController) UpdateDividendsOrder() {
  26 + dividendsOrderService := service.NewDividendsOrderService(nil)
  27 + updateDividendsOrderCommand := &command.UpdateDividendsOrderCommand{}
  28 + err := controller.Unmarshal(updateDividendsOrderCommand)
  29 + if err != nil {
  30 + log.Logger.Debug("json err:" + err.Error())
  31 + }
  32 + orderId, _ := controller.GetInt(":orderId")
  33 + updateDividendsOrderCommand.DividendsOrderID = orderId
  34 + data, err := dividendsOrderService.UpdateDividendsOrder(updateDividendsOrderCommand)
  35 + controller.Response(data, err)
  36 +}
  37 +
  38 +func (controller *DividendsOrderController) RemoveDividendsOrder() {
  39 + dividendsOrderService := service.NewDividendsOrderService(nil)
  40 + removeDividendsOrderCommand := &command.RemoveDividendsOrderCommand{}
  41 + err := controller.Unmarshal(removeDividendsOrderCommand)
  42 + if err != nil {
  43 + log.Logger.Debug("json err:" + err.Error())
  44 + }
  45 + removeDividendsOrderCommand.Operator = controller.GetOperator()
  46 + data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand)
  47 + controller.Response(data, err)
  48 +}
  49 +
  50 +func (controller *DividendsOrderController) GetDividendsOrder() {
  51 + dividendsOrderService := service.NewDividendsOrderService(nil)
  52 + getDividendsOrderQuery := &query.GetDividendsOrderQuery{}
  53 + orderId, _ := controller.GetInt(":orderId")
  54 + getDividendsOrderQuery.DividendsOrderId = orderId
  55 + getDividendsOrderQuery.Operator = controller.GetOperator()
  56 + data, err := dividendsOrderService.GetDividendsOrder(getDividendsOrderQuery)
  57 + controller.Response(data, err)
  58 +}
  59 +
  60 +func (controller *DividendsOrderController) SearchDividendsOrder() {
  61 + dividendsOrderService := service.NewDividendsOrderService(nil)
  62 + searchDividendsOrderQuery := &query.SearchDividendsOrderQuery{}
  63 + err := controller.Unmarshal(searchDividendsOrderQuery)
  64 + if err != nil {
  65 + log.Logger.Debug("json err:" + err.Error())
  66 + }
  67 + searchDividendsOrderQuery.Operator = controller.GetOperator()
  68 + cnt, data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery)
  69 + controller.returnPageListData(int64(cnt), data, err, searchDividendsOrderQuery.PageNumber)
  70 +}
  1 +package web_client
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/service"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  8 +)
  9 +
  10 +type DividendsReturnedOrderController struct {
  11 + baseController
  12 +}
  13 +
  14 +func (controller *DividendsReturnedOrderController) CreateDividendsReturnedOrder() {
  15 + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
  16 + createDividendsReturnedOrderCommand := &command.CreateDividendsReturnedOrderCommand{}
  17 + err := controller.Unmarshal(createDividendsReturnedOrderCommand)
  18 + if err != nil {
  19 + log.Logger.Debug("json err:" + err.Error())
  20 + }
  21 + createDividendsReturnedOrderCommand.Operator = controller.GetOperator()
  22 + data, err := dividendsReturnedOrderService.CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand)
  23 + controller.Response(data, err)
  24 +}
  25 +
  26 +func (controller *DividendsReturnedOrderController) UpdateDividendsReturnedOrder() {
  27 + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
  28 + updateDividendsReturnedOrderCommand := &command.UpdateDividendsReturnedOrderCommand{}
  29 + err := controller.Unmarshal(updateDividendsReturnedOrderCommand)
  30 + if err != nil {
  31 + log.Logger.Debug("json err:" + err.Error())
  32 + }
  33 + projectId, _ := controller.GetInt(":projectId")
  34 + updateDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId
  35 + updateDividendsReturnedOrderCommand.Operator = controller.GetOperator()
  36 + data, err := dividendsReturnedOrderService.UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand)
  37 + controller.Response(data, err)
  38 +}
  39 +
  40 +func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder() {
  41 + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
  42 + removeDividendsReturnedOrderCommand := &command.RemoveDividendsReturnedOrderCommand{}
  43 + err := controller.Unmarshal(removeDividendsReturnedOrderCommand)
  44 + if err != nil {
  45 + log.Logger.Debug("json err:" + err.Error())
  46 + }
  47 + projectId, _ := controller.GetInt(":projectId")
  48 + removeDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId
  49 + removeDividendsReturnedOrderCommand.Operator = controller.GetOperator()
  50 + data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand)
  51 + controller.Response(data, err)
  52 +}
  53 +
  54 +func (controller *DividendsReturnedOrderController) GetDividendsReturnedOrder() {
  55 + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
  56 + getDividendsReturnedOrderQuery := &query.GetDividendsReturnedOrderQuery{}
  57 + projectId, _ := controller.GetInt(":projectId")
  58 + getDividendsReturnedOrderQuery.DividendsReturnedOrderID = projectId
  59 + getDividendsReturnedOrderQuery.Operator = controller.GetOperator()
  60 + data, err := dividendsReturnedOrderService.GetDividendsReturnedOrder(getDividendsReturnedOrderQuery)
  61 + controller.Response(data, err)
  62 +}
  63 +
  64 +func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder() {
  65 + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
  66 + searchDividendsReturnedOrderQuery := &query.SearchDividendsReturnedOrderQuery{}
  67 + err := controller.Unmarshal(searchDividendsReturnedOrderQuery)
  68 + if err != nil {
  69 + log.Logger.Debug("json err:" + err.Error())
  70 + }
  71 + searchDividendsReturnedOrderQuery.Operator = controller.GetOperator()
  72 + cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
  73 + controller.returnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber)
  74 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode")
  10 + web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Put:UpdateCooperationMode")
  11 + web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Get:GetCooperationMode")
  12 + web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Delete:RemoveCooperationMode")
  13 + web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:ListCooperationMode")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/v1/web/dividends-returned-order/", &web_client.DividendsReturnedOrderController{}, "Post:CreateDividendsReturnedOrder")
  10 + web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Put:UpdateDividendsReturnedOrder")
  11 + web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Delete:RemoveDividendsReturnedOrder")
  12 + web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Get:GetDividendsReturnedOrder")
  13 + web.Router("/v1/web/dividends-returned-order/search", &web_client.DividendsReturnedOrderController{}, "Post:SearchDividendsReturnedOrder")
  14 +}