作者 tangxuhui

数据结构调整

@@ -5,5 +5,5 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai @@ -5,5 +5,5 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai
5 type RemoveDictionaryCommand struct { 5 type RemoveDictionaryCommand struct {
6 //操作人 6 //操作人
7 Operator domain.Operator `json:"-"` 7 Operator domain.Operator `json:"-"`
8 - DictionaryId int `json:"dictionaryId,string"` 8 + DictionaryIds []string `json:"dictionaryIds"`
9 } 9 }
1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "strconv"
  5 +
4 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/background/dictionary/command" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/background/dictionary/command"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/background/dictionary/query" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/background/dictionary/query"
@@ -65,8 +67,13 @@ func (dictionaryService *DictionayService) GetDictionay(getQuery *query.GetDicti @@ -65,8 +67,13 @@ func (dictionaryService *DictionayService) GetDictionay(getQuery *query.GetDicti
65 func (dictionaryService *DictionayService) RemoveDictionay(removeCommand *command.RemoveDictionaryCommand) (interface{}, error) { 67 func (dictionaryService *DictionayService) RemoveDictionay(removeCommand *command.RemoveDictionaryCommand) (interface{}, error) {
66 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic( 68 creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
67 removeCommand.Operator) 69 removeCommand.Operator)
68 - result, err := creationBasicGateway.DictionaryGet(allied_creation_basic.ReqDictionaryGet{  
69 - DictionaryId: removeCommand.DictionaryId, 70 + var dictionaryIds []int
  71 + for _, v := range removeCommand.DictionaryIds {
  72 + id, _ := strconv.Atoi(v)
  73 + dictionaryIds = append(dictionaryIds, id)
  74 + }
  75 + result, err := creationBasicGateway.DictionaryRemove(allied_creation_basic.ReqDictionaryRemove{
  76 + DictionaryIds: dictionaryIds,
70 }) 77 })
71 if err != nil { 78 if err != nil {
72 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 79 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -140,7 +140,7 @@ func (gateway HttplibAlliedCreationBasic) DictionaryGet(param ReqDictionaryGet) @@ -140,7 +140,7 @@ func (gateway HttplibAlliedCreationBasic) DictionaryGet(param ReqDictionaryGet)
140 140
141 //DictionaryRemove 删除字典 141 //DictionaryRemove 删除字典
142 func (gateway HttplibAlliedCreationBasic) DictionaryRemove(param ReqDictionaryRemove) (*DataDictionaryRemove, error) { 142 func (gateway HttplibAlliedCreationBasic) DictionaryRemove(param ReqDictionaryRemove) (*DataDictionaryRemove, error) {
143 - url := gateway.baseUrL + "/dictionarys/" + strconv.Itoa(int(param.DictionaryId)) 143 + url := gateway.baseUrL + "/dictionarys/remove"
144 method := "DELETE" 144 method := "DELETE"
145 req := gateway.CreateRequest(url, method) 145 req := gateway.CreateRequest(url, method)
146 //TODO traceID 146 //TODO traceID
@@ -100,7 +100,7 @@ type ( @@ -100,7 +100,7 @@ type (
100 100
101 type ( 101 type (
102 ReqDictionaryRemove struct { 102 ReqDictionaryRemove struct {
103 - DictionaryId int `json:"dictionaryId"` 103 + DictionaryIds []int `json:"dictionaryIds"`
104 } 104 }
105 DataDictionaryRemove struct { 105 DataDictionaryRemove struct {
106 } 106 }