作者 tangxuhui

更新

  1 +package dto
  2 +
  3 +type NoticeSettingItem struct {
  4 + CompanyID int `json:"companyId,string"`
  5 + Content string `json:"content"`
  6 + IsPush int `json:"isPush"`
  7 + Module string `json:"module"`
  8 + ModuleAction string `json:"moduleAction"`
  9 + NoticeSettingID int `json:"noticeSettingId,string"`
  10 + OrgID int `json:"orgId,string"`
  11 +}
@@ -11,7 +11,7 @@ type NoticeSettingListQuery struct { @@ -11,7 +11,7 @@ type NoticeSettingListQuery struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 // 查询偏离量 13 // 查询偏离量
14 - PageNumber int `json:"pageNumber" valid:"Required"` 14 + PageNumber int `json:"pageNumber"`
15 // 查询限制 15 // 查询限制
16 PageSize int `json:"pageSize" valid:"Required"` 16 PageSize int `json:"pageSize" valid:"Required"`
17 } 17 }
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 5
6 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/command" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/command"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/dto"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/query" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/query"
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic" 10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
10 ) 11 )
@@ -29,8 +30,20 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin @@ -29,8 +30,20 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
29 if err != nil { 30 if err != nil {
30 return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 31 return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
31 } 32 }
32 -  
33 - return result.Count, result.NoticeSettings, nil 33 + dataList := []dto.NoticeSettingItem{}
  34 + for _, v := range result.List {
  35 + item := dto.NoticeSettingItem{
  36 + CompanyID: v.CompanyID,
  37 + Content: v.Content,
  38 + IsPush: v.IsPush,
  39 + Module: v.Module,
  40 + ModuleAction: v.ModuleAction,
  41 + NoticeSettingID: v.NoticeSettingID,
  42 + OrgID: v.OrgID,
  43 + }
  44 + dataList = append(dataList, item)
  45 + }
  46 + return result.Count, dataList, nil
