作者 yangfu
1 package command 1 package command
2 2
3 -import (  
4 - "fmt"  
5 - "reflect"  
6 - "strings"  
7 - "time" 3 +// type CreateCompanyCommand struct {
  4 +// // 企业名称
  5 +// CompanyName string `cname:"企业名称" json:"companyName" valid:"Required"`
  6 +// // 规模
  7 +// Scale string `cname:"规模" json:"scale" valid:"Required"`
  8 +// // 公司Logo地址
  9 +// Logo string `cname:"公司Logo地址" json:"logo" valid:"Required"`
  10 +// // 公司地址
  11 +// Address string `cname:"公司地址" json:"address" valid:"Required"`
  12 +// // 所属行业
  13 +// IndustryCategory string `cname:"所属行业" json:"industryCategory" valid:"Required"`
  14 +// // 联系人
  15 +// Contacts string `cname:"联系人" json:"contacts" valid:"Required"`
  16 +// // 注册时间
  17 +// RegisteredTime time.Time `cname:"注册时间" json:"registeredTime,omitempty"`
  18 +// // 注册状态 1:已注册 2:待认证 3:已认证
  19 +// Status int `cname:"注册状态 1:已注册 2:待认证 3:已认证" json:"status,omitempty"`
  20 +// }
8 21
9 - "github.com/beego/beego/v2/core/validation"  
10 -) 22 +// func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) {
11 23
12 -type CreateCompanyCommand struct {  
13 - // 企业名称  
14 - CompanyName string `cname:"企业名称" json:"companyName" valid:"Required"`  
15 - // 规模  
16 - Scale string `cname:"规模" json:"scale" valid:"Required"`  
17 - // 公司Logo地址  
18 - Logo string `cname:"公司Logo地址" json:"logo" valid:"Required"`  
19 - // 公司地址  
20 - Address string `cname:"公司地址" json:"address" valid:"Required"`  
21 - // 所属行业  
22 - IndustryCategory string `cname:"所属行业" json:"industryCategory" valid:"Required"`  
23 - // 联系人  
24 - Contacts string `cname:"联系人" json:"contacts" valid:"Required"`  
25 - // 注册时间  
26 - RegisteredTime time.Time `cname:"注册时间" json:"registeredTime,omitempty"`  
27 - // 注册状态 1:已注册 2:待认证 3:已认证  
28 - Status int `cname:"注册状态 1:已注册 2:待认证 3:已认证" json:"status,omitempty"`  
29 -} 24 +// }
30 25
31 -func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) {  
32 -  
33 -}  
34 -  
35 -func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error {  
36 - valid := validation.Validation{}  
37 - b, err := valid.Valid(createCompanyCommand)  
38 - if err != nil {  
39 - return err  
40 - }  
41 - if !b {  
42 - elem := reflect.TypeOf(createCompanyCommand).Elem()  
43 - for _, validErr := range valid.Errors {  
44 - field, isExist := elem.FieldByName(validErr.Field)  
45 - if isExist {  
46 - return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))  
47 - } else {  
48 - return fmt.Errorf(validErr.Message)  
49 - }  
50 - }  
51 - }  
52 - return nil  
53 -} 26 +// func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error {
  27 +// valid := validation.Validation{}
  28 +// b, err := valid.Valid(createCompanyCommand)
  29 +// if err != nil {
  30 +// return err
  31 +// }
  32 +// if !b {
  33 +// elem := reflect.TypeOf(createCompanyCommand).Elem()
  34 +// for _, validErr := range valid.Errors {
  35 +// field, isExist := elem.FieldByName(validErr.Field)
  36 +// if isExist {
  37 +// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
  38 +// } else {
  39 +// return fmt.Errorf(validErr.Message)
  40 +// }
  41 +// }
  42 +// }
  43 +// return nil
  44 +// }
