c++职工管理系统

2023-11-02

要求

在这里插入图片描述

代码

management_system.cpp(main函数)

#include<iostream>
#include "WorkerManager.h"
#include "Worker.h"
#include "Employee.h"
#include "Manager.h"
#include "Boss.h"
using namespace std;

int main() {
	WorkerManager manager;
	int choice = 0;

	while (true) {
		manager.showMenu();

		cout << "请输入您的选择" << endl;
		cin >> choice;

		switch (choice)
		{
		case 0://退出管理程序
			manager.exitSystem();
			break;
		case 1://增加职工信息
			manager.addEmp();
			break;
		case 2://显示职工信息
			manager.showEmp();
			break;
		case 3://删除离职职工
			manager.delEmp();
			break;
		case 4://修改职工信息
			manager.modifyEmp();
			break;
		case 5://查找职工信息
			manager.findEmp();
			break;
		case 6://按照编号排序
			manager.sortEmp();
			break;
		case 7://清空所有文档
			manager.cleanEmp();
			break;
		default:
			system("cls");
			break;
		}
	}

	system("pause");
	return 0;
}

Worker.h(虚基类,作为父类,形成多态)

#pragma once
#include <iostream>
#include <string>
using namespace std;


class Worker {
public:
	int id;
	string name;
	int did;

public:
	//显示个人信息
	virtual void showInfo() = 0;
	//获取岗位名称
	virtual string getDeptName() = 0;
};

注意:虚基类不能有构造函数

Employee.h(普通员工的类)

#pragma once
#include <iostream>
#include <string>
#include "Worker.h"
using namespace std;

class Employee : public Worker {
public:

	Employee(int id, string name, int did);

	//显示个人信息
	virtual void showInfo();
	//获取岗位名称
	virtual string getDeptName();

	~Employee();
};

Employee.cpp

#include "Employee.h"


Employee::Employee(int id, string name, int did) {
	this->id = id;
	this->name = name;
	this->did = did;
}

//显示个人信息
void Employee::showInfo() {
	cout << "编号:" << this->id << "\t姓名:" << this->name << "\t部门编号:" << this->getDeptName() << "\t岗位职责:完成经理交给的任务" << endl;
}

//获取岗位名称
string Employee::getDeptName() {
	return string("普通员工");
}


Employee::~Employee() {

}

Manager.h(经理类)

#pragma once
#include <iostream>
#include "Worker.h"
using namespace std;

class Manager : public Worker {
public:
	Manager(int id, string name, int did);
	//显示个人信息
	virtual void showInfo();
	//获取岗位名称
	virtual string getDeptName();
};

Boss.h(老板类)

#pragma once
#include "Worker.h"

class Boss : public Worker {
public:
	Boss(int id, string name, int did);
	//显示个人信息
	virtual void showInfo();
	//获取岗位名称
	virtual string getDeptName();
};

注:Manager.cpp、Boss.cpp和Employee.cpp雷同,不再详述

WorkerManager.h(整个系统的职工管理的类)

#pragma once
#include<iostream>
#include"Worker.h"
#include "Employee.h"
#include "Manager.h"
#include "Boss.h"
#include <fstream>
#define FILENAME "worker.txt"
using namespace std;


class WorkerManager {
public:
	int empNum;//记录文件中的人员个数
	Worker** pWorkerArray;//员工数组的指针
	bool fileIsEmpty;//判断文件是否存在

	WorkerManager();

	//展示菜单
	void showMenu();

	//退出系统
	void exitSystem();

	//添加职工
	void addEmp();

	//保存文件
	void saveFile();

	//获取文件中人员的个数
	int getFileEmpNum();

	//根据文件初始化员工
	void initEmp();

	//显示职工
	void showEmp();

	//判断职工是否存在
	int isExist(int id);

	//删除职工
	void delEmp();

	//修改职工
	void modifyEmp();

	//查找职工
	void findEmp();

	//员工按编号排序
	void sortEmp();

	//清空员工
	void cleanEmp();

	~WorkerManager();
};

WorkerManager.cpp

#include "WorkerManager.h"


