作者 yangfu
package command
import (
"fmt"
"reflect"
"strings"
"time"
// type CreateCompanyCommand struct {
// // 企业名称
// CompanyName string `cname:"企业名称" json:"companyName" valid:"Required"`
// // 规模
// Scale string `cname:"规模" json:"scale" valid:"Required"`
// // 公司Logo地址
// Logo string `cname:"公司Logo地址" json:"logo" valid:"Required"`
// // 公司地址
// Address string `cname:"公司地址" json:"address" valid:"Required"`
// // 所属行业
// IndustryCategory string `cname:"所属行业" json:"industryCategory" valid:"Required"`
// // 联系人
// Contacts string `cname:"联系人" json:"contacts" valid:"Required"`
// // 注册时间
// RegisteredTime time.Time `cname:"注册时间" json:"registeredTime,omitempty"`
// // 注册状态 1:已注册 2:待认证 3:已认证
// Status int `cname:"注册状态 1:已注册 2:待认证 3:已认证" json:"status,omitempty"`
// }
"github.com/beego/beego/v2/core/validation"
)
// func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) {
type CreateCompanyCommand struct {
// 企业名称
CompanyName string `cname:"企业名称" json:"companyName" valid:"Required"`
// 规模
Scale string `cname:"规模" json:"scale" valid:"Required"`
// 公司Logo地址
Logo string `cname:"公司Logo地址" json:"logo" valid:"Required"`
// 公司地址
Address string `cname:"公司地址" json:"address" valid:"Required"`
// 所属行业
IndustryCategory string `cname:"所属行业" json:"industryCategory" valid:"Required"`
// 联系人
Contacts string `cname:"联系人" json:"contacts" valid:"Required"`
// 注册时间
RegisteredTime time.Time `cname:"注册时间" json:"registeredTime,omitempty"`
// 注册状态 1:已注册 2:待认证 3:已认证
Status int `cname:"注册状态 1:已注册 2:待认证 3:已认证" json:"status,omitempty"`
}
// }
func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) {
}
func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(createCompanyCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(createCompanyCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
// func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(createCompanyCommand)
// if err != nil {
// return err
// }
// if !b {
// elem := reflect.TypeOf(createCompanyCommand).Elem()
// for _, validErr := range valid.Errors {
// field, isExist := elem.FieldByName(validErr.Field)
// if isExist {
// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
// } else {
// return fmt.Errorf(validErr.Message)
// }
// }
// }
// return nil
// }
... ...
package command
import (
"fmt"
"reflect"
"strings"
// type ListCompanyCustomizeMenusCommand struct {
// // 企业id
// CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`
// // 菜单类别 web app
// MenuCategory string `cname:"菜单类别" json:"menuCategory,omitempty" valid:"Required"`
// }
"github.com/beego/beego/v2/core/validation"
)
// func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {
type ListCompanyCustomizeMenusCommand struct {
// 企业id
CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`
// 菜单类别 web app
MenuCategory string `cname:"菜单类别" json:"menuCategory,omitempty" valid:"Required"`
}
// }
func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {
}
func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(listCompanyCustomizeMenusCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(listCompanyCustomizeMenusCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
// func (listCompanyCustomizeMenusCommand *ListCompanyCustomizeMenusCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(listCompanyCustomizeMenusCommand)
// if err != nil {
// return err
// }
// if !b {
// elem := reflect.TypeOf(listCompanyCustomizeMenusCommand).Elem()
// for _, validErr := range valid.Errors {
// field, isExist := elem.FieldByName(validErr.Field)
// if isExist {
// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
// } else {
// return fmt.Errorf(validErr.Message)
// }
// }
// }
// return nil
// }
... ...
package command
import (
"fmt"
"reflect"
"strings"
// type RemoveCompanyCommand struct {
// // 企业id
// CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`
// }
"github.com/beego/beego/v2/core/validation"
)
// func (removeCompanyCommand *RemoveCompanyCommand) Valid(validation *validation.Validation) {
// validation.SetError("CustomValid", "未实现的自定义认证")
// }
type RemoveCompanyCommand struct {
// 企业id
CompanyId int64 `cname:"企业id" json:"companyId,string" valid:"Required"`
}
func (removeCompanyCommand *RemoveCompanyCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (removeCompanyCommand *RemoveCompanyCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(removeCompanyCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(removeCompanyCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
// func (removeCompanyCommand *RemoveCompanyCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(removeCompanyCommand)
// if err != nil {
// return err
// }
// if !b {
// elem := reflect.TypeOf(removeCompanyCommand).Elem()
// for _, validErr := range valid.Errors {
// field, isExist := elem.FieldByName(validErr.Field)
// if isExist {
// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
// } else {
// return fmt.Errorf(validErr.Message)
// }
// }
// }
// return nil
// }
... ...
package command
import (
"fmt"
"reflect"
"strings"
// type UpdateCompanyCustomizeMenusCommand struct {
// // 企业id
// CompanyId int64 `cname:"企业id" json:"companyId" valid:"Required"`
// // 菜单编号
// MenuId int64 `cname:"菜单编号" json:"menuId" valid:"Required"`
// // 菜单名称
// //MenuName string `cname:"菜单名称" json:"menuName" valid:"Required"`
// // 菜单别名
// MenuAlias string `cname:"菜单别名" json:"menuAlias" valid:"Required"`
// // 排序
// Sort int `cname:"排序" json:"sort" valid:"Required"`
// }
"github.com/beego/beego/v2/core/validation"
)
// func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {
// //validation.SetError("CustomValid", "未实现的自定义认证")
// }
type UpdateCompanyCustomizeMenusCommand struct {
// 企业id
CompanyId int64 `cname:"企业id" json:"companyId" valid:"Required"`
// 菜单编号
MenuId int64 `cname:"菜单编号" json:"menuId" valid:"Required"`
// 菜单名称
//MenuName string `cname:"菜单名称" json:"menuName" valid:"Required"`
// 菜单别名
MenuAlias string `cname:"菜单别名" json:"menuAlias" valid:"Required"`
// 排序
Sort int `cname:"排序" json:"sort" valid:"Required"`
}
func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateCompanyCustomizeMenusCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(updateCompanyCustomizeMenusCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
// func (updateCompanyCustomizeMenusCommand *UpdateCompanyCustomizeMenusCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(updateCompanyCustomizeMenusCommand)
// if err != nil {
// return err
// }
// if !b {
// elem := reflect.TypeOf(updateCompanyCustomizeMenusCommand).Elem()
// for _, validErr := range valid.Errors {
// field, isExist := elem.FieldByName(validErr.Field)
// if isExist {
// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
// } else {
// return fmt.Errorf(validErr.Message)
// }
// }
// }
// return nil
// }
... ...
package query
import (
"fmt"
"reflect"
"strings"
// type ListCompanyQuery struct {
// // 查询偏离量
// Offset int `cname:"查询偏离量" json:"offset" valid:"Required"`
// // 查询限制
// Limit int `cname:"查询限制" json:"limit" valid:"Required"`
// }
"github.com/beego/beego/v2/core/validation"
)
// func (listCompanyQuery *ListCompanyQuery) Valid(validation *validation.Validation) {
// validation.SetError("CustomValid", "未实现的自定义认证")
// }
type ListCompanyQuery struct {
// 查询偏离量
Offset int `cname:"查询偏离量" json:"offset" valid:"Required"`
// 查询限制
Limit int `cname:"查询限制" json:"limit" valid:"Required"`
}
func (listCompanyQuery *ListCompanyQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (listCompanyQuery *ListCompanyQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listCompanyQuery)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(listCompanyQuery).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
// func (listCompanyQuery *ListCompanyQuery) ValidateQuery() error {
// valid := validation.Validation{}
// b, err := valid.Valid(listCompanyQuery)
// if err != nil {
// return err
// }
// if !b {
// elem := reflect.TypeOf(listCompanyQuery).Elem()
// for _, validErr := range valid.Errors {
// field, isExist := elem.FieldByName(validErr.Field)
// if isExist {
// return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
// } else {
// return fmt.Errorf(validErr.Message)
// }
// }
// }
// return nil
// }
... ...
... ... @@ -12,9 +12,9 @@ type CompanyService struct {
}
// 创建企业
func (companyService *CompanyService) CreateCompany(createCompanyCommand *command.CreateCompanyCommand) (interface{}, error) {
return nil, nil
}
// func (companyService *CompanyService) CreateCompany(createCompanyCommand *command.CreateCompanyCommand) (interface{}, error) {
// return nil, nil
// }
// 返回企业
func (companyService *CompanyService) GetCompany(getCompanyQuery *query.GetCompanyQuery) (interface{}, error) {
... ... @@ -22,19 +22,19 @@ func (companyService *CompanyService) GetCompany(getCompanyQuery *query.GetCompa
}
// 返回企业列表
func (companyService *CompanyService) ListCompany(listCompanyQuery *query.ListCompanyQuery) (interface{}, error) {
return nil, nil
}
// func (companyService *CompanyService) ListCompany(listCompanyQuery *query.ListCompanyQuery) (interface{}, error) {
// return nil, nil
// }
// 返回自定义菜单列表(匹配有设置的菜单)
func (companyService *CompanyService) ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand *command.ListCompanyCustomizeMenusCommand) (interface{}, error) {
return nil, nil
}
// func (companyService *CompanyService) ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand *command.ListCompanyCustomizeMenusCommand) (interface{}, error) {
// return nil, nil
// }
// 移除企业
func (companyService *CompanyService) RemoveCompany(removeCompanyCommand *command.RemoveCompanyCommand) (interface{}, error) {
return nil, nil
}
// func (companyService *CompanyService) RemoveCompany(removeCompanyCommand *command.RemoveCompanyCommand) (interface{}, error) {
// return nil, nil
// }
// 更新企业
func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *command.UpdateCompanyCommand) (interface{}, error) {
... ... @@ -53,9 +53,9 @@ func (companyService *CompanyService) UpdateCompany(updateCompanyCommand *comman
}
// 更新自定义菜单
func (companyService *CompanyService) UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand *command.UpdateCompanyCustomizeMenusCommand) (interface{}, error) {
return nil, nil
}
// func (companyService *CompanyService) UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand *command.UpdateCompanyCustomizeMenusCommand) (interface{}, error) {
// return nil, nil
// }
func NewCompanyService(options map[string]interface{}) *CompanyService {
newCompanyService := &CompanyService{}
... ...
package dto
type NoticeSettingItem struct {
CompanyID int `json:"companyId,string"`
Content string `json:"content"`
IsPush int `json:"isPush"`
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
NoticeSettingID int `json:"noticeSettingId,string"`
OrgID int `json:"orgId,string"`
}
... ...
... ... @@ -11,7 +11,7 @@ type NoticeSettingListQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageNumber" valid:"Required"`
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
}
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
)
... ... @@ -29,8 +30,20 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return result.Count, result.NoticeSettings, nil
dataList := []dto.NoticeSettingItem{}
for _, v := range result.List {
item := dto.NoticeSettingItem{
CompanyID: v.CompanyID,
Content: v.Content,
IsPush: v.IsPush,
Module: v.Module,
ModuleAction: v.ModuleAction,
NoticeSettingID: v.NoticeSettingID,
OrgID: v.OrgID,
}
dataList = append(dataList, item)
}
return result.Count, dataList, nil
}
//NoticeSettingProfile 推送消息配置需求的参数候选项
... ... @@ -62,7 +75,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett
IsPush: noticeSettingUpdateCommand.IsPush,
Module: noticeSettingUpdateCommand.Module,
ModuleAction: noticeSettingUpdateCommand.ModuleAction,
OrganizationID: int(noticeSettingUpdateCommand.Operator.OrgId),
OrgId: int(noticeSettingUpdateCommand.Operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -84,13 +97,13 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting
IsPush: noticeSettingAddCommand.IsPush,
Module: noticeSettingAddCommand.Module,
ModuleAction: noticeSettingAddCommand.ModuleAction,
OrganizationID: int(noticeSettingAddCommand.Operator.OrgId),
OrgId: int(noticeSettingAddCommand.Operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
data := struct {
NoticeSettingId int `json:"noticeSettingId"`
NoticeSettingId int `json:"noticeSettingId,string"`
command.NoticeSettingAddCommand
}{
NoticeSettingId: result.NoticeSettingID,
... ... @@ -115,7 +128,16 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingGet(noticeSetting
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return result, nil
data := dto.NoticeSettingItem{
CompanyID: result.CompanyID,
Content: result.Content,
IsPush: result.IsPush,
Module: result.Module,
ModuleAction: result.ModuleAction,
NoticeSettingID: result.NoticeSettingID,
OrgID: result.OrgID,
}
return data, nil
}
func NewNoticeSettingService(options map[string]interface{}) *NoticeSettingService {
... ...
... ... @@ -12,7 +12,7 @@ var LOG_LEVEL = "debug"
var HTTP_PORT int = 8083
//天联共创基础模块
var ALLIED_CREATION_BASIC_HOST = "http://allied-creation-basic-dev.fjmaimaimai.com"
var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" //"http://allied-creation-basic-dev.fjmaimaimai.com"
//天联共创用户模块
var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creation-user-dev.fjmaimaimai.com"
... ...
... ... @@ -11,7 +11,7 @@ import (
// NoticeSettingUpdate 更新消息模板
func (gateway HttplibAlliedCreationBasic) NoticeSettingUpdate(param ReqNoticeSettingUpdate) (*DataNoticeSettingUpdate, error) {
url := gateway.baseUrL + "/notice-setting" + strconv.Itoa(param.NoticeSettingID)
url := gateway.baseUrL + "/notice-setting/" + strconv.Itoa(param.NoticeSettingID)
method := "PUT"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向基础模块请求数据:更新消息模板。", map[string]interface{}{
... ...
... ... @@ -2,14 +2,14 @@ package allied_creation_basic
//ReqGetDictionarysByCode 根据code获取字典数据
type ReqGetDictionaryByCode struct {
DictCode []string `json:"dictCode"`
DictCodes []string `json:"dictCodes"`
}
//DataGetDictionarysByCode 根据code获取字典数据
type DataGetDictionaryByCode struct {
Dictionarys []struct {
// 字典编号 主键
DictionaryId int64 `json:"dictionaryId"`
DictionaryId int64 `json:"dictionaryId,string"`
// 字典编码
DictCode string `json:"dictCode"`
// 字典名称
... ...
... ... @@ -9,7 +9,7 @@ type (
IsPush int `json:"isPush"`
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
OrganizationID int `json:"organizationId"`
OrgId int `json:"orgId"`
}
DataNoticeSettingUpdate struct {
... ... @@ -19,7 +19,7 @@ type (
IsPush int `json:"isPush"`
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
OrganizationID int `json:"organizationId"`
OrgId int `json:"orgId"`
}
)
... ... @@ -31,7 +31,7 @@ type (
IsPush int `json:"isPush"`
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
OrganizationID int `json:"organizationId"`
OrgId int `json:"orgId"`
}
DataNoticeSettingAdd struct {
... ... @@ -41,7 +41,7 @@ type (
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
NoticeSettingID int `json:"noticeSettingId"`
OrganizationID int `json:"organizationId"`
OrgId int `json:"orgId"`
}
)
... ... @@ -58,7 +58,7 @@ type (
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
NoticeSettingID int `json:"noticeSettingId"`
OrganizationID int `json:"organizationId"`
OrgID int `json:"orgId"`
}
)
... ... @@ -72,16 +72,15 @@ type (
DataNoticeSettingSearch struct {
Count int64 `json:"count"`
NoticeSettings []struct {
List []struct {
CompanyID int `json:"companyId"`
Content string `json:"content"`
IsPush int `json:"isPush"`
Module string `json:"module"`
ModuleAction string `json:"moduleAction"`
NoticeSettingID int `json:"noticeSettingId"`
OrganizationID int `json:"organizationId"`
SysCode string `json:"sysCode"`
} `json:"noticeSettings"`
OrgID int `json:"orgId"`
} `json:"list"`
}
)
... ... @@ -95,8 +94,8 @@ type (
Name string `json:"name"`
} `json:"moduleList"`
ModuleActionList []struct {
ModuleCode string `json:"module_code"`
ActionCode string `json:"action_Code"`
ModuleCode string `json:"moduleCode"`
ActionCode string `json:"actionCode"`
Name string `json:"name"`
} `json:"moduleActionList"`
ParamList []struct {
... ...
... ... @@ -12,6 +12,22 @@ type (
}
DataSystemSettingUpdate struct {
// 公司id
CompanyId int64 `json:"companyId,string"`
// 管控层级
ControlLevel string `json:"controlLevel"`
// 描述
Description string `json:"description"`
// 设置对应的编码
SettingCode string `json:"settingCode"`
// 设置对应的名称
SettingName string `json:"settingName"`
// 数据id
SystemSettingId int64 `json:"systemSettingId,string"`
// 设定的值
Value string `json:"value"`
// 值类型
ValueType string `json:"valueType"`
}
)
... ... @@ -23,7 +39,7 @@ type (
DataSystemSettingSearch struct {
SystemSetting []struct {
// 公司id
CompanyId int64 `json:"companyId"`
CompanyId int64 `json:"companyId,string"`
// 管控层级
ControlLevel string `json:"controlLevel"`
// 描述
... ... @@ -33,7 +49,7 @@ type (
// 设置对应的名称
SettingName string `json:"settingName"`
// 数据id
SystemSettingId int64 `json:"systemSettingId"`
SystemSettingId int64 `json:"systemSettingId,string"`
// 设定的值
Value string `json:"value"`
// 值类型
... ... @@ -50,7 +66,7 @@ type (
DataSystemSettingGet struct {
// 公司id
CompanyId int64 `json:"companyId"`
CompanyId int64 `json:"companyId,string"`
// 管控层级
ControlLevel string `json:"controlLevel"`
// 描述
... ... @@ -60,7 +76,7 @@ type (
// 设置对应的名称
SettingName string `json:"settingName"`
// 数据id
SystemSettingId int64 `json:"systemSettingId"`
SystemSettingId int64 `json:"systemSettingId,string"`
// 设定的值
Value string `json:"value"`
// 值类型
... ...
... ... @@ -10,13 +10,13 @@ type CompanyController struct {
baseController
}
func (controller *CompanyController) CreateCompany() {
companyService := service.NewCompanyService(nil)
createCompanyCommand := &command.CreateCompanyCommand{}
controller.Unmarshal(createCompanyCommand)
data, err := companyService.CreateCompany(createCompanyCommand)
controller.Response(data, err)
}
// func (controller *CompanyController) CreateCompany() {
// companyService := service.NewCompanyService(nil)
// createCompanyCommand := &command.CreateCompanyCommand{}
// controller.Unmarshal(createCompanyCommand)
// data, err := companyService.CreateCompany(createCompanyCommand)
// controller.Response(data, err)
// }
func (controller *CompanyController) UpdateCompany() {
companyService := service.NewCompanyService(nil)
... ... @@ -36,40 +36,40 @@ func (controller *CompanyController) GetCompany() {
controller.Response(data, err)
}
func (controller *CompanyController) RemoveCompany() {
companyService := service.NewCompanyService(nil)
removeCompanyCommand := &command.RemoveCompanyCommand{}
controller.Unmarshal(removeCompanyCommand)
companyId, _ := controller.GetInt64(":companyId")
removeCompanyCommand.CompanyId = companyId
data, err := companyService.RemoveCompany(removeCompanyCommand)
controller.Response(data, err)
}
// func (controller *CompanyController) RemoveCompany() {
// companyService := service.NewCompanyService(nil)
// removeCompanyCommand := &command.RemoveCompanyCommand{}
// controller.Unmarshal(removeCompanyCommand)
// companyId, _ := controller.GetInt64(":companyId")
// removeCompanyCommand.CompanyId = companyId
// data, err := companyService.RemoveCompany(removeCompanyCommand)
// controller.Response(data, err)
// }
func (controller *CompanyController) ListCompany() {
companyService := service.NewCompanyService(nil)
listCompanyQuery := &query.ListCompanyQuery{}
data, err := companyService.ListCompany(listCompanyQuery)
controller.Response(data, err)
}
// func (controller *CompanyController) ListCompany() {
// companyService := service.NewCompanyService(nil)
// listCompanyQuery := &query.ListCompanyQuery{}
// data, err := companyService.ListCompany(listCompanyQuery)
// controller.Response(data, err)
// }
func (controller *CompanyController) ListCompanyCustomizeMenus() {
companyService := service.NewCompanyService(nil)
listCompanyCustomizeMenusCommand := &command.ListCompanyCustomizeMenusCommand{}
controller.Unmarshal(listCompanyCustomizeMenusCommand)
companyId, _ := controller.GetInt64(":companyId")
listCompanyCustomizeMenusCommand.CompanyId = companyId
listCompanyCustomizeMenusCommand.MenuCategory = controller.GetString("menuCategory")
data, err := companyService.ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand)
controller.Response(data, err)
}
// func (controller *CompanyController) ListCompanyCustomizeMenus() {
// companyService := service.NewCompanyService(nil)
// listCompanyCustomizeMenusCommand := &command.ListCompanyCustomizeMenusCommand{}
// controller.Unmarshal(listCompanyCustomizeMenusCommand)
// companyId, _ := controller.GetInt64(":companyId")
// listCompanyCustomizeMenusCommand.CompanyId = companyId
// listCompanyCustomizeMenusCommand.MenuCategory = controller.GetString("menuCategory")
// data, err := companyService.ListCompanyCustomizeMenus(listCompanyCustomizeMenusCommand)
// controller.Response(data, err)
// }
func (controller *CompanyController) UpdateCompanyCustomizeMenus() {
companyService := service.NewCompanyService(nil)
updateCompanyCustomizeMenusCommand := &command.UpdateCompanyCustomizeMenusCommand{}
controller.Unmarshal(updateCompanyCustomizeMenusCommand)
companyId, _ := controller.GetInt64(":companyId")
updateCompanyCustomizeMenusCommand.CompanyId = companyId
data, err := companyService.UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand)
controller.Response(data, err)
}
// func (controller *CompanyController) UpdateCompanyCustomizeMenus() {
// companyService := service.NewCompanyService(nil)
// updateCompanyCustomizeMenusCommand := &command.UpdateCompanyCustomizeMenusCommand{}
// controller.Unmarshal(updateCompanyCustomizeMenusCommand)
// companyId, _ := controller.GetInt64(":companyId")
// updateCompanyCustomizeMenusCommand.CompanyId = companyId
// data, err := companyService.UpdateCompanyCustomizeMenus(updateCompanyCustomizeMenusCommand)
// controller.Response(data, err)
// }
... ...
... ... @@ -10,4 +10,5 @@ func init() {
web.Router("/v1/web/notice-setting/profile/get", &web_client.NoticeSettingController{}, "Get:NoticeSettingProfile")
web.Router("/v1/web/notice-setting/:settingId", &web_client.NoticeSettingController{}, "Get:NoticeSettingGet")
web.Router("/v1/web/notice-setting/:settingId", &web_client.NoticeSettingController{}, "Put:NoticeSettingUpdate")
web.Router("/v1/web/notice-setting", &web_client.NoticeSettingController{}, "Post:NoticeSettingAdd")
}
... ...
... ... @@ -7,6 +7,6 @@ import (
func init() {
web.Router("/v1/web/system-setting/search", &web_client.SystemSettingController{}, "Post:SystemSettingSearch")
web.Router("/v1/web/syetem-setting/:settingId", &web_client.SystemSettingController{}, "Get:SystemSettingGet")
web.Router("/v1/web/syetem-setting/get", &web_client.SystemSettingController{}, "Post:SystemSettingGet")
web.Router("/v1/web/syetem-setting", &web_client.SystemSettingController{}, "Put:SystemSettingUpdate")
}
... ...