|
|
package cost_structured
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
|
...
|
...
|
@@ -36,12 +38,30 @@ func (gateway HttpLibCostStructured) BaseUrl() string { |
|
|
}
|
|
|
|
|
|
//批量添加成本管理
|
|
|
func (gateway HttpLibCostStructured) BatchCreateCostManagemant(param BatchAddCostManagemantRequest) (*BatchAddCostManagemantResponse, error) {
|
|
|
func (gateway HttpLibCostStructured) BatchCreateCostManagemant(param BatchAddCostManagemantRequest) (*service_gateway.GatewayResponse, error) {
|
|
|
url := fmt.Sprintf("%s%s", gateway.BaseUrl(), "/cost-managemants/batch-create-cost-managemants")
|
|
|
method := "post"
|
|
|
var data BatchAddCostManagemantResponse
|
|
|
err := gateway.FastDoRequest(url, method, param, &data)
|
|
|
return &data, err
|
|
|
//var data BatchAddCostManagemantResponse
|
|
|
//err := gateway.FastDoRequest(url, method, param, &data)
|
|
|
|
|
|
r := gateway.CreateRequest(url, method)
|
|
|
if len(gateway.InOrgIds) > 0 {
|
|
|
r.Header("orgIds", strings.Join(service_gateway.ToArrayString(gateway.InOrgIds), ","))
|
|
|
}
|
|
|
req, err := r.JSONBody(param)
|
|
|
if err != nil {
|
|
|
return nil,err
|
|
|
}
|
|
|
byteResult, err:= req.Bytes()
|
|
|
if err != nil {
|
|
|
return nil,err
|
|
|
}
|
|
|
var result service_gateway.GatewayResponse
|
|
|
err = json.Unmarshal(byteResult, &result)
|
|
|
if err != nil {
|
|
|
return nil,err
|
|
|
}
|
|
|
return &result, nil
|
|
|
}
|
|
|
type BatchAddCostManagemantRequest struct {
|
|
|
*domain.BatchCreateCostManagemant
|
...
|
...
|
|