WorkerManager::WorkerManager() {
	ifstream ifs;
	ifs.open(FILENAME, ios::in);

	//文件不存在的情况
	if (!ifs.is_open()) {
		/*cout << "文件不存在" << endl;*/
		this->empNum = 0;
		this->pWorkerArray = NULL;
		this->fileIsEmpty = true;
		ifs.close();
		return;
	}
	
	//文件存在但记录为空的情况
	char ch;
	ifs >> ch;
	if (ifs.eof()) {
		/*cout << "文件内容为空" << endl;*/
		this->empNum = 0;
		this->pWorkerArray = NULL;
		this->fileIsEmpty = true;
		ifs.close();
		return;
	}

	//文件存在且记录不为空的情况
	this->empNum = this->getFileEmpNum();
	this->pWorkerArray = new Worker * [this->empNum];
	this->initEmp();
}


//展示菜单
void WorkerManager::showMenu() {
	cout << "********************************************" << endl;
	cout << "*********  欢迎使用职工管理系统! **********" << endl;
	cout << "*************  0.退出管理程序  *************" << endl;
	cout << "*************  1.增加职工信息  *************" << endl;
	cout << "*************  2.显示职工信息  *************" << endl;
	cout << "*************  3.删除离职职工  *************" << endl;
	cout << "*************  4.修改职工信息  *************" << endl;
	cout << "*************  5.查找职工信息  *************" << endl;
	cout << "*************  6.按照编号排序  *************" << endl;
	cout << "*************  7.清空所有文档  *************" << endl;
	cout << "********************************************" << endl;
	cout << endl;
}


//退出系统
void WorkerManager::exitSystem() {
	cout << "退出成功,欢迎下次使用" << endl;
	system("pause");
	exit(0);
}


//添加职工
void WorkerManager::addEmp() {
	cout << "请输入您要添加的人数" << endl;
	int addNum = 0;//保存用户的输入数量
	cin >> addNum;

	if (addNum > 0) {
		int newSize = addNum + this->empNum;
		Worker** pNewSpace = new Worker * [newSize];

		//将原数组中的元素复制到新数组中
		if (this->pWorkerArray != NULL) {
			for (int i = 0; i < this->empNum; i++) {
				pNewSpace[i] = this->pWorkerArray[i];
			}
		}
		delete[] this->pWorkerArray;

		//添加新元素
		for (int i = 0; i < addNum; i++) {
			cout << "请输入您需要添加的第" << (i + 1) << "个员工的编号" << endl;
			int id = 0;
			cin >> id;
			cout << "请输入您需要添加的第" << (i + 1) << "个员工的姓名" << endl;
			string name;
			cin >> name;
			cout << "请输入您需要添加的第" << (i + 1) << "个员工的部门编号" << endl;
			Flag:
			cout << "1:普通员工\t2:经理\t3:老板" << endl;
			int did = 0;
			cin >> did;

			Worker* workerTemp = NULL;
			switch (did)
			{
			case 1:
				workerTemp = new Employee(id, name, did);
				break;
			case 2:
				workerTemp = new Manager(id, name, did);
				break;
			case 3:
				workerTemp = new Boss(id, name, did);
				break;
			default:
				cout << "请输入正确的部门编号" << endl;
				goto Flag;
			}

			pNewSpace[this->empNum + i] = workerTemp;
		}

		//将新数组pNewSpace设置成pWorkerArray
		this->pWorkerArray = pNewSpace;
		this->empNum = newSize;
		this->fileIsEmpty = false;

		this->saveFile();
		cout << "添加成功" << endl;
	}
	else {
		cout << "请输入正确的数字" << endl;
	}

	system("pause");
	system("cls");
}


//保存文件
void WorkerManager::saveFile() {
	ofstream ofs;
	ofs.open(FILENAME, ios::out);
	for (int i = 0; i < this->empNum; i++) {
		ofs << this->pWorkerArray[i]->id << " " << this->pWorkerArray[i]->name << " " << this->pWorkerArray[i]->did << endl;
	}
	ofs.close();
}


//获取文件中人员的个数
int WorkerManager::getFileEmpNum() {
	ifstream ifs;
	int id;
	string name;
	int did;
	int num = 0;

	ifs.open(FILENAME, ios::in);
	while (ifs >> id && ifs >> name && ifs >> did) {
		num++;
	}
	ifs.close();
	return num;
}


//根据文件初始化员工
void WorkerManager::initEmp() {
	ifstream ifs;
	ifs.open(FILENAME, ios::in);
	
	int id;
	string name;
	int did;
	int index = 0;

	while (ifs >> id && ifs >> name && ifs >> did) {
		Worker* worker = NULL;
		switch (did)
		{
		case 1:
			worker = new Employee(id, name, did);
			break;
		case 2:
			worker = new Manager(id, name, did);
			break;
		case 3:
			worker = new Boss(id, name, did);
			break;
		default:
			break;
		}
		this->pWorkerArray[index++] = worker;
	}

	ifs.close();
}