1 package command 1 package command
2 2
3 -import (  
4 - "fmt"  
5 - "reflect"  
6 - "strings" 3 +// type ListCompanyCustomizeMenusCommand struct {
  4 +// // 企业id
  5 +// CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`
  6 +// // 菜单类别 web app
  7 +// MenuCategory string `cname:"菜单类别" json:"menuCategory,omitempty" valid:"Required"`
  8 +// }
7 9
8 - "github.com/beego/beego/v2/core/validation"  
9 -) 10 +// func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {
10 11
11 -type ListCompanyCustomizeMenusCommand struct {  
12 - // 企业id  
13 - CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`  
14 - // 菜单类别 web app  
15 - MenuCategory string `cname:"菜单类别" json:"menuCategory,omitempty" valid:"Required"`  
16 -} 12 +// }
17 13
18 -func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {  
19 -  
20 -}  
21 -  
22 -func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) ValidateCommand() error {  
23 - valid := validation.Validation{}  
24 - b, err := valid.Valid(listCompanyCustomizeMenusCommand)  
25 - if err != nil {  
26 - return err  
27 - }  
28 - if !b {  
29 - elem := reflect.TypeOf(listCompanyCustomizeMenusCommand).Elem()  
30 - for _, validErr := range valid.Errors {  
31 - field, isExist := elem.FieldByName(validErr.Field)  
32 - if isExist {  
33 - return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))  
34 - } else {  
35 - return fmt.Errorf(validErr.Message)  
36 - }  
37 - }  
38 - }  
39 - return nil  
40 -} 14 +// func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) ValidateCommand() error {
  15 +// valid := validation.Validation{}
  16 +// b, err := valid.Valid(listCompanyCustomizeMenusCommand)
  17 +// if err != nil {
  18 +// return err
  19 +// }
  20 +// if !b {
  21 +// elem := reflect.TypeOf(listCompanyCustomizeMenusCommand).Elem()
  22 +// for _, validErr := range valid.Errors {
  23 +// field, isExist := elem.FieldByName(validErr.Field)
  24 +// if isExist {
  25 +// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
  26 +// } else {
  27 +// return fmt.Errorf(validErr.Message)
  28 +// }
  29 +// }
  30 +// }
  31 +// return nil
  32 +// }
1 package command 1 package command
2 2
3 -import (  
4 - "fmt"  
5 - "reflect"  
6 - "strings" 3 +// type RemoveCompanyCommand struct {
  4 +// // 企业id
  5 +// CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`
  6 +// }
7 7
8 - "github.com/beego/beego/v2/core/validation"  
9 -) 8 +// func (removeCompanyCommand *RemoveCompanyCommand) Valid(validation *validation.Validation) {
  9 +// validation.SetError("CustomValid", "未实现的自定义认证")
  10 +// }
