作者 tangxuhui

添加承接反馈

  1 +package allied_creation_cooperation
  2 +
  3 +import (
  4 + "encoding/json"
  5 + "fmt"
  6 + "strconv"
  7 +
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  9 +
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
  11 +)
  12 +
  13 +// ContractUndertakerFeedbackAdd 创建共创合约反馈信息
  14 +func (gateway HttplibAlliedCreationCooperation) ContractUndertakerFeedbackAdd(param ReqContractUndertakerFeedbackAdd) (*DataContractUndertakerFeedbackAdd, error) {
  15 + url := gateway.baseUrL + "/contract-undertaker-feedbacks"
  16 + method := "POST"
  17 + req := gateway.CreateRequest(url, method)
  18 + log.Logger.Debug("向基础模块请求数据:创建共创合约反馈信息。", map[string]interface{}{
  19 + "api": method + ":" + url,
  20 + "param": param,
  21 + })
  22 + req, err := req.JSONBody(param)
  23 + if err != nil {
  24 + return nil, fmt.Errorf("请求创建共创合约反馈信息失败:%w", err)
  25 + }
  26 +
  27 + byteResult, err := req.Bytes()
  28 + if err != nil {
  29 + return nil, fmt.Errorf("获取创建共创合约反馈信息失败:%w", err)
  30 + }
  31 + log.Logger.Debug("获取基础模块请求数据:创建共创合约反馈信息。", map[string]interface{}{
  32 + "result": string(byteResult),
  33 + })
  34 + var result service_gateway.GatewayResponse
  35 + err = json.Unmarshal(byteResult, &result)
  36 + if err != nil {
  37 + return nil, fmt.Errorf("解析创建共创合约反馈信息:%w", err)
  38 + }
  39 + var data DataContractUndertakerFeedbackAdd
  40 + err = gateway.GetResponseData(result, &data)
  41 + return &data, err
  42 +}
  43 +
  44 +// ContractUndertakerFeedbackUpdate 更新共创合约反馈信息
  45 +func (gateway HttplibAlliedCreationCooperation) ContractUndertakerFeedbackUpdate(param ReqContractUndertakerFeedbackUpdate) (
  46 + *DataContractUndertakerFeedbackUpdate, error) {
  47 + url := gateway.baseUrL + "/contract-undertaker-feedbacks/" + strconv.Itoa(param.ContractUndertakerFeedbackId)
  48 + method := "PUT"
  49 + req := gateway.CreateRequest(url, method)
  50 + log.Logger.Debug("向基础模块请求数据:更新共创合约反馈信息。", map[string]interface{}{
  51 + "api": method + ":" + url,
  52 + "param": param,
  53 + })
  54 + req, err := req.JSONBody(param)
  55 + if err != nil {
  56 + return nil, fmt.Errorf("请求更新共创合约反馈信息失败:%w", err)
  57 + }
  58 +
  59 + byteResult, err := req.Bytes()
  60 + if err != nil {
  61 + return nil, fmt.Errorf("获取更新共创合约反馈信息失败:%w", err)
  62 + }
  63 + log.Logger.Debug("获取基础模块请求数据:更新共创合约反馈信息。", map[string]interface{}{
  64 + "result": string(byteResult),
  65 + })
  66 + var result service_gateway.GatewayResponse
  67 + err = json.Unmarshal(byteResult, &result)
  68 + if err != nil {
  69 + return nil, fmt.Errorf("解析更新共创合约反馈信息:%w", err)
  70 + }
  71 + var data DataContractUndertakerFeedbackUpdate
  72 + err = gateway.GetResponseData(result, &data)
  73 + return &data, err
  74 +}
  75 +
  76 +// ContractUndertakerFeedbackSearch 查询共创承接方反馈信息
  77 +func (gateway HttplibAlliedCreationCooperation) ContractUndertakerFeedbackSearch(param ReqContractUndertakerFeedbackSearch) (
  78 + *DataContractUndertakerFeedbackSearch, error) {
  79 + url := gateway.baseUrL + "/contract-undertaker-feedbacks/search"
  80 + method := "POST"
  81 + req := gateway.CreateRequest(url, method)
  82 + log.Logger.Debug("向基础模块请求数据:查询共创承接方反馈信息。", map[string]interface{}{
  83 + "api": method + ":" + url,
  84 + "param": param,
  85 + })
  86 + req, err := req.JSONBody(param)
  87 + if err != nil {
  88 + return nil, fmt.Errorf("请求查询共创承接方反馈信息失败:%w", err)
  89 + }
  90 +
  91 + byteResult, err := req.Bytes()
  92 + if err != nil {
  93 + return nil, fmt.Errorf("获取查询共创承接方反馈信息失败:%w", err)
  94 + }
  95 + log.Logger.Debug("获取基础模块请求数据:查询共创承接方反馈信息。", map[string]interface{}{
  96 + "result": string(byteResult),
  97 + })
  98 + var result service_gateway.GatewayResponse
  99 + err = json.Unmarshal(byteResult, &result)
  100 + if err != nil {
  101 + return nil, fmt.Errorf("解析查询共创承接方反馈信息:%w", err)
  102 + }
  103 + var data DataContractUndertakerFeedbackSearch
  104 + err = gateway.GetResponseData(result, &data)
  105 + return &data, err
  106 +}
  107 +
  108 +// ContractUndertakerFeedbackRemove 移除共创合约反馈信息
  109 +func (gateway HttplibAlliedCreationCooperation) ContractUndertakerFeedbackRemove(param ReqContractUndertakerFeedbackRemove) (
  110 + *DataContractUndertakerFeedbackRemove, error) {
  111 + url := gateway.baseUrL + "/contract-undertaker-feedbacks/" + strconv.Itoa(param.ContractUndertakerFeedbackId)
  112 + method := "DELETE"
  113 + req := gateway.CreateRequest(url, method)
  114 + log.Logger.Debug("向基础模块请求数据:移除共创合约反馈信息。", map[string]interface{}{
  115 + "api": method + ":" + url,
  116 + "param": param,
  117 + })
  118 + req, err := req.JSONBody(param)
  119 + if err != nil {
  120 + return nil, fmt.Errorf("请求移除共创合约反馈信息失败:%w", err)
  121 + }
  122 +
  123 + byteResult, err := req.Bytes()
  124 + if err != nil {
  125 + return nil, fmt.Errorf("获取移除共创合约反馈信息失败:%w", err)
  126 + }
  127 + log.Logger.Debug("获取基础模块请求数据:移除共创合约反馈信息。", map[string]interface{}{
  128 + "result": string(byteResult),
  129 + })
  130 + var result service_gateway.GatewayResponse
  131 + err = json.Unmarshal(byteResult, &result)
  132 + if err != nil {
  133 + return nil, fmt.Errorf("解析移除共创合约反馈信息:%w", err)
  134 + }
  135 + var data DataContractUndertakerFeedbackRemove
  136 + err = gateway.GetResponseData(result, &data)
  137 + return &data, err
  138 +}
  139 +
  140 +// ContractUndertakerFeedbackList 返回共创合约反馈信息列表
  141 +func (gateway HttplibAlliedCreationCooperation) ContractUndertakerFeedbackList(param ReqContractUndertakerFeedbackList) (
  142 + *DataContractUndertakerFeedbackList, error) {
  143 + url := gateway.baseUrL + "/contract-undertaker-feedbacks"
  144 + method := "GET"
  145 + req := gateway.CreateRequest(url, method)
  146 + log.Logger.Debug("向基础模块请求数据:返回共创合约反馈信息列表。", map[string]interface{}{
  147 + "api": method + ":" + url,
  148 + "param": param,
  149 + })
  150 + req, err := req.JSONBody(param)
  151 + if err != nil {
  152 + return nil, fmt.Errorf("请求返回共创合约反馈信息列表失败:%w", err)
  153 + }
  154 +
  155 + byteResult, err := req.Bytes()
  156 + if err != nil {
  157 + return nil, fmt.Errorf("获取返回共创合约反馈信息列表失败:%w", err)
  158 + }
  159 + log.Logger.Debug("获取基础模块请求数据:返回共创合约反馈信息列表。", map[string]interface{}{
  160 + "result": string(byteResult),
  161 + })
  162 + var result service_gateway.GatewayResponse
  163 + err = json.Unmarshal(byteResult, &result)
  164 + if err != nil {
  165 + return nil, fmt.Errorf("解析返回共创合约反馈信息列表:%w", err)
  166 + }
  167 + var data DataContractUndertakerFeedbackList
  168 + err = gateway.GetResponseData(result, &data)
  169 + return &data, err
  170 +}
  171 +
  172 +// ContractUndertakerFeedbackGet 返回共创合约反馈信息详情
  173 +func (gateway HttplibAlliedCreationCooperation) ContractUndertakerFeedbackGet(param ReqContractUndertakerFeedbackGet) (*DataContractUndertakerFeedbackGet, error) {
  174 + url := gateway.baseUrL + "/contract-undertaker-feedbacks/" + strconv.Itoa(param.ContractUndertakerFeedbackId)
  175 + method := "GET"
  176 + req := gateway.CreateRequest(url, method)
  177 + log.Logger.Debug("向基础模块请求数据:返回共创合约反馈信息详情。", map[string]interface{}{
  178 + "api": method + ":" + url,
  179 + "param": param,
  180 + })
  181 + req, err := req.JSONBody(param)
  182 + if err != nil {
  183 + return nil, fmt.Errorf("请求返回共创合约反馈信息详情失败:%w", err)
  184 + }
  185 +
  186 + byteResult, err := req.Bytes()
  187 + if err != nil {
  188 + return nil, fmt.Errorf("获取返回共创合约反馈信息详情失败:%w", err)
  189 + }
  190 + log.Logger.Debug("获取基础模块请求数据:返回共创合约反馈信息详情。", map[string]interface{}{
  191 + "result": string(byteResult),
  192 + })
  193 + var result service_gateway.GatewayResponse
  194 + err = json.Unmarshal(byteResult, &result)
  195 + if err != nil {
  196 + return nil, fmt.Errorf("解析返回共创合约反馈信息详情:%w", err)
  197 + }
  198 + var data DataContractUndertakerFeedbackGet
  199 + err = gateway.GetResponseData(result, &data)
  200 + return &data, err
  201 +}