//显示职工
void WorkerManager::showEmp() {
	if (this->fileIsEmpty) {
		cout << "文件不存在或文件为空" << endl;
	}
	else {
		for (int i = 0; i < this->empNum; i++) {
			this->pWorkerArray[i]->showInfo();
		}
	}
	system("pause");
	system("cls");
}


//判断职工是否存在
int WorkerManager::isExist(int id) {
	for (int i = 0; i < this->empNum; i++) {
		if (this->pWorkerArray[i]->id == id) {
			return i;
		}
	}
	return -1;
}


//删除职工
void WorkerManager::delEmp() {
	if (this->fileIsEmpty) {
		cout << "文件不存在和记录为空" << endl;
	}
	else {
		cout << "请输入要删除的员工编号" << endl;
		int id = 0;
		cin >> id;
		int index = this->isExist(id);
		if (index != -1) {
			delete this->pWorkerArray[index];
			for (int i = index; i < this->empNum-1; i++) {
				this->pWorkerArray[i] = this->pWorkerArray[i + 1];
			}
			this->empNum--;
			this->saveFile();
			cout << "删除成功" << endl;
		}
		else {
			cout << "该员工不存在" << endl;
		}
	}
	system("pause");
	system("cls");
}


//修改职工
void WorkerManager::modifyEmp() {
	if (this->fileIsEmpty) {
		cout << "文件不存在或记录为空" << endl;
	}
	else {
		cout << "请输入您要修改的员工编号" << endl;
		int id;
		cin >> id;
		int index = this->isExist(id);

		if (index != -1) {
			string name;
			int did;

			cout << "请输入修改后此人的编号" << endl;
			cin >> id;
			cout << "请输入修改后此人的姓名" << endl;
			cin >> name;
			cout << "请输入修改后此人的部门编号" << endl;
			cout << "1、普通职工" << endl;
			cout << "2、经理" << endl;
			cout << "3、老板" << endl;
			cin >> did;

			delete this->pWorkerArray[index];
			Worker* worker = NULL;

			switch (did)
			{
			case 1:
				worker = new Employee(id, name, did);
				break;
			case 2:
				worker = new Manager(id, name, did);
				break;
			case 3:
				worker = new Boss(id, name, did);
				break;
			default:
				break;
			}

			this->pWorkerArray[index] = worker;
			this->saveFile();
			cout << "修改完成" << endl;
		}
		else {
			cout << "查无此人" << endl;
		}
	}

	system("pause");
	system("cls");
}


//查找职工
void WorkerManager::findEmp() {
	if (this->fileIsEmpty) {
		cout << "文件不存在或记录为空" << endl;
	}
	else {
		cout << "请输入您要查找的方式\n1:通过编号查找\n2:通过姓名查找" << endl;
		int findType = 0;
		cin >> findType;

		if (findType == 1) {
			cout << "请输入要查找职工的编号" << endl;
			int id;
			cin >> id;
			int index = this->isExist(id);
			if (index != -1) {
				this->pWorkerArray[index]->showInfo();
			}
			else {
				cout << "查无此人" << endl;
			}
		}

		else if (findType == 2) {
			cout << "请输入要查找的职工的姓名" << endl;
			string name;
			cin >> name;
			bool flag = false;

			for (int i = 0; i < this->empNum; i++) {
				if (this->pWorkerArray[i]->name == name) {
					this->pWorkerArray[i]->showInfo();
					flag = true;
				}
			}

			if (flag==false) {
				cout << "查无此人" << endl;
			}
		}

		else {
			cout << "输入选项有误" << endl;
		}
	}

	system("pause");
	system("cls");
}


