...
|
...
|
@@ -15,6 +15,7 @@ func (controller *UserController) CreateUser() { |
|
|
userService := service.NewUserService(nil)
|
|
|
createUserCommand := &command.CreateUserCommand{}
|
|
|
Must(controller.Unmarshal(createUserCommand))
|
|
|
createUserCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.CreateUser(createUserCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -25,6 +26,7 @@ func (controller *UserController) UpdateUser() { |
|
|
Must(controller.Unmarshal(updateUserCommand))
|
|
|
userId, _ := controller.GetInt64(":userId")
|
|
|
updateUserCommand.UserId = userId
|
|
|
updateUserCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.UpdateUser(updateUserCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -34,6 +36,7 @@ func (controller *UserController) GetUser() { |
|
|
getUserQuery := &query.GetUserQuery{}
|
|
|
userId, _ := controller.GetInt64(":userId")
|
|
|
getUserQuery.UserId = userId
|
|
|
getUserQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.GetUser(getUserQuery)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -44,6 +47,7 @@ func (controller *UserController) RemoveUser() { |
|
|
controller.Unmarshal(removeUserCommand)
|
|
|
userId, _ := controller.GetInt64(":userId")
|
|
|
removeUserCommand.UserId = userId
|
|
|
removeUserCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.RemoveUser(removeUserCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -51,6 +55,7 @@ func (controller *UserController) RemoveUser() { |
|
|
func (controller *UserController) ListUser() {
|
|
|
userService := service.NewUserService(nil)
|
|
|
listUserQuery := &query.ListUserQuery{}
|
|
|
listUserQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.ListUser(listUserQuery)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -64,6 +69,7 @@ func (controller *UserController) GetUserAccessMenus() { |
|
|
getUserAccessMenusQuery.MenuCategory = menuCategory
|
|
|
getUserAccessMenusQuery.OrgId, _ = controller.GetInt64("orgId", 0)
|
|
|
getUserAccessMenusQuery.ALLDisableMenu, _ = controller.GetInt("allDisableMenu", 0)
|
|
|
getUserAccessMenusQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.GetUserAccessMenus(getUserAccessMenusQuery)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -73,6 +79,7 @@ func (controller *UserController) GetUserProfile() { |
|
|
getUserProfileQuery := &query.GetUserProfileQuery{}
|
|
|
userId, _ := controller.GetInt64(":userId")
|
|
|
getUserProfileQuery.UserId = userId
|
|
|
getUserProfileQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.GetUserProfile(getUserProfileQuery)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -81,6 +88,7 @@ func (controller *UserController) BatchAdd() { |
|
|
userService := service.NewUserService(nil)
|
|
|
batchAddCommand := &command.BatchAddCommand{}
|
|
|
Must(controller.Unmarshal(batchAddCommand))
|
|
|
batchAddCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.BatchAdd(batchAddCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -89,6 +97,7 @@ func (controller *UserController) BatchEnable() { |
|
|
userService := service.NewUserService(nil)
|
|
|
batchEnableCommand := &command.BatchEnableCommand{}
|
|
|
controller.Unmarshal(batchEnableCommand)
|
|
|
batchEnableCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.BatchEnable(batchEnableCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -97,6 +106,7 @@ func (controller *UserController) BatchResetPassword() { |
|
|
userService := service.NewUserService(nil)
|
|
|
batchResetPasswordCommand := &command.BatchResetPasswordCommand{}
|
|
|
controller.Unmarshal(batchResetPasswordCommand)
|
|
|
batchResetPasswordCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.BatchResetPassword(batchResetPasswordCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -107,6 +117,7 @@ func (controller *UserController) UpdateUsersBase() { |
|
|
controller.Unmarshal(updateUsersBaseCommand)
|
|
|
userId, _ := controller.GetInt64(":userId")
|
|
|
updateUsersBaseCommand.UserId = userId
|
|
|
updateUsersBaseCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.UpdateUsersBase(updateUsersBaseCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -115,6 +126,7 @@ func (controller *UserController) CreateCooperator() { |
|
|
userService := service.NewUserService(nil)
|
|
|
createCooperatorCommand := &command.CreateCooperatorCommand{}
|
|
|
Must(controller.Unmarshal(createCooperatorCommand))
|
|
|
createCooperatorCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.CreateCooperator(createCooperatorCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -125,6 +137,7 @@ func (controller *UserController) UpdateCooperator() { |
|
|
controller.Unmarshal(updateCooperatorCommand)
|
|
|
userId, _ := controller.GetInt64(":userId")
|
|
|
updateCooperatorCommand.UserId = userId
|
|
|
updateCooperatorCommand.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.UpdateCooperator(updateCooperatorCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -133,6 +146,7 @@ func (controller *UserController) SearchUser() { |
|
|
userService := service.NewUserService(nil)
|
|
|
listUserQuery := &query.ListUserQuery{}
|
|
|
Must(controller.Unmarshal(listUserQuery))
|
|
|
listUserQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
|
|
|
data, err := userService.ListUser(listUserQuery)
|
|
|
controller.Response(data, err)
|
|
|
} |
...
|
...
|
|