Пример #1
0
// POST /api/process
func AddMachineToCurrentOrg(c *middleware.Context, cmd m.AddMachineCommand) Response {

	logger := log.New("main")
	logger.Info("Add ProcessForCurrentOrg", c.OrgId)
	cmd.OrgId = c.OrgId
	return addMachineHelper(cmd)
}
Пример #2
0
// add a machine
func addMachineHelper(cmd m.AddMachineCommand) Response {

	logger := log.New("main")
	logger.Info("Add ProcessForCurrentOrg111", cmd.OrgId)
	query := m.AddMachineCommand{}

	query.OrgId = cmd.OrgId
	query.ProcessId = cmd.ProcessId
	query.MachineName = cmd.MachineName
	query.Description = cmd.Description
	query.UpdatedBy = cmd.UpdatedBy
	query.Vendor = cmd.Vendor

	if err := bus.Dispatch(&query); err != nil {
		return ApiError(500, "Could not add process to organization", err)
	}

	return ApiSuccess("Process Sucessfully added ")

}