...
|
...
|
@@ -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)
|
...
|
...
|
|