34 } 47 }
35 48
36 //NoticeSettingProfile 推送消息配置需求的参数候选项 49 //NoticeSettingProfile 推送消息配置需求的参数候选项
@@ -62,7 +75,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett @@ -62,7 +75,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett
62 IsPush: noticeSettingUpdateCommand.IsPush, 75 IsPush: noticeSettingUpdateCommand.IsPush,
63 Module: noticeSettingUpdateCommand.Module, 76 Module: noticeSettingUpdateCommand.Module,
64 ModuleAction: noticeSettingUpdateCommand.ModuleAction, 77 ModuleAction: noticeSettingUpdateCommand.ModuleAction,
65 - OrganizationID: int(noticeSettingUpdateCommand.Operator.OrgId), 78 + OrgId: int(noticeSettingUpdateCommand.Operator.OrgId),
66 }) 79 })
67 if err != nil { 80 if err != nil {
68 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 81 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -84,13 +97,13 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting @@ -84,13 +97,13 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting
84 IsPush: noticeSettingAddCommand.IsPush, 97 IsPush: noticeSettingAddCommand.IsPush,
85 Module: noticeSettingAddCommand.Module, 98 Module: noticeSettingAddCommand.Module,
86 ModuleAction: noticeSettingAddCommand.ModuleAction, 99 ModuleAction: noticeSettingAddCommand.ModuleAction,
87 - OrganizationID: int(noticeSettingAddCommand.Operator.OrgId), 100 + OrgId: int(noticeSettingAddCommand.Operator.OrgId),
88 }) 101 })
89 if err != nil { 102 if err != nil {
90 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 103 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
91 } 104 }
92 data := struct { 105 data := struct {
93 - NoticeSettingId int `json:"noticeSettingId"` 106 + NoticeSettingId int `json:"noticeSettingId,string"`
94 command.NoticeSettingAddCommand 107 command.NoticeSettingAddCommand
95 }{ 108 }{
96 NoticeSettingId: result.NoticeSettingID, 109 NoticeSettingId: result.NoticeSettingID,
@@ -115,7 +128,16 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingGet(noticeSetting @@ -115,7 +128,16 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingGet(noticeSetting
115 if err != nil { 128 if err != nil {
116 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 129 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
117 } 130 }
118 - return result, nil 131 + data := dto.NoticeSettingItem{
  132 + CompanyID: result.CompanyID,
  133 + Content: result.Content,
  134 + IsPush: result.IsPush,
  135 + Module: result.Module,
  136 + ModuleAction: result.ModuleAction,
  137 + NoticeSettingID: result.NoticeSettingID,
  138 + OrgID: result.OrgID,
  139 + }
  140 + return data, nil
119 } 141 }
120 142
121 func NewNoticeSettingService(options map[string]interface{}) *NoticeSettingService { 143 func NewNoticeSettingService(options map[string]interface{}) *NoticeSettingService {
@@ -12,7 +12,7 @@ var LOG_LEVEL = "debug" @@ -12,7 +12,7 @@ var LOG_LEVEL = "debug"
12 var HTTP_PORT int = 8083 12 var HTTP_PORT int = 8083
13 13
14 //天联共创基础模块 14 //天联共创基础模块
15 -var ALLIED_CREATION_BASIC_HOST = "http://allied-creation-basic-dev.fjmaimaimai.com" 15 +var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" //"http://allied-creation-basic-dev.fjmaimaimai.com"
16 16
17 //天联共创用户模块 17 //天联共创用户模块
18 var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creation-user-dev.fjmaimaimai.com" 18 var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creation-user-dev.fjmaimaimai.com"
@@ -11,7 +11,7 @@ import ( @@ -11,7 +11,7 @@ import (
11 11
12 // NoticeSettingUpdate 更新消息模板 12 // NoticeSettingUpdate 更新消息模板
13 func (gateway HttplibAlliedCreationBasic) NoticeSettingUpdate(param ReqNoticeSettingUpdate) (*DataNoticeSettingUpdate, error) { 13 func (gateway HttplibAlliedCreationBasic) NoticeSettingUpdate(param ReqNoticeSettingUpdate) (*DataNoticeSettingUpdate, error) {
14 - url := gateway.baseUrL + "/notice-setting" + strconv.Itoa(param.NoticeSettingID) 14 + url := gateway.baseUrL + "/notice-setting/" + strconv.Itoa(param.NoticeSettingID)
15 method := "PUT" 15 method := "PUT"
16 req := gateway.CreateRequest(url, method) 16 req := gateway.CreateRequest(url, method)
17 log.Logger.Debug("向基础模块请求数据:更新消息模板。", map[string]interface{}{ 17 log.Logger.Debug("向基础模块请求数据:更新消息模板。", map[string]interface{}{
@@ -9,7 +9,7 @@ type ( @@ -9,7 +9,7 @@ type (
9 IsPush int `json:"isPush"` 9 IsPush int `json:"isPush"`
10 Module string `json:"module"` 10 Module string `json:"module"`
11 ModuleAction string `json:"moduleAction"` 11 ModuleAction string `json:"moduleAction"`
12 - OrganizationID int `json:"organizationId"` 12 + OrgId int `json:"orgId"`
13 } 13 }
14 14
15 DataNoticeSettingUpdate struct { 15 DataNoticeSettingUpdate struct {
@@ -19,7 +19,7 @@ type ( @@ -19,7 +19,7 @@ type (
19 IsPush int `json:"isPush"` 19 IsPush int `json:"isPush"`
20 Module string `json:"module"` 20 Module string `json:"module"`
21 ModuleAction string `json:"moduleAction"` 21 ModuleAction string `json:"moduleAction"`
22 - OrganizationID int `json:"organizationId"` 22 + OrgId int `json:"orgId"`
23 } 23 }
24 ) 24 )
25 25
@@ -31,7 +31,7 @@ type ( @@ -31,7 +31,7 @@ type (
31 IsPush int `json:"isPush"` 31 IsPush int `json:"isPush"`
32 Module string `json:"module"` 32 Module string `json:"module"`
33 ModuleAction string `json:"moduleAction"` 33 ModuleAction string `json:"moduleAction"`
34 - OrganizationID int `json:"organizationId"` 34 + OrgId int `json:"orgId"`
35 } 35 }
36 36
37 DataNoticeSettingAdd struct { 37 DataNoticeSettingAdd struct {
@@ -41,7 +41,7 @@ type ( @@ -41,7 +41,7 @@ type (
41 Module string `json:"module"` 41 Module string `json:"module"`
42 ModuleAction string `json:"moduleAction"` 42 ModuleAction string `json:"moduleAction"`
43 NoticeSettingID int `json:"noticeSettingId"` 43 NoticeSettingID int `json:"noticeSettingId"`
44 - OrganizationID int `json:"organizationId"` 44 + OrgId int `json:"orgId"`
45 } 45 }
46 ) 46 )
47 47
@@ -58,7 +58,7 @@ type ( @@ -58,7 +58,7 @@ type (
58 Module string `json:"module"` 58 Module string `json:"module"`
59 ModuleAction string `json:"moduleAction"` 59 ModuleAction string `json:"moduleAction"`
60 NoticeSettingID int `json:"noticeSettingId"` 60 NoticeSettingID int `json:"noticeSettingId"`
61 - OrganizationID int `json:"organizationId"` 61 + OrgID int `json:"orgId"`
62 } 62 }
63 ) 63 )
64 64
@@ -72,16 +72,15 @@ type ( @@ -72,16 +72,15 @@ type (
72 72
73 DataNoticeSettingSearch struct { 73 DataNoticeSettingSearch struct {
74 Count int64 `json:"count"` 74 Count int64 `json:"count"`
75 - NoticeSettings []struct { 75 + List []struct {
76 CompanyID int `json:"companyId"` 76 CompanyID int `json:"companyId"`
77 Content string `json:"content"` 77 Content string `json:"content"`
78 IsPush int `json:"isPush"` 78 IsPush int `json:"isPush"`
79 Module string `json:"module"` 79 Module string `json:"module"`
80 ModuleAction string `json:"moduleAction"` 80 ModuleAction string `json:"moduleAction"`
81 NoticeSettingID int `json:"noticeSettingId"` 81 NoticeSettingID int `json:"noticeSettingId"`
82 - OrganizationID int `json:"organizationId"`  
83 - SysCode string `json:"sysCode"`  
84 - } `json:"noticeSettings"` 82 + OrgID int `json:"orgId"`
  83 + } `json:"list"`
85 } 84 }
86 ) 85 )
87 86
@@ -95,8 +94,8 @@ type ( @@ -95,8 +94,8 @@ type (
95 Name string `json:"name"` 94 Name string `json:"name"`
96 } `json:"moduleList"` 95 } `json:"moduleList"`
97 ModuleActionList []struct { 96 ModuleActionList []struct {
98 - ModuleCode string `json:"module_code"`  
99 - ActionCode string `json:"action_Code"` 97 + ModuleCode string `json:"moduleCode"`
  98 + ActionCode string `json:"actionCode"`
100 Name string `json:"name"` 99 Name string `json:"name"`
101 } `json:"moduleActionList"` 100 } `json:"moduleActionList"`
102 ParamList []struct { 101 ParamList []struct {
@@ -10,4 +10,5 @@ func init() { @@ -10,4 +10,5 @@ func init() {
10 web.Router("/v1/web/notice-setting/profile/get", &web_client.NoticeSettingController{}, "Get:NoticeSettingProfile") 10 web.Router("/v1/web/notice-setting/profile/get", &web_client.NoticeSettingController{}, "Get:NoticeSettingProfile")
11 web.Router("/v1/web/notice-setting/:settingId", &web_client.NoticeSettingController{}, "Get:NoticeSettingGet") 11 web.Router("/v1/web/notice-setting/:settingId", &web_client.NoticeSettingController{}, "Get:NoticeSettingGet")
12 web.Router("/v1/web/notice-setting/:settingId", &web_client.NoticeSettingController{}, "Put:NoticeSettingUpdate") 12 web.Router("/v1/web/notice-setting/:settingId", &web_client.NoticeSettingController{}, "Put:NoticeSettingUpdate")
  13 + web.Router("/v1/web/notice-setting", &web_client.NoticeSettingController{}, "Post:NoticeSettingAdd")
13 } 14 }