10 11
11 -type RemoveCompanyCommand struct {  
12 - // 企业id  
13 - CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`  
14 -}  
15 -  
16 -func (removeCompanyCommand *RemoveCompanyCommand) Valid(validation *validation.Validation) {  
17 - validation.SetError("CustomValid", "未实现的自定义认证")  
18 -}  
19 -  
20 -func (removeCompanyCommand *RemoveCompanyCommand) ValidateCommand() error {  
21 - valid := validation.Validation{}  
22 - b, err := valid.Valid(removeCompanyCommand)  
23 - if err != nil {  
24 - return err  
25 - }  
26 - if !b {  
27 - elem := reflect.TypeOf(removeCompanyCommand).Elem()  
28 - for _, validErr := range valid.Errors {  
29 - field, isExist := elem.FieldByName(validErr.Field)  
30 - if isExist {  
31 - return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))  
32 - } else {  
33 - return fmt.Errorf(validErr.Message)  
34 - }  
35 - }  
36 - }  
37 - return nil  
38 -} 12 +// func (removeCompanyCommand *RemoveCompanyCommand) ValidateCommand() error {
  13 +// valid := validation.Validation{}
  14 +// b, err := valid.Valid(removeCompanyCommand)
  15 +// if err != nil {
  16 +// return err
  17 +// }
  18 +// if !b {
  19 +// elem := reflect.TypeOf(removeCompanyCommand).Elem()
  20 +// for _, validErr := range valid.Errors {
  21 +// field, isExist := elem.FieldByName(validErr.Field)
  22 +// if isExist {
  23 +// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
  24 +// } else {
  25 +// return fmt.Errorf(validErr.Message)
  26 +// }
  27 +// }
  28 +// }
  29 +// return nil
  30 +// }
1 package command 1 package command
2 2
3 -import (  
4 - "fmt"  
5 - "reflect"  
6 - "strings" 3 +// type UpdateCompanyCustomizeMenusCommand struct {
  4 +// // 企业id
  5 +// CompanyId int64 `cname:"企业id" json:"companyId" valid:"Required"`
  6 +// // 菜单编号
  7 +// MenuId int64 `cname:"菜单编号" json:"menuId" valid:"Required"`
  8 +// // 菜单名称
  9 +// //MenuName string `cname:"菜单名称" json:"menuName" valid:"Required"`
  10 +// // 菜单别名
  11 +// MenuAlias string `cname:"菜单别名" json:"menuAlias" valid:"Required"`
  12 +// // 排序
  13 +// Sort int `cname:"排序" json:"sort" valid:"Required"`
  14 +// }
7 15
8 - "github.com/beego/beego/v2/core/validation"  
9 -) 16 +// func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {
  17 +// //validation.SetError("CustomValid", "未实现的自定义认证")
  18 +// }
10 19
11 -type UpdateCompanyCustomizeMenusCommand struct {  
12 - // 企业id  
13 - CompanyId int64 `cname:"企业id" json:"companyId" valid:"Required"`  
14 - // 菜单编号  
15 - MenuId int64 `cname:"菜单编号" json:"menuId" valid:"Required"`  
16 - // 菜单名称  
17 - //MenuName string `cname:"菜单名称" json:"menuName" valid:"Required"`  
18 - // 菜单别名  
19 - MenuAlias string `cname:"菜单别名" json:"menuAlias" valid:"Required"`  
20 - // 排序  
21 - Sort int `cname:"排序" json:"sort" valid:"Required"`  
22 -}  
23 -  
24 -func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {  
25 - //validation.SetError("CustomValid", "未实现的自定义认证")  
26 -}  
27 -  
28 -func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) ValidateCommand() error {  
29 - valid := validation.Validation{}  
30 - b, err := valid.Valid(updateCompanyCustomizeMenusCommand)  
31 - if err != nil {  
32 - return err  
33 - }  
34 - if !b {  
35 - elem := reflect.TypeOf(updateCompanyCustomizeMenusCommand).Elem()  
36 - for _, validErr := range valid.Errors {  
37 - field, isExist := elem.FieldByName(validErr.Field)  
38 - if isExist {  
39 - return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))  
40 - } else {  
41 - return fmt.Errorf(validErr.Message)  
42 - }  
43 - }  
44 - }  
45 - return nil  
46 -} 20 +// func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) ValidateCommand() error {
  21 +// valid := validation.Validation{}
  22 +// b, err := valid.Valid(updateCompanyCustomizeMenusCommand)
  23 +// if err != nil {
  24 +// return err
  25 +// }
  26 +// if !b {
  27 +// elem := reflect.TypeOf(updateCompanyCustomizeMenusCommand).Elem()
  28 +// for _, validErr := range valid.Errors {
  29 +// field, isExist := elem.FieldByName(validErr.Field)
  30 +// if isExist {
  31 +// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
  32 +// } else {
  33 +// return fmt.Errorf(validErr.Message)
  34 +// }
  35 +// }
  36 +// }
  37 +// return nil
  38 +// }
1 package query 1 package query
2 2
3 -import (  
4 - "fmt"  
5 - "reflect"  
6 - "strings" 3 +// type ListCompanyQuery struct {
  4 +// // 查询偏离量
  5 +// Offset int `cname:"查询偏离量" json:"offset" valid:"Required"`
  6 +// // 查询限制
  7 +// Limit int `cname:"查询限制" json:"limit" valid:"Required"`
  8 +// }
7 9
8 - "github.com/beego/beego/v2/core/validation"  
9 -) 10 +// func (listCompanyQuery *ListCompanyQuery) Valid(validation *validation.Validation) {
  11 +// validation.SetError("CustomValid", "未实现的自定义认证")
  12 +// }
10 13
11 -type ListCompanyQuery struct {  
12 - // 查询偏离量  
13 - Offset int `cname:"查询偏离量" json:"offset" valid:"Required"`  
14 - // 查询限制  
15 - Limit int `cname:"查询限制" json:"limit" valid:"Required"`  
16 -}  
17 -  
18 -func (listCompanyQuery *ListCompanyQuery) Valid(validation *validation.Validation) {  
19 - validation.SetError("CustomValid", "未实现的自定义认证")  
20 -}  
21 -  
22 -func (listCompanyQuery *ListCompanyQuery) ValidateQuery() error {  
23 - valid := validation.Validation{}  
24 - b, err := valid.Valid(listCompanyQuery)  
25 - if err != nil {  
26 - return err  
27 - }  
28 - if !b {  
29 - elem := reflect.TypeOf(listCompanyQuery).Elem()  
30 - for _, validErr := range valid.Errors {  
31 - field, isExist := elem.FieldByName(validErr.Field)  
32 - if isExist {  
33 - return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))  
34 - } else {  
35 - return fmt.Errorf(validErr.Message)  
36 - }  
37 - }  
38 - }  
39 - return nil  
40 -} 14 +// func (listCompanyQuery *ListCompanyQuery) ValidateQuery() error {
  15 +// valid := validation.Validation{}
  16 +// b, err := valid.Valid(listCompanyQuery)
  17 +// if err != nil {
  18 +// return err
  19 +// }
  20 +// if !b {
  21 +// elem := reflect.TypeOf(listCompanyQuery).Elem()
  22 +// for _, validErr := range valid.Errors {
  23 +// field, isExist := elem.FieldByName(validErr.Field)
  24 +// if isExist {
  25 +// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
  26 +// } else {
  27 +// return fmt.Errorf(validErr.Message)
  28 +// }
  29 +// }
  30 +// }
  31 +// return nil
  32 +// }
@@ -12,9 +12,9 @@ type CompanyService struct { @@ -12,9 +12,9 @@ type CompanyService struct {
12 } 12 }
13 13
14 // 创建企业 14 // 创建企业
15 -func (companyService *CompanyService) CreateCompany(createCompanyCommand *command.CreateCompanyCommand) (interface{}, error) {  
16 - return nil, nil  
17 -} 15 +// func (companyService *CompanyService) CreateCompany(createCompanyCommand *command.CreateCompanyCommand) (interface{}, error) {
  16 +// return nil, nil
  17 +// }
18 18
19 // 返回企业 19 // 返回企业
20 func (companyService *CompanyService) GetCompany(getCompanyQuery *query.GetCompanyQuery) (interface{}, error) { 20 func (companyService *CompanyService) GetCompany(getCompanyQuery *query.GetCompanyQuery) (interface{}, error) {
@@ -22,19 +22,19 @@ func (companyService *CompanyService) GetCompany(getCompanyQuery *query.GetCompa @@ -22,19 +22,19 @@ func (companyService *CompanyService) GetCompany(getCompanyQuery *query.GetCompa
22 } 22 }
23 23
24 // 返回企业列表 24 // 返回企业列表
25 -func (companyService *CompanyService) ListCompany(listCompanyQuery *query.ListCompanyQuery) (interface{}, error) {  
26 - return nil, nil  
27 -} 25 +// func (companyService *CompanyService) ListCompany(listCompanyQuery *query.ListCompanyQuery) (interface{}, error) {
  26 +// return nil, nil
  27 +// }
28 28
29 // 返回自定义菜单列表(匹配有设置的菜单) 29 // 返回自定义菜单列表(匹配有设置的菜单)
30 -func (companyService *CompanyService) ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand *command.ListCompanyCustomizeMenusCommand) (interface{}, error) {  
31 - return nil, nil  
32 -} 30 +// func (companyService *CompanyService) ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand *command.ListCompanyCustomizeMenusCommand) (interface{}, error) {
  31 +// return nil, nil
  32 +// }
33 33
34 // 移除企业 34 // 移除企业
35 -func (companyService *CompanyService) RemoveCompany(removeCompanyCommand *command.RemoveCompanyCommand) (interface{}, error) {  
36 - return nil, nil  
37 -} 35 +// func (companyService *CompanyService) RemoveCompany(removeCompanyCommand *command.RemoveCompanyCommand) (interface{}, error) {
  36 +// return nil, nil
  37 +// }
38 38
39 // 更新企业 39 // 更新企业
40 func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *command.UpdateCompanyCommand) (interface{}, error) { 40 func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *command.UpdateCompanyCommand) (interface{}, error) {
@@ -53,9 +53,9 @@ func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *comman @@ -53,9 +53,9 @@ func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *comman
53 } 53 }
54 54
55 // 更新自定义菜单 55 // 更新自定义菜单
56 -func (companyService *CompanyService) UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand *command.UpdateCompanyCustomizeMenusCommand) (interface{}, error) {  
57 - return nil, nil  
58 -} 56 +// func (companyService *CompanyService) UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand *command.UpdateCompanyCustomizeMenusCommand) (interface{}, error) {
  57 +// return nil, nil
  58 +// }
59 59
60 func NewCompanyService(options map[string]interface{}) *CompanyService { 60 func NewCompanyService(options map[string]interface{}) *CompanyService {
61 newCompanyService := &CompanyService{} 61 newCompanyService := &CompanyService{}
  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())
@@ -79,18 +92,18 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting @@ -79,18 +92,18 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting
79 noticeSettingAddCommand.Operator, 92 noticeSettingAddCommand.Operator,
80 ) 93 )
81 result, err := creationBasicGateway.NoticeSettingAdd(allied_creation_basic.ReqNoticeSettingAdd{ 94 result, err := creationBasicGateway.NoticeSettingAdd(allied_creation_basic.ReqNoticeSettingAdd{
82 - CompanyID: int(noticeSettingAddCommand.Operator.CompanyId),  
83 - Content: noticeSettingAddCommand.Content,  
84 - IsPush: noticeSettingAddCommand.IsPush,  
85 - Module: noticeSettingAddCommand.Module,  
86 - ModuleAction: noticeSettingAddCommand.ModuleAction,  
87 - OrganizationID: int(noticeSettingAddCommand.Operator.OrgId), 95 + CompanyID: int(noticeSettingAddCommand.Operator.CompanyId),
  96 + Content: noticeSettingAddCommand.Content,
  97 + IsPush: noticeSettingAddCommand.IsPush,
  98 + Module: noticeSettingAddCommand.Module,
  99 + ModuleAction: noticeSettingAddCommand.ModuleAction,
  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{}{
@@ -2,14 +2,14 @@ package allied_creation_basic @@ -2,14 +2,14 @@ package allied_creation_basic
2 2
3 //ReqGetDictionarysByCode 根据code获取字典数据 3 //ReqGetDictionarysByCode 根据code获取字典数据
4 type ReqGetDictionaryByCode struct { 4 type ReqGetDictionaryByCode struct {
5 - DictCode []string `json:"dictCode"` 5 + DictCodes []string `json:"dictCodes"`
6 } 6 }
7 7
8 //DataGetDictionarysByCode 根据code获取字典数据 8 //DataGetDictionarysByCode 根据code获取字典数据
9 type DataGetDictionaryByCode struct { 9 type DataGetDictionaryByCode struct {
10 Dictionarys []struct { 10 Dictionarys []struct {
11 // 字典编号 主键 11 // 字典编号 主键
12 - DictionaryId int64 `json:"dictionaryId"` 12 + DictionaryId int64 `json:"dictionaryId,string"`
13 // 字典编码 13 // 字典编码
14 DictCode string `json:"dictCode"` 14 DictCode string `json:"dictCode"`
15 // 字典名称 15 // 字典名称
@@ -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,19 +19,19 @@ type ( @@ -19,19 +19,19 @@ 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
26 //添加化消息模板 26 //添加化消息模板
27 type ( 27 type (
28 ReqNoticeSettingAdd struct { 28 ReqNoticeSettingAdd struct {
29 - CompanyID int `json:"companyId"`  
30 - Content string `json:"content"`  
31 - IsPush int `json:"isPush"`  
32 - Module string `json:"module"`  
33 - ModuleAction string `json:"moduleAction"`  
34 - OrganizationID int `json:"organizationId"` 29 + CompanyID int `json:"companyId"`
  30 + Content string `json:"content"`
  31 + IsPush int `json:"isPush"`
  32 + Module string `json:"module"`
  33 + ModuleAction string `json:"moduleAction"`
  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
@@ -71,17 +71,16 @@ type ( @@ -71,17 +71,16 @@ type (
71 } 71 }
72 72
73 DataNoticeSettingSearch struct { 73 DataNoticeSettingSearch struct {
74 - Count int64 `json:"count"`  
75 - NoticeSettings []struct { 74 + Count int64 `json:"count"`
  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 {
@@ -12,6 +12,22 @@ type ( @@ -12,6 +12,22 @@ type (
12 } 12 }
13 13
14 DataSystemSettingUpdate struct { 14 DataSystemSettingUpdate struct {
  15 + // 公司id
  16 + CompanyId int64 `json:"companyId,string"`
  17 + // 管控层级
  18 + ControlLevel string `json:"controlLevel"`
  19 + // 描述
  20 + Description string `json:"description"`
  21 + // 设置对应的编码
  22 + SettingCode string `json:"settingCode"`
  23 + // 设置对应的名称
  24 + SettingName string `json:"settingName"`
  25 + // 数据id
  26 + SystemSettingId int64 `json:"systemSettingId,string"`
  27 + // 设定的值
  28 + Value string `json:"value"`
  29 + // 值类型
  30 + ValueType string `json:"valueType"`
15 } 31 }
16 ) 32 )
17 33
@@ -23,7 +39,7 @@ type ( @@ -23,7 +39,7 @@ type (
23 DataSystemSettingSearch struct { 39 DataSystemSettingSearch struct {
24 SystemSetting []struct { 40 SystemSetting []struct {
25 // 公司id 41 // 公司id
26 - CompanyId int64 `json:"companyId"` 42 + CompanyId int64 `json:"companyId,string"`
27 // 管控层级 43 // 管控层级
28 ControlLevel string `json:"controlLevel"` 44 ControlLevel string `json:"controlLevel"`
29 // 描述 45 // 描述
@@ -33,7 +49,7 @@ type ( @@ -33,7 +49,7 @@ type (
33 // 设置对应的名称 49 // 设置对应的名称
34 SettingName string `json:"settingName"` 50 SettingName string `json:"settingName"`
35 // 数据id 51 // 数据id
36 - SystemSettingId int64 `json:"systemSettingId"` 52 + SystemSettingId int64 `json:"systemSettingId,string"`
37 // 设定的值 53 // 设定的值
38 Value string `json:"value"` 54 Value string `json:"value"`
39 // 值类型 55 // 值类型
@@ -50,7 +66,7 @@ type ( @@ -50,7 +66,7 @@ type (
50 66
51 DataSystemSettingGet struct { 67 DataSystemSettingGet struct {
52 // 公司id 68 // 公司id
53 - CompanyId int64 `json:"companyId"` 69 + CompanyId int64 `json:"companyId,string"`
54 // 管控层级 70 // 管控层级
55 ControlLevel string `json:"controlLevel"` 71 ControlLevel string `json:"controlLevel"`
56 // 描述 72 // 描述
@@ -60,7 +76,7 @@ type ( @@ -60,7 +76,7 @@ type (
60 // 设置对应的名称 76 // 设置对应的名称
61 SettingName string `json:"settingName"` 77 SettingName string `json:"settingName"`
62 // 数据id 78 // 数据id
63 - SystemSettingId int64 `json:"systemSettingId"` 79 + SystemSettingId int64 `json:"systemSettingId,string"`
64 // 设定的值 80 // 设定的值
65 Value string `json:"value"` 81 Value string `json:"value"`
66 // 值类型 82 // 值类型
@@ -10,13 +10,13 @@ type CompanyController struct { @@ -10,13 +10,13 @@ type CompanyController struct {
10 baseController 10 baseController
11 } 11 }
12 12
13 -func (controller *CompanyController) CreateCompany() {  
14 - companyService := service.NewCompanyService(nil)  
15 - createCompanyCommand := &command.CreateCompanyCommand{}  
16 - controller.Unmarshal(createCompanyCommand)  
17 - data, err := companyService.CreateCompany(createCompanyCommand)  
18 - controller.Response(data, err)  
19 -} 13 +// func (controller *CompanyController) CreateCompany() {
  14 +// companyService := service.NewCompanyService(nil)
  15 +// createCompanyCommand := &command.CreateCompanyCommand{}
  16 +// controller.Unmarshal(createCompanyCommand)
  17 +// data, err := companyService.CreateCompany(createCompanyCommand)
  18 +// controller.Response(data, err)
  19 +// }
20 20
21 func (controller *CompanyController) UpdateCompany() { 21 func (controller *CompanyController) UpdateCompany() {
22 companyService := service.NewCompanyService(nil) 22 companyService := service.NewCompanyService(nil)
@@ -36,40 +36,40 @@ func (controller *CompanyController) GetCompany() { @@ -36,40 +36,40 @@ func (controller *CompanyController) GetCompany() {
36 controller.Response(data, err) 36 controller.Response(data, err)
37 } 37 }
38 38
39 -func (controller *CompanyController) RemoveCompany() {  
40 - companyService := service.NewCompanyService(nil)  
41 - removeCompanyCommand := &command.RemoveCompanyCommand{}  
42 - controller.Unmarshal(removeCompanyCommand)  
43 - companyId, _ := controller.GetInt64(":companyId")  
44 - removeCompanyCommand.CompanyId = companyId  
45 - data, err := companyService.RemoveCompany(removeCompanyCommand)  
46 - controller.Response(data, err)  
47 -} 39 +// func (controller *CompanyController) RemoveCompany() {
  40 +// companyService := service.NewCompanyService(nil)
  41 +// removeCompanyCommand := &command.RemoveCompanyCommand{}
  42 +// controller.Unmarshal(removeCompanyCommand)
  43 +// companyId, _ := controller.GetInt64(":companyId")
  44 +// removeCompanyCommand.CompanyId = companyId
  45 +// data, err := companyService.RemoveCompany(removeCompanyCommand)
  46 +// controller.Response(data, err)
  47 +// }
48 48
49 -func (controller *CompanyController) ListCompany() {  
50 - companyService := service.NewCompanyService(nil)  
51 - listCompanyQuery := &query.ListCompanyQuery{}  
52 - data, err := companyService.ListCompany(listCompanyQuery)  
53 - controller.Response(data, err)  
54 -} 49 +// func (controller *CompanyController) ListCompany() {
  50 +// companyService := service.NewCompanyService(nil)
  51 +// listCompanyQuery := &query.ListCompanyQuery{}
  52 +// data, err := companyService.ListCompany(listCompanyQuery)
  53 +// controller.Response(data, err)
  54 +// }
55 55
56 -func (controller *CompanyController) ListCompanyCustomizeMenus() {  
57 - companyService := service.NewCompanyService(nil)  
58 - listCompanyCustomizeMenusCommand := &command.ListCompanyCustomizeMenusCommand{}  
59 - controller.Unmarshal(listCompanyCustomizeMenusCommand)  
60 - companyId, _ := controller.GetInt64(":companyId")  
61 - listCompanyCustomizeMenusCommand.CompanyId = companyId  
62 - listCompanyCustomizeMenusCommand.MenuCategory = controller.GetString("menuCategory")  
63 - data, err := companyService.ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand)  
64 - controller.Response(data, err)  
65 -} 56 +// func (controller *CompanyController) ListCompanyCustomizeMenus() {
  57 +// companyService := service.NewCompanyService(nil)
  58 +// listCompanyCustomizeMenusCommand := &command.ListCompanyCustomizeMenusCommand{}
  59 +// controller.Unmarshal(listCompanyCustomizeMenusCommand)
  60 +// companyId, _ := controller.GetInt64(":companyId")
  61 +// listCompanyCustomizeMenusCommand.CompanyId = companyId
  62 +// listCompanyCustomizeMenusCommand.MenuCategory = controller.GetString("menuCategory")
  63 +// data, err := companyService.ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand)
  64 +// controller.Response(data, err)
  65 +// }
66 66
67 -func (controller *CompanyController) UpdateCompanyCustomizeMenus() {  
68 - companyService := service.NewCompanyService(nil)  
69 - updateCompanyCustomizeMenusCommand := &command.UpdateCompanyCustomizeMenusCommand{}  
70 - controller.Unmarshal(updateCompanyCustomizeMenusCommand)  
71 - companyId, _ := controller.GetInt64(":companyId")  
72 - updateCompanyCustomizeMenusCommand.CompanyId = companyId  
73 - data, err := companyService.UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand)  
74 - controller.Response(data, err)  
75 -} 67 +// func (controller *CompanyController) UpdateCompanyCustomizeMenus() {
  68 +// companyService := service.NewCompanyService(nil)
  69 +// updateCompanyCustomizeMenusCommand := &command.UpdateCompanyCustomizeMenusCommand{}
  70 +// controller.Unmarshal(updateCompanyCustomizeMenusCommand)
  71 +// companyId, _ := controller.GetInt64(":companyId")
  72 +// updateCompanyCustomizeMenusCommand.CompanyId = companyId
  73 +// data, err := companyService.UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand)
  74 +// controller.Response(data, err)
  75 +// }
@@ -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 }
@@ -7,6 +7,6 @@ import ( @@ -7,6 +7,6 @@ import (
7 7
8 func init() { 8 func init() {
9 web.Router("/v1/web/system-setting/search", &web_client.SystemSettingController{}, "Post:SystemSettingSearch") 9 web.Router("/v1/web/system-setting/search", &web_client.SystemSettingController{}, "Post:SystemSettingSearch")
10 - web.Router("/v1/web/syetem-setting/:settingId", &web_client.SystemSettingController{}, "Get:SystemSettingGet") 10 + web.Router("/v1/web/syetem-setting/get", &web_client.SystemSettingController{}, "Post:SystemSettingGet")
11 web.Router("/v1/web/syetem-setting", &web_client.SystemSettingController{}, "Put:SystemSettingUpdate") 11 web.Router("/v1/web/syetem-setting", &web_client.SystemSettingController{}, "Put:SystemSettingUpdate")
12 } 12 }