作者 tangxuhui

数据结构调整

... ... @@ -4,6 +4,6 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domai
type RemoveDictionaryCommand struct {
//操作人
Operator domain.Operator `json:"-"`
DictionaryId int `json:"dictionaryId,string"`
Operator domain.Operator `json:"-"`
DictionaryIds []string `json:"dictionaryIds"`
}
... ...
package service
import (
"strconv"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/background/dictionary/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/background/dictionary/query"
... ... @@ -65,8 +67,13 @@ func (dictionaryService *DictionayService) GetDictionay(getQuery *query.GetDicti
func (dictionaryService *DictionayService) RemoveDictionay(removeCommand *command.RemoveDictionaryCommand) (interface{}, error) {
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
removeCommand.Operator)
result, err := creationBasicGateway.DictionaryGet(allied_creation_basic.ReqDictionaryGet{
DictionaryId: removeCommand.DictionaryId,
var dictionaryIds []int
for _, v := range removeCommand.DictionaryIds {
id, _ := strconv.Atoi(v)
dictionaryIds = append(dictionaryIds, id)
}
result, err := creationBasicGateway.DictionaryRemove(allied_creation_basic.ReqDictionaryRemove{
DictionaryIds: dictionaryIds,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -140,7 +140,7 @@ func (gateway HttplibAlliedCreationBasic) DictionaryGet(param ReqDictionaryGet)
//DictionaryRemove 删除字典
func (gateway HttplibAlliedCreationBasic) DictionaryRemove(param ReqDictionaryRemove) (*DataDictionaryRemove, error) {
url := gateway.baseUrL + "/dictionarys/" + strconv.Itoa(int(param.DictionaryId))
url := gateway.baseUrL + "/dictionarys/remove"
method := "DELETE"
req := gateway.CreateRequest(url, method)
//TODO traceID
... ...
... ... @@ -100,7 +100,7 @@ type (
type (
ReqDictionaryRemove struct {
DictionaryId int `json:"dictionaryId"`
DictionaryIds []int `json:"dictionaryIds"`
}
DataDictionaryRemove struct {
}
... ...