diff --git a/doc/界面评审.txt b/doc/界面评审.txt new file mode 100644 index 0000000..5040543 --- /dev/null +++ b/doc/界面评审.txt @@ -0,0 +1,5 @@ +界面设计评审: +1. 界面交互性还需要进行完善,即增加动画以及响应效果。 +2. 各个界面之间的关系,主要是界面之间的跳转,回跳的关系应该更加清晰完整一点(目前只展示了主要逻辑跳转关系)。 +3. 所有的界面需要共同实现一个导航栏的接口,导航栏在每一个界面上都是存在的。 +4.设计缺少对于错误处理的界面,即错误重定向界面的设计。 \ No newline at end of file diff --git a/src/code/Compatibility_Checking/check_error.txt b/src/code/Compatibility_Checking/check_error.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/code/Compatibility_Checking/check_result.json b/src/code/Compatibility_Checking/check_result.json index 85da184..70c6b3a 100644 --- a/src/code/Compatibility_Checking/check_result.json +++ b/src/code/Compatibility_Checking/check_result.json @@ -1 +1 @@ -{"flag": 0, "errorList": ["\u6240\u9009\u5185\u5b58\u5bb9\u91cf\u5927\u4e8e\u4e3b\u677f\u652f\u6301\u7684\u6700\u5927\u5185\u5b58\u5bb9\u91cf", "\u6240\u9009\u5185\u5b58\u6570\u91cf\u5927\u4e8e\u6240\u9009\u4e3b\u677f\u4e0a\u7684\u63d2\u69fd\u6570\u91cf", "\u6240\u9009\u4e3b\u677f\u677f\u578b\u5927\u4e8e\u6240\u9009\u673a\u7bb1\u80fd\u5bb9\u7eb3\u7684\u6700\u5927\u4e3b\u677f\u5927\u5c0f", "\u6240\u9009\u6c34\u51b7\u5c3a\u5bf8\u5927\u4e8e\u6240\u9009\u673a\u7bb1\u652f\u6301\u7684\u6700\u5927\u5c3a\u5bf8", "\u6240\u9009\u673a\u7bb1\u65e0\u6cd5\u5bb9\u7eb3\u6240\u9009\u7535\u6e90"]} \ No newline at end of file +{"flag": 1} \ No newline at end of file diff --git a/src/code/Compatibility_Checking/doCheck.py b/src/code/Compatibility_Checking/doCheck.py index 12b0158..a7b12dc 100644 --- a/src/code/Compatibility_Checking/doCheck.py +++ b/src/code/Compatibility_Checking/doCheck.py @@ -12,9 +12,12 @@ import pymysql from pprint import pprint -MYSQL_HOSTS = "192.168.136.129" -MYSQL_USER = "root" -MYSQL_PASSWORD = "1213800" +# 设置连接配置 +with open("../dbConfig.json", 'r', encoding='UTF-8') as conf: + dbConfig = json.load(conf) +MYSQL_HOSTS = dbConfig["hostname"] +MYSQL_USER = dbConfig["username"] +MYSQL_PASSWORD = dbConfig["password"] MYSQL_PORT = 3306 MYSQL_DB = "computer_accessories" diff --git a/src/code/Compatibility_Checking/questionnaire.json b/src/code/Compatibility_Checking/questionnaire.json index 4f4bff4..a69208c 100644 --- a/src/code/Compatibility_Checking/questionnaire.json +++ b/src/code/Compatibility_Checking/questionnaire.json @@ -1 +1 @@ -{"l1":"https:\/\/item.jd.com\/100006391078.html","l2":"https:\/\/item.jd.com\/100003809901.html","l3":"https:\/\/item.jd.com\/100009115115.html","l4":"https:\/\/item.jd.com\/100012759442.html","l5":"https:\/\/item.jd.com\/100005926991.html","l6":"https:\/\/item.jd.com\/675971.html","l7":"https:\/\/item.jd.com\/100011674030.html","l8":"https:\/\/item.jd.com\/6828141.html","l9":"https:\/\/item.jd.com\/100007000176.html"} \ No newline at end of file +{"l1":"https:\/\/item.jd.com\/100006391078.html","l2":"https:\/\/item.jd.com\/100003809901.html","l3":"https:\/\/item.jd.com\/100009115115.html","l4":"https:\/\/item.jd.com\/100005116786.html","l5":"https:\/\/item.jd.com\/100005926991.html","l6":"https:\/\/item.jd.com\/675971.html","l7":"https:\/\/item.jd.com\/100011674030.html","l8":"https:\/\/item.jd.com\/6828141.html","l9":"https:\/\/item.jd.com\/100002404996.html"} \ No newline at end of file diff --git a/src/code/Recommend_Code/questionAnswers.json b/src/code/Recommend_Code/questionAnswers.json index 76a5e3e..dfc3a60 100644 --- a/src/code/Recommend_Code/questionAnswers.json +++ b/src/code/Recommend_Code/questionAnswers.json @@ -1 +1 @@ -{"version":"primary","Q1":["5000","7000"],"Q2":"1","Q3":"1","Q4":"4","Q5":"1"} \ No newline at end of file +{"version":"advanced","Q1":["6000","10000"],"Q2":["1","2"],"Q3":"2","Q4":"","Q5":"2","Q6":"","Q7":"","Q8":"","Q9":"","Q10":"","Q11":"","Q12":"","Q13":"4","Q14":"1","Q15":"2","Q16":"2","Q17":"2","Q18":"2","Q19":"1","Q20":"1","Q21":"3"} \ No newline at end of file diff --git a/src/code/Recommend_Code/recommend.py b/src/code/Recommend_Code/recommend.py index 6e0b524..c3191a1 100644 --- a/src/code/Recommend_Code/recommend.py +++ b/src/code/Recommend_Code/recommend.py @@ -34,6 +34,13 @@ class AccessoriesList: self.powerSupply = Accessories('powerSupply') self.CPURadiator = Accessories('CPURadiator') +# 设置连接配置 +with open("../dbConfig.json", 'r', encoding='UTF-8') as conf: + dbConfig = json.load(conf) +HOSTNAME = dbConfig["hostname"] +USERNAME = dbConfig["username"] +PASSWORD = dbConfig["password"] +DATABASE = "computer_accessories" def parse(questionAnswersData): res = {} @@ -105,8 +112,7 @@ def check(questionAnswers): elif(questionAnswers['version'] == 'advanced'): # 连接数据库 - db = pymysql.connect("192.168.136.129", "root", - "1213800", "computer_accessories") + db = pymysql.connect(HOSTNAME, USERNAME, PASSWORD, DATABASE) # 使用cursor()方法创建一个游标对象 cursor = db.cursor() @@ -334,8 +340,7 @@ def preferParse(preDict, questionAnswers): def suggest(listX, preDict): # 连接数据库 - db = pymysql.connect("192.168.136.129", "root", - "1213800", "computer_accessories") + db = pymysql.connect(HOSTNAME, USERNAME, PASSWORD, DATABASE) # 使用cursor()方法创建一个游标对象 cursor = db.cursor() errorInf = {'type': 0, 'flag': 1, 'errorList': []} @@ -385,7 +390,7 @@ def suggest(listX, preDict): if((item[7] in preDict['MBBrand'] or preDict['MBBrand'] == []) and (item[9] == preDict['MBSize'] or preDict['MBSize'] == None) and item[11] == listX.CPU.socket and abs(item[5] - listX.motherboard.budget) <= 100): itemList.append(item) ##print(preDict['MBSize'], item[9]) - ##print(listX.CPU.socket, item[11]) + ##print(listX.CPU.socket, item[11])cvon ##print(abs(item[5] - listX.motherboard.budget)) # #print('\n-------------------------------\n') if(itemList == []): diff --git a/src/code/Recommend_Code/recommend_error.txt b/src/code/Recommend_Code/recommend_error.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/code/Recommend_Code/recommend_result.json b/src/code/Recommend_Code/recommend_result.json index b4dff11..90199b3 100644 --- a/src/code/Recommend_Code/recommend_result.json +++ b/src/code/Recommend_Code/recommend_result.json @@ -1 +1 @@ -{"type": 0, "flag": 0, "count": 3, "result": [{"CPU": ["英特尔i5-10400F", "https://item.jd.com/100006897507.html", 1199], "motherboard": ["华擎H410M-ITX/ac主板", "https://item.jd.com/100013507418.html", 699], "memory": ["美商海盗船复仇者LPX DDR4 2666 16GB(8G×2)", "https://item.jd.com/100004590445.html", 539], "SSD": ["朗科N530S", "https://item.jd.com/100001985502.html", 439], "GPU": ["微星GeForce GTX 1650 GAMING X 4G", "https://item.jd.com/100005114232.html", 1299], "case": ["PHANTEKSPH-ES215PTG_BK", "https://item.jd.com/6306346.html", 399], "powerSupply": ["鑫谷M450B电源", "https://item.jd.com/100000254386.html", 299], "CPURadiator": ["ThermalrightTL-AS120 PLUS", "https://item.jd.com/100006880794.html", 169], "HDD": ["noneed", "", 0], "totalPrice": 5042, "hash": "8138058853"}, {"CPU": ["AMDR5 3600X", "https://item.jd.com/100003815415.html", 1499], "motherboard": ["技嘉B450 I AORUS PRO WIFI", "https://item.jd.com/100000205431.html", 949], "memory": ["美商海盗船复仇者LPX DDR4 2666 16GB(8G×2)", "https://item.jd.com/100004590445.html", 539], "SSD": ["七彩虹SL500 1TB", "https://item.jd.com/100005444250.html", 599], "GPU": ["蓝宝石RX 5500XT 白金版OC", "https://item.jd.com/100010515956.html", 1649], "case": ["PHANTEKSPH-ES215PTG_BK", "https://item.jd.com/6306346.html", 399], "powerSupply": ["银欣ST30SF", "https://item.jd.com/3945819.html", 369], "CPURadiator": ["ThermalrightTL-AS120 PLUS", "https://item.jd.com/100006880794.html", 169], "HDD": ["noneed", "", 0], "totalPrice": 6172, "hash": "20571650032"}, {"CPU": ["AMDR5 3600X", "https://item.jd.com/100003815415.html", 1499], "motherboard": ["技嘉B450 I AORUS PRO WIFI", "https://item.jd.com/100000205431.html", 949], "memory": ["美商海盗船复仇者LPX DDR4 3600 16GB(8G×2)", "https://item.jd.com/100003383025.html", 639], "SSD": ["西部数据WDS100T2G0A", "https://item.jd.com/100005145074.html", 669], "GPU": ["华擎Radeon RX 5500XT Challenger D 8G OC", "https://item.jd.com/100010501414.html", 1839], "case": ["PHANTEKSPH-ES215PTG_BK", "https://item.jd.com/6306346.html", 399], "powerSupply": ["银欣SST-ST45SF", "https://item.jd.com/3979099.html", 469], "CPURadiator": ["ThermalrightAK120MINI", "https://item.jd.com/100006722267.html", 199], "HDD": ["noneed", "", 0], "totalPrice": 6662, "hash": "15307189858"}]} \ No newline at end of file +{"type": 0, "flag": 0, "count": 3, "result": [{"CPU": ["AMDR5 3600X", "https://item.jd.com/100003815415.html", 1499], "motherboard": ["华擎A320M-ITX 主板", "https://item.jd.com/8790449.html", 669], "memory": ["美商海盗船复仇者LPX DDR4 2666 16GB(8G×2)", "https://item.jd.com/100004590445.html", 539], "SSD": ["朗科N530S", "https://item.jd.com/100001985502.html", 439], "GPU": ["华擎RX 5500XT Phantom Gaming D 8G OC", "https://item.jd.com/100010501424.html", 1899], "case": ["乔思伯V10侧透版", "https://item.jd.com/100016086972.html", 379], "powerSupply": ["全汉FSP450-50SD", "https://item.jd.com/100007255048.html", 419], "CPURadiator": ["超频三巨浪120", "https://item.jd.com/3762171.html", 199], "HDD": ["noneed", "", 0], "totalPrice": 6042, "hash": "2396870787"}, {"CPU": ["AMD锐龙5 5600X 处理器", "https://item.jd.com/100016046824.html", 2129], "motherboard": ["技嘉B450 I AORUS PRO WIFI", "https://item.jd.com/100000205431.html", 949], "memory": ["美商海盗船复仇者LPX DDR4 3600 16GB(8G×2)", "https://item.jd.com/100003383025.html", 639], "SSD": ["西部数据WDS100T2G0A", "https://item.jd.com/100005145074.html", 669], "GPU": ["华硕TUF 3-RX5600XT-T6G-EVO-GAMING", "https://item.jd.com/100009264203.html", 2499], "case": ["乔思伯V10侧透版", "https://item.jd.com/100016086972.html", 379], "powerSupply": ["全汉FSP450-50SD", "https://item.jd.com/100007255048.html", 419], "CPURadiator": ["酷冷至尊海魔120 水冷散热器", "https://item.jd.com/1025469.html", 279], "HDD": ["noneed", "", 0], "totalPrice": 7962, "hash": "2347804812"}, {"CPU": ["AMDR7 3700X", "https://item.jd.com/100006391078.html", 2449], "motherboard": ["玩家国度ROG STRIX B450-I GAMING", "https://item.jd.com/100010049592.html", 999], "memory": ["美商海盗船DDR4 3200 16GB(8Gx2条)", "https://item.jd.com/2810173.html", 819], "SSD": ["三星870 QVO 1TB MZ-77Q1T0B", "https://item.jd.com/100007847303.html", 739], "GPU": ["蓝宝石RX 5700XT 8G D6 超白金PRO OC", "https://item.jd.com/100008245245.html", 3299], "case": ["PHANTEKSPH-ES215PTG_BK", "https://item.jd.com/6306346.html", 399], "powerSupply": ["全汉FSP500-50SD", "https://item.jd.com/100006670405.html", 529], "CPURadiator": ["酷冷至尊RL-SB24-20PK-R1", "https://item.jd.com/4567820.html", 369], "HDD": ["noneed", "", 0], "totalPrice": 9602, "hash": "29056291413"}]} \ No newline at end of file diff --git a/src/controllers/contactController.php b/src/controllers/contactController.php index 4a696eb..9534e68 100644 --- a/src/controllers/contactController.php +++ b/src/controllers/contactController.php @@ -1,5 +1,12 @@