//员工按编号排序
void WorkerManager::sortEmp() {
	if (this->fileIsEmpty) {
		cout << "文件不存在或记录为空" << endl;

		system("pause");
		system("cls");
	}
	else {
		cout << "请选择排序的的顺序:\n1:升序\n2:降序" << endl;
		int selection = 0;
		cin >> selection;
		if (selection == 1) {
			for (int i = 0; i < this->empNum; i++) {
				int min = i;
				for (int j = i+1; j < this->empNum; j++) {
					if (this->pWorkerArray[min]->id > this->pWorkerArray[j]->id) {
						min = j;
					}
				}
				if (min != i) {
					Worker* temp = this->pWorkerArray[min];
					this->pWorkerArray[min] = this->pWorkerArray[i];
					this->pWorkerArray[i] = temp;
				}
			}

			cout << "排序成功,排序后的职工信息为" << endl;
			this->showEmp();
			this->saveFile();
		}

		else if (selection == 2) {
			for (int i = 0; i < this->empNum; i++) {
				int max = i;
				for (int j = i+1; j < this->empNum; j++) {
					if (this->pWorkerArray[max]->id < this->pWorkerArray[j]->id) {
						max = j;
					}
				}

				if (max != i) {
					Worker* temp = this->pWorkerArray[max];
					this->pWorkerArray[max] = this->pWorkerArray[i];
					this->pWorkerArray[i] = temp;
				}
			}

			cout << "排序成功,排序后的职工信息为" << endl;
			this->showEmp();
			this->saveFile();
		}
		else {
			cout << "输入选项有误" << endl;
		}
	}
}


//清空员工
void WorkerManager::cleanEmp() {
	if (this->fileIsEmpty) {
		cout << "文件已清空" << endl;
	}
	else {
		cout << "是否确认清空(y/n)" << endl;
		char ch;
		cin >> ch;
		if (ch == 'y') {
			//清空文件记录
			ofstream ofs;
			ofs.open(FILENAME, ios::trunc);
			ofs.close();

			//清空内存中的记录
			if (this->pWorkerArray != NULL) {
				for (int i = 0; i < this->empNum; i++) {
					if (this->pWorkerArray[i] != NULL) {
						delete this->pWorkerArray[i];
					}
				}
				delete[] this->pWorkerArray;
				this->pWorkerArray = NULL;
				this->empNum = 0;
				this->fileIsEmpty = true;
			}
			cout << "清空成功" << endl;
		}
	}

	system("pause");
	system("cls");
}


