作者 tangxuhui

更新

  1 +package command
  2 +
  3 +import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  4 +
  5 +type SearchFeedbackCommand struct {
  6 + //操作人
  7 + Operator domain.Operator `json:"-"`
  8 + // 页面大小
  9 + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
  10 + // 页面大小
  11 + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
  12 +}
  1 +package service
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/core/application"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  7 +)
  8 +
  9 +// UndertakerFeedbackService 承接反馈服务
  10 +type UndertakerFeedbackService struct {
  11 +}
  12 +
  13 +// CreateCooperationProject 承接反馈列表
  14 +func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) {
  15 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  16 + cmd.Operator)
  17 + resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{
  18 + PageNumber: cmd.PageNumber,
  19 + PageSize: cmd.PageSize,
  20 + })
  21 + if err != nil {
  22 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  23 + }
  24 + return resultMenu, nil
  25 +}
  1 +package web_client
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/command"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/service"
  6 +)
  7 +
  8 +type UndertakerFeedbackController struct {
  9 + baseController
  10 +}
  11 +
  12 +//SearchFeedback ...
  13 +func (controller *UndertakerFeedbackController) SearchFeedback() {
  14 + svr := service.UndertakerFeedbackService{}
  15 + cmd := &command.SearchFeedbackCommand{}
  16 + err := controller.Unmarshal(cmd)
  17 + if err != nil {
  18 + controller.Response(nil, err)
  19 + return
  20 + }
  21 + cmd.Operator = controller.GetOperator()
  22 + data, err := svr.SearchFeedback(cmd)
  23 + controller.Response(data, err)
  24 +}
  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/contract-undertaker-feedbacks/search", &web_client.UndertakerFeedbackController{}, "Put:SearchFeedback")
  10 +}