作者 tangxuhui

添加json解析错误打印

... ... @@ -4,6 +4,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type MenuController struct {
... ... @@ -13,7 +14,10 @@ type MenuController struct {
func (controller *MenuController) MenuList() {
menuService := service.NewMenuService(nil)
menuListQuery := &query.MenuListQuery{}
controller.Unmarshal(menuListQuery)
err := controller.Unmarshal(menuListQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
menuListQuery.Operator = controller.GetOperator()
data, err := menuService.MenuList(menuListQuery)
controller.Response(data, err)
... ... @@ -22,7 +26,10 @@ func (controller *MenuController) MenuList() {
func (controller *MenuController) MenuUpdate() {
menuService := service.NewMenuService(nil)
menuUpdateQuery := &command.MenuUpdateCommand{}
controller.Unmarshal(menuUpdateQuery)
err := controller.Unmarshal(menuUpdateQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
menuUpdateQuery.Operator = controller.GetOperator()
data, err := menuService.MenuUpdate(menuUpdateQuery)
controller.Response(data, err)
... ... @@ -31,7 +38,10 @@ func (controller *MenuController) MenuUpdate() {
func (controller *MenuController) MenuFavorite() {
menuService := service.NewMenuService(nil)
menuFavoriteCommand := &command.MenuFavoriteCommand{}
controller.Unmarshal(menuFavoriteCommand)
err := controller.Unmarshal(menuFavoriteCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
menuFavoriteCommand.Operator = controller.GetOperator()
data, err := menuService.MenuFavorite(menuFavoriteCommand)
controller.Response(data, err)
... ...
... ... @@ -4,6 +4,7 @@ import (
"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/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type NoticeSettingController struct {
... ... @@ -13,7 +14,10 @@ type NoticeSettingController struct {
func (controller *NoticeSettingController) NoticeSettingList() {
noticeSettingService := service.NewNoticeSettingService(nil)
noticeSettingListQuery := &query.NoticeSettingListQuery{}
controller.Unmarshal(noticeSettingListQuery)
err := controller.Unmarshal(noticeSettingListQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
noticeSettingListQuery.Operator = controller.GetOperator()
cnt, data, err := noticeSettingService.NoticeSettingList(noticeSettingListQuery)
controller.returnPageListData(cnt, data, err, noticeSettingListQuery.PageNumber)
... ... @@ -23,7 +27,10 @@ func (controller *NoticeSettingController) NoticeSettingUpdate() {
noticeSettingService := service.NewNoticeSettingService(nil)
noticeSettingUpdateCommand := &command.NoticeSettingUpdateCommand{}
settingId := controller.GetString(":settingId")
controller.Unmarshal(noticeSettingUpdateCommand)
err := controller.Unmarshal(noticeSettingUpdateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
noticeSettingUpdateCommand.Operator = controller.GetOperator()
noticeSettingUpdateCommand.NoticeSettingId = settingId
data, err := noticeSettingService.NoticeSettingUpdate(noticeSettingUpdateCommand)
... ... @@ -33,7 +40,10 @@ func (controller *NoticeSettingController) NoticeSettingUpdate() {
func (controller *NoticeSettingController) NoticeSettingAdd() {
noticeSettingService := service.NewNoticeSettingService(nil)
noticeSettingAddCommand := &command.NoticeSettingAddCommand{}
controller.Unmarshal(noticeSettingAddCommand)
err := controller.Unmarshal(noticeSettingAddCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
noticeSettingAddCommand.Operator = controller.GetOperator()
data, err := noticeSettingService.NoticeSettingAdd(noticeSettingAddCommand)
controller.Response(data, err)
... ...
... ... @@ -4,6 +4,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/orgs/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type OrgsController struct {
... ... @@ -13,7 +14,10 @@ type OrgsController struct {
func (controller *OrgsController) OrgAdd() {
orgsService := service.NewOrgsService(nil)
orgAddCommand := &command.OrgAddCommand{}
controller.Unmarshal(orgAddCommand)
err := controller.Unmarshal(orgAddCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
orgAddCommand.Operator = controller.GetOperator()
data, err := orgsService.OrgAdd(orgAddCommand)
controller.Response(data, err)
... ... @@ -22,7 +26,10 @@ func (controller *OrgsController) OrgAdd() {
func (controller *OrgsController) OrgUpdate() {
orgsService := service.NewOrgsService(nil)
orgUpdateCommand := &command.OrgUpdateCommand{}
controller.Unmarshal(orgUpdateCommand)
err := controller.Unmarshal(orgUpdateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
orgId := controller.GetString(":orgId")
orgUpdateCommand.OrgId = orgId
orgUpdateCommand.Operator = controller.GetOperator()
... ... @@ -33,7 +40,10 @@ func (controller *OrgsController) OrgUpdate() {
func (controller *OrgsController) OrgList() {
orgsService := service.NewOrgsService(nil)
orgListQuery := &query.OrgListQuery{}
controller.Unmarshal(orgListQuery)
err := controller.Unmarshal(orgListQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
orgListQuery.Operator = controller.GetOperator()
data, err := orgsService.OrgList(orgListQuery)
controller.Response(data, err)
... ... @@ -52,7 +62,10 @@ func (controller *OrgsController) OrgGet() {
func (controller *OrgsController) OrgEnable() {
orgsService := service.NewOrgsService(nil)
orgEnableCommand := &command.OrgEnableCommand{}
controller.Unmarshal(orgEnableCommand)
err := controller.Unmarshal(orgEnableCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
orgEnableCommand.Operator = controller.GetOperator()
data, err := orgsService.OrgEnable(orgEnableCommand)
controller.Response(data, err)
... ... @@ -61,7 +74,10 @@ func (controller *OrgsController) OrgEnable() {
func (controller *OrgsController) OrgGetSubDepartment() {
orgsService := service.NewOrgsService(nil)
orgGetSubDepartmentQuery := &query.OrgGetSubDepartmentQuery{}
controller.Unmarshal(orgGetSubDepartmentQuery)
err := controller.Unmarshal(orgGetSubDepartmentQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
orgGetSubDepartmentQuery.Operator = controller.GetOperator()
data, err := orgsService.OrgGetSubDepartment(orgGetSubDepartmentQuery)
controller.Response(data, err)
... ...
... ... @@ -4,6 +4,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/roles/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type RolesController struct {
... ... @@ -13,7 +14,10 @@ type RolesController struct {
func (controller *RolesController) RoleAdd() {
rolesService := service.NewRolesService(nil)
roleAddCommand := &command.RoleAddCommand{}
controller.Unmarshal(roleAddCommand)
err := controller.Unmarshal(roleAddCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleAddCommand.Operator = controller.GetOperator()
data, err := rolesService.RoleAdd(roleAddCommand)
controller.Response(data, err)
... ... @@ -22,7 +26,10 @@ func (controller *RolesController) RoleAdd() {
func (controller *RolesController) RoleUpdate() {
rolesService := service.NewRolesService(nil)
roleUpdateCommand := &command.RoleUpdateCommand{}
controller.Unmarshal(roleUpdateCommand)
err := controller.Unmarshal(roleUpdateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleId := controller.GetString(":roleId")
roleUpdateCommand.RoleId = roleId
roleUpdateCommand.Operator = controller.GetOperator()
... ... @@ -33,7 +40,10 @@ func (controller *RolesController) RoleUpdate() {
func (controller *RolesController) RoleList() {
rolesService := service.NewRolesService(nil)
roleListQuery := &query.RoleListQuery{}
controller.Unmarshal(roleListQuery)
err := controller.Unmarshal(roleListQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleListQuery.Operator = controller.GetOperator()
cnt, data, err := rolesService.RoleList(roleListQuery)
controller.returnPageListData(cnt, data, err, roleListQuery.PageNumber)
... ... @@ -62,7 +72,10 @@ func (controller *RolesController) RoleUserInfo() {
func (controller *RolesController) RoleUserAdd() {
rolesService := service.NewRolesService(nil)
roleUserAddQuery := &command.RoleUserAddCommand{}
controller.Unmarshal(roleUserAddQuery)
err := controller.Unmarshal(roleUserAddQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleUserAddQuery.Operator = controller.GetOperator()
data, err := rolesService.RoleUserAdd(roleUserAddQuery)
controller.Response(data, err)
... ... @@ -71,7 +84,10 @@ func (controller *RolesController) RoleUserAdd() {
func (controller *RolesController) RoleUserDelete() {
rolesService := service.NewRolesService(nil)
roleUserDeleteQuery := &command.RoleUserDeleteCommand{}
controller.Unmarshal(roleUserDeleteQuery)
err := controller.Unmarshal(roleUserDeleteQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleUserDeleteQuery.Operator = controller.GetOperator()
data, err := rolesService.RoleUserDelete(roleUserDeleteQuery)
controller.Response(data, err)
... ... @@ -91,7 +107,10 @@ func (controller *RolesController) RoleMenuBeforeEdit() {
rolesService := service.NewRolesService(nil)
roleMenuBeforeEditQuery := &query.RoleMenuBeforeEditQuery{}
roleMenuBeforeEditQuery.Operator = controller.GetOperator()
controller.Unmarshal(roleMenuBeforeEditQuery)
err := controller.Unmarshal(roleMenuBeforeEditQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleId := controller.GetString(":roleId")
roleMenuBeforeEditQuery.RoleId = roleId
data, err := rolesService.RoleMenuBeforeEdit(roleMenuBeforeEditQuery)
... ... @@ -101,7 +120,10 @@ func (controller *RolesController) RoleMenuBeforeEdit() {
func (controller *RolesController) RoleMenuEdit() {
rolesService := service.NewRolesService(nil)
roleMenuEditQuery := &command.RoleMenuEditCommand{}
controller.Unmarshal(roleMenuEditQuery)
err := controller.Unmarshal(roleMenuEditQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleId := controller.GetString(":roleId")
roleMenuEditQuery.RoleId = roleId
roleMenuEditQuery.Operator = controller.GetOperator()
... ... @@ -112,7 +134,10 @@ func (controller *RolesController) RoleMenuEdit() {
func (controller *RolesController) RoleDelete() {
rolesService := service.NewRolesService(nil)
roleRemoveCommand := &command.RoleRemoveCommand{}
controller.Unmarshal(roleRemoveCommand)
err := controller.Unmarshal(roleRemoveCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
roleRemoveCommand.Operator = controller.GetOperator()
data, err := rolesService.RoleRemove(roleRemoveCommand)
controller.Response(data, err)
... ...
... ... @@ -4,6 +4,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/systemsetting/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/systemsetting/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/systemsetting/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type SystemSettingController struct {
... ... @@ -12,17 +13,20 @@ type SystemSettingController struct {
func (controller SystemSettingController) SystemSettingSearch() {
systemSettingService := service.NewSystemSettingService(nil)
q := &query.SettingListQuery{
settingListQuery := &query.SettingListQuery{
Operator: controller.GetOperator(),
}
data, err := systemSettingService.GetSystemSettingList(q)
data, err := systemSettingService.GetSystemSettingList(settingListQuery)
controller.Response(data, err)
}
func (controller SystemSettingController) SystemSettingGet() {
systemSettingService := service.NewSystemSettingService(nil)
q := &query.SettingGetQuery{}
controller.Unmarshal(q)
err := controller.Unmarshal(q)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
q.Operator = controller.GetOperator()
data, err := systemSettingService.GetSystemSetting(q)
controller.Response(data, err)
... ... @@ -32,7 +36,10 @@ func (controller SystemSettingController) SystemSettingGet() {
func (controller SystemSettingController) SystemSettingUpdate() {
systemSettingService := service.NewSystemSettingService(nil)
q := &command.SettingUpdateCommand{}
controller.Unmarshal(q)
err := controller.Unmarshal(q)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
q.Operator = controller.GetOperator()
data, err := systemSettingService.SystemSettingUpdate(q)
controller.Response(data, err)
... ...