@@ -74,7 +74,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeList(param ReqCoo @@ -74,7 +74,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeList(param ReqCoo
74 74
75 // CooperationModeGet 返回共创模式详情 75 // CooperationModeGet 返回共创模式详情
76 func (gateway HttplibAlliedCreationCooperation) CooperationModeGet(param ReqCooperationModeGet) (*DataCooperationModeGet, error) { 76 func (gateway HttplibAlliedCreationCooperation) CooperationModeGet(param ReqCooperationModeGet) (*DataCooperationModeGet, error) {
77 - url := gateway.baseUrL + "/cooperation-modes/" + strconv.Itoa(param.ModeId) 77 + url := gateway.baseUrL + "/cooperation-modes/" + strconv.Itoa(param.CooperationModeId)
78 method := "get" 78 method := "get"
79 req := gateway.CreateRequest(url, method) 79 req := gateway.CreateRequest(url, method)
80 log.Logger.Debug("向基础模块请求数据:返回共创模式详情。", map[string]interface{}{ 80 log.Logger.Debug("向基础模块请求数据:返回共创模式详情。", map[string]interface{}{
@@ -105,7 +105,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeGet(param ReqCoop @@ -105,7 +105,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeGet(param ReqCoop
105 105
106 // CooperationModeUpdate 更新共创模式 106 // CooperationModeUpdate 更新共创模式
107 func (gateway HttplibAlliedCreationCooperation) CooperationModeUpdate(param ReqCooperationModeUpdate) (*DataCooperationModeUpdate, error) { 107 func (gateway HttplibAlliedCreationCooperation) CooperationModeUpdate(param ReqCooperationModeUpdate) (*DataCooperationModeUpdate, error) {
108 - url := gateway.baseUrL + "/cooperation-modes" + strconv.Itoa(param.ModeId) 108 + url := gateway.baseUrL + "/cooperation-modes" + strconv.Itoa(param.CooperationModeId)
109 method := "put" 109 method := "put"
110 req := gateway.CreateRequest(url, method) 110 req := gateway.CreateRequest(url, method)
111 log.Logger.Debug("向基础模块请求数据:更新共创模式。", map[string]interface{}{ 111 log.Logger.Debug("向基础模块请求数据:更新共创模式。", map[string]interface{}{
@@ -136,7 +136,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeUpdate(param ReqC @@ -136,7 +136,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModeUpdate(param ReqC
136 136
137 //CooperationModeRemove 移除共创模式 137 //CooperationModeRemove 移除共创模式
138 func (gateway HttplibAlliedCreationCooperation) CooperationModeRemove(param ReqCooperationModeRemove) (*DataCooperationModeRemove, error) { 138 func (gateway HttplibAlliedCreationCooperation) CooperationModeRemove(param ReqCooperationModeRemove) (*DataCooperationModeRemove, error) {
139 - url := gateway.baseUrL + "/cooperation-modes/" + strconv.Itoa(param.ModeId) 139 + url := gateway.baseUrL + "/cooperation-modes/" + strconv.Itoa(param.CooperationModeId)
140 method := "delete" 140 method := "delete"
141 req := gateway.CreateRequest(url, method) 141 req := gateway.CreateRequest(url, method)
142 log.Logger.Debug("向基础模块请求数据:移除共创模式。", map[string]interface{}{ 142 log.Logger.Debug("向基础模块请求数据:移除共创模式。", map[string]interface{}{
  1 +package allied_creation_cooperation
  2 +
  3 +//创建共创合约反馈信息
  4 +type (
  5 + ReqContractUndertakerFeedbackAdd struct {
  6 + }
  7 +
  8 + DataContractUndertakerFeedbackAdd struct {
  9 + }
  10 +)
  11 +
  12 +//更新共创合约反馈信息
  13 +type (
  14 + ReqContractUndertakerFeedbackUpdate struct {
  15 + ContractUndertakerFeedbackId int
  16 + }
  17 +
  18 + DataContractUndertakerFeedbackUpdate struct {
  19 + }
  20 +)
  21 +
  22 +//查询共创承接方反馈信息
  23 +type (
  24 + ReqContractUndertakerFeedbackSearch struct {
  25 + }
  26 +
  27 + DataContractUndertakerFeedbackSearch struct {
  28 + }
  29 +)
  30 +
  31 +//移除共创合约反馈信息
  32 +type (
  33 + ReqContractUndertakerFeedbackRemove struct {
  34 + ContractUndertakerFeedbackId int
  35 + }
  36 +
  37 + DataContractUndertakerFeedbackRemove struct {
  38 + }
  39 +)
  40 +
  41 +//返回共创合约反馈信息列表
  42 +type (
  43 + ReqContractUndertakerFeedbackList struct {
  44 + }
  45 +
  46 + DataContractUndertakerFeedbackList struct {
  47 + }
  48 +)
  49 +
  50 +//返回共创合约反馈信息详情
  51 +type (
  52 + ReqContractUndertakerFeedbackGet struct {
  53 + ContractUndertakerFeedbackId int
  54 + }
  55 +
  56 + DataContractUndertakerFeedbackGet struct {
  57 + }
  58 +)
@@ -3,6 +3,9 @@ package allied_creation_cooperation @@ -3,6 +3,9 @@ package allied_creation_cooperation
3 //创建共创模式 3 //创建共创模式
4 type ( 4 type (
5 ReqCooperationModeAdd struct { 5 ReqCooperationModeAdd struct {
  6 + CooperationModeName string `json:"cooperationModeName"`
  7 + CooperationModeNumber string `json:"cooperationModeNumber"`
  8 + Remarks string `json:"remarks"`
6 } 9 }
7 10
8 DataCooperationModeAdd struct { 11 DataCooperationModeAdd struct {
@@ -12,26 +15,86 @@ type ( @@ -12,26 +15,86 @@ type (
12 //返回共创模式列表 15 //返回共创模式列表
13 type ( 16 type (
14 ReqCooperationModeList struct { 17 ReqCooperationModeList struct {
  18 + PageSize int `json:"pageSize"`
  19 + PageNumber int `json:"pageNumber"`
15 } 20 }
16 21
17 DataCooperationModeList struct { 22 DataCooperationModeList struct {
  23 + Total int `json:"total"`
  24 + List []struct {
  25 + // 共创模式ID
  26 + CooperationModeId int `json:"cooperationModeId"`
  27 + // 共创模式编码,
  28 + CooperationModeNumber string `json:"cooperationModeNumber"`
  29 + // 模式名称,
  30 + CooperationModeName string `json:"cooperationModeName"`
  31 + // 共创模式状态,1启用,2禁用
  32 + Status int `json:"status"`
  33 + // 备注
  34 + Remarks string `json:"remarks"`
  35 + Company struct {
  36 + // 公司ID,
  37 + CompanyId int `json:"companyId"`
  38 + // 公司logo
  39 + CompanyLogo string `json:"companyLogo"`
  40 + // 公司名称
  41 + CompanyName string `json:"companyName"`
  42 + } `json:"company"`
  43 + // 数据所属组织机构
  44 + Org struct {
  45 + // 组织机构ID
  46 + OrgId int `json:"orgId"`
  47 + // 组织名称
  48 + OrgName string `json:"orgName"`
  49 + } `json:"org"`
  50 + } `json:"list"`
18 } 51 }
19 ) 52 )
20 53
21 //返回共创模式详情 54 //返回共创模式详情
22 type ( 55 type (
23 ReqCooperationModeGet struct { 56 ReqCooperationModeGet struct {
24 - ModeId int `json:"modeId"` 57 + CooperationModeId int `json:"modeId"`
25 } 58 }
26 59
27 DataCooperationModeGet struct { 60 DataCooperationModeGet struct {
  61 + // 共创模式ID
  62 + CooperationModeId int `json:"cooperationModeId"`
  63 + // 共创模式编码,
  64 + CooperationModeNumber string `json:"cooperationModeNumber"`
  65 + // 模式名称,
  66 + CooperationModeName string `json:"cooperationModeName"`
  67 + // 共创模式状态,1启用,2禁用
  68 + Status int `json:"status"`
  69 + // 备注
  70 + Remarks string `json:"remarks"`
  71 + Company struct {
  72 + // 公司ID,
  73 + CompanyId int `json:"companyId,string"`
  74 + // 公司logo
  75 + CompanyLogo string `json:"companyLogo"`
  76 + // 公司名称
  77 + CompanyName string `json:"companyName"`
  78 + } `json:"company"`
  79 + // 数据所属组织机构
  80 + Org struct {
  81 + // 组织机构ID
  82 + OrgId int `json:"orgId,string"`
  83 + // 组织名称
  84 + OrgName string `json:"orgName"`
  85 + } `json:"org"`
28 } 86 }
29 ) 87 )
30 88
31 //更新共创模式 89 //更新共创模式
32 type ( 90 type (
33 ReqCooperationModeUpdate struct { 91 ReqCooperationModeUpdate struct {
34 - ModeId int `json:"modeId"` 92 + // 共创模式ID
  93 + CooperationModeId int `json:"cooperationModeId"`
  94 + CooperationModeName string `json:"cooperationModeName"`
  95 + Remarks string `json:"remarks"`
  96 + // 共创模式状态,1启用,2禁用
  97 + Status int `json:"status"`
35 } 98 }
36 99
37 DataCooperationModeUpdate struct { 100 DataCooperationModeUpdate struct {
@@ -41,7 +104,7 @@ type ( @@ -41,7 +104,7 @@ type (
41 //移除共创模式 104 //移除共创模式
42 type ( 105 type (
43 ReqCooperationModeRemove struct { 106 ReqCooperationModeRemove struct {
44 - ModeId int `json:"modeId"` 107 + CooperationModeId int `json:"modeId"`
45 } 108 }
46 109
47 DataCooperationModeRemove struct { 110 DataCooperationModeRemove struct {