WorkerManager::~WorkerManager() {
	if (this->pWorkerArray != NULL) {
		for (int i = 0; i < this->empNum; i++) {
			delete this->pWorkerArray[i];
		}
		delete[] this->pWorkerArray;
		this->pWorkerArray = NULL;
	}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

c++职工管理系统 的相关文章

  • 什么定义了类型的大小?

    ISO C 标准规定 sizeof char lt sizeof short lt sizeof int lt sizeof long 我在 BIT Linux mint 19 1 上使用 GCC 8 大小为long int is 8 我正
  • 无法使用c#更改视频捕获分辨率

    我正在尝试使用 C 中的 DirectShowNet 更改默认网络摄像头分辨率 据我所知 我需要通过调用 windows win32 api dll 中内置的 VideoInfoHeader 类来更改它以进行 avi 捕获 我有来自 Dir
  • 采用 std::vector 或 std::array 的模板函数

    我有一个函数 当前接受 2 个向量 其中可以包含任何普通的旧数据 template
  • 如何使用 Entity Framework 和 Identity 解决对象处置异常 ASP.NET Core

    我正在尝试编写一个控制器 该控制器接收来自 AJAX 调用的请求并通过 DBContext 对数据库执行一些调用 但是 当我发出命令时var user await GetCurrentUserAsynch 在对 DBContext 的任何调
  • 头文件中实现的函数的静态与内联

    我想到的方式inline在 C 中用于链接 作用域 我把它放在同一个篮子里extern and static对于全局对象 通常 对于在头文件中实现的函数 我的首选解决方案是将其设为静态 In Foo h static void foo Do
  • C++ 指针和对象实例化

    这有效 MyObject o o new MyObject 而这并不 MyObject o new MyObject Why 关键词new 返回一个指针 http msdn microsoft com en us library kewsb
  • 无法将参数从 `const char *` 转换为 `char *`

    鉴于此代码 void group build int size std string ips Build the LL after receiving the member list from bootstrap head new memb
  • 选择initializer_list迭代器定义

    Why std initializer list
  • 从内存流播放视频文件

    只是好奇看看这是否可能 我有一个 Windows 应用程序 它从我的电脑上的 avi 文件读取所有字节 然后将其存储在 byte 中 现在我的内存中有 avi 文件 我想直接从内存将其加载到某种视频播放器控件中 我尝试过使用 wmplaye
  • 在 .NET Core 中从 HttpResponseMessage 转换为 IActionResult

    我正在将之前在 NET Framework 中编写的一些代码移植到 NET Core 我有这样的事情 HttpResponseMessage result await client SendAync request if result St
  • QSpinBox 输入 NaN 作为有效值

    我正在尝试扩展 QSpinBox 以能够输入 NaN 或 nan 作为有效值 根据文档 我应该使用 textFromValue valueFromText 和 validate 函数来完成此操作 但我无法让它工作 因为它仍然不允许我输入除数
  • 原子存储抛出错误

    我最近升级到了 C 11 兼容编译器 并且尝试将一些代码从 boost 更新到 c 11 标准 我在使用atomic store转换一些代码时遇到了问题 这是一些简单的测试代码 似乎会引发编译器错误 int main std shared
  • 如何在 C++ 和 QML 应用程序中使用 qrc?

    我在 Windows7 上用 c qnd Qt Creator QML 编写了 Qt Quick Desktop 应用程序 现在 我必须部署它 并且我需要隐藏 qml 文件和图像 意味着 将它们放入资源等中 我读到有一个很好的方法可以使用
  • 使用 OleDbCommand / OleDbDataAdapter 读取 CSV 文件

    我不明白为什么 但是当我使用 OleDbDataAdapter 或 OleDbCommand 读取 CSV 文件时 在这两种情况下 生成的数据结构良好 它识别文件头中的列 但行数据都是空字符串 我之前已经成功进行过多次 CSV 处理 因此我
  • 使用 dateTimePicker 在 DataGridView 中编辑日期

    我有一个DateTime我的 WinForms 中的专栏DataGridView 目前只能通过手动输入日期来编辑该字段 例如 2010 09 02 需要什么才能拥有一个DateTimePicker 或同等 用作编辑器 DataGridVie
  • 应在堆栈上分配的最大数量

    我一直在寻找堆栈溢出有关应在堆栈上分配的最大内存量的指南 我看到了堆栈与堆分配的最佳实践 但没有关于应该在堆栈上分配多少以及应该在堆上分配多少的指南 有什么想法 数字可以作为指导吗 什么时候应该在堆栈上分配 什么时候应该在堆上分配 多少才算
  • 展开 std::reference_wrapper 的成本

    Given include
  • 基础设施 - 同步和异步接口和实现? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 在实现库 基础设施时 并且该 API 的用户希望同步和异步使用代码 我读到混合同步和异步并不是一个好主意 例如 同步实现包括等待异步实现 显然
  • Unity - 在生成时获取随机颜色

    我有一个小问题 我想在我的场景中生成四边形 它们都应该有红色或绿色作为材质 但 Random Range 函数只能是 int 我该如何解决它 void SpawningSquadsRnd rndColor 0 Color red rndCo
  • 如何通过API退出Win32应用程序?

    我有一个使用 Win32 API 编写的 C Win32 应用程序 我希望强制它在其中一个函数中退出 有没有类似的东西Exit or Destroy or Abort 类似的东西会终止它吗 哎呀呀呀呀呀呀 不要做任何这些事情 exit 和

随机推荐

  • 内连接、外连接、左连接、右连接

    连接是使用一定条件将两个表合在在一起的操作 包括内连接 inner join 和外连接 outer join 1 内连接 等值连接 两个表中都满足相关条件的记录才被选择出来 2 外连接包括左外连接 左连接 left join 和右外连接 右
  • 美国一桶牛奶多少钱?

    你好 我是郭震 zhenguo 最近 关注我的朋友中有几位 想叫我多分享下美国的生活 今天我就从一个很小的生活点入手 牛奶 开始 牛奶在美国超市一般都是下面的这种大桶 比如Costco超市里 一般提供以下两种 口感有些不同 但是价格很相似
  • JAVA学习经验谈

    本文是我自2002年9月开始JAVA学习以来的一点经验之谈 首先我不是有丰富编程经验的程序员 所以本文不对JAVA的具体语法 编程技巧和设计模式做过多的论述 仅从个人的学习角度谈感受 由于有大学期间的C语言学习经历我对JAVA的基本语法相对
  • The Difference between Probability and Statistic

    本科数学专业 现在在PKU学习计算机 当前主要的focus是DNN RNN in Action Recognition 心中总有一股数学情结 OOAD 课程上老师提及这个问题 所以信誓旦旦地想写一篇博客 可惜最后发现雷声大 雨点小 先mar
  • 使用IDEA 对springboot项目进行打war包

    网上很多版本 以下是本人新建springboot项目后本地测试通过 好了上步骤 1首先这个地方需要配置
  • 多媒体讲解器基本型设计

    多媒体讲解器功能按照播放器功能和灯光控制功能分类 播放功能分类 简易型 具备按键操作功能 TF卡升级 在线播放 U盘升级 在线播放 具备人体接近检测功能 红外 雷达 自动播放讲解功能 自动停止讲解功能 自动播放音乐 自动切换到讲解功能 切换
  • Dart 断言(assert)和异常

    一 断言 assert 断言的作用是 如果表达式的求值结果不满足需要 则打断代码的执行 可以要将提示消息附加到断言 添加一个字符串作为第二个参数 实例 void main String urlString http www baidu co
  • Winsock状态说明及错误代码

    Winsock状态参数说明 常数 值 描述 sckClosed 0 缺省值 关闭 SckOpen 1 打开 SckListening 2 侦听 sckConnectionPending 3 连接挂起 sckResolvingHost 4 识
  • “定点打击”——XPath 使用细则(Just For Selenium WebDriver)

    该系列文章系个人读书笔记及总结性内容 任何组织和个人不得转载进行商业活动 Selenium WebDriver中有关元素定位的学习 需要XPath的支持 特此梳理 前言 XPath教程 XPath是一门在XML文档中查找信息的语言 XPat
  • 基于线性预测的语音编码原理解析

    早期的音频系统都是基于声音的模拟信号实现的 在声音的录制 编辑和播放过程中很容易引入各种噪声 从而导致信号的失真 随着信息技术的发展 数字信号处理技术在越来越多领域得到了应用 数字信号更是具备了易于存储和远距离传输 没有累积失真 抗干扰能力
  • SpringSecurity——OAuth2框架鉴权实现源码分析

    SpringSecurity OAuth2框架鉴权实现源码分析 一 ManagedFilter迭代过滤器链 1 4 springSecurityFilterChain 1 4 7 OAuth2AuthenticationProcessing
  • 【Redis】Redis在Windows下的使用(hiredis+Qt5.7.0+mingw5.3.0)

    1 下载hiredis https github com redis hiredis 得到hiredis master zip 解压后 得到hiredis master目录 可以看到CMakeLists txt 2 下载CMake http
  • Oracle12C 用户创建、修改、授权、删除、登录等操作

    1 以系统用户命令行登录 sqlplus sys sys as sysdba 2 确认选择CDB select name cdb from v database col pdb name for a30 select pdb id pdb
  • matlab绘图(三)绘制三维图像

    目录 一 绘制三维曲线 二 绘制三维曲面 1 meshgrid函数 2 mesh和surf函数 一 绘制三维曲线 1 最基本的绘制三维曲线的函数 plot3 plot3 x1 y1 z1 选项 1 x2 y2 z2 选项 2 xn yn z
  • 样本方差的分母为何为n-1而不是n之无偏估计

    设样本均值为 样本方差为 总体均值为 总体方差为 那么样本方差有如下公式 很多人可能都会有疑问 为什么要除以n 1 而不是n 但是翻阅资料 发现很多都是交代到 如果除以n 对样本方差的估计不是无偏估计 比总体方差要小 要想是无偏估计就要调小
  • 撸一撸Spring Cloud Ribbon的原理

    说起负载均衡一般都会想到服务端的负载均衡 常用产品包括LBS硬件或云服务 Nginx等 都是耳熟能详的产品 而Spring Cloud提供了让服务调用端具备负载均衡能力的Ribbon 通过和Eureka的紧密结合 不用在服务集群内再架设负载
  • html alert字体颜色,js里alert里的字体颜色怎么设置:字体颜色方法;fontcolor(color)...

    我的总结 alert应该是没办法改变的 只有自己写个弹出窗口才可以改变字体颜色 我的总结 alert应该是没办法改变的 只有自己写个弹出窗口才可以改变字体颜色 alert 投票总数不大于 不知道怎么改变字体所以查了下 找到下面的信息 好东西
  • 超强干货,Pytest自动化测试框架fixture固件使用,0-1精通实战

    前言 如果有以下场景 用例 1 需要先登录 用例 2 不需要登录 用例 3 需要先登录 很显然无法用 setup 和 teardown 来实现了 fixture 可以让我们自定义测试用例的前置条件 fixture 的优势 命名方式灵活 不局
  • std::thread的常用参数传递总结

    实参的生命周期 给std thread传递参数的时候要注意 参数是引用或者指针的情况下 要注意生命周期的问题 看代码 include
  • c++职工管理系统

    要求 代码 management system cpp main函数 include