作者 tangxuhui

更新

package command
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
type SearchFeedbackCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// UndertakerFeedbackService 承接反馈服务
type UndertakerFeedbackService struct {
}
// CreateCooperationProject 承接反馈列表
func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
... ...
package web_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/undertakerFeedback/service"
)
type UndertakerFeedbackController struct {
baseController
}
//SearchFeedback ...
func (controller *UndertakerFeedbackController) SearchFeedback() {
svr := service.UndertakerFeedbackService{}
cmd := &command.SearchFeedbackCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.SearchFeedback(cmd)
controller.Response(data, err)
}
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
)
func init() {
web.Router("/v1/web/contract-undertaker-feedbacks/search", &web_client.UndertakerFeedbackController{}, "Put:SearchFeedback")
}
... ...