CREATE TABLE IF NOT EXISTS `KuaiDiSender` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL DEFAULT '',
  `phone` char(11) NOT NULL DEFAULT '0',
  `sum` int(11) NOT NULL DEFAULT '0',
  `date` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=274 ;

--
-- 转存表中的数据 `KuaiDiSender`
--

INSERT INTO `KuaiDiSender` (`id`, `name`, `phone`, `sum`, `date`) VALUES
(1, '覃艳奎', '13926851468', 52, '2024-02-29'),
(2, '春春', '13788287721', 35, '2024-02-29'),
(3, '覃留连', '18377832036', 144, '2024-02-29'),
(4, '覃曼林', '15296051635', 5, '2024-02-29'),
(5, '覃日晓', '15177395725', 2, '2024-02-29'),
(6, '韦凤皖', '15924223049', 10, '2024-02-29'),
(7, '小莫', '17377050484', 5, '2024-02-29'),
(8, '韦善告', '13132786495', 122, '2024-02-29'),
(9, '覃应果', '13377492599', 5, '2024-02-28'),
(10, '覃白暖', '15577834133', 3, '2024-02-27'),
(11, '覃素玲', '19116769639', 8, '2024-02-27'),
(12, '善兰', '18176198641', 17, '2024-02-27'),
(13, '覃世安', '13132708130', 2, '2024-02-27'),
(14, '覃艳妹', '18776837649', 32, '2024-02-27'),
(15, '覃壮豪', '13097785663', 49, '2024-02-27'),
(16, '韦秀欢', '19877866207', 53, '2024-02-27'),
(17, '莫白研', '18277864629', 27, '2024-02-26'),
(18, '覃甲杏', '13471840423', 23, '2024-02-26'),
(19, '覃艳玲', '15099761357', 16, '2024-02-25'),
(20, '吕晨曦', '18477820878', 1, '2024-02-25'),
(21, '覃贺生', '14707782309', 33, '2024-02-25'),
(22, '莫耐桃', '13377382669', 19, '2024-02-25'),
(23, '覃明莉', '19994454864', 8, '2024-02-25'),
(24, '莫白纺', '18278802693', 64, '2024-02-25'),
(25, '覃美生', '19177836225', 34, '2024-02-25'),
(26, '覃女士', '19178872606', 9, '2024-02-25'),
(27, '覃灵敢', '18377824674', 4, '2024-02-23'),
(28, '覃文武', '18587833806', 2, '2024-02-23'),
(29, '文博', '13557182767', 4, '2024-02-23'),
(30, '覃顺', '18776825828', 5, '2024-02-23'),
(31, '覃庆周', '13377382802', 4, '2024-02-23'),
(32, '韦萌萌', '13557011259', 1, '2024-02-23'),
(33, '覃纯宁', '15058592100', 5, '2024-02-22'),
(34, '覃飞达', '13265464395', 7, '2024-02-22'),
(35, '覃扬开', '18776844329', 24, '2024-02-22'),
(36, '陆惠纯', '13132788150', 176, '2024-02-22'),
(37, '覃燕妍', '15007889341', 10, '2024-02-22'),
(38, '覃扬芝', '15007889780', 5, '2024-02-22'),
(39, '覃文妹', '18277860580', 8, '2024-02-22'),
(40, '覃江婵', '18820315815', 35, '2024-02-22'),
(41, '覃幸群', '13407792110', 2, '2024-02-21'),
(42, '覃建', '13958870483', 7, '2024-02-20'),
(43, '覃玲曼', '18077891446', 12, '2024-02-20'),
(44, '覃汝满', '18377831296', 2, '2024-02-20'),
(45, '覃克孟', '18877814862', 16, '2024-02-20'),
(46, '覃美团', '13737971423', 39, '2024-02-20'),
(47, '覃日田', '18377821672', 2, '2024-02-20'),
(48, '覃纯班', '18776849088', 4, '2024-02-20'),
(49, '覃顺纳', '18775820599', 3, '2024-02-20'),
(50, '春岚', '15777874719', 36, '2024-02-20'),
(51, '兰锦', '19994538776', 41, '2024-02-20'),
(52, '覃艺鲜', '18357561983', 2, '2024-02-20'),
(53, '老快', '13481840197', 29, '2024-02-20'),
(54, '覃寒义', '15277867105', 5, '2024-02-20'),
(55, '覃冠达', '15677817648', 198, '2024-02-19'),
(56, '陈胤池', '13922190580', 15, '2024-02-19'),
(57, '谢嘉震', '13802730818', 13, '2024-02-19'),
(58, '杨静静', '13600001762', 10, '2024-02-19'),
(59, '覃顶红', '18176195617', 8, '2024-02-19'),
(60, '覃启革', '19907887498', 40, '2024-02-02'),
(61, '覃赞平', '15078649643', 49, '2024-02-02'),
(62, '苗苗', '13481842753', 9, '2024-02-02'),
(63, '覃在团', '13132787653', 29, '2024-02-02'),
(64, '覃仁杰', '13517583337', 40, '2024-02-02'),
(65, '覃永志', '13587332285', 331, '2024-01-31'),
(66, '覃艳玲', '13100587358', 4, '2024-01-31'),
(67, '曼芝', '18858577067', 140, '2024-01-31'),
(68, '韦金玉', '18377820556', 1, '2024-01-31'),
(69, '覃程叶', '15177884583', 12, '2024-01-31'),
(70, '覃欢', '15676827656', 5, '2024-01-31'),
(71, '覃永生', '13768489937', 6, '2024-01-30'),
(72, '叶恋', '15977822089', 11, '2024-01-30'),
(73, '覃雨畅', '15078585904', 1, '2024-01-30'),
(74, '覃苏源', '13407795616', 21, '2024-01-30'),
(75, '覃晚科', '13802380495', 8, '2024-01-30'),
(76, '崖往', '18070824596', 62, '2024-01-30'),
(77, '覃佳佳', '15677802291', 52, '2024-01-30'),
(78, '覃茂鲜', '15977853575', 18, '2024-01-30'),
(79, '覃小东', '15078859339', 5, '2024-01-30'),
(80, '韦桂凤', '13677787974', 23, '2024-01-29'),
(81, '邓玉珍', '13527182750', 7, '2024-01-29'),
(82, '薛崇飞', '13316635138', 4, '2024-01-29'),
(83, '吴晓', '13901236694', 35, '2024-01-29'),
(84, '欧阳', '18627802782', 5, '2024-01-29'),
(85, '覃顺勇', '15230928756', 1, '2024-01-29'),
(86, '覃春妹', '17754780900', 2, '2024-01-29'),
(87, '覃鲁俊', '17328354050', 144, '2024-01-29'),
(88, '杨克峰', '13810189297', 12, '2024-01-29'),
(89, '李为民', '13977159417', 2, '2024-01-29'),
(90, '莫雪丽', '15778825027', 2, '2024-01-29'),
(91, '莫中峰', '15296051081', 25, '2024-01-29'),
(92, '韦旦', '18977825018', 5, '2024-01-28'),
(93, '覃炳立', '13481842826', 11, '2024-01-28'),
(94, '现军', '18148712559', 18, '2024-01-28'),
(95, '凤端', '18278801726', 24, '2024-01-27'),
(96, '刘再茂', '18977823666', 24, '2024-01-27'),
(97, '艺米阳光', '15807881766', 1, '2024-01-27'),
(98, '盼盼', '15677877178', 7, '2024-01-27'),
(99, '韦小纯', '15977892590', 14, '2024-01-26'),
(100, '覃正佳', '13977897201', 5, '2024-01-26'),
(101, '兰花秀', '15977848977', 2, '2024-01-26'),
(102, '覃文生', '18977896285', 3, '2024-01-25'),
(103, '黄明文', '15296866190', 14, '2024-01-25'),
(104, '莫壮媚', '15078649831', 7, '2024-01-25'),
(105, '覃万福', '15277877960', 3, '2024-01-25'),
(106, '韦善告', '15707784095', 4, '2024-01-25'),
(107, '廖漫转', '13481836932', 2, '2024-01-25'),
(108, '韦金云', '18877880582', 13, '2024-01-25'),
(109, '覃河念', '18178899093', 39, '2024-01-25'),
(110, '奶多', '17777930357', 5, '2024-01-25'),
(111, '覃顺合', '18377823956', 53, '2024-01-24'),
(112, '孟川', '19802506780', 28, '2024-01-24'),
(113, '莫荣顺', '13877879760', 4, '2024-01-24'),
(114, '莫正月', '19127228086', 28, '2024-01-24'),
(115, '潘浩锐', '18077805511', 25, '2024-01-24'),
(116, '莫五妹', '15878848853', 4, '2024-01-24'),
(117, '郭建东', '13084103168', 4, '2024-01-23'),
(118, '覃秋云', '13471861755', 7, '2024-01-23'),
(119, '覃立双', '13645940795', 3, '2024-01-23'),
(120, '仙先生', '15563489901', 14, '2024-01-23'),
(121, '莫先生', '18074789691', 1, '2024-01-23'),
(122, '覃文要', '18100208636', 10, '2024-01-22'),
(123, '覃素爱', '13599735612', 2, '2024-01-22'),
(124, '莫白', '17758595834', 2, '2024-01-22'),
(125, '胡女士', '18924601820', 3, '2024-01-22'),
(126, '覃会稳', '13737957281', 3, '2024-01-22'),
(127, '张文方', '13591313547', 2, '2024-01-22'),
(128, '覃梅', '15677886718', 6, '2024-01-21'),
(129, '韦丽妮', '19127085416', 5, '2024-01-21'),
(130, '韦政贵', '18077838604', 14, '2024-01-21'),
(131, '廖花棉', '18977825927', 14, '2024-01-20'),
(132, '志姣', '13412916553', 4, '2024-01-20'),
(133, '廖艳研', '19977817145', 4, '2024-01-20'),
(134, '覃纯宁', '15277899973', 9, '2024-01-19'),
(135, '韦礼雪', '19977817495', 11, '2024-01-19'),
(136, '许姐', '18377882906', 1, '2024-01-19'),
(137, '覃玲艺', '13788083465', 2, '2024-01-19'),
(138, '蒙秀金', '13560362421', 3, '2024-01-19'),
(139, '蒙春霞', '13407797077', 12, '2024-01-18'),
(140, '罗玲艳', '15078578097', 16, '2024-01-18'),
(141, '韦壮猛', '13481881333', 10, '2024-01-17'),
(142, '覃美四', '15807884984', 3, '2024-01-17'),
(143, '莫壮飞', '13481838618', 11, '2024-01-17'),
(144, '韦萍', '15107886353', 6, '2024-01-17'),
(145, '覃愿柳', '18176181600', 12, '2024-01-17'),
(146, '莫三妹', '18977824689', 4, '2024-01-16'),
(147, '海风年', '15602469807', 8, '2024-01-16'),
(148, '覃姗妮', '19127083892', 6, '2024-01-16'),
(149, '周翠姣', '15078093719', 12, '2024-01-16'),
(150, '月爱', '13687783137', 2, '2024-01-16'),
(151, '覃建峰', '13481843215', 11, '2024-01-16'),
(152, '莫伶伶', '15808934696', 3, '2024-01-16'),
(153, '覃贤凤', '19116760562', 2, '2024-01-16'),
(154, '卢覃东', '15277872387', 6, '2024-01-14'),
(155, '葛修彪', '18977868009', 10, '2024-01-14'),
(156, '韦燕菊', '13471877753', 2, '2024-01-14'),
(157, '韦玉盘', '18178534114', 1, '2024-01-14'),
(158, '覃壮奔', '13737992506', 1, '2024-01-14'),
(159, '覃美花', '18277869629', 1, '2024-01-13'),
(160, '覃春现', '13788286515', 1, '2024-01-13'),
(161, '覃火暖', '15078589772', 10, '2024-01-12'),
(162, '覃花田', '18277866388', 1, '2024-01-12'),
(163, '王先生1', '15012958083', 2, '2024-01-11'),
(164, '覃淑颖', '15277862157', 48, '2024-01-10'),
(165, '莫爱雪', '13481837874', 4, '2024-01-10'),
(166, '韦利雪', '13237785987', 1, '2024-01-09'),
(167, '覃云钊', '18602071057', 28, '2024-01-09'),
(168, '覃环恩', '13407792421', 1, '2024-01-09'),
(169, '莫灵在', '18178867817', 3, '2024-01-08'),
(170, '覃春燕', '19977840945', 2, '2024-03-29'),
(171, '覃怡霞', '13471860418', 55, '2024-03-29'),
(172, '莫满植', '19127081376', 12, '2024-03-29'),
(173, '覃丽珍', '17878876170', 16, '2024-03-29'),
(174, '覃先生', '18676502006', 8, '2024-03-28'),
(175, '覃叶弯', '13434579787', 5, '2024-03-28'),
(176, '飞飞', '18277861108', 1, '2024-03-28'),
(177, '韦凤才', '18877883935', 5, '2024-03-28'),
(178, '莫会兰', '15078586776', 3, '2024-03-28'),
(179, '李彦卯', '18934929913', 6, '2024-03-28'),
(180, '覃善上', '13877886365', 2, '2024-03-27'),
(181, '覃会安', '15078089560', 1, '2024-03-27'),
(182, '覃敏', '18277860805', 14, '2024-03-27'),
(183, '奇缘', '19877866992', 6, '2024-03-27'),
(184, '覃广平', '18775863789', 1, '2024-03-27'),
(185, '韦庆柳', '15723780993', 2, '2024-03-27'),
(186, '周秀寒', '18977856017', 3, '2024-03-27'),
(187, '叶优', '13666083862', 3, '2024-03-26'),
(188, '蒙东汉', '19127223168', 109, '2024-03-26'),
(189, '莫冬菊', '18174915196', 78, '2024-03-26'),
(190, '覃春梅', '13481840269', 2, '2024-03-26'),
(191, '覃秀妹', '18777854166', 4, '2024-03-26'),
(192, '莫香媚', '18074893215', 3, '2024-03-26'),
(193, '覃慧威', '13607786517', 2, '2024-03-26'),
(194, '覃孟叶', '13558080283', 2, '2024-03-25'),
(195, '谭善维', '19148657386', 16, '2024-03-25'),
(196, '覃胜波', '18307883519', 1, '2024-03-25'),
(197, '韦忆韩', '13397882883', 6, '2024-03-25'),
(198, '覃小英', '15078645637', 19, '2024-03-24'),
(199, '蒙柳娇', '13086735516', 15, '2024-03-24'),
(200, '覃妮', '19194522962', 5, '2024-03-24'),
(201, '黄虚', '18777855137', 3, '2024-03-24'),
(202, '莫桂连', '19178873996', 19, '2024-03-24'),
(203, '覃美年', '15977815137', 11, '2024-03-24'),
(204, '覃壮康', '18174943425', 11, '2024-03-24'),
(205, '覃桂团', '13737990970', 12, '2024-03-24'),
(206, '覃应军', '15977825293', 23, '2024-03-24'),
(207, '覃凤云', '19127081679', 17, '2024-03-24'),
(208, '岑显根', '18278811077', 5, '2024-03-24'),
(209, '覃春瑾', '13717220027', 2, '2024-03-24'),
(210, '莫志良', '15977892718', 2, '2024-03-23'),
(211, '龙云凤', '18677841702', 14, '2024-03-23'),
(212, '覃月妙', '18377826636', 2, '2024-03-23'),
(213, '覃灵奔', '17777945753', 2, '2024-03-23'),
(214, '覃顺妮', '18777854669', 5, '2024-03-22'),
(215, '覃介美', '15878924672', 1, '2024-03-22'),
(216, '覃爱玲', '17776599286', 3, '2024-03-22'),
(217, '覃美玉', '19148658206', 2, '2024-03-22'),
(218, '覃俊峰', '15949330859', 2, '2024-03-22'),
(219, '覃汉元', '13788388042', 1, '2024-03-22'),
(220, '覃在朗', '18777854929', 8, '2024-03-22'),
(221, '莫羽卉', '18077858886', 2, '2024-03-22'),
(222, '覃善块', '15507784507', 3, '2024-03-22'),
(223, '冉彩琼', '19130224162', 3, '2024-03-22'),
(224, '覃丽雅', '15277875933', 10, '2024-03-22'),
(225, '覃友兰', '15296041494', 1, '2024-03-21'),
(226, '农卫凤', '15878925909', 4, '2024-03-21'),
(227, '覃小岚', '13117680446', 3, '2024-03-21'),
(228, '覃壮族', '18176754075', 3, '2024-03-21'),
(229, '覃素娇', '18124178986', 4, '2024-03-21'),
(230, '周柳飞', '18977895737', 2, '2024-03-21'),
(231, '黄登汉', '18278821272', 4, '2024-03-21'),
(232, '覃宇宁', '13737975941', 1, '2024-03-21'),
(233, '谭兰叶', '15277872798', 2, '2024-03-21'),
(234, '覃飞雪', '18077852956', 7, '2024-03-20'),
(235, '覃应彩', '15977840855', 5, '2024-03-20'),
(236, '莫可可', '13407791825', 25, '2024-03-20'),
(237, '覃懂贫', '18278812889', 5, '2024-03-20'),
(238, '覃建华', '13977802784', 3, '2024-03-20'),
(239, '覃誉乾', '18074893900', 2, '2024-03-19'),
(240, '覃和卫', '19178936823', 8, '2024-03-19'),
(241, '覃艳芬', '15296872756', 19, '2024-03-19'),
(242, '覃六妹', '18377838395', 1, '2024-03-18'),
(243, '覃雅仙', '18258083181', 4, '2024-03-18'),
(244, '莫飞雪', '18934931906', 1, '2024-03-18'),
(245, '廖玉桃', '17754780908', 6, '2024-03-18'),
(246, '覃秀全', '15777810679', 25, '2024-03-17'),
(247, '覃意顺', '15078564468', 74, '2024-03-16'),
(248, '老覃', '15977907052', 2, '2024-03-16'),
(249, '覃永丽', '15777868011', 6, '2024-03-16'),
(250, '覃杨莉', '15977892679', 4, '2024-03-16'),
(251, '覃艳引', '13968571463', 5, '2024-03-15'),
(252, '覃玉鲜', '13471860677', 4, '2024-03-15'),
(253, '覃柳燕', '18070827414', 7, '2024-03-14'),
(254, '韦忆韩', '13977847983', 5, '2024-03-13'),
(255, '覃运惭', '19877856612', 5, '2024-03-13'),
(256, '覃爱美', '18177898497', 2, '2024-03-13'),
(257, '覃世共', '19907788203', 2, '2024-03-12'),
(258, '覃幸成', '15977823071', 3, '2024-03-12'),
(259, '曼雅', '19994539630', 6, '2024-03-11'),
(260, '龙照滚', '19148656809', 2, '2024-03-10'),
(261, '覃运杰', '18377838173', 8, '2024-03-09'),
(262, '覃万水', '19994539460', 1, '2024-03-09'),
(263, '覃三高', '15977893360', 2, '2024-03-07'),
(264, '覃晚科', '18977868619', 32, '2024-03-06'),
(265, '贺香群', '13728605897', 38, '2024-03-05'),
(266, '覃柳纪', '19977840465', 3, '2024-03-05'),
(267, '覃彩莲', '15977825464', 1, '2024-03-04'),
(268, '覃丹', '17395753935', 2, '2024-03-04'),
(269, '覃金灵', '18177883270', 2, '2024-03-04'),
(270, '覃慧妮', '19192849549', 3, '2024-03-01'),
(271, '覃继宁', '13481887292', 4, '2024-03-01'),
(272, '覃慢卷', '18249929076', 3, '2024-03-30'),
(273, '莫曼玉', '13737992671', 1, '2024-03-30');

-- --------------------------------------------------------

--
-- 表的结构 `KuaiDiTest`
--

CREATE TABLE IF NOT EXISTS `KuaiDiTest` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL DEFAULT '0',
  `phone` char(11) NOT NULL DEFAULT '0',
  `address` varchar(64) NOT NULL DEFAULT '',
  `kuaidi` varchar(25) NOT NULL DEFAULT '',
  `kuaidi_number` varchar(64) NOT NULL DEFAULT '',
  `sendphone` char(11) NOT NULL DEFAULT '',
  `sendname` varchar(64) NOT NULL,
  `province` varchar(64) NOT NULL DEFAULT '',
  `date` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `Users`
--

CREATE TABLE IF NOT EXISTS `Users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(32) NOT NULL,
  `passwd` varchar(32) NOT NULL,
  `openid` varchar(32) DEFAULT '',
  `grade` int(1) NOT NULL DEFAULT '1',
  `session_id` varchar(40) DEFAULT '',
  `user_ip` varchar(20) DEFAULT '',
  `login_date` datetime DEFAULT '1000-01-01 00:00:00',
  `passwd2` varchar(20) DEFAULT '',
  `ocr` int(11) DEFAULT '0',
  `ocr_end` date DEFAULT '1000-01-01',
  `email` varchar(30) DEFAULT '',
  `roomid` int(7) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ;

--
-- 转存表中的数据 `Users`
--

INSERT INTO `Users` (`id`, `user`, `passwd`, `openid`, `grade`, `session_id`, `user_ip`, `login_date`, `passwd2`, `ocr`, `ocr_end`, `email`, `roomid`) VALUES
(1, 'webserver', '0xhWEjpuDTEc9E+KW4KeQMHQ==', 'oBenE5L_Q5JEFBIWn1wQMh8OVTeE', 9, 'webserver=0xhWEjpuDTEc9E%2BKW4KeQMHQ%3D%', '117.181.149.102', '2024-03-30 14:09:43', 'golangjacob', 99940, '2022-08-23', '282246101@qq.com', 1),
(7, '13788280442', '0xNHLAtlaLQZagsYaf116A+Q==', 'oBenE5J-bPVd6_7BgzzV_Vd93ZMk', 7, '', '117.181.148.2', '2022-11-17 08:12:57', '', 0, NULL, '', 1),
(11, '18178898624', '0x0XlfYMyMQHtgEBxut7HIeA==', 'oBenE5BBPh6iq8nrIfLjcjSMbvxU', 7, '', '117.181.148.2', '2022-11-17 08:14:37', '', 0, NULL, '', 1),
(12, '15078578097', '0xvS5jcICPRWEoL+F7hrElxA==', 'oBenE5PiWlk--zrJNqSq6Lc7SQFQ', 7, 'security_session_verify=e06738173d362144', '117.181.149.26', '2024-01-02 07:10:22', '', 0, NULL, '348780705@qq.com', 1),
(20, 'jijian', '0xm/yDjM6zjbiLYbqHGpZ+sA==', NULL, 1, 'jijian=0xm%2FyDjM6zjbiLYbqHGpZ%2BsA%3D%3', '117.181.149.34', '2024-03-16 06:59:10', '', 0, NULL, 'qngrda@qq.com', 0),
(21, '19374036877', '0xzn7Wi8mBmma1Ywd42Voadg==', 'oBenE5L_Q5JEFBIWn1wQMh8OVTeE', 1, '', '', '1000-01-01 00:00:00', '', 0, '1000-01-01', '', 0);

-- --------------------------------------------------------

--
-- 表的结构 `VehicleCard`
--

CREATE TABLE IF NOT EXISTS `VehicleCard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '',
  `indate` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  `outdate` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  `monthly` datetime DEFAULT '1000-01-01 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `VehicleMoney`
--

CREATE TABLE IF NOT EXISTS `VehicleMoney` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `month` varchar(20) NOT NULL,
  `money` varchar(30) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `WarehouseCategories`
--

CREATE TABLE IF NOT EXISTS `WarehouseCategories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(32) NOT NULL,
  `types` varchar(32) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=99 ;

--
-- 转存表中的数据 `WarehouseCategories`
--

INSERT INTO `WarehouseCategories` (`id`, `user`, `types`) VALUES
(1, 'webserver', '电磁炉'),
(3, 'webserver', '洗衣机'),
(4, 'webserver', '微波炉'),
(5, 'webserver', '电脑'),
(8, 'webserver', '电风扇'),
(13, 'family282246101', '个人必备'),
(14, 'family282246101', '家庭必备'),
(73, 'webserver', '喷雾器'),
(25, 'webserver', '二极管'),
(26, 'webserver', '三极管'),
(37, 'webserver', '电容'),
(40, 'webserver', '电阻'),
(42, 'webserver', '液晶屏'),
(43, 'webserver', '饮水机'),
(46, 'webserver', '单片机'),
(49, 'webserver', '保险管'),
(51, 'webserver', '豆浆机'),
(52, 'webserver', '功放'),
(77, 'webserver', '汽车'),
(58, 'webserver', 'dvd'),
(80, 'webserver', '锅'),
(62, 'webserver', '适配器'),
(63, 'webserver', '线座'),
(65, 'webserver', '机顶盒'),
(66, 'webserver', '制冷'),
(69, 'webserver', '电子称'),
(87, 'webserver', '继电器'),
(93, 'webserver', '传感器'),
(90, 'webserver', '电热燃气'),
(95, 'webserver', '割草机'),
(92, 'webserver', '耗材'),
(96, 'webserver', '饮水机'),
(97, 'webserver', '电商'),
(98, 'webserver', '电动配件');

-- --------------------------------------------------------

--
-- 表的结构 `WarehouseGoods`
--

CREATE TABLE IF NOT EXISTS `WarehouseGoods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL DEFAULT '',
  `price` float DEFAULT '0',
  `number` float NOT NULL DEFAULT '0',
  `buy` float DEFAULT '0',
  `freight` float NOT NULL DEFAULT '0',
  `date` date NOT NULL,
  `user` varchar(32) NOT NULL,
  `attribute` varchar(500) DEFAULT '',
  `quantity` int(7) DEFAULT '0',
  `shortage` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1161 ;

--
-- 转存表中的数据 `WarehouseGoods`
--

INSERT INTO `WarehouseGoods` (`id`, `name`, `price`, `number`, `buy`, `freight`, `date`, `user`, `attribute`, `quantity`, `shortage`) VALUES
(4, '开关 非自锁8x8mm', 2, 6, 0.2, 1, '2023-07-30', 'webserver', '13\r\n按下为 断开,\r\n正常一直是导通', 0, 0),
(8, '电磁炉 万能电源块', 15, 5, 3, 1, '2018-09-07', 'webserver', '输入电压为300V直流 并接电路板直流滤波电容\r\n正负极别接错,拆掉变压器,拆掉电路板电源集成块\r\n输出电压分别是\r\n5v 并进电路一般拆下电路上78L05接在5V输出脚\r\n12v(很少用)\r\n18v 接散热风扇,插座下', 1, 0),
(9, '电压锅 温控器', 20, 1, 4, 1, '2018-10-03', 'webserver', '防止失控时烧坏锅体', 0, 0),
(10, '电脑 VGA视频线', 15, 2, 6, 1, '2022-09-05', 'webserver', '', 4, 0),
(11, '彩电9脚管座', 15, 2, 1, 1, '2018-04-30', 'webserver', '', 0, 0),
(12, '电压锅 压力开关10A', 15, 9, 1.6, 1, '2023-11-27', 'webserver', '压力开关调试方法\r\n上锅放水开机等上面冒白气时,拔电把压力开关调到刚好触发的状态即可\r\n维修30\r\n零售15', 6, 0),
(13, '微波炉 磁控管2M219J', 70, 1, 32, 1, '2018-04-30', 'webserver', '', 0, 0),
(14, '电脑 SD卡套', 8, 4, 1, 1, '2023-07-30', 'webserver', '2', 0, 0),
(18, '线座 圆形接线端', 0.5, 25, 0.1, 1, '2019-12-10', 'webserver', '', 0, 0),
(20, '电压锅 插簧+皮套', 0.5, 7, 0.1, 1, '2023-07-30', 'webserver', '1\r\n6.3mm插簧+皮套', 16, 0),
(23, '电脑 双usb连接头', 10, 1, 1.5, 1, '2018-04-30', 'webserver', '', 0, 0),
(26, '线座 16A高级电源插头', 5, 21, 2, 1, '2021-07-17', 'webserver', '绿白固定22个', 16, 0),
(27, '电脑 显示器电源', 35, 1, 15, 1, '2018-04-30', 'webserver', '', 0, 0),
(28, '电容 1.5UF', 5, 6, 0.8, 1, '2021-07-17', 'webserver', '', 12, 0),
(29, '电容 6UF', 10, 3, 2.2, 1, '2018-04-30', 'webserver', '', 1, 0),
(31, '电容 400V2UF', 5, 9, 0.7, 1, '2023-07-30', 'webserver', '34', 2, 0),
(33, '电脑 鼠标垫', 4, 9, 2, 1, '2018-04-30', 'webserver', '', 10, 0),
(967, '电脑 内存条DDR3 4G 1600', 100, 1, 50, 0, '2022-03-25', 'webserver', '放在电脑机箱里', 0, 0),
(35, '电磁炉 大整流桥GBJ2510', 7, 2, 1, 1, '2023-07-30', 'webserver', '36\r\n耐压1000V\r\n耐流25A\r\n可以在线电路测量其好坏\r\n根据二极管原理测量\r\n中间两个引脚为交流输入\r\n旁边两个脚分别都有标识正负极', 7, 0),
(37, '电磁炉 温度传感器', 20, 48, 0.2, 1, '2023-07-30', 'webserver', '19\r\n正常电阻值为33k左右', 8, 0),
(38, '电磁炉 三极管ACT30B', 3, 10, 0.6, 1, '2018-04-30', 'webserver', '', 0, 0),
(39, '保险管 微波炉 保险丝组件', 10, 3, 2.5, 1, '2023-07-30', 'webserver', '10\r\n有单独2个保险管', 7, 0),
(40, '液晶屏 19寸液晶显示器', 310, 1, 310, 1, '2022-03-30', 'webserver', '', 0, 0),
(41, '彩电行管D2553', 5, 7, 0.4, 1, '2018-04-30', 'webserver', '', 0, 0),
(42, '电脑 硬盘SATA数据线', 7, 4, 1.5, 1, '2021-05-25', 'webserver', '', 1, 0),
(43, '电容 电解电容450V4.7UF', 1, 4, 0.2, 1, '2023-10-09', 'webserver', '8', 3, 0),
(44, '电容 400V(394J)', 3, 5, 0.3, 1, '2018-04-30', 'webserver', '', 0, 0),
(45, '电磁炉 BYM26 二极管', 1, 4, 0.3, 1, '2018-09-17', 'webserver', '位置:F盒', 0, 0),
(46, '电磁炉 LED发光二极管', 0.5, 26, 0.1, 1, '2018-09-17', 'webserver', '位置:F盒', 24, 0),
(47, '电风扇 落地扇档位开关', 8, 2, 1, 1, '2021-05-25', 'webserver', '三个档位四个接触点\r\n除了三个档位外,另一个就是公共端\r\n分区拔到1.2.3\r\n档测量与公共端是否连通来判断是否良好', 3, 0),
(1130, '电脑 cpu散热膏袋装', 3, 10, 0.2, 0, '2023-09-09', 'webserver', '34', 0, 0),
(827, '电脑 内置有线网卡', 45, 1, 19, 5, '2020-09-20', 'webserver', '', 0, 0),
(50, '彩电消磁电阻', 7, 5, 0.7, 1, '2023-07-30', 'webserver', '30', 0, 0),
(52, '电磁炉 VIPer22A', 20, 2, 1.2, 1, '2023-07-30', 'webserver', '36\r\n电磁炉电源集成块\r\n可以代换VIPer12A', 4, 0),
(54, '机顶盒 电源板22V15V5V4V', 30, 1, 7, 1, '2021-09-26', 'webserver', '5V/4V/15V/22V', 2, 0),
(55, '液晶屏 电视DL0165R电源', 10, 5, 0.4, 1, '2018-04-30', 'webserver', '', 0, 0),
(56, '电磁炉 DH321电源芯片', 10, 5, 0.3, 1, '2018-04-30', 'webserver', '', 0, 0),
(57, '液晶屏 FSL206MR电源', 20, 4, 1, 1, '2019-01-25', 'webserver', '创维电源', 0, 0),
(58, '液晶屏 CP1653A', 20, 2, 1, 1, '2018-04-30', 'webserver', '', 0, 0),
(59, '液晶屏 SD6834', 15, 3, 0.7, 1, '2018-04-30', 'webserver', '', 0, 0),
(60, '液晶屏 FSQ510电源芯片', 30, 2, 2, 1, '2018-04-30', 'webserver', '', 0, 0),
(61, '单片机 EL/PC817C光耦 ', 5, 22, 0.2, 1, '2023-07-30', 'webserver', '9\r\n左边（1、2脚：输入端、控制端）是一个发光二极管。\r\n右边（3、4脚：输出端、受控端）是一个三极管（CE极）\r\n4脚必须接正电一边\r\n控制端：最大电压5V，最大电流50mA。最大反向电压6V。\r\n受控端：最大电压35V，最大电流50mA。\r\n隔离电压：5000V。\r\n工作温度：-30℃ ～ +100℃。\r\nCRT（电流比）：200% ～ 400%。\r\n[ 最佳电压电流范围 ]\r\n控制端最佳电压为0.3V~1.4V，最佳电流不超过20mA。\r\n受控端最佳电压不超过30V，最佳电流不超过30mA。', 12, 0),
(62, '液晶屏 电源芯片SD6832', 10, 5, 0.5, 1, '2018-04-30', 'webserver', '', 0, 0),
(64, '彩电高压帽', 5, 2, 1, 1, '2018-04-30', 'webserver', '', 0, 0),
(65, '机顶盒 开关电源板18v15v3.3v', 30, 1, 3, 1, '2021-04-20', 'webserver', '3.3V\r\nGND\r\n15V（12V-16V都插在15V这个电压上）\r\n18V（18V-24V都插在18V这个电压上）', 0, 0),
(977, '耗材 手机尾插 Micro 接口 ', 10, 4, 2, 1, '2022-03-30', 'webserver', '', 0, 0),
(66, '线座 3线6头视音频线', 10, 2, 4, 1, '2023-11-27', 'webserver', '红白黄三线\r\n长1.5米\r\n黄线一般接视频输入\r\n另外两根接左右声道', 5, 0),
(67, '功放 TDA2030A 音频', 7, 21, 0.6, 1, '2023-07-30', 'webserver', '9\r\n当零件卖7元/个,维修25元/一对管\r\n2030A可以直接代换1006', 0, 0),
(68, '功放 双联电位器50K', 5, 5, 1, 1, '2018-04-30', 'webserver', '', 1, 0),
(69, '三极管 稳压管L7805', 7, 8, 0.21, 1, '2018-11-07', 'webserver', '输入12V\r\n输出5V\r\n串联型稳压管', 6, 0),
(70, '三极管 s8050', 1, 98, 0.03, 1, '2023-07-30', 'webserver', '20\r\nNPN型\r\n耗散功率0.625W,集电极电流0.5A,集电极--基极电压40V\r\n集电极--发射极击穿电压25V\r\n按三极管后缀号分为 B C D档 贴片为 L H档,\r\n放大倍数B85-160 C120-200 D160-300 L100-200 H200-350\r\n引脚排列多为EBC', 4, 0),
(71, '三极管 9014', 10, 42, 0.1, 1, '2023-07-30', 'webserver', '20', 3, 0),
(72, '三极管 ss8550', 1, 180, 0.1, 1, '2023-07-30', 'webserver', '20\r\nPNP型\r\n耗散功率: 1W(TA=25℃) 2W(TC=25℃)\r\n集电极电流1.5A\r\n集电极--基极电压40V\r\n集电极--发射极击穿电压25V\r\n特征频率fT 最小100MHZ\r\n放大倍数：按三极管后缀号分为 B C D 共3档\r\n放大倍数 B：85-160 C：120-200 D：160-300\r\n引脚排列多为EBC', 21, 0),
(73, '二极管 整流管RL207', 1, 48, 0.1, 1, '2023-07-30', 'webserver', '35\r\n耐压是1000V.\r\n正向电流是2A', 0, 0),
(74, '二极管 整流管1N4007', 10, 108, 0.1, 1, '2023-07-30', 'webserver', '35\r\n零售1元\r\n耐压700V\r\n二极管特性\r\n用于整流\r\n正向电阻50K左右反向无穷大', 29, 0),
(75, '三极管 稳压管L7812', 7, 3, 0.4, 1, '2023-07-30', 'webserver', '6\r\n输入18V\r\n输出12V\r\n串联型稳压管', 2, 0),
(76, '三极管 稳压管L7809', 7, 5, 0.4, 1, '2018-04-30', 'webserver', '', 0, 0),
(80, '三极管 s9013', 1, 50, 0.1, 1, '2023-07-30', 'webserver', '20\r\nNPN 　　\r\n集电极-发射极电压 25V 　　\r\n集电极-基极电压 45V 　　\r\n发射极-基极电压0.7V 　　\r\n集电极电流Ic Max 0.5A 　　\r\n耗散功率 0.625W 　　\r\n工作温度 -55℃ ~ +150℃ 　　\r\n特征频率 150MHz 　　\r\n放大倍数 D64-91 E78-122 F96-135 G122-166 H144-220 I190-300 　　\r\n主要用途 放大电路。   ', 0, 0),
(81, '三极管 c1815', 1, 95, 0.1, 1, '2023-07-30', 'webserver', '20\r\nNPN型\r\n集电极-基极击穿电压(VCBO)：60V\r\n集电极-发射极击穿电压(VCEO)：50V\r\n发射极-基极击穿电压(VEBO)：5V\r\n集电极电流(IC)：150mA\r\n基极电流(IB)：50mA\r\n耗散功率(PC)：400mW\r\n集电极-发射极饱和压降(VCE)：0.25V\r\n特征频率(fr)：80MHz\r\n因生产厂商不同1815三极管会有不同前缀，如C1815、2SC1815、KSC1815等，其特性一致。\r\n与C1015配对', 5, 0),
(82, '三极管 c1015', 1, 49, 0.1, 1, '2023-07-30', 'webserver', '20\r\nPNP型\r\n集电极-基极击穿电压(VCBO)：60V\r\n集电极-发射极击穿电压(VCEO)：50V\r\n发射极-基极击穿电压(VEBO)：5V\r\n集电极电流(IC)：150mA\r\n基极电流(IB)：50mA\r\n耗散功率(PC)：400mW\r\n集电极-发射极饱和压降(VCE)：0.25V\r\n特征频率(fr)：80MHz\r\n与C1815配对', 1, 0),
(83, '三极管 C2383 1A/160V', 1, 10, 0.1, 1, '2018-09-17', 'webserver', '位置:C盒', 0, 0),
(84, '功放 音频TEA2025', 20, 6, 0.5, 1, '2018-04-30', 'webserver', '', 0, 0),
(85, '单片机 陶瓷晶振 Z8.0M', 5, 11, 0.4, 1, '2018-04-30', 'webserver', '', 0, 0),
(86, '单片机 陶瓷晶振 Z4.0M', 5, 5, 0.4, 1, '2018-04-30', 'webserver', '', 0, 0),
(87, '单片机 晶振32.768K ', 5, 10, 0.3, 1, '2019-02-03', 'webserver', '石英', 0, 0),
(88, '集成电路 KA7500', 5, 1, 1, 1, '2018-04-30', 'webserver', '', 0, 0),
(89, '电磁炉 18v稳压管1n4746', 0.5, 77, 0.1, 1, '2023-07-30', 'webserver', '17\r\n正反向电阻分别为 5.2m和无穷大', 9, 0),
(90, '二极管 12V稳压管1n4742', 0.5, 9, 0.1, 1, '2023-07-30', 'webserver', '17', 1, 0),
(91, '保险管 250V2A ', 1, 4, 0.2, 1, '2018-09-17', 'webserver', '位置:A盒', 1, 0),
(93, '彩电场输出LA78040', 20, 2, 0.4, 1, '2018-04-30', 'webserver', '', 0, 0),
(94, '电脑 风扇轴承油脂', 5, 2, 1.15, 1, '2019-12-19', 'webserver', '', 0, 0),
(95, '彩电高压包 N2420C', 50, 1, 20, 1, '2018-04-30', 'webserver', '', 0, 0),
(96, '彩电场集成 LA78041', 10, 2, 1, 1, '2018-04-30', 'webserver', '', 0, 0),
(97, '电容 电解电容450V10UF', 1, 11, 0.2, 1, '2023-07-30', 'webserver', '8\r\n正负极之分\r\n电路板图标 空白划线为负极\r\n', 0, 0),
(98, '电容 电解电容50V100UF', 0.5, 15, 0.1, 1, '2023-07-30', 'webserver', '8\r\n正负极之分\r\n电路板图标 空白划线为负极', 1, 0),
(99, '电容 电解电容160V220UF', 5, 2, 0.6, 1, '2023-07-30', 'webserver', '8\r\n正负极之分\r\n电路板图标 空白划线为负极', 0, 0),
(100, '电容 电解电容35V1000UF', 1, 16, 0.2, 1, '2023-07-30', 'webserver', '8\r\n正负极之分\r\n电路板图标 空白划线为负极', 1, 0),
(103, 'DVD 皮带', 10, 8, 2.5, 1, '2023-07-30', 'webserver', '32', 1, 0),
(104, '电容 电磁炉0.3UF/1200V', 10, 4, 0.8, 1, '2019-09-23', 'webserver', '不区分正负极\r\n一般烧电磁炉IGBT管时都会连带这个一起更换', 1, 0),
(107, '微波炉 高压二极管', 10, 7, 0.5, 1, '2023-07-30', 'webserver', '10', 1, 0),
(110, 'DVD 移动EVD拨动开关', 5, 9, 0.2, 1, '2018-11-11', 'webserver', '', 1, 0),
(112, '电饭锅 磁钢限温器', 15, 10, 1, 1, '2024-01-07', 'webserver', '温度达到饭熟时就失去磁力,使开关跳开断电\r\n煮饭不熟,直接更换这个', 46, 0),
(113, '电脑 4CM显卡风扇', 5, 5, 1.5, 1, '2018-04-30', 'webserver', '', 1, 0),
(114, '电脑 CPU散热风扇', 25, 4, 5, 1, '2018-04-30', 'webserver', '', 3, 0),
(115, '电阻 水泥5W/47欧', 1, 9, 10, 1, '2023-07-30', 'webserver', '30', 0, 0),
(117, '电容 电磁炉5UF/400V', 8, 4, 1, 1, '2019-09-26', 'webserver', '电磁炉，间接加热或者加热温度达不到沸点。\r\n更换就好了', 4, 0),
(118, '彩电万能遥控器', 20, 2, 5, 1, '2018-07-28', 'webserver', '', 0, 0),
(120, '电饭锅 保温片', 10, 2, 1, 1, '2018-04-30', 'webserver', '', 3, 0),
(122, '洗衣机 进水阀1A125V', 25, 2, 5, 1, '2018-04-30', 'webserver', '', 1, 0),
(123, '电容 12UF450V', 18, 4, 3, 1, '2024-01-07', 'webserver', '', 4, 0),
(125, '电脑 鼠标按键1A125V', 3, 18, 0.2, 1, '2018-06-16', 'webserver', '', 0, 0),
(126, '开关 6x6x8MM 轻触', 1, 29, 0.1, 0.01, '2023-07-30', 'webserver', '12', 39, 0),
(127, '开关 6X6X9MM轻触', 2, 45, 0.1, 0.01, '2023-07-30', 'webserver', '12', 28, 0),
(128, '微波炉 磁控管2M226', 80, 1, 40, 1, '2019-01-25', 'webserver', ' 01GMT', 0, 0),
(129, '洗衣机 二脚水位开关', 70, 2, 7, 1, '2022-10-23', 'webserver', '零售20\r\n2脚一般阻值为20欧左右\r\n', 2, 0),
(1051, '机顶盒 通用板5V5v24v 带开关', 30, 1, 7.9, 0.5, '2022-07-31', 'webserver', '', 2, 0),
(1064, '锅 带线温度保险15a', 20, 1, 2.3, 0, '2023-04-15', 'webserver', '零售10元', 5, 0),
(1069, 'dvd HOP-120X 带架移动激光头', 50, 3, 15, 1, '2023-10-26', 'webserver', '小型随身DVD激光头\r\n上面的电位器不能调，一调就用不了了', 3, 0),
(135, '线座 音频数据线1对1', 10, 2, 1.6, 1, '2018-12-25', 'webserver', '1拖1\r\n松育电子一个0.5', 1, 0),
(136, '电饭锅 2脚船型开关', 5, 14, 0.3, 1, '2023-12-01', 'webserver', '21', 4, 0),
(141, '三极管 三端稳压7810', 3, 2, 0.5, 1, '2018-04-30', 'webserver', '', 0, 0),
(143, '电脑 笔记本内存条2G', 100, 1, 50, 1, '2023-07-30', 'webserver', '2\r\n1333 ', 0, 0),
(152, '汽车 48-72v转12v20a', 70, 1, 31, 1, '2019-06-03', 'webserver', '已经使用在果树抽水遥控器上', 0, 0),
(155, '电压锅 三脚电源插座', 10, 9, 0.4, 1, '2023-11-27', 'webserver', '', 25, 0),
(156, '手电筒弯脚开关', 5, 8, 0.5, 1, '2018-04-30', 'webserver', '', 0, 0),
(159, '电风扇 鸿运塑料旋钮', 2, 11, 0.2, 1, '2019-06-27', 'webserver', '', 1, 0),
(161, '电风扇 定时开关120分', 20, 2, 3.5, 1, '2021-07-03', 'webserver', '通用定时开关120分', 7, 0),
(162, '电风扇 墙扇拉线档位开关', 15, 3, 1, 1, '2018-04-30', 'webserver', '', 1, 0),
(1073, '电热燃气 电热水壶电源线', 10, 3, 3, 1, '2023-10-23', 'webserver', '', 8, 0),
(174, '电容 400V1.2UF', 5, 11, 0.54, 1, '2019-06-21', 'webserver', '', 7, 0),
(179, '线座 硬塑料两脚插头', 5, 9, 2, 1, '2018-04-30', 'webserver', '', 3, 0),
(181, '电脑 usb母座', 2, 2, 0.5, 1, '2023-09-03', 'webserver', '', 3, 0),
(182, '电脑 复位开关', 15, 1, 1, 1, '2018-04-30', 'webserver', '', 0, 0),
(183, '电脑 读卡器3.0', 35, 1, 20, 1, '2018-04-30', 'webserver', '', 0, 0),
(188, '电风扇 风扇摇头同步电机', 20, 3, 4.5, 1, '2022-08-01', 'webserver', '这个是通用的，如果装不下，可以反过来装', 1, 0),
(265, '电磁炉 轻触开关8x8x10', 5, 4, 0.25, 0.01, '2023-07-30', 'webserver', '12', 3, 0),
(266, '开关 电筒开关两脚', 5, 8, 0.25, 1, '2018-04-30', 'webserver', '', 0, 0),
(270, '液晶屏 电源板RSAG7.820.', 150, 1, 50, 10, '2019-02-03', 'webserver', '海信', 0, 0),
(271, '电磁炉 按键板RK2106', 35, 1, 18, 2, '2018-04-30', 'webserver', '', 0, 0),
(284, '微波炉 定时器开关4插', 80, 1, 7, 10, '2018-04-30', 'webserver', '', 0, 0),
(285, '电磁炉 轻触开关4脚6x6x5', 2, 607, 0.03, 0.01, '2023-07-30', 'webserver', '12\r\n10元起步\r\n之后每一个3元\r\n\r\n零售1元一个', 966, 50),
(286, '电磁炉 轻触开关2脚6x6x5', 2, 86, 0.04, 0.01, '2023-07-30', 'webserver', '12\r\n', 29, 0),
(1080, '电磁炉 电源线', 15, 5, 4.2, 0, '2024-01-07', 'webserver', '', 19, 0),
(292, 'DVD 激光头HD65=HD850', 50, 3, 12.5, 0, '2022-10-27', 'webserver', '好像有一个是坏的，\r\n新激光头在正面把一坨焊锡焊开，\r\n才能正常使用\r\n上面的电位器不能调，一调就用不了了', 2, 0),
(294, '电脑 水晶头', 2, 135, 0.1, 0.3, '2022-11-19', 'webserver', '', 21, 0),
(845, '适配器 5V3A(TYPE-C)', 15, 1, 8, 0.5, '2021-05-19', 'webserver', '树莓派备用电源', 0, 0),
(299, '适配器 9v1a', 15, 1, 5, 1, '2019-05-29', 'webserver', '', 1, 0),
(851, '电脑 HDMI高清线1.5米3D', 20, 1, 5, 1, '2020-12-09', 'webserver', '', 0, 0),
(753, '电风扇 墙壁扇摇头', 20, 1, 4, 0.5, '2023-07-20', 'webserver', '', 1, 0),
(313, '耗材 9V6F22电池 ', 5, 3, 2.5, 1, '2019-12-13', 'webserver', '位置:T盒\r\n万用表电池', 3, 0),
(314, '耗材 纽扣3V电池 ', 5, 8, 0.5, 1, '2018-09-17', 'webserver', '位置:T盒\r\n电脑电池', 1, 0),
(1078, '洗衣机 皮带O-470E', 12, 4, 1.2, 1, '2023-11-19', 'webserver', '', 3, 0),
(1079, '电磁炉 FGA25N120', 10, 3, 1.6, 1, '2023-11-27', 'webserver', '36\r\n在线电路板测量方法\r\n测量2和3脚如果正反电阻都很小时,已经损坏\r\n指针万用表黑接3脚，红接2脚700欧反向无穷大\r\n其余都是测量不通\r\n为好管', 14, 0),
(333, '电脑 cpu硅脂散热膏', 15, 1, 3, 1, '2018-04-30', 'webserver', '', 0, 0),
(334, '电脑 读卡器川宇牌', 5, 17, 1.5, 0.4, '2019-06-07', 'webserver', '', 15, 0),
(336, '电脑 网线', 1.5, 145, 0.4, 0.1, '2020-09-06', 'webserver', '', 125, 0),
(339, '电脑 硬盘80g', 30, 1, 0, 0, '2022-01-28', 'webserver', '外置硬盘正在使用中', 1, 0),
(350, '电脑 cpu速龙198(fm1)', 50, 1, 20, 1, '2018-05-03', 'webserver', '', 0, 0),
(356, '线座 DC电源插座', 5, 17, 0.1, 1, '2018-09-17', 'webserver', '位置:M盒', 0, 0),
(359, '二极管 肖特基MBR1660 16', 5, 7, 0.8, 1, '2018-06-02', 'webserver', '', 0, 0),
(367, '单片机 8脚ic插座', 3, 15, 0.06, 1, '2019-06-07', 'webserver', '位置:O盒', 8, 0),
(372, '电容 400V1UF', 15, 1, 1, 1, '2018-09-10', 'webserver', '零售5元\r\n维修收费15元', 0, 0),
(373, '电风扇 鸿运3档开关', 15, 18, 2, 0, '2022-07-27', 'webserver', '', 5, 0),
(384, '电脑 16g川宇内存卡', 35, 2, 21, 0, '2020-12-16', 'webserver', '一张音乐放车上\r\n剩下2个出售 35元不还价', 3, 0),
(388, '电饭锅 触点开关U型C型', 20, 7, 0.7, 1, '2018-07-07', 'webserver', '', 3, 0),
(390, '电压锅 接线片', 1, 5, 0.08, 0.2, '2018-07-22', 'webserver', '', 0, 0),
(394, '线座 鳄鱼夹', 1, 16, 0.35, 0.1, '2018-06-12', 'webserver', '', 0, 0),
(395, '线座 鳄鱼夹(中号)', 0.5, 20, 0.14, 0.1, '2019-07-15', 'webserver', '', 0, 0),
(998, '耗材 5寸打印相纸(89x127mm)', 4, 39, 0.3, 2, '2023-09-04', 'webserver', '每张0.08元 ，电，墨水，墨盒共算0.3\r\n照相10元', 59, 0),
(399, '制冷 安全阀四种', 100, 1, 53, 0, '2018-06-13', 'webserver', '', 0, 0),
(402, '制冷 磷铜焊条', 2, 57, 0.68, 0.5, '2018-07-11', 'webserver', '', 0, 0),
(403, '制冷 2L焊枪+3米防爆管', 60, 1, 24.5, 0.5, '2018-06-14', 'webserver', '', 0, 0),
(404, '制冷 鸿森 加液表三通阀', 20, 2, 10, 0.5, '2018-06-21', 'webserver', '', 0, 0),
(408, '制冷 氟利昂R600a', 15, 1, 3.2, 1, '2019-01-22', 'webserver', '(净重120g)', 7, 0),
(409, '制冷 氟利昂 R12', 12, 3, 4.25, 1, '2019-01-22', 'webserver', '(净重150g)', 0, 0),
(411, '豆浆机 碰撞微动开关', 10, 4, 0.4, 0.5, '2018-06-21', 'webserver', '', 0, 0),
(414, '制冷 冰箱干燥过滤器', 15, 6, 1.95, 1, '2019-12-13', 'webserver', '三花19mm通用型', 0, 0),
(415, '制冷 毛细管1.8mm壁厚0.5', 4, 15, 1.2, 1, '2019-01-22', 'webserver', '1.8mm壁厚0.5mm', 0, 0),
(416, '制冷 铜管6壁厚0.5(mm)', 15, 2, 5.9, 1, '2018-06-17', 'webserver', '', 0, 0),
(417, '制冷 铜管4.0壁厚0.5(mm)', 15, 1, 3.9, 1, '2018-06-17', 'webserver', '', 0, 0),
(419, '制冷 通用加氟工具表', 46, 1, 46, 0, '2018-06-20', 'webserver', '', 0, 0),
(420, '制冷 冰箱快速接头0.35', 5, 28, 1, 0.5, '2019-01-22', 'webserver', '(厚0.35总长80MM)', 0, 0),
(421, '制冷 冰箱快速接头0.6', 25, 2, 2.5, 0.5, '2019-01-22', 'webserver', '(厚0.6总长80MM)', 0, 0),
(720, '电磁炉 pn8124f', 20, 4, 1.2, 1, '2019-06-20', 'webserver', '', 0, 0),
(428, '制冷 启动器125W 22欧', 10, 3, 3, 1, '2018-07-11', 'webserver', '', 0, 0),
(429, '制冷 冷凝器0.8米高8格', 20, 1, 9.3, 1, '2018-06-24', 'webserver', '', 0, 0),
(435, '制冷 公英加氟管', 15, 2, 8.5, 0, '2018-06-24', 'webserver', '', 0, 0),
(436, '电脑 英特尔G1610 CPU', 30, 1, 0, 0, '2022-03-16', 'webserver', '', 0, 0),
(782, '微波炉 302WP-1AH-C继电器', 10, 4, 2, 0.5, '2023-07-30', 'webserver', '7', 2, 0),
(884, '电热燃气 燃气灶左炉头总成', 20, 4, 6, 1, '2023-11-12', 'webserver', '打火针朝下，左边出气为左炉头', 1, 0),
(716, '液晶屏 索尔SON-303X万能遥控器', 15, 1, 4.7, 0.5, '2023-05-30', 'webserver', '索尔SON-303X电视万能遥控器 等离子液晶电视机CRT彩电LCDLED通用', 8, 0),
(443, '制冷 铜铝焊条', 10, 1, 3, 1, '2018-07-07', 'webserver', '', 0, 0),
(444, '液晶屏 LED灯条套件', 120, 1, 7.7, 1, '2019-01-22', 'webserver', '(19寸22寸24寸宽屏通用)', 0, 0),
(447, '制冷 铜管10壁厚1(mm)', 30, 1, 14.8, 0, '2018-07-07', 'webserver', '', 0, 0),
(448, '制冷 铜管3壁厚0.5(mm)', 10, 1, 3.4, 0, '2018-07-07', 'webserver', '', 0, 0),
(449, '制冷 铜管2壁厚0.5(mm)', 10, 3, 3.3, 0, '2018-07-07', 'webserver', '', 0, 0),
(452, '耗材 3号1.5v电池', 5, 2, 1.8, 0, '2018-09-07', 'webserver', '指针万用表备用电池', 0, 0),
(453, '电容 400V25UF', 20, 1, 4.5, 0, '2018-07-11', 'webserver', '', 0, 0),
(454, '电容 400V35UF', 30, 1, 6.7, 0, '2018-07-11', 'webserver', '', 1, 0),
(456, '制冷 5绝缘套管0.9米', 2, 4, 0.45, 0, '2018-07-11', 'webserver', '', 0, 0),
(458, '制冷 氟利昂R410A(变频空调)', 50, 1, 25, 0, '2019-04-26', 'webserver', '毛重650G净重450\r\n小一匹空调补加要1瓶左右，全加要2瓶左右。\r\n正一匹和大一匹补加要1-2瓶左右，全加要3瓶左右。\r\n1.5匹补加要1-3瓶左右，全加要4瓶左右。\r\n汽车一般加要2-3瓶左右。R410家用空调加6-7个压左右就行\r\n，R22家用空调加4.5个压左右就行，\r\n制冷剂保质期有3年', 0, 0),
(459, '制冷 氟利昂R22(定频空调)', 30, 1, 15, 0, '2019-01-22', 'webserver', '毛重450G净含量330G', 0, 0),
(1139, '洗衣机 主板神童 EB80BM029', 130, 1, 60, 0, '2023-11-08', 'webserver', '', 0, 0),
(467, '适配器 7W-15W镇流器', 15, 1, 1.8, 1, '2019-01-22', 'webserver', '通用台灯', 0, 0),
(470, '三极管 稳压管78L05', 5, 176, 0.06, 0.5, '2023-07-30', 'webserver', '6\r\n输入电压范围 5v-12V', 19, 0),
(472, '电容 电解电容50V470UF', 3, 8, 0.12, 1, '2023-07-30', 'webserver', '8', 0, 0),
(474, '开关 2200W船形', 5, 2, 0.67, 1, '2018-08-05', 'webserver', '', 0, 0),
(476, '三极管 ss8050', 1, 261, 0.06, 0.2, '2023-07-30', 'webserver', '20\r\nNPN型\r\n(耐流比s8050大)\r\n耗散功率: 1W(TA=25℃) 2W(TC=25℃)\r\n集电极电流1.5A\r\n集电极--基极电压40V\r\n集电极--发射极击穿电压25V\r\n特征频率fT 最小100MHZ\r\n放大倍数：按三极管后缀号分为 B C D 共3档\r\n放大倍数 B：85-160 C：120-200 D：160-300\r\n引脚排列多为EBC', 61, 0),
(479, '电风扇 三档电吹风开关', 5, 2, 0.75, 0.2, '2023-07-30', 'webserver', '15', 1, 0),
(480, '电磁炉 501可调电阻 500欧', 5, 8, 0.2, 0.2, '2021-07-12', 'webserver', '电磁炉可调电阻', 2, 0),
(483, '电脑 128G 内存卡 三星', 179, 1, 179, 0, '2023-07-16', 'webserver', '闲置摄像头2', 0, 0),
(485, '电脑 DVI转VGA转接头24+5', 15, 1, 9.9, 0, '2018-08-21', 'webserver', '', 0, 0),
(486, '继电器 12v30A', 15, 2, 3, 1, '2018-08-19', 'webserver', '', 0, 0),
(487, '电风扇 跌倒自停开关', 10, 6, 0.8, 0.5, '2023-07-30', 'webserver', '33', 4, 0),
(488, '线座 8字线', 10, 2, 2, 1, '2018-08-25', 'webserver', '', 0, 0),
(491, '线座 压线扣454Au形', 1, 26, 0.1, 0.2, '2018-08-25', 'webserver', '', 0, 0),
(494, '洗衣机 排水阀拉簧', 50, 1, 0.5, 1, '2018-08-25', 'webserver', '', 0, 0),
(497, '耗材 剪刀', 6, 8, 3.8, 0, '2019-02-13', 'webserver', '', 9, 0),
(499, '饮水机 放水阀门水堵', 3, 3, 0.5, 0.2, '2018-08-26', 'webserver', '', 1, 0),
(500, '微波炉 电压锅 微动开关', 15, 9, 0.6, 0.5, '2018-09-17', 'webserver', '位置:K盒', 1, 0),
(501, '线座 电视天线插头', 5, 2, 0.38, 0.5, '2018-09-17', 'webserver', '位置:M盒', 0, 0),
(503, '线座 接收机F头', 10, 10, 0.2, 0.5, '2018-09-17', 'webserver', '位置:M盒', 0, 0),
(743, '线座 一分二音频线', 12, 1, 1.6, 1, '2019-07-05', 'webserver', '一拖二', 0, 0),
(505, '电风扇 双向可控硅97A6', 5, 93, 0.1, 0.5, '2023-07-30', 'webserver', '23', 3, 0),
(506, '线座 接线帽', 0.5, 150, 0.02, 0.1, '2023-11-27', 'webserver', '14', 31, 0),
(507, '保险管 250V10A(玻璃)', 1, 15, 0.1, 0.1, '2018-09-17', 'webserver', '位置:A盒', 4, 0),
(508, '保险管 250V5A(玻璃)', 1, 20, 0.06, 0.1, '2018-09-17', 'webserver', '位置:A盒', 0, 0),
(509, '液晶屏 贴片按键3x6x2.5两脚', 1, 20, 0.06, 0.1, '2018-08-29', 'webserver', '', 0, 0),
(512, '电脑 usb声卡', 15, 1, 6, 1, '2023-07-30', 'webserver', '2', 0, 0),
(513, '三极管 贴片2n3904', 1, 266, 0.05, 0.01, '2023-07-30', 'webserver', '26\r\n元件表面显示1AM为3904\r\n一般换电磁炉IGBT管就连带一起换2N3906\r\n', 21, 0),
(514, '三极管 贴片2n3906', 1, 126, 0.05, 0.01, '2023-07-30', 'webserver', '26\r\n元件表面显示2A为3906\r\n一般换电磁炉IGBT管就连带一起换2N3904', 16, 0),
(515, '电容 400v20uf', 15, 1, 3, 0.1, '2018-09-07', 'webserver', '电机电容', 0, 0),
(517, '二极管 红外发射管5mm', 2, 10, 0.16, 0.1, '2018-09-17', 'webserver', '位置:P盒2格', 0, 0),
(518, '二极管 红外发射管3mm', 1, 20, 0.16, 0.1, '2018-09-17', 'webserver', '位置:P盒1格', 0, 0),
(520, '电容 400V6UF', 15, 1, 2.8, 1, '2018-09-07', 'webserver', '', 0, 0),
(523, '电阻 510', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(524, '电阻 220', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(525, '电阻 47', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(526, '电阻 47k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(527, '电阻 20k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(528, '电阻 100k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(529, '电阻 51k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(530, '电阻 6.8k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(531, '电阻 150', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(532, '电阻 4.7k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(533, '电阻 2.2k', 0.5, 38, 0.02, 0.5, '2018-11-07', 'webserver', '\r\n', 2, 0),
(534, '电阻 10k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(535, '电阻 22', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(536, '电阻 5.1k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(537, '电阻 270', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(538, '电阻 300k', 0.5, 130, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(539, '电阻 220k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(540, '电阻 470', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(541, '电阻 330', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(542, '电阻 200', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '\r\n', 0, 0),
(543, '电阻 1k', 0.5, 34, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(544, '电阻 1m', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(545, '电阻 470k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(546, '电阻 68k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(547, '电阻 100', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(548, '电阻 680', 0.5, 39, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(549, '电阻 2k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(550, '电阻 3.3k', 0.5, 39, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(551, '电阻 680k', 0.5, 40, 0.02, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(552, '电阻 10', 0.5, 40, 0.01, 0.5, '2018-11-07', 'webserver', '', 0, 0),
(553, '电磁炉 VIPER12A', 5, 14, 0.11, 0.2, '2023-07-30', 'webserver', '36\r\n可代换 ap8012', 3, 0),
(554, '二极管 一体红外接收HS0038', 2, 2, 0.26, 0.5, '2018-09-17', 'webserver', '位置:P盒3格', 0, 0),
(929, '汽车 刹车油500g', 60, 1, 20, 0.5, '2021-09-20', 'webserver', '盈科刹车油/制动液500g长安之星 五菱之光 东风小康 哈飞民意等 ', 1, 0),
(556, '单片机 晶振49s无源12m', 5, 12, 0.3, 0.5, '2018-09-17', 'webserver', '', 0, 0),
(557, '单片机 晶振49s无源10m', 5, 2, 0.5, 0.5, '2018-09-07', 'webserver', '', 0, 0),
(835, '单片机 ESP8266-01S', 9, 1, 8.5, 0.5, '2021-05-20', 'webserver', '', 0, 0),
(560, '单片机 STC89C52RC', 20, 2, 4, 0.5, '2018-09-25', 'webserver', '', 0, 0),
(563, '三极管 9018', 1, 50, 0.04, 0.5, '2023-07-30', 'webserver', '20\r\nNPN型\r\n超高频1GHZ\r\n耐压30V\r\n由于它的噪声较大，一般高档的话筒不用', 0, 0),
(564, '三极管 贴片s8050', 3, 182, 0.04, 0.5, '2023-07-30', 'webserver', '26\r\n表面显示J3Y\r\n', 12, 0),
(565, '单片机 CH340G刷机板模块', 15, 1, 2.45, 0.5, '2018-09-09', 'webserver', '', 0, 0),
(568, '单片机 16脚IC座', 2, 7, 0.1, 0.5, '2018-09-17', 'webserver', '位置:O盒', 0, 0),
(569, '电磁炉 1203p100', 1, 1, 1, 0.5, '2018-09-09', 'webserver', '', 0, 0),
(571, '单片机 40脚IC座(圆脚)', 10, 5, 1.3, 0.5, '2018-09-10', 'webserver', '', 0, 0),
(572, '制冷 冷凝器 1.3米加密型', 40, 2, 28, 0, '2018-09-15', 'webserver', '', 0, 0),
(574, '电风扇 控制电路8206BA4', 20, 2, 0.7, 0.5, '2018-09-16', 'webserver', '', 0, 0),
(575, '电风扇 控制电路SN8P2602', 20, 2, 1.25, 0.5, '2018-09-16', 'webserver', '', 0, 0),
(578, '电热燃气 电热水壶蒸汽开关', 10, 2, 0.7, 0.5, '2023-07-30', 'webserver', '15', 2, 0),
(852, '汽车 20A保险丝', 5, 3, 0.5, 0.5, '2023-07-30', 'webserver', '24\r\n一个放在SUV车上备用', 0, 0),
(581, '电磁炉 小整流桥(GBU15K)', 7, 6, 1, 0.5, '2018-11-17', 'webserver', '耐压1000V\r\n耐流15A\r\n可以在线电路测量其好坏\r\n根据二极管原理测量\r\n中间两个引脚为交流输入\r\n旁边两个脚分别都有标识正负极', 3, 0),
(582, '单片机 STC12C5A60S2', 20, 1, 5.7, 0.5, '2018-09-17', 'webserver', '', 0, 0),
(583, '电阻 精密可调 电位器10K', 2, 4, 0.27, 0.5, '2018-09-17', 'webserver', '', 0, 0),
(584, '单片机 USB转TTL PL2303', 10, 1, 2.25, 0.5, '2018-09-17', 'webserver', '', 0, 0),
(585, '单片机 USB转ESP8266模块', 15, 1, 2.9, 0.5, '2018-09-17', 'webserver', '', 0, 0),
(586, '单片机 40P锁紧 51单片机', 20, 1, 5.2, 0.5, '2018-09-17', 'webserver', '', 0, 0),
(587, '单片机 51单片机小系统板', 10, 2, 1.85, 0.5, '2018-09-25', 'webserver', '', 0, 0),
(590, '三极管 贴片AMS1117(3.3v)', 5, 46, 0.1, 0.1, '2021-10-17', 'webserver', '输出3.3v\r\n输入5v到15v\r\n左边第1脚为负\r\n第2脚为输出脚\r\n第3脚为输入脚', 4, 0),
(591, '单片机 49S型晶振11.0592', 5, 10, 0.17, 0.2, '2019-02-03', 'webserver', '无源', 0, 0),
(592, '线座 40p杜绑线母对母30CM', 5, 1, 1.7, 0.2, '2019-02-03', 'webserver', '杜绑', 3, 0),
(593, '线座 DC电源插头4.0x1.7', 7, 6, 0.4, 0.1, '2023-10-09', 'webserver', '4.0x1.7', 7, 0),
(1006, '洗衣机 水位传感器三脚', 70, 2, 6.2, 0, '2023-03-24', 'webserver', '零售20，更换手水位压力可能有变，需要随机应变开启档位', 4, 0),
(596, '单片机 无源蜂鸣器3/5v通用', 1, 1, 0.16, 0.3, '2018-10-03', 'webserver', '', 1, 0),
(597, '单片机 49S型无源晶振 24M', 1, 10, 0.14, 0.2, '2018-10-03', 'webserver', '', 0, 0),
(598, '单片机 49S型晶振22.1184', 1, 10, 0.13, 0.2, '2018-10-03', 'webserver', '', 0, 0),
(771, '保险管 185℃ 20A 250V', 1, 15, 0.1, 0, '2022-04-12', 'webserver', '', 13, 0),
(768, '电热燃气 热水器水动开关', 10, 4, 1, 0.5, '2020-01-16', 'webserver', '通水后有水压,触发开关', 12, 0),
(601, '单片机 NRF24L01/2.4G无线', 10, 2, 4.9, 0.5, '2018-11-03', 'webserver', '带3.3V转接口1.8元/个', 0, 0),
(602, '单片机 USB转nRF24L01', 15, 1, 7.45, 0.5, '2018-10-11', 'webserver', '', 0, 0),
(610, '电热燃气 热水器3A250v KW12开关', 5, 1, 0.4, 1, '2023-07-30', 'webserver', '3\r\n燃气热水器', 1, 0),
(611, '继电器 891WP-1A-C  ', 8, 4, 1.23, 1, '2018-11-07', 'webserver', '12V25A', 0, 0),
(613, '电压锅 圆轴DKJ-Y90分定时器', 25, 1, 5.82, 0.5, '2020-11-19', 'webserver', 'DKJ-Y90分 第二次买是10元一个', 2, 0),
(1083, '电热燃气 热水器旋钮帽小号', 4, 2, 0.9, 0.5, '2023-01-25', 'webserver', '', 0, 0),
(617, '适配器 可调压模块4~32V 5A', 15, 1, 3.8, 1, '2019-06-03', 'webserver', '', 0, 0),
(618, '三极管 贴片s8550', 1, 95, 0.04, 0.03, '2023-07-30', 'webserver', '26\r\n上面显示2TY', 4, 0),
(619, '单片机 声音检测模块', 5, 1, 1.35, 0.1, '2018-11-03', 'webserver', '有声音输出低电平', 0, 0),
(623, '耗材 9v电池扣子', 1, 5, 0.16, 0.2, '2018-11-07', 'webserver', '', 0, 0),
(625, '二极管 开关管4148', 1, 196, 0.1, 0.5, '2021-06-25', 'webserver', '正向电阻60K左右,反向电阻无穷大\r\n75V\r\n150mA\r\n防止继电器断开时线圈产生的反向自感电压击穿继电器的驱动电路', 5, 0),
(626, '电压锅 继电器SRD-12VDC-SL-C', 20, 6, 1, 0.5, '2023-07-30', 'webserver', '7\r\n电压力锅供电主板吸合继电器', 8, 0),
(629, '洗衣机 皮带O-450E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(985, '洗衣机 皮带O-500E', 12, 1, 1.2, 0.5, '2022-04-12', 'webserver', '', 1, 0),
(633, '洗衣机 皮带O-610E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(634, '洗衣机 皮带O-620E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(635, '洗衣机 皮带O-630E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(636, '洗衣机 皮带O-640E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(637, '洗衣机 皮带O-655E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(638, '洗衣机 皮带O-660E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(639, '洗衣机 皮带O-670E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(640, '洗衣机 皮带O-680E', 12, 1, 1.2, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(641, '豆浆机 电机刀片', 10, 1, 0.8, 0.5, '2018-11-11', 'webserver', '', 0, 0),
(642, '二极管 整流1N5408', 1, 26, 0.1, 0, '2023-07-30', 'webserver', '35\r\n耐压1000V\r\n耐流3A', 4, 0),
(643, '功放  贴片TDA2822', 10, 3, 0.17, 0, '2023-07-30', 'webserver', '9\r\n9v\r\n音频功率放大器', 0, 0),
(644, '果树 包装箱(30*25*18)', 4, 1, 3.07, 0, '2019-02-06', 'webserver', '', 0, 0),
(646, '果树 封箱胶布4.8CM*100', 15, 1, 6.53, 0, '2019-02-06', 'webserver', '', 0, 0),
(647, '电压锅 4.8mm插簧+皮套', 1, 47, 0.08, 0.5, '2018-11-12', 'webserver', '', 0, 0),
(648, '电压锅 2.8mm插簧+皮套', 1, 35, 0.08, 0.5, '2023-07-30', 'webserver', '1', 10, 0),
(999, '耗材 A4塑封膜7丝', 4, 93, 0.5, 2, '2022-05-13', 'webserver', '每张0.16元，过塑损耗2毛，电费1毛，共算0.5元', 7, 0),
(964, '电磁炉 SP25N135T', 40, 4, 5, 0.5, '2024-01-07', 'webserver', '', 4, 0),
(652, '三极管 2N3904', 2, 185, 0.03, 0.2, '2023-11-27', 'webserver', '29', 12, 0),
(653, '三极管 2N3906', 2, 93, 0.03, 0.2, '2023-11-27', 'webserver', '29', 5, 0),
(654, '二极管 整流堆KBPC5010', 20, 2, 1.97, 0.2, '2018-11-17', 'webserver', '1000V\r\n50A', 1, 0),
(655, '电磁炉 TM1668 SM1668', 25, 14, 0.5, 0.2, '2023-12-05', 'webserver', '电磁炉面板任何按钮都失效\r\n测量 6脚为正 倒数第三脚为负 有电压就说明坏了\r\n更换就OK\r\n热风枪焊接技巧,先用电洛铁4个角的引脚焊上,中间两排放焊膏,再用热风枪', 11, 0),
(659, '功放 音频对管C5198 A1941', 35, 2, 1.5, 0.5, '2018-11-30', 'webserver', '一对是两个', 0, 0),
(660, '电磁炉 面板集成TM1628', 25, 16, 0.58, 0.5, '2022-06-10', 'webserver', '电磁炉面板任何按钮都失效\r\n更换就OK', 19, 0),
(664, '适配器 5v1a', 15, 3, 4.99, 1, '2024-01-05', 'webserver', '', 1, 0),
(665, '单片机 光敏电阻5516', 5, 20, 1, 0.5, '2023-07-30', 'webserver', '32', 0, 0),
(666, '传感器 霍尔 49e', 3, 9, 0.26, 0.5, '2018-12-14', 'webserver', '线性霍尔电路49e是一块线性霍尔效应集成电路，输出电压随着磁通密度的变化而变化，能检测出细微的磁场变化情况。它可应用于测量物体的运动、距离，位置传感器等方面，也适合在环境恶劣或污染严重的条件下使用。\r\n产品特点：线性度好，功耗低，灵敏度高（1.9mv/gs），输出阻抗低，\r\n工作电压在2.3v-10v 电参数\r\n 电参数\r\n功耗icc(ma)   \r\n负载电流io(ma)   \r\n输出高电平vol(mv)   \r\n输出低电平vol(mv)   \r\n灵敏度△vout   \r\n2～5   \r\n\r\n15   \r\n>4.2   \r\n<900   \r\n1.9mv/gs', 0, 0),
(670, '单片机 微音拾音器模块', 30, 1, 13.3, 4, '2018-12-24', 'webserver', '散件需要自己焊接\r\n用于200米内监听', 0, 0),
(671, '功放 NE5532P', 5, 4, 0.85, 0.2, '2019-04-15', 'webserver', '', 0, 0),
(672, '功放 TAD2822直插', 10, 5, 0.35, 0.2, '2018-12-25', 'webserver', '', 0, 0),
(673, '电磁炉 LM339', 20, 9, 0.3, 0.2, '2018-12-25', 'webserver', '', 0, 0),
(674, '功放 双声道3.5音频插座', 2, 10, 0.06, 0.2, '2019-01-07', 'webserver', '', 0, 0),
(675, '功放 二节 耳机插头', 2, 2, 0.35, 0.2, '2018-12-25', 'webserver', '', 0, 0),
(676, '功放 3.5立体声音频插头', 2, 3, 0.35, 0.2, '2018-12-25', 'webserver', '', 0, 0),
(678, '电脑 紫光dvd刻录光盘', 5, 48, 0.92, 0, '2019-01-06', 'webserver', 'DVD-R 4.7G 16X空白光盘', 0, 0),
(1003, '线座 一分三音视频线', 15, 2, 2.4, 1, '2022-05-19', 'webserver', '', 3, 0),
(683, '电脑 铂科(3056)黑色鼠标', 25, 6, 10.9, 0, '2019-06-29', 'webserver', '', 3, 0),
(953, '洗衣机 皮带O-480E', 10, 3, 1.5, 1, '2023-07-30', 'webserver', '', 3, 0),
(696, '电子称 船形开关3脚3档', 8, 8, 0.8, 0, '2022-07-07', 'webserver', '', 11, 0),
(700, '洗衣机 皮带O-460E', 12, 6, 1.2, 1, '2022-04-12', 'webserver', '', 1, 0),
(701, '电热燃气 热水器单耳水膜片大54', 10, 5, 0.36, 0, '2019-10-25', 'webserver', '燃气热水器水压开关,里面的水压膜\r\n卖10元,维修20元', 2, 0),
(702, '电热燃气 热水器单耳水膜片中49.5', 10, 11, 0.36, 0, '2020-10-26', 'webserver', '燃气热水器水压开关,里面的水压膜\r\n卖10元,维修20元', 5, 0),
(703, '电热燃气 热水器单耳水膜片小44.5', 10, 3, 0.36, 0, '2021-07-10', 'webserver', '燃气热水器水压开关,里面的水压膜\r\n卖10元,维修20元', 11, 0),
(704, '电热燃气 热水器双耳水膜片大53', 10, 7, 0.36, 0, '2019-10-25', 'webserver', '燃气热水器水压开关,里面的水压膜\r\n卖10元,维修20元', 0, 0),
(705, '电脑 4口2.0usb外接电源', 20, 1, 16, 0, '2019-06-03', 'webserver', '电脑正在使用中', 0, 0),
(706, '保险管 陶瓷250V15A', 15, 34, 0.25, 0.3, '2024-01-07', 'webserver', '24\r\n陶瓷保险管的好处在于,后面有短路只会断开,不会爆管危险\r\n零售5元', 25, 0),
(708, '电脑 机箱开关线', 10, 3, 0.45, 0.5, '2019-06-13', 'webserver', '电脑开不了机,或时而失灵,更换这个就好', 1, 0),
(712, '电风扇 万能遥控器', 12, 3, 5, 1, '2019-06-13', 'webserver', '(外观一样即可使用)', 0, 0),
(717, '适配器 5v2a手机充电头', 15, 2, 5, 0.5, '2019-06-20', 'webserver', '', 0, 0),
(718, '继电器 24v30a 6脚', 20, 4, 4, 0.5, '2019-06-20', 'webserver', '一开一闭', 0, 0),
(724, '单片机 覆铜板10x15', 10, 2, 1.9, 0.5, '2019-06-20', 'webserver', '', 0, 0),
(725, '单片机 覆铜板腐蚀剂', 15, 1, 3.2, 0.5, '2019-06-20', 'webserver', '一包可腐蚀10块10x15的覆铜板', 0, 0),
(726, '单片机 V3开发板CH-340 底座', 15, 1, 4.6, 0.5, '2019-09-10', 'webserver', '', 0, 0),
(1105, '喷雾器 超大功率耐用水泵', 50, 2, 19, 1, '2023-05-24', 'webserver', '最低50元,', 3, 0),
(901, '洗衣机 水位气管', 20, 10, 1.1, 1, '2023-08-10', 'webserver', '10米 还没剪成每条1米 \r\n零售10元', 0, 2),
(739, '电饭锅 大功率触点开关', 20, 2, 1.3, 0.5, '2021-09-23', 'webserver', '', 2, 0),
(742, '汽车 4.8a手机充电器', 50, 1, 38, 0, '2019-07-01', 'webserver', '', 0, 0),
(1114, '电压锅 加厚锅密封圈胶圈 5L/6L', 10, 1, 4.8, 1, '2023-07-27', 'webserver', '一分不少', 10, 0),
(749, '电风扇 遥控主板电容105J400V', 30, 11, 0.18, 1, '2023-08-11', 'webserver', '33\r\n容量是1UF\r\n115j是1.1uf', 6, 0),
(750, '电压锅 电源芯片ln8k06', 30, 6, 1, 0.5, '2019-08-15', 'webserver', '', 0, 0),
(751, '电风扇 晶振 455K 455E', 20, 3, 0.15, 0.5, '2019-08-15', 'webserver', '', 0, 0),
(758, '耗材 ab万能胶水', 5, 11, 2, 1, '2023-09-07', 'webserver', '', 28, 0),
(764, '电压锅 中心固定密封圈', 4, 2, 0.6, 0, '2019-09-23', 'webserver', '', 2, 0),
(775, '电脑 b85m-hd3', 180, 1, 1, 0, '2019-12-04', 'webserver', '维修剩下的好板', 0, 0),
(767, '单片机 ESP8266串口V3 CH-340', 30, 2, 10.8, 1, '2021-05-20', 'webserver', '4个空闲', 2, 0),
(769, '电脑 DVD刻录机', 80, 1, 32, 0, '2019-11-05', 'webserver', '二手台式刻录机', 0, 0),
(770, '汽车 倒车灯p21w', 1, 9, 1, 0, '2019-11-18', 'webserver', '汽车倒车灯', 0, 0),
(779, '制冷 冰柜干燥过滤器', 6, 2, 1.7, 0.5, '2019-12-13', 'webserver', '', 0, 0),
(882, '电容 2.5uf/400v', 10, 6, 0.9, 1, '2023-10-09', 'webserver', '', 9, 0),
(1141, '电热燃气 燃气灶右炉头总成', 15, 4, 7, 0.5, '2024-01-05', 'webserver', '打火针朝下，右边出气为右炉头', 9, 0),
(783, '电热燃气 3V电磁阀煤气阀', 25, 2, 7, 0.5, '2019-12-19', 'webserver', '', 4, 0),
(784, '机顶盒 电源自锁开关', 20, 1, 1, 0.5, '2022-06-12', 'webserver', '', 5, 0),
(785, '电热燃气 热水器点火针', 5, 8, 0.5, 0.5, '2023-07-30', 'webserver', '3', 4, 0),
(786, '电热燃气 热水器感应针', 5, 2, 0.5, 0.5, '2023-07-30', 'webserver', '3', 3, 0),
(788, '线座 4.8MM 插簧', 0.3, 80, 0.08, 0.5, '2020-05-27', 'webserver', '', 18, 0),
(791, '洗衣机 皮带O-445E', 12, 2, 1.35, 0.5, '2020-04-29', 'webserver', '', 0, 0),
(792, '洗衣机 皮带O-410E', 12, 2, 1.35, 0.5, '2020-04-29', 'webserver', '', 0, 0),
(1054, '电风扇 18寸遥控铜电机', 55, 1, 30, 2, '2023-08-14', 'webserver', '钢片厚2cm  村长7.8cm', 1, 0),
(794, '锅 电饭锅1000w电热盘', 50, 1, 0, 0, '2020-05-16', 'webserver', '', 0, 0),
(797, '液晶屏 42寸海信灯条', 300, 2, 50, 0, '2021-08-25', 'webserver', '另一个是二手拆机', 0, 0),
(820, '二极管 5.6v1w稳压管', 15, 73, 0.07, 0.5, '2023-07-30', 'webserver', '17\r\n零售价5元', 7, 0),
(837, '机顶盒 电源板KEHAI-SPB31D ', 35, 2, 8.28, 0.5, '2021-04-20', 'webserver', 'GND \r\nLNB \r\nLNB-CTR \r\nGND \r\n5V', 0, 0),
(799, '喷雾器 大开关', 12, 4, 3.5, 0.5, '2021-10-12', 'webserver', '零售卖10块', 10, 0),
(869, '耗材 网套10*6规格', 0.04, 4300, 0.02, 0, '2024-03-09', 'webserver', '网套10*6规格540个每包\r\n25x540=13500个\r\n进货每个0.02元了，必须每个以0.03元卖', 227, 0),
(808, '电热燃气 热水器感应开关(免水压)', 25, 3, 1.9, 1, '2023-07-30', 'webserver', '3\r\n燃气 热水器', 1, 0),
(1086, '适配器 12v2a', 15, 1, 7.5, 0.5, '2023-02-14', 'webserver', '', 1, 0),
(1133, '液晶屏 海信LED55N3000U灯条', 300, 1, 45, 0.5, '2023-09-21', 'webserver', '海信LED55N3000U灯条屏HD550K3U82-L1K1灯条JL.D55051330-003ES-M', 0, 0),
(1108, '制冷 空调万能遥控器', 20, 1, 6.75, 0, '2023-05-30', 'webserver', '', 4, 0),
(818, '电容 4UF400v', 10, 1, 1.5, 0.5, '2022-06-24', 'webserver', '', 2, 0),
(828, '电脑 键盘ps2', 35, 2, 16.5, 1, '2020-09-26', 'webserver', '买电脑键盘尽量买PS2的这个不会有供电不足现象\r\n自己电脑正在使用\r\n', 1, 0),
(823, '电脑 川宇32g内存卡', 50, 1, 21, 0.5, '2023-05-19', 'webserver', '一张装系统', 1, 0),
(830, '单片机 HC-SR501 人体红外感应模块', 3, 2, 2.8, 0.5, '2023-12-27', 'webserver', '', 0, 0),
(831, '单片机 DS18B20温度传感器', 3, 2, 2.42, 0.5, '2023-12-17', 'webserver', '已经回本', 1, 0),
(832, '单片机 土壤湿度计检测模块', 2, 2, 1.6, 0.5, '2021-05-20', 'webserver', '', 0, 0),
(833, '单片机 RCWL-0516 微波雷达感应', 2, 1, 1.6, 0.5, '2021-05-20', 'webserver', '', 0, 0),
(834, '单片机 超声波测距模块 HC-SR04', 3, 2, 2.75, 0.5, '2023-12-17', 'webserver', '3.3到5v通用', 0, 0),
(836, '单片机 树莓派散热风扇', 5, 1, 3.5, 0.5, '2020-10-01', 'webserver', '', 0, 0),
(839, '适配器 DK124', 10, 2, 0.7, 0.5, '2020-10-02', 'webserver', '', 0, 0),
(841, 'dvd 万能开关电源板', 30, 1, 4, 1, '2020-10-26', 'webserver', '', 0, 0),
(842, '电子称 船形2脚开关', 5, 1, 0.16, 0.5, '2023-07-30', 'webserver', '21', 7, 0),
(1090, '电热燃气 漏电保护插头带电源线', 35, 1, 17.5, 0.5, '2023-04-02', 'webserver', '16A', 3, 0),
(844, '保险管 陶瓷250V12A', 15, 7, 0.2, 0.5, '2023-07-30', 'webserver', '24\r\n不带线的', 1, 0),
(966, '电磁炉 18v大散热风扇', 20, 5, 2.4, 1, '2023-10-09', 'webserver', '零售12元 维修更换20', 11, 0),
(949, '单片机 NodeMCUesp32', 50, 3, 23.6, 0, '2023-11-27', 'webserver', '', 1, 0),
(848, '电磁炉 H20PR5 场效应管', 15, 1, 2.5, 0.5, '2020-11-24', 'webserver', '40A1350V', 0, 0),
(849, '电磁炉 轻触开关4脚6x6x15', 3, 43, 0.05, 0.01, '2023-07-30', 'webserver', '12', 7, 0),
(853, '汽车 30A保险丝', 5, 3, 0.5, 0.5, '2020-12-23', 'webserver', '一个放在SUV车上备用', 0, 0),
(854, '汽车 5A保险丝', 5, 3, 0.5, 0.5, '2023-07-30', 'webserver', '24\r\n一个放在SUV车上备用', 0, 0),
(855, '液晶屏 32寸海信灯条', 180, 2, 20, 0.5, '2021-01-15', 'webserver', '还有2根灯条', 0, 0),
(856, '制冷 电容400v20uf', 20, 1, 5, 1, '2021-01-07', 'webserver', '', 1, 0),
(857, '电热燃气 电热水壶底座耦合器套', 15, 5, 2, 1, '2023-10-23', 'webserver', '', 2, 0),
(861, '电热燃气 热水器旋钮帽大号', 4, 5, 0.9, 0.5, '2023-01-25', 'webserver', '', 4, 0),
(862, '电热燃气 热水器O形密封圈套', 20, 1, 9, 0.5, '2021-02-03', 'webserver', '', 0, 0),
(863, '洗衣机 滚筒 皮带', 25, 1, 12, 0.5, '2021-03-24', 'webserver', '通用5PJ12818P1258 帮安装35', 0, 0),
(864, '耗材  封箱胶带（壹品骄胶带）', 7, 23, 4.72, 0.2, '2023-04-14', 'webserver', '原价208一箱，要两箱396元 就是每箱198元\r\n平均一个4.71元\r\n内纸外缘与胶带外缘是3cm', 66, 0),
(1088, '电动配件 103碳刷 14.5x10x6mm', 8, 6, 0.7, 0.5, '2023-08-07', 'webserver', '一对0.7元维修20,卖8', 4, 0),
(1053, '豆浆机 碳刷', 4, 3, 0.6, 0.5, '2022-08-08', 'webserver', '', 2, 0),
(868, '耗材  礼盒装(10斤)', 5, 13, 4.2, 0, '2022-02-07', 'webserver', '原厂价3.8元一个，运费0.4元\r\n', 137, 0),
(1004, '电热燃气 过热保护温控器 20A93度4脚', 30, 4, 3.5, 0.5, '2024-02-17', 'webserver', '5\r\n小圆形\r\n零售25', 2, 0),
(886, '二极管 5.1v稳压1N4733', 10, 58, 0.07, 0.5, '2023-07-30', 'webserver', '17', 2, 0),
(1030, '液晶屏 50寸灯条', 350, 9, 6, 2, '2022-12-25', 'webserver', 'JL.D50051235-017AS-F\r\n换就换一套,不然容易坏', 0, 0),
(891, '单片机 5V700mA隔离开关电源', 20, 2, 4.2, 0.5, '2021-06-28', 'webserver', '', 0, 0),
(892, '继电器 5v模块带光耦隔离', 20, 3, 2.5, 0.5, '2021-06-28', 'webserver', '支持高低电平触发', 0, 0),
(1129, '单片机 单片机 5~32V 3A 可调降压', 15, 2, 2.2, 0, '2023-09-07', 'webserver', '', 0, 0),
(896, '三极管 78L05贴片', 30, 11, 0.4, 0.5, '2022-07-07', 'webserver', '', 0, 0),
(898, '耗材 7号电池', 1.5, 50, 10, 0, '2023-05-19', 'webserver', '7号碱性电池1.5V\r\n1板60节=8.8元', 38, 0),
(1014, '线座 三脚插头10a3000瓦', 6, 9, 2, 0.5, '2023-09-11', 'webserver', '', 8, 0),
(905, '电容 400v4.7uf', 20, 9, 0.08, 0, '2021-07-30', 'webserver', '', 1, 0),
(906, '液晶屏 TCLL48P1S-CF背光灯条', 400, 10, 4, 0, '2022-06-27', 'webserver', '', 0, 0),
(907, '豆浆机 双向可控硅BTA12-800B', 100, 1, 1.5, 2, '2021-08-14', 'webserver', '为什么烧坏，很有可能电机跟线路板同时烧了必须收100元\r\n最左和最右两脚正反向电阻123欧左右，别的都是无穷大为正常', 2, 0),
(908, '豆浆机 BTA16-800BW', 50, 2, 1, 0.5, '2021-08-14', 'webserver', '为什么烧坏，很有可能电机跟线路板同时烧了必须收100元', 0, 0),
(909, '豆浆机 继电器 SRIH-12VDC-SH-C', 50, 3, 1, 0.5, '2021-08-11', 'webserver', 'SRIH-12VDC-SL-C通用\r\n零售20', 0, 0),
(910, '液晶屏 海信42寸电脑主板', 180, 1, 10, 0.5, '2021-08-25', 'webserver', '二手拆机', 0, 0),
(911, '液晶屏 海信42寸电源板', 180, 1, 10, 0.5, '2021-09-02', 'webserver', '二手拆机的', 0, 0),
(913, '制冷 整流桥KBPC5010', 15, 2, 2, 0.5, '2021-09-01', 'webserver', '耐压1000v 耐流50a', 1, 0),
(915, '单片机 for 电压检测模块', 10, 1, 0.7, 0.5, '2021-09-04', 'webserver', '电压输入范围：DC0－25V\r\n电压检测范围：DC0.02445V-25V\r\n电压模拟分辨率：0.00489V\r\nDC输入接口：端子正极接VCC，负极接GND\r\n输出接口："+"接5/3.3V, "-"接GND，"s"接Arduino的AD引脚', NULL, 0),
(921, '汽车 割草机139活塞环', 70, 1, 7.8, 0.5, '2021-09-10', 'webserver', '活塞直径39mm', NULL, 0),
(923, 'DVD HOP-120X光头带架', 50, 1, 13.9, 1, '2021-09-11', 'webserver', '', 1, 0),
(930, '汽车 发动机水堵2CM', 10, 2, 2, 0.5, '2021-09-20', 'webserver', '', 1, 0),
(922, '汽车 割草机140活塞环', 70, 1, 8, 0.5, '2021-09-10', 'webserver', '活塞直径40mm', NULL, 0),
(961, '电磁炉 18v中风扇', 15, 1, 1.47, 0.5, '2022-08-08', 'webserver', '', 2, 0),
(927, '电磁炉 18v小风扇', 20, 2, 6, 0.5, '2021-09-11', 'webserver', '', NULL, 0),
(928, 'dvd 电源拨动开关 卧式 双排6脚', 20, 5, 0.3, 0.5, '2021-09-11', 'webserver', '', NULL, 0),
(936, '电磁炉 轻触开关6*6*4.3MM', 13, 5, 0.04, 0.5, '2023-07-30', 'webserver', '12', 1, 0),
(937, '电磁炉 轻触开关4脚6*6*9MM侧键', 15, 3, 0.07, 0.5, '2022-02-27', 'webserver', '', 3, 0),
(939, '电热燃气 热水器 索尔两线点火器', 35, 2, 8.5, 1, '2021-10-21', 'webserver', '', 1, 0),
(940, '电热燃气 温控开关KSD301', 10, 2, 1, 0.5, '2021-10-21', 'webserver', '220v  16A', 1, 0),
(941, '锅 电源指示灯', 10, 1, 0.24, 0.5, '2023-07-30', 'webserver', '13', 3, 0),
(1036, '耗材 打印机黑色墨水100ml', 6.88, 1, 6.88, 1, '2022-07-12', 'webserver', '70ml可以打印500张A4纸左右\r\n100ml应该可以打印700张A4纸\r\n在打印或复印110张A4纸左右就需要加墨水了，加到墨盒背后海绵有水印就要马上停止加了，这时刚刚好', 0, 0),
(956, '锅 8升密封圈', 12, 1, 4.8, 0.5, '2023-07-27', 'webserver', '自己电压力锅备用', 2, 0);
INSERT INTO `WarehouseGoods` (`id`, `name`, `price`, `number`, `buy`, `freight`, `date`, `user`, `attribute`, `quantity`, `shortage`) VALUES
(1113, '电风扇 18寸手动铜电机', 50, 2, 31, 2, '2023-08-15', 'webserver', '钢片厚2cm 村长7.8cm ', 7, 0),
(968, '电脑 英特尔CPU G2010', 40, 1, 0, 0, '2022-03-16', 'webserver', '', 0, 0),
(969, '电脑 内存条DDR3 2G', 30, 1, 0, 0, '2023-07-30', 'webserver', '2\r\n维修电脑备用', 0, 0),
(975, '电磁炉 大功率主板', 60, 1, 30, 0, '2024-02-17', 'webserver', '三个月内正常使用坏免费修', 3, 0),
(1111, '电脑 电源航嘉 300W', 100, 1, 45, 2, '2023-08-16', 'webserver', '300W 45 \r\n330W 39', 5, 0),
(997, '线座 三脚插头16a4500瓦', 6, 10, 2, 0.2, '2022-05-07', 'webserver', '', 0, 0),
(979, '锅 TM1618', 30, 4, 0.8, 0.5, '2022-04-12', 'webserver', '', 0, 0),
(980, '锅 TM1638', 30, 1, 1.7, 0.5, '2022-04-12', 'webserver', '', 0, 0),
(981, '锅 TM1623', 30, 2, 1.3, 0.5, '2022-05-12', 'webserver', '', 0, 0),
(982, '锅 TM1812', 30, 1, 1, 0.5, '2022-04-12', 'webserver', '', 0, 0),
(983, '电磁炉 电源芯片 AP8012', 25, 3, 0.23, 0.5, '2023-07-30', 'webserver', '36', 1, 0),
(984, '锅 LED电源驱动PN8024', 20, 2, 0.75, 0.5, '2022-04-12', 'webserver', '', 0, 0),
(987, '锅 电感 1mh', 15, 99, 0.05, 0.05, '2023-07-30', 'webserver', '11', 1, 0),
(988, '锅 电感 1mh 大电流4x6', 15, 10, 0.1, 0.1, '2023-07-30', 'webserver', '11', 0, 0),
(989, '锅 MY-SS5048P按键板', 55, 1, 1, 0.5, '2022-04-15', 'webserver', '', 1, 0),
(992, '耗材 A6塑封膜7丝', 2, 117, 0.4, 0, '2023-02-09', 'webserver', '每张膜0.14元过塑机损耗和电费一共算0.4元', 83, 10),
(993, '耗材 A4喷墨复印打印纸', 1, 1857, 0.3, 0, '2024-02-12', 'webserver', '已经回本,\r\n进货价0.04每张，墨水和墨盒,电费损耗，共算0.3每张\r\n下次到1980张，加一次墨水', 2059, 200),
(1000, '耗材 订书钉(盒)', 5, 1, 1, 0.5, '2022-05-10', 'webserver', '', 0, 0),
(1001, '耗材 936烙铁芯', 10, 2, 10, 0, '2023-07-30', 'webserver', '4号盒子', 1, 0),
(1002, '耗材 莲花内热烙铁芯', 25, 2, 10, 0.5, '2022-05-10', 'webserver', '', 0, 0),
(1005, '电热燃气 过热保护温控器 92-110度', 30, 2, 12, 0.5, '2023-07-30', 'webserver', '5\r\n大的有专门的导管感应器', 0, 0),
(1009, '电压锅 半圆轴机械定时器', 30, 1, 10, 1, '2022-05-24', 'webserver', '90分', 0, 0),
(1010, '耗材 电动车前进后退停止开关', 10, 1, 1.5, 0.5, '2022-05-24', 'webserver', '', 0, 0),
(1011, '耗材 水龙头接头', 5, 1, 1.5, 0.5, '2022-05-24', 'webserver', '', 0, 0),
(1012, '耗材 热缩管绝缘套管2mm', 1, 3, 0.2, 0.5, '2022-05-26', 'webserver', '0.2元每米', 2, 0),
(1013, '耗材 热缩管绝缘套管3mm', 1, 4, 0.2, 0.5, '2022-05-24', 'webserver', '', 1, 0),
(1024, '电风扇 落地壁扇遥控铝电机', 50, 1, 26, 1, '2022-08-19', 'webserver', '钢片厚度1.5CM 杆长7.8cm ', 2, 0),
(1018, '电热燃气 热水器通用电池盒', 8, 2, 1.1, 0.5, '2024-01-07', 'webserver', '', 7, 0),
(1037, '割草机 139/140化油器', 50, 2, 22, 0.5, '2022-07-21', 'webserver', '不易启动或者启动后熄火就需要更换\r\n这个是可以清洗保养的 主要清理汽油小滤网\r\n一个在抽水机上使用', 0, 0),
(1020, '耗材 磨砂橡皮擦', 2, 1, 1, 0.5, '2022-06-04', 'webserver', '', 0, 0),
(1023, '二极管 WL 18V 贴片稳压管SOD-123', 2, 10, 0.15, 0.5, '2022-06-04', 'webserver', '', 0, 0),
(1026, '电容 瓷片101(100pf)', 5, 95, 0.06, 0.5, '2022-06-19', 'webserver', '', 5, 0),
(1027, '电容 瓷片104(0.1uF 100V)', 5, 96, 0.06, 0.5, '2023-07-30', 'webserver', '18', 4, 0),
(1028, '电容 贴片101(100pf)', 5, 100, 0.06, 0.5, '2022-06-19', 'webserver', '100pf=0.0001uf', 0, 0),
(1029, '电容 贴片104M(100NF)', 5, 100, 0.06, 0.5, '2022-06-19', 'webserver', '100NF=0.1uf', 0, 0),
(1099, '机顶盒 户户通 20v15v5v', 35, 3, 9, 0.5, '2023-04-30', 'webserver', '24v12v5v通用', 2, 0),
(1034, '电容 瓷片电容103', 10, 100, 0.03, 0.5, '2022-07-07', 'webserver', '0.01uf', 0, 0),
(1035, '电容 瓷片电容102', 10, 100, 0.03, 0, '2022-07-07', 'webserver', '1NF', 0, 0),
(1056, '液晶屏 TCL43寸灯条3800A', 250, 2, 0, 0, '2022-08-22', 'webserver', '拆机', 1, 0),
(1050, '液晶屏 灯条AE270C14-2204S', 150, 1, 30, 0.5, '2022-07-30', 'webserver', '', 0, 0),
(1040, '电磁炉 轻触开关12*12*10MM', 15, 9, 0.08, 0.5, '2023-07-30', 'webserver', '12', 1, 0),
(1041, '电容 3.5uf/400v', 10, 2, 2, 0.5, '2023-04-03', 'webserver', '', 0, 0),
(1042, '饮水机 通用制冷主板', 50, 1, 25, 0.5, '2022-07-18', 'webserver', '', 0, 0),
(1044, '饮水机 制冷片tec1-2706', 50, 1, 11, 0.5, '2022-07-18', 'webserver', '正反向电阻分别为0和45欧', 1, 0),
(1052, '制冷 氟利昂r134(220克)', 50, 2, 11, 0.5, '2022-08-01', 'webserver', '', 0, 0),
(1087, '电商 35x26x21 10斤装泡沫装', 3.5, 4155, 2.1, 0, '2024-03-01', 'webserver', '内 长宽高 31x22x17(不算盖子) \r\n外 长宽高 35x26x21\r\n以上规格没有了,只能选 35x26x21\r\n\r\n\r\n原厂价1.58元 买了13米挂车装有5568个泡沫箱\r\n运费1500元，算下来平均一个2元到家\r\n\r\n零售10元3个\r\n10个以上3.2每个\r\n寄果3元每个\r\n\r\n信科泡沫 1.8*4400  +1300运费\r\n', 12682, 0),
(1058, '电容 3uf/400v', 10, 3, 0.9, 0, '2022-08-26', 'webserver', '', 10, 0),
(1067, '锅 保险管热熔断器JY169A四线', 20, 1, 7.8, 0.5, '2022-09-25', 'webserver', '', 0, 0),
(1070, '锅 电压锅 万能主板13.6x14.8x12', 60, 1, 14.5, 0.5, '2024-02-18', 'webserver', '', 7, 0),
(1071, '电压锅 万能主板17.3x14', 60, 1, 22, 0.5, '2023-11-19', 'webserver', '', 2, 0),
(1075, '电视接收机 遥控器 索乐-09', 15, 1, 3.2, 1, '2022-12-03', 'webserver', '(无需设置直接使用)', 5, 0),
(1076, '洗衣机 602胶水', 5, 1, 1.1, 0.5, '2022-12-25', 'webserver', '', 0, 0),
(1081, '洗衣机 通用进水管2米', 20, 2, 6.8, 0.5, '2023-09-22', 'webserver', '', 2, 0),
(1156, '电容 30uf/400v', 20, 1, 4.5, 0.5, '2024-01-05', 'webserver', '', 0, 0),
(1084, '电热燃气 热水器三线点火器', 35, 3, 9.25, 1, '2024-02-17', 'webserver', '燃气 热水器', 14, 0),
(1089, '洗衣机 滚筒门锁17438100000461', 80, 1, 25, 0.5, '2023-03-19', 'webserver', '', 0, 0),
(1091, '锅 电饭锅 电源开关', 20, 4, 0.64, 0.5, '2023-04-03', 'webserver', '零售15', 0, 0),
(1092, '电磁炉 FGA25N125P', 40, 3, 2.3, 0.5, '2023-04-03', 'webserver', '零售15', 1, 0),
(1096, '洗衣机 滚筒水位开关17438100001348', 80, 1, 12, 0.5, '2023-04-18', 'webserver', '', 0, 0),
(1101, '继电器 36VDC继电器6脚 C型', 10, 3, 3.6, 0, '2023-05-18', 'webserver', '电压低于25v的用24v继电器', 4, 0),
(1104, '单片机 PWM直流电机马达调速器', 60, 1, 16, 0, '2023-05-19', 'webserver', '产品参数：\r\n输入电压：DC9-55V                              \r\n输出电压：负载下线性       \r\n输出电流：0-40A                                   \r\n持续功率：2000W             \r\n调速类型：调流                                     \r\n调速方式：电位器（线性）\r\n调速范围：0——100%                          \r\n控制频率：25KHZ             \r\n接线类型：栅栏式接线端子                     \r\n旋钮规格：100K（148）  \r\n模块尺寸：长*宽*高83MM*56MM*28MM\r\n主板按装尺寸：长*宽72MM*48MM           \r\n电位器按装开孔：7MM', 0, 0),
(1106, '继电器 12v6脚继电器', 15, 3, 3, 0.5, '2023-06-13', 'webserver', '', 0, 0),
(1109, '电热燃气 磁控免水压开关', 25, 1, 2.5, 0.5, '2023-05-30', 'webserver', '', 0, 0),
(1112, '电风扇 鸿运电机', 30, 1, 15, 0.5, '2023-07-19', 'webserver', '', 0, 0),
(1115, '适配器 12v5a显示器电源', 30, 2, 14, 0, '2023-07-31', 'webserver', '另一个正在使用,可卖', 1, 0),
(1118, '电脑 三星内存卡256G', 220, 1, 220, 0, '2023-07-27', 'webserver', '360摄像头1', 0, 0),
(1119, '耗材 轮胎补胎胶16+8', 2, 24, 0.25, 0, '2023-08-06', 'webserver', '16片小的8片大的', 0, 0),
(1120, '喷雾器 打药机单向阀', 7, 4, 2.5, 0.5, '2023-08-20', 'webserver', '新的已经使用,只有旧的', 0, 0),
(1121, '电风扇 80mm摇头杆', 2, 4, 0.5, 0, '2023-08-15', 'webserver', '', 0, 0),
(1122, '电子称 4.4v 5A电瓶', 35, 2, 16.5, 0, '2023-09-03', 'webserver', '', 1, 0),
(1123, '耗材 煤气罐', 280, 2, 270, 0, '2023-09-06', 'webserver', '赚10元', 12, 0),
(1124, '耗材 电瓶修复液500ml', 20, 1, 6, 0.5, '2023-08-20', 'webserver', '20元一次保养\r\n使用工具\r\n1.浓缩修复液  2 一字小螺丝刀 3 注射针管\r\n一 浓缩液用量 每个电瓶安数 / 2 \r\n比如12A的   12/2=6毫升  如果一个是电瓶有6个格，每个格要加6毫升,加完502胶水粘好盖子\r\n二 静放4小时,然后充电2小时,把点放完,然后一次性把点充满,再放电,做循环让修复液彻底循环', 0, 0),
(1125, '洗衣机 通用排水管', 12, 4, 4, 1, '2024-01-05', 'webserver', '', 5, 0),
(1127, '液晶屏 电源开关', 50, 3, 2, 0, '2023-09-05', 'webserver', '34', 1, 0),
(1128, '电动配件 电动配件 21碳刷 6.5x7.5x15', 3, 18, 0.35, 0, '2023-09-05', 'webserver', '一对6元', 2, 0),
(1131, '耗材 卷帘门门控开关', 15, 1, 1.5, 0, '2023-09-09', 'webserver', '32\r\n卷帘门备用', 0, 0),
(1134, '锅 电压力锅电源变压器', 35, 1, 2.2, 0.5, '2023-10-09', 'webserver', '', 0, 0),
(1135, '电风扇 10cm连杆', 10, 5, 0.45, 0, '2023-10-11', 'webserver', '34', 0, 0),
(1136, '锅 电压力锅开阀芯', 5, 2, 2, 0, '2023-10-11', 'webserver', '5', 0, 0),
(1137, '机顶盒 SON-09 索尔 遥控器', 12, 2, 3.5, 0, '2023-10-23', 'webserver', '', 1, 0),
(1138, '锅 DDFB-30罩极式电机定时器', 30, 1, 6.5, 0, '2023-10-23', 'webserver', '', 1, 0),
(1140, '洗衣机 滚筒排水电机PX2025-3', 130, 1, 25, 0, '2023-11-11', 'webserver', '', 0, 0),
(1142, '线座 电源线3脚1500W', 15, 1, 4.2, 1, '2023-11-27', 'webserver', '白色花纹1.5米3000W', 32, 0),
(1143, '电饭锅 电炒锅插头', 20, 1, 6.4, 1, '2023-11-26', 'webserver', '', 5, 0),
(1151, '单片机 常闭型震动传感器SW-420', 5, 2, 1.07, 0.5, '2023-12-27', 'webserver', '', 0, 0),
(1147, '单片机 NodeMCUesp32 38p螺母底座', 10, 1, 6, 0, '2023-12-17', 'webserver', '接单作品使用', 0, 0),
(1148, '单片机 esp01s', 10, 1, 5, 0, '2023-12-17', 'webserver', '', 0, 0),
(1149, '单片机 压力气压水位传感器', 10, 1, 3.85, 0, '2023-12-17', 'webserver', '可以测量气压,水位', 0, 0),
(1150, '单片机 温湿度传感器DHT11', 10, 1, 2.4, 0.5, '2023-12-17', 'webserver', '', 0, 0),
(1152, '单片机 水位传感器 Water Sensor', 5, 2, 0.6, 0.5, '2023-12-27', 'webserver', '', 0, 0),
(1153, '单片机 压电片 敲击 振动 震动传感器', 10, 1, 2.55, 0.5, '2023-12-27', 'webserver', '', 0, 0),
(1154, '单片机 火焰传感器模块3线', 5, 1, 1.2, 0.5, '2023-12-27', 'webserver', '', 0, 0),
(1155, '单片机 微型SR602人体红外感应', 10, 2, 2.2, 0.5, '2023-12-27', 'webserver', '', 0, 0),
(1157, '电容 5uf/400v', 20, 1, 1.2, 0.5, '2024-01-07', 'webserver', '', 0, 0),
(1158, '电磁炉 IGBT管H20R1353', 30, 1, 2, 0.5, '2024-01-07', 'webserver', '', 0, 0),
(1159, '电动配件 60v20a 充电器', 35, 1, 20, 0, '2024-02-17', 'webserver', '', 1, 0),
(1160, '洗衣机 万能平衡杆', 70, 1, 16, 0, '2024-03-01', 'webserver', '', 0, 0);

-- --------------------------------------------------------

--
-- 表的结构 `WarehousePreorder`
--

CREATE TABLE IF NOT EXISTS `WarehousePreorder` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL DEFAULT '',
  `price` float DEFAULT '0',
  `number` float NOT NULL DEFAULT '0',
  `buy` float DEFAULT '0',
  `freight` float NOT NULL DEFAULT '0',
  `user` varchar(32) NOT NULL,
  `attribute` text NOT NULL,
  `quantity` int(4) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=604 ;

--
-- 转存表中的数据 `WarehousePreorder`
--

INSERT INTO `WarehousePreorder` (`id`, `name`, `price`, `number`, `buy`, `freight`, `user`, `attribute`, `quantity`) VALUES
(215, '电磁炉 JW28P50CD16J 芯片', 35, 1, 11, 0, 'webserver', '电磁炉主控芯片', NULL),
(597, '适配器 6v2a', 15, 1, 6, 0.5, 'webserver', '', 2),
(360, '洗衣机 TB75-5168g电脑板', 150, 1, 60, 0, 'webserver', '', NULL),
(533, '洗衣机 荣事达XQB68-78A', 150, 1, 75, 0, 'webserver', '电脑板', 1),
(382, '机顶盒 电源板KEHAI-SPB31D', 35, 1, 8.7, 1, 'webserver', '', NULL),
(363, '微波炉 电脑板G70D20CN1P-D2', 120, 1, 30, 10, 'webserver', '', NULL),
(364, '洗衣机 小天鹅电脑板5168G', 130, 1, 48, 10, 'webserver', '', NULL),
(365, '洗衣机 电脑板301330500010', 200, 1, 70, 10, 'webserver', '美的滚筒洗衣机电脑版', NULL),
(370, '电子称 4v4ah20h蓄电池', 25, 1, 18, 0, 'webserver', '', NULL),
(372, '洗衣机 xqb70-a7238电脑板', 170, 1, 85, 0, 'webserver', '', NULL),
(374, '洗衣机 小天鹅TG80-Q1266LPS门开关', 80, 1, 27, 1, 'webserver', '一般主板烧了,门开关一起换', NULL),
(377, '洗衣机 滚筒门锁17438100000473', 25, 1, 22, 0, 'webserver', '', NULL),
(601, '电磁炉 大功率通用主板套', 60, 1, 31, 1, 'webserver', '55包一个月，\r\n60包三个月\r\n零售45', 11),
(411, '洗衣机 荣事达电脑板XQB70-950G', 180, 1, 79, 0, 'webserver', '', NULL),
(414, '洗衣机 XQB65-2018主板', 170, 1, 80, 0, 'webserver', '', NULL),
(402, '洗衣机 波轮电脑板TB75-Q5288CLSR', 150, 1, 74, 0, 'webserver', '一套的包括副板', NULL),
(405, '微波炉 EG823MF7-NRH电脑板主板', 150, 1, 55, 0, 'webserver', '保半年', NULL),
(484, '液晶屏 海尔LE40B510X 主板', 180, 1, 49, 10, 'webserver', '', 1),
(413, '洗衣机 波轮 小天鹅XQB65-2018电脑板', 150, 1, 80, 2, 'webserver', '', NULL),
(409, '液晶屏 创维42E660EC背光板', 30, 1, 5, 5, 'webserver', '', NULL),
(410, '液晶屏 创维42E660C电源板', 150, 1, 22, 0, 'webserver', '', NULL),
(423, '电热燃气 万家乐电热水器D50电脑板', 150, 1, 67, 1, 'webserver', '', NULL),
(432, '电热燃气 万家乐电热水器D50显示器', 100, 1, 50, 1, 'webserver', '上次购买多余的配件', NULL),
(439, '单片机 DHT11温度模块', 20, 1, 4.45, 1, 'webserver', '1 DO  小板开关数字量输出接口 接单片机IO口\r\n2 VCC 外接3.3V-5V\r\n3 GND 外接GND', NULL),
(600, '电磁炉 小整流桥(反向)', 25, 1, 5, 0, 'webserver', '', 2),
(518, '电磁炉 超薄万能主板大功能', 60, 1, 33, 0, 'webserver', '零售45', 2),
(454, '洗衣机 奇帅XQB75-7075电脑板', 150, 1, 78, 0, 'webserver', '', 1),
(479, '液晶屏 乐华TP.MS628M PB803电源板', 250, 1, 108, 2, 'webserver', '', 1),
(511, '电风扇 落地扇壁扇遥控纯铜电机', 70, 1, 29.8, 0.5, 'webserver', '纯铜', 1),
(498, '洗衣机 美的MB80-1100MH主板', 150, 1, 41, 7, 'webserver', '', 1),
(513, '洗衣机 洗衣机电脑板XQB85-S8286', 180, 1, 95, 2, 'webserver', '原装显示板+六插座电源板一套', 1),
(537, '单片机 XL4015可调降压模块', 20, 1, 4.49, 0.5, 'webserver', '输出电流可达5A\r\n带散热片', 1),
(563, '微波炉 M1-235E红色薄膜开关', 50, 1, 24, 0.5, 'webserver', '', 1),
(542, '机顶盒 22v15v5v5v', 30, 1, 7, 0.5, 'webserver', '22v也可放在24v', 2),
(555, '适配器 12v2a', 15, 1, 7, 1, 'webserver', '监控电源', 5),
(556, '洗衣机 排水弹簧', 50, 1, 0.4, 1, 'webserver', '', 1),
(557, '液晶屏 带固定孔船形电源开关', 15, 1, 1.23, 0, 'webserver', '', 2),
(564, '电风扇 通用电脑板带遥控', 40, 1, 8, 0.5, 'webserver', '', 4),
(580, '电子称 台秤电瓶4v4 20HR', 30, 1, 19.5, 0, 'webserver', '', 1),
(584, '二极管 1N5401', 1, 1, 0.1, 1, 'webserver', '耐压100V\r\n耐流3A', 3),
(586, '单片机 STARS-922强粘性散热硅胶', 10, 1, 2.5, 0, 'webserver', '', 1),
(603, '喷雾器 调速器', 15, 1, 5, 1, 'webserver', '加强加厚', 6);

-- --------------------------------------------------------

--
-- 表的结构 `WarehouseSoldtoday`
--

CREATE TABLE IF NOT EXISTS `WarehouseSoldtoday` (
  `id` int(17) NOT NULL AUTO_INCREMENT,
  `writetext` varchar(32) NOT NULL,
  `time` int(11) NOT NULL,
  `profit` int(7) NOT NULL,
  `user` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `warehouse_wait_buy`
--

CREATE TABLE IF NOT EXISTS `warehouse_wait_buy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL DEFAULT '',
  `price` float DEFAULT '0',
  `number` int(10) DEFAULT '0',
  `buy` float DEFAULT '0',
  `freight` int(4) NOT NULL,
  `user` varchar(32) NOT NULL,
  `attribute` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `WisdomBarrtitle`
--

CREATE TABLE IF NOT EXISTS `WisdomBarrtitle` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rid` int(11) NOT NULL,
  `content` text NOT NULL,
  `imgtext` varchar(80) NOT NULL DEFAULT '',
  `date` datetime NOT NULL,
  `user` varchar(32) NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=222 ;

--
-- 转存表中的数据 `WisdomBarrtitle`
--

INSERT INTO `WisdomBarrtitle` (`id`, `rid`, `content`, `imgtext`, `date`, `user`) VALUES
(36, 25, 'application/config.php 找到''view_replace_str''=>[ ''__PUBLIC__''=>''/public/static'', ''__ROOT__''=>''/'', ]', '', '2019-05-22 09:48:00', ''),
(37, 25, '路由配置文件application/route.php中定义         ''__alias__'' =>  [\r\n        ''index''  =>  ''index/index'',\r\n        ''admin''  =>  ''admin/index'',\r\n        ''users''  =>  ''warehouse/index'',\r\n    ],\r\n 缩短访问路由地址', '', '2019-05-22 09:48:00', ''),
(40, 25, '根目录下的 extend 新建任何目录可小写 类名.php (首字母必须大写 类名跟php文件一样) new \\目录名\\类名', '', '2019-05-22 09:50:00', ''),
(39, 25, '把js,css,image文件放到public/static/下面', '', '2019-05-22 09:49:00', ''),
(38, 25, 'index/view 下新建 public目录 存放 网站布局 上 下部模板 {include file="index@./public/head" /} 引用网站布局 上 下部模板\\', '', '2019-05-22 09:49:00', ''),
(41, 25, '引用类 根目录下的 extend 新建任何目录可小写 类名.php (首字母必须大写 类名跟php文件一样) new \\目录名\\类名', '', '2019-05-22 09:50:00', ''),
(14, 25, '把public/. htaccess复制到根目录下', '', '2018-03-28 09:08:00', 'webserver'),
(15, 40, '每次使用完，剩下的汽油要倒到瓶子里，不能放留在机器中，会挥发完的', '', '2018-08-03 22:08:00', 'webserver'),
(31, 34, '赤霉酸 又称920 用药量过多会引起 皮粗', '', '2019-04-24 15:38:00', ''),
(33, 25, '把 public/index.php复制到根目录下,改 /./application/ /./thinkphp/start.php', '', '2019-05-22 09:45:00', ''),
(35, 25, '根目录index.php  \\think\\Build::module(''index''); \r\n\\think\\Build::module(''users''); \r\n\\think\\Build::module(''admin''); 生成框架目录', '', '2019-05-22 09:47:00', ''),
(42, 67, '草长得高于1分米的话,基本没有效果,用割草机除草效果更好', '', '2019-06-03 22:04:00', 'admin'),
(55, 40, '标准的汽油是没有冒黑烟的', '', '2019-06-29 12:45:00', 'webserver'),
(59, 93, '5座强险费用少100多', '', '2019-12-01 17:12:00', 'webserver'),
(60, 93, '5座年检费好像少100元', '', '2019-12-12 19:37:00', 'webserver'),
(65, 94, '超过450攻速就放不出黑龙波', '', '2020-02-21 19:36:00', 'webserver'),
(66, 94, '攻速过480又能放出黑龙波', '', '2020-02-21 21:30:00', 'webserver'),
(67, 119, '1、使用小苏打水浸泡。将食用小苏打和水按1：100的比例溶解，然后将剩下的沃柑放入水中浸泡清洗，然后取出自然风干即可。小苏打水能有效杀除沃柑表面的主要细菌，从而有利于延长沃柑的保存时间。\r\n\r\n2、使用松树枝铺底存放。如果剩余的沃柑量大的话，建议寻找一些新鲜的松树枝或有类似杀菌功能的树枝铺在保存箱的底部，然后将沃柑放入后，再在上面再铺一层松树枝，上面再放沃柑，也就是每放一层沃柑就铺一层松树枝。松树枝能够分泌杀菌物质，以延长沃柑的保存时间。\r\n\r\n', '', '2020-03-12 11:40:00', 'webserver'),
(68, 119, '咪鲜胺+24滴', '', '2020-03-20 18:16:00', 'webserver'),
(69, 34, '保果农药不能是乳油剂', '', '2020-04-01 18:03:00', 'webserver'),
(72, 133, '显示编码\r\nSHOW VARIABLES LIKE ''char%'';', '', '2020-05-28 09:43:00', 'webserver'),
(80, 161, 'centos8已用2.47 GB，5.03%, 共 49.15 GB \r\nutuntu18.04 已用2.75 GB，5.60%, 共 49.15 GB ', '', '2020-08-18 20:06:00', 'webserver'),
(81, 161, 'utuntu18.04 性能测试\r\n首页0.001101s 0.001079s 0.000991s\r\n快递查询 0.079329s  0.077336s 0.069506s\r\n商品 0.005285s 0.005192s 0.005211s\r\n客户 0.002999s 0.002678s  0.002196s\r\n', '', '2020-08-18 20:06:00', 'webserver'),
(82, 161, 'centos\r\n首页 0.008927s 0.009819s 0.009249s\r\n快递查询 0.100604s  0.059532s 0.096578s\r\n商品  0.019471s  0.018690s 0.018613s\r\n客户 0.014628s  0.012539s 0.012587s', '', '2020-08-18 20:34:00', 'webserver'),
(85, 167, '网址是http://www.beian.gov.cn/portal/index.do', '', '2020-09-20 17:57:00', 'webserver'),
(90, 161, 'sdfsd', '', '2021-02-12 21:11:00', 'webserver'),
(93, 189, ' ChinaNet-XzXJ 18777899139', '', '2021-04-17 08:51:00', 'webserver'),
(165, 90, '化油器坏了', '', '2022-07-22 08:17:00', 'webserver'),
(156, 189, 'CMCC-8886 a13768488886', '', '2021-09-09 12:00:00', '站长'),
(166, 212, '贴瓷砖记得防护毁害时粉尘危害', '', '2022-07-23 09:12:00', 'webserver'),
(167, 212, '贴瓷砖记得防护瓷砖切割时粉尘危害', '', '2022-07-23 09:13:00', 'webserver'),
(104, 191, '壳牌假油太多，直接买马石油\r\npetronas马石油旗舰店', '', '2021-08-19 15:56:00', 'admin'),
(107, 16, 'previouspage', '', '2021-08-31 20:39:00', 'webserver'),
(114, 189, 'CMCC-hEuc      88888888', '', '2021-09-09 09:25:00', 'webserver'),
(154, 189, 'CMCC-YUKY;88888888', '', '2021-09-09 11:59:00', '站长'),
(155, 189, 'CMCC-3575  15977853575', '', '2021-09-09 12:00:00', '站长'),
(157, 189, '大才摩修_5G at090411', '', '2021-09-09 12:00:00', '站长'),
(158, 189, 'CMCC-大才快递 12345678', '', '2021-09-09 12:00:00', '站长'),
(159, 189, 'qq qt123456', '', '2021-09-09 12:00:00', '站长'),
(163, 201, 'go是php7.4.29的14.2倍\r\npackage main\r\n\r\nfunc fib(n int64) int64 {\r\n	if n <= 2 {\r\n		return 1\r\n	}\r\n	return fib(n-1) + fib(n-2)\r\n}\r\n\r\nfunc main() {\r\n	println(fib(45))\r\n}\r\n\r\n\r\n<?php\r\n\r\n\r\nfunction fib($int64){\r\n	if($int64<=2){\r\n		return 1;\r\n	}\r\n	return fib($int64-1)+fib($int64-2);\r\n}\r\n$begin=time();\r\n\r\necho fib(45);\r\n\r\n$end=time();\r\n$re=$end-$begin;\r\necho "<br/>";\r\necho $re;', '', '2022-04-17 01:47:00', 'webserver'),
(164, 201, 'Java版本:\r\n\r\npackage bench;\r\n\r\npublic class Bench1 {\r\n	static long fib(long n) {\r\n		return n <= 2 ? 1 : fib(n - 1) + fib(n - 2);\r\n	}\r\n\r\n	public static void main(String[] args) {\r\n		System.out.println(fib(45));\r\n	}\r\n}', '', '2022-04-21 09:00:00', 'webserver'),
(168, 220, 'HiTV_E8CCB8', '', '2022-08-30 10:53:00', 'webserver'),
(169, 220, '区  -C3962', '', '2022-08-30 11:17:00', 'webserver'),
(170, 229, '无法识别墨盒,千万不要普通纸去擦,要粘点酒精来擦,就可以修复好', '', '2023-08-27 04:57:00', 'webserver'),
(171, 229, '打印复印扫描还是喷墨打印机好,省电(是激光打印机10分之1功耗),便宜,耐用\r\n没有激光打印粉尘危害', '', '2023-09-15 08:11:00', 'webserver'),
(172, 237, '10月3号缴费30', '', '2023-12-06 06:42:00', 'webserver'),
(173, 237, '12月6号缴费30元 费用到11月28日  60-(19*3)=3 剩余3元', '', '2023-12-06 07:14:00', 'webserver'),
(174, 252, 'esp8266\r\n点灯科技平台 手机遥控灯\r\n自动感应人体并且在光线黑暗的环境下自动点亮,\r\n开关状态反馈给点灯科技平台(手机)', '', '2023-12-29 07:12:00', 'webserver'),
(175, 252, 'esp32 cam \r\n有摄像头\r\n能够显示温度\r\n控制4组水泵开关  \r\n(最好能定时) \r\n130-28-12=90', '', '2023-12-29 07:16:00', 'webserver'),
(176, 252, 'esp8266\r\n需要做6个震动装置，通过点灯科技的按钮实现：\r\n1、按动按钮后，每个振动器3秒的震动时间（我可以调整时长）\r\n2、震动的同时，按钮的文字显示：正在震动\r\n3、震动完成后，按钮的文字显示：完成震动\r\n\r\n100元', '', '2023-12-29 07:17:00', 'webserver'),
(177, 254, 'arduino WIFI网页配网说明\r\n查看附近WIFI  有 192, 168, 168, 2     密码 nobiggie.cn\r\n连接后 手机打开IE浏览器  输入 192.168.168.2\r\n进入页面 会扫描出附近的WIFI,选择你自己的 \r\n下面打上你们家的wifi 密码 设置  等待15秒后就联网成功 ', '', '2024-01-05 08:06:00', 'webserver'),
(178, 252, '160+40+40+90+100+350+120+300+60=1260', '', '2024-01-12 11:22:00', 'webserver'),
(179, 256, '(sendphone,name,phone,province,address,date,kuaidi,kuaidi_number)', '', '2024-01-13 01:15:00', 'webserver'),
(180, 256, 'insert into CommerceKdOther (sendphone,name,phone,province,address,date,kuaidi,kuaidi_number)\r\nvalues(''18977868009'',''梁志抓账号寄的'',''15067667365'',''浙江省'',''浙江省台州市临海市社桥镇上王村'',''2024-01-14'',''邮政'',''9712322727067'');', '', '2024-01-14 10:00:00', 'webserver'),
(192, 259, '7.5*5=37.5+7*2=14\r\n37.5+14=51.5\r\n51.5+170=221.5', '', '2024-01-16 02:42:00', 'webserver'),
(191, 259, '170', '', '2024-01-16 02:38:00', 'webserver'),
(190, 259, '70+22.5(13)+ 52.5(7)+17.5(2)+7.5', '', '2024-01-16 02:37:00', 'webserver'),
(195, 252, '1260+20+30=1310', '', '2024-01-16 04:10:00', 'webserver'),
(189, 259, '109-30=79', '', '2024-01-16 01:59:00', 'webserver'),
(188, 259, '1422.5', '', '2024-01-16 01:58:00', 'webserver'),
(193, 259, '30箱221.5元', '', '2024-01-16 02:43:00', 'webserver'),
(194, 259, '收到21.5+309=330.5', '', '2024-01-16 02:44:00', 'webserver'),
(196, 259, '2199-1422.5=776.5-221.5=555\r\n\r\n555-330.5=224.5', '', '2024-01-17 11:35:00', 'webserver'),
(197, 259, '9720389898567 刘在七遗漏', '', '2024-01-17 12:03:00', 'webserver'),
(198, 259, '总快递费 2413.5 ￥\r\n\r\n214.5-87.5=127', '', '2024-01-17 05:01:00', 'webserver'),
(199, 259, '总快递费 3105.5 ￥  我自己的', '', '2024-01-18 03:59:00', 'webserver'),
(200, 259, '总快递费 3183.5 ￥', '', '2024-01-18 06:57:00', 'webserver'),
(201, 259, '4664.5', '', '2024-01-22 08:21:00', 'webserver'),
(202, 259, '总快递费 6444.5 ￥', '', '2024-01-24 11:04:00', 'webserver'),
(203, 261, '15211+810=16021\r\n16021-8600=7421', '', '2024-02-05 09:56:00', 'webserver'),
(204, 237, '缴费 30', '', '2024-02-05 05:42:00', 'webserver'),
(205, 262, '9786861230367 地址不详退回', '', '2024-02-08 09:03:00', 'webserver'),
(206, 262, '9720464892767 梁志抓 帮带去,第二天,你让我们重新 录单号重贴,结果梁志抓说 到那东西找不到了', '', '2024-02-08 09:05:00', 'webserver'),
(207, 262, '(9788213885867 ,9788215637067)  有一箱退回大才,其中一箱丢失', '', '2024-02-08 09:05:00', 'webserver'),
(208, 262, '1月27号 收件200箱,录库199件少一箱,事后没有处理  (这里一件丢失', '', '2024-02-08 09:06:00', 'webserver'),
(209, 262, '9756005728967   9756005722767  这两箱 砂糖橘破损严重 申请赔偿', '', '2024-02-08 09:06:00', 'webserver'),
(210, 262, '9790314079767 一直是环江2区揽收部正在发往下一站', '', '2024-02-08 09:08:00', 'webserver'),
(211, 262, '9799830062067  发往浙江 分拣分错到湖南了', '', '2024-02-08 11:02:00', 'webserver'),
(212, 262, '覃永志45箱理赔', '', '2024-02-09 11:51:00', 'webserver'),
(213, 253, '<script>alert(''111'');</script>;', '', '2024-02-11 09:32:00', 'webserver'),
(214, 253, 'ctx.Request.Header.Set("X-XSS-Protection", "1")', '', '2024-02-11 09:33:00', 'webserver'),
(215, 262, '9720389898567   15074607435刘在七 (梁志爪的丢失)', '', '2024-02-13 10:38:00', 'webserver'),
(216, 264, '就算平均1天500票  0.7元1票  500*0.7=350元\r\n货车油费70   350-70=280元\r\n货车司机 开车到环江  \r\n取件+上车+开车来回+下车+分拣+上货架 这个最少最少人工费也要算100元\r\n280-100=180元\r\n店里留守等待 客户取件 不管一个还是两个人,我算60元吧\r\n180-60=120元\r\n150000/120=1250天\r\n1250/365=3.42年  3年半时间回本\r\n', '', '2024-02-18 08:56:00', 'webserver'),
(217, 256, 'insert into CommerceKuaiDi (sendphone,name,phone,province,address,date,kuaidi,kuaidi_number)', '', '2024-02-19 09:36:00', 'webserver'),
(218, 264, '1/8=0.125    12.5%\r\n我5(包含车汽油钱)                 你3     \r\n500*0.7=350*0.375=131.25\r\n350*0.625=218.75-70=148.75\r\n车子年检和保险你出\r\n每月2号按上个月出库量按规定比例转账你', '', '2024-02-27 02:22:00', 'webserver'),
(219, 264, '20%\r\n我 4(包含车汽油钱)年检保险                你 1 \r\n比如一天 500 票    \r\n500*0.7=350 元\r\n350*0.2=70 元 你的大概(具体按出库量)\r\n\r\n350*0.8=280元 我的包含很多烦琐的手续\r\n280-70=210 元 减去油钱\r\n210-150=60 元 开车-货上车-开车-货下车-上货架至少两个人干，一人 75 两个 150 元\r\n还有 60 元算是等待客户取件费，场地费就不算了，算了就不挣钱，意思就是间接在家找了份相对稳定收入的工作\r\n\r\n每月2号按上个月出库量按规定比例转账你', '', '2024-02-28 06:03:00', 'webserver'),
(220, 261, '欧兴华 12.27分5票扫入我的账号 47.5元 ', '', '2024-02-29 02:53:00', 'webserver'),
(221, 237, '交了 10 元话费', '', '2024-03-05 05:41:00', 'webserver');

-- --------------------------------------------------------

--
-- 表的结构 `WisdomBartitle`
--

CREATE TABLE IF NOT EXISTS `WisdomBartitle` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(60) NOT NULL,
  `content` text NOT NULL,
  `date` datetime NOT NULL,
  `user` varchar(32) NOT NULL,
  UNIQUE KEY `id_2` (`id`),
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=268 ;

--
-- 转存表中的数据 `WisdomBartitle`
--

INSERT INTO `WisdomBartitle` (`id`, `title`, `content`, `date`, `user`) VALUES
(6, '手动代码创建数据表', 'create table abc(\r\n''id'' int(11) not null auto_increment,\r\nprimary key(''id'')\r\n)engine-innodb default charset=utf8;', '2017-12-05 09:53:00', '站长'),
(9, '邮件知识 IMAP是“双向”的而POP3是单向的', '邮件知识 IMAP是“双向”的而POP3是单向的**作不会反馈到服务器上,IMAP正好相反', '2017-12-05 09:54:00', '站长'),
(13, 'IMAP和POP有什么区别', 'POP 移动邮件标记已读等，这是不会反馈到服务器上的。IMAP就不同了。还有一点不同，IMAP可以只下载邮件的主题，只有当您真正需要的时候，才会下载邮件的所有内容', '2017-12-14 16:36:00', '站长'),
(14, '固态硬盘4K对齐', '分区时使用4096', '2018-01-01 14:46:00', 'webserver'),
(15, 'android 获取去电号码', 'String outgoingNumber = getResultData();\r\n            Toast.makeText(context, "去电号码是：" + outgoingNumber, Toast.LENGTH_LONG).show();', '2018-01-03 18:46:00', 'webserver'),
(16, '去电', ' Uri  uri= Uri.parse("content://call_log/calls");\r\n        //监听通话记录内容改变\r\n        getContentResolver().registerContentObserver(uri, true,\r\n                new ContentObserver(new Handler()) {\r\n            //监视的数据库发生了改变,就会触发的方法\r\n            @Override\r\n            public void onChange(boolean selfChange) {\r\n                super.onChange(selfChange);\r\n              tv.setText("状态改变了");\r\n            }\r\n        });', '2018-01-18 21:02:00', 'webserver'),
(19, '手机隐藏的一个监听指令', '*#*#4636#*#*', '2018-03-02 07:53:00', 'webserver'),
(144, '冰点还原秘钥', 'JZ1YM06A-3QT4X32Q-0DQEJ25S-M0ZWDWKQ-PJP93K3F', '2020-07-29 20:59:00', 'webserver'),
(25, 'TP5使用', '使用步骤', '2018-03-27 21:28:00', '站长'),
(30, '手机刷机三合一', '1.ROM\r\n2.手机连接驱动\r\n3.平台', '2018-04-13 18:37:00', 'webserver'),
(104, '液化气罐', '空罐33斤左右,满罐60斤左右', '2019-12-19 21:48:00', 'webserver'),
(33, '沃柑保花', '普滋硼+泰森猛锌+细胞分裂素+杀红杀螨药 不能用溃疡病药', '2018-04-21 13:53:00', '站长'),
(34, '沃柑保果', '普滋硼+毒死蜱+花果之素+戊唑 醚菌酯+芸苔素内酯(芸多乐)+赤霉酸+杀红杀螨药+磷酸二氢甲(叶面肥) 不能用溃疡病药', '2018-04-21 13:53:00', '站长'),
(35, 'CSS的position属性', 'absolute绝对定位 在整个网页面中某个位置.fixed固定定位,固定在整个显示屏的某个位置.relative相对于其它位置进行定位', '2018-04-23 08:30:00', '站长'),
(36, 'CSS的z-index属性', 'z-index使用前提必须要有position属性才有效果,z-index即在两个元素重叠的时为负数被遮挡,为正数值大的最前面显示', '2018-04-23 08:36:00', '站长'),
(40, '割草机机油更换量', '一次80毫升,更换时间为10个小时更换一次', '2018-06-04 18:19:00', 'webserver'),
(45, '至尊30公斤电子称改斤显示方法', '操作之前请注意，先准备一个准5公斤的物品。每个步骤中的去皮，零和小数点都不能掉，请依次操作：\r\n\r\n1.按3658（或者9868）去皮 出现CAL （半个零）\r\n\r\n2.输入:1去皮   单价窗口显示2\r\n\r\n3.放上5千克物品 再去皮  单价窗口显示3\r\n\r\n4.输入：10.000去皮   单价窗口显示4\r\n\r\n5.输入：60.000去皮  单价窗口显示5\r\n\r\n6.输入：3去皮   单价窗口显示6\r\n\r\n7.输入：10去皮   重量窗口显示10.000，其他窗口归零，操作完成，请先关机再拿下物品。开机即可使用', '2018-09-06 22:17:00', '站长'),
(46, '防止网站视频 或iframe被别的网站引用', ' header(''X-Frame-Options: deny'');', '2018-09-10 08:33:00', 'webserver'),
(56, '500斤水配1斤进口磷酸二氢钾', '500斤水配1斤进口磷酸二氢钾', '2018-10-30 14:53:00', 'webserver'),
(58, 'win10 开机启动方法', 'C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp  快捷方式存放地址', '2019-02-06 20:26:00', 'webserver'),
(70, '王者荣耀攻速阀', '露娜12 李白1 老夫子5', '2019-05-13 00:29:00', 'webserver'),
(67, '4斤草甘膦可配500斤水3两洗衣粉', '4斤草甘膦可配500斤水3两洗衣粉', '2019-04-18 07:57:00', 'webserver'),
(80, '程序开机自启方法', '右键 我的电脑 ->管理 ->服务与应用程序->服务 \r\n\r\n找到你的程序选择 自启 确认后重启', '2019-07-14 06:36:00', 'webserver'),
(76, '宽带DNS大全', '电信的 202.103.224.68 \r\n202.103.225.68\r\n移动的 211.138.240.100', '2019-06-09 21:29:00', 'webserver'),
(82, '树霉派可代替虚拟机', '如虚拟主机涨价后可以考虑,\r\n花生壳+树霉派(lamp)做服务器一年电耗80度左右', '2019-07-30 09:30:00', 'webserver'),
(94, '奇迹私服法师攻速', '不超过405是最快的', '2019-12-12 19:36:00', 'webserver'),
(91, '单机游戏', 'https://www.3dmgame.com', '2019-11-03 21:35:00', 'webserver'),
(93, '汽车5座6座7座区别', '5-6座车6年免检\r\n7座车每2年车检1次\r\n567座车6年以后每年都车检1次\r\n567座车15年以后每年都车检2次\r\n强险770元每年\r\n车船税按排量计算1.0-1.6是每年360元\r\n强险+车船税=1130元每年\r\n', '2019-11-10 08:47:00', 'webserver'),
(90, '割草机汽油机启动巧门', '用根小指大小木棍沾点汽油在进气口放,然后启动,这样容易启动', '2019-10-21 11:52:00', 'webserver'),
(95, '穿42码鞋子1.73米穿XL衣服', '穿42码鞋子1.73米穿XL衣服', '2019-12-18 15:36:00', 'webserver'),
(99, '称动帐号amdin Cmcc10086#', '称动帐号amdin Cmcc10086#', '2019-12-18 15:38:00', 'webserver'),
(101, '街上支付宝电费帐号查询040500420012782', '街上支付宝电费帐号查询040500420012782', '2019-12-18 15:40:00', 'webserver'),
(107, '卖果套路说明', '问:淘市上有卖价格很低的沃柑?\r\n\r\n答:不可能!果园田头批发价都在3到4元一斤,加上打包装,快递费,怎么可能比我更低呢?\r\n\r\n你买到的只有两种可能,\r\n\r\n1.次果,花皮,太阳果,小个青果(哪有那么多次果,最可能的是下面第二个原因)\r\n\r\n2.反问一下您自己是否会分辨真正的沃柑,某些商家都是挂羊头卖狗肉,发给你就是那种田头1块左右(非沃柑)果,坑你还帮人家数钱点赞!\r\n\r\n3.比你贵点人家买5斤送5斤(套路啊大哥).一共10斤你感觉赚到了是吧!\r\n\r\n套路=>给你发5斤沃柑,送的5斤却是市场上几毛钱一斤的迷橘类的东西,你还觉你赚到了吗?\r\n\r\n \r\n\r\n4.您可以去当地超市看一下沃柑的价格一斤多少再来对比一下!', '2020-01-02 10:55:00', 'webserver'),
(106, '沃柑广告语', '广西沃柑 果园直销\r\n没有中间商赚差价,一件代发,全国包邮!\r\n净重9斤=50元,净重10斤=54元,量大可议!\r\n特别甜,发的都是大果65规格以上精品果\r\n支持淘宝下单交易,安心放心交易\r\n诚招微商或客商合作一起发展!\r\n网站www.360xyz.cn 有相关水果照片展示\r\n本人手机号15677817648 微信同号', '2019-12-31 09:35:00', 'webserver'),
(108, '东三省西六省', '东三省 ->黑龙江省、吉林省、辽宁省\r\n西六省 ->宁夏、新疆、青海、陕西、甘肃、内蒙古自治区', '2020-01-05 20:52:00', 'webserver'),
(109, '沃柑商品广告标题', '广西沃柑 果园直销基地发货 大果净重9斤10斤包邮 假一赔十 特甜\r\n\r\n沃柑 假一赔十量大从优,\r\n\r\n问:淘市上有卖价格很低的沃柑?\r\n\r\n答:不可能!果园田头批发价都在3到4元一斤,加上打包装,快递费,怎么可能比我更低呢?\r\n\r\n你买到的只有两种可能,\r\n\r\n1.次果,花皮,太阳果,小个青果(哪有那么多次果,最可能的是下面第二个原因)\r\n\r\n2.反问一下您自己是否会分辨真正的沃柑,某些商家都是挂羊头卖狗肉,发给你就是那种田头1块左右(非沃柑)果,坑你还帮人家数钱点赞!\r\n\r\n3.比你贵点人家买5斤送5斤(套路啊大哥).一共10斤你感觉赚到了是吧!\r\n\r\n套路=>给你发5斤沃柑,送的5斤却是市场上几毛钱一斤的迷橘类的东西,你还觉你赚到了吗?\r\n\r\n \r\n\r\n4.您可以去当地超市看一下沃柑的价格一斤多少再来对比一下!\r\n\r\n \r\n\r\n \r\n\r\n欢迎广大朋友合作 15677817648\r\n\r\n广西少数民族沃柑山青水秀育好果来自壮族的沃柑\r\n\r\n全国包邮\r\n\r\n特别声明: 本店的果树都是用割草机除草的,物理除草,没有污染!\r\n\r\n请客户放心!有时旺旺不在线可以电话 15677817648真正的沃柑,\r\n\r\n假一赔十', '2020-01-26 12:12:00', 'admin'),
(116, '柑橘肥料口决', '无氮不生长、无磷难成花、无硼难坐果、无钾不上色、缺钙裂果多、无水不长树、无光不长果。', '2020-02-26 09:31:00', 'webserver'),
(117, '沃柑价格表', '礼盒装净果9斤68元\r\n<普通装>净果10斤大果55元(70以上)\r\n<普通装>净果10斤中大果45元(65-70)\r\n<普通装>净果10斤中果40元(60-65)\r\n<普通装>净果10斤中果35元(55-60)\r\n', '2020-03-04 20:06:00', 'webserver'),
(118, '老款小喷雾机正负电识别', '直立好喷雾器，最靠近底部的是正极', '2020-03-11 15:54:00', 'webserver'),
(119, '沃柑冷库保存温度', '沃柑冷库贮藏最适宜的温度是0℃～1.2℃，湿度最好保持在85%—90%。沃柑放在这样的冷库环境中贮藏，保质期可达2个月左右\r\n', '2020-03-12 11:38:00', 'webserver'),
(120, '木瓜奇迹1万点法师加点', '力300 敏捷 1380 智力5400 剩下的体力', '2020-03-19 14:44:00', 'webserver'),
(218, '抖音号： 77406979860', '\r\n达哥悦读\r\n抖音号： 77406979860', '2022-07-24 08:44:00', 'webserver'),
(217, '外出工作职业选择 非常重要', '有粉尘污染，或刺激味的工作，多少钱都不能做\r\n', '2022-07-23 09:11:00', 'webserver'),
(253, '真理1', '读万卷书不如行万里路\r\n行万里路不如阅人无数\r\n阅人无数不如名师指路\r\n名师指路不如贵人相助', '2023-12-31 09:06:00', 'webserver'),
(212, '帖瓷砖方法', '1.先用电子水平仪整体标记水平点\r\n2.用粘有墨水的细线，两点一线，回弹让墙壁有一条水平线\r\n3.水泥+河沙+水 1比3比1 比例混合成半湿状态\r\n4.沙子铺平整，把瓷砖预先放好在要贴的位置，该切割的切，切割瓷砖，搅拌水泥 要做好防尘工作，最好是用电风扇 吹向自己\r\n5.找一水桶 放上3分之1的水跟水泥混合用于直接粘在瓷砖背面  水跟水泥比例大概1比1\r\n6.水平尺，瓷砖振动器，水平细线准备好，现在就要使用\r\n7.瓷砖之间间隔2毫米左右可以用两个绑瓷砖的带子折叠，在一线上下两头放上去，用于隔开\r\n\r\n', '2022-07-12 08:50:00', 'webserver'),
(125, '手机型号首个字母的意思', 'M -> 正规零售机\r\nN -> 官方换亲机\r\nF -> 官方翻新机\r\n3A-> 店铺展示机 ', '2020-03-31 20:53:00', 'webserver'),
(127, '王者荣耀甄姬心得', '王者荣耀甄姬。可以边移动边放技能。\r\n连招方式。\r\n3 2 1 普通攻击直到二技能冷却 2技能\r\n开局主点 2技能。', '2020-05-15 04:13:00', 'webserver'),
(128, '电压力锅煮白粥设置', '调到01', '2020-05-22 09:32:00', 'webserver'),
(133, 'mysql source 就断开连接', '问题主要是编码问题，把编码设置成utf8\r\n打开my.cnf后，在文件内的[mysqld]下增加如下几行代码:\r\n[client]\r\ndefault-character-set=utf8\r\n[mysqld]\r\ncharacter-set-server=utf8\r\n[mysql]\r\ndefault-character-set=utf8\r\n\r\n\r\n重启', '2020-05-28 09:35:00', 'webserver'),
(136, '火狐浏览器帐号密码', '282246101@qq.com    www.360xyz.cn', '2020-07-09 12:19:00', 'webserver'),
(235, '天火奇迹革新区', 'golang\r\nQQ28224610', '2023-07-18 08:15:00', 'webserver'),
(139, '二冲程汽油机油锯', '加的燃油 汽油和二冲程专用机油比例25比1.2\r\n油锯链条 切记加汽油机普通发动机油 \r\n等机油从油锯链条上溅出来的时候，才能锯木头\r\n装油锯链条时装完后记得手动转一下链条\r\n检查是否卡住，顺畅为正确\r\n', '2020-07-18 20:20:00', 'webserver'),
(143, '更改mysql密码', 'use mysql\r\nupdate user set password=password(''新密码'') where user=''root'' and host=''localhost'';\r\nflush privilege', '2020-07-29 20:58:00', 'webserver'),
(167, '物联网公安备案帐号密码', 'qq282246101  qq@282246101', '2020-09-20 17:54:00', 'webserver'),
(161, 'ubuntu18.04与centos8 文件大小，性能对比', 'ubuntu18.04与centos8 文件大小，性能对比', '2020-08-18 20:05:00', 'webserver'),
(173, 'suv前后轮胎气压', '前两轮胎218kpa  后两轮胎气压215kpa', '2020-12-17 13:51:00', 'webserver'),
(174, '买suv时陈吉佳奶奶打了666.6元红包', '买suv时陈吉佳奶奶打了666.6元红包', '2020-12-17 13:53:00', 'webserver'),
(175, '买SUV时覃慧春发了66.66元微信红包', '买SUV时覃慧春发了66.66元微信红包', '2020-12-23 22:26:00', 'admin'),
(190, '电商包装物资 尺寸', '泡沫箱尺寸 26x35x20\r\n礼盒装28x34x12.5 这个不完美 \r\n28x34x13.8 这个完美 ', '2021-04-29 14:14:00', 'webserver'),
(179, '一件代发计算', '网套0.5元每单\r\n纸箱胶带0.3元每单\r\n纸箱2元每单\r\n快递费4.5元每单\r\n10000斤按损耗5%就是500斤\r\n剩余9500斤 以9斤净果为例 就是1055单\r\n小果15%x1055=158单\r\n中果35%x1055=369单\r\n大果55%x1055=580单\r\n以2000单请8个人工为例1000单请4个人\r\n每人每天180元x4=720元人工费 / 1055=0.68算0.7元每件打包费用\r\n网套0.5+胶带0.3+纸箱2+快递4.5=7.3元每件打包运费+0.7元打包费用=8元\r\n每单完成任务送到客户手上成本是8元 x 1055=8440元\r\n以价格2元一斤收10000斤成本就是20000元\r\n20000+8440=28440元\r\n每单应挣1？x1055=1055\r\n28440+1055=总合费用\r\n29495\r\n然后用总合费用算出 小中大果应该卖多少钱每件\r\n', '2021-04-02 23:11:00', 'webserver'),
(187, '寄件重量说明', '同一地址收件人一天不能超过200斤(100公斤)\r\n不包括同一省不同地址不同收件人', '2021-04-12 11:21:00', 'webserver'),
(191, '机油防伪查询网站', '先上网站手动输入查询\r\n再微信描码看看', '2021-06-06 13:18:00', 'webserver'),
(189, '附近WIFI密码', 'HUAWEI-EY6V WIFI密码13481836880 \r\nCMCC-nCYi 6rmj242f \r\nMERCURY_3E7E  a13768488886', '2021-04-17 08:50:00', 'webserver'),
(192, 'cloud.vivo.com', '密码qq282246101', '2021-07-12 22:00:00', 'webserver'),
(234, 'php PDO类', '<?php\r\nnamespace myclass;\r\n\r\nclass PdoXyz{\r\n	//private $host="192.168.100.254";\r\n	private $host="2280lan.dnstoo.com";\r\n	//private $sqlUser="root";\r\n	private $sqlUser="xyz_f";\r\n	private $sqlPasswd="qq282246101";\r\n	private $sqlDb="xyz";\r\n	private $PDO=null;\r\n	public function __construct(string $dbName=""){\r\n		if ($dbName!="") {\r\n			$this->sqlDb=$dbName;\r\n		}\r\n		$this->PDO = new \\pdo("mysql:host={$this->host};port=3306;dbname={$this->sqlDb}", $this->sqlUser,$this->sqlPasswd);\r\n		//转义交由MySQL Server转义\r\n		$this->PDO->setAttribute(\\PDO::ATTR_EMULATE_PREPARES, false);\r\n		$this->PDO->exec(''set names utf8'');\r\n	}\r\n	public function Fetch(string $sql, array $arr){\r\n		$execute = $this->PDO->prepare($sql);\r\n		if ($execute) {\r\n			if($execute->execute($arr)){\r\n				$execute->setFetchMode(\\PDO::FETCH_ASSOC);\r\n				$result = $execute->fetch();\r\n				return $result;\r\n			}\r\n		}\r\n		return null;\r\n	}\r\n	public function FetchAll(string $sql, array $arr) :array{\r\n		$execute = $this->PDO->prepare($sql);\r\n		if ($execute) {\r\n			if($execute->execute($arr)){\r\n				$execute->setFetchMode(\\PDO::FETCH_ASSOC);\r\n				$result = $execute->fetchAll();\r\n				return $result;\r\n			}\r\n		}\r\n		return array();\r\n	}\r\n	public function Exec(string $sql, array $arr):int{\r\n		$execute = $this->PDO->prepare($sql);\r\n		$execute->execute($arr);\r\n		return $execute->rowCount();\r\n	}\r\n	public function LastInsertId(string $sql): int{\r\n		$execute = $this->PDO->prepare($sql);\r\n		$execute->execute();\r\n		return $execute->lastInsertId;\r\n	}\r\n	public function DeleteAll(String $table): bool{\r\n		$execute = $this->PDO->prepare("SELECT id FROM {$table}");\r\n		if ($execute) {\r\n			if($execute->execute(array())){\r\n				$execute->setFetchMode(\\PDO::FETCH_ASSOC);\r\n				$a = $execute->fetchAll();\r\n				foreach ($a as $k => $v) {\r\n					$sql = "DELETE FROM {$table} WHERE id=?";\r\n					$execute1 = $this->PDO->prepare($sql);\r\n					$execute1->execute(array($v[''id'']));\r\n				}\r\n				return true;\r\n			}\r\n			return false;\r\n		}\r\n		return false;\r\n	}\r\n	public function __destruct(){\r\n		$this->PDO=null;\r\n	}\r\n}\r\n', '2023-06-30 08:06:00', 'webserver'),
(227, '早晚一大杯豆浆可以调理胃', '豆浆什么都不要放,豆浆是碱性可以中和胃酸,补钙,\r\n胃酸太多可以吐出来缓解.', '2022-12-25 09:34:00', 'webserver'),
(222, 'wx', 'wx0732ee13b305beba\r\n3ca043a8038d6b73cc2cf0651ffc9130', '2022-09-10 10:55:00', 'webserver'),
(194, '怎么判断感冒是病毒性还是细菌性', '1.病毒性感冒的时候，往往全身症状是比较严重的，会有浑身的肌肉酸疼、乏力的症状出现，会有流清鼻涕的症状\r\n\r\n四季抗病毒合剂、利巴韦林颗粒或者蒲地蓝消炎口服液\r\n2.细菌性感冒，往往会有扁桃体咽喉部的化脓，检查血常规的时候会有白细胞的升高，会有流黄鼻涕或者咳黄痰的症状出现\r\n抗生素进行消炎治疗的。可以使用头孢类抗生素，如果平时没有过敏的情况，可以使用头孢克肟、头孢羟氨苄或者头孢克洛进行消炎的治疗', '2021-08-10 05:28:00', 'webserver'),
(195, '细菌感冒治疗特效药', '1.阿莫西林\r\n2.复方甘草口服溶液', '2021-08-11 20:34:00', 'webserver'),
(196, '高压电线是有辐射的，要远离300米以上最安全', '高压电线是有辐射的，要远离300米以上最安全', '2021-08-22 18:33:00', 'webserver'),
(198, '望远镜 分为 伽利略 和 开普勒', '伽利略 物镜是 凹透镜 + 目镜 凸透镜\r\n开普勒 物镜是 凸透镜 + 目镜 凸透镜 放大倍数完胜伽利略 伽利略望远镜一般都是玩具', '2021-09-22 14:18:00', 'webserver'),
(200, 'vscode golang 安装插件', 'vscode golang 插件安装\r\nhttps://goproxy.io/zh/ 一个全球代理为 Go 模块而生\r\n\r\n按说明配置 go 1.13 及以上\r\n\r\ngo env -w GO111MODULE=on\r\ngo env -w GOPROXY=https://goproxy.io,direct\r\n安装完记得关一下\r\ngo env -w GO111MODULE=off', '2021-10-28 20:21:00', 'webserver'),
(201, 'java vs go性能\r\nstprintboot   iris', '单纯返回字符串   go是java 3倍速度\r\n返回json        go是java 3倍多一点速度\r\n数据库全量查询  go是java 的4倍速度', '2021-11-12 16:58:00', 'webserver'),
(204, 'go 性能是java的2.5倍', 'go 性能是java的2.5倍', '2021-12-11 22:27:00', 'webserver'),
(205, '移动宽带路由登录', '192.168.100.254\r\nadmin\r\nCmcc10086#', '2021-12-12 08:21:00', 'webserver'),
(206, 'TCS-180 电子台称 公斤市斤互换', '开机 12763  去皮 63 去皮    （公斤转市斤）\r\n开机 12763  去皮 33 去皮    （市斤转公斤）', '2021-12-12 11:47:00', 'webserver'),
(207, '宝骏530更换机油', '1.拆开发动机防尘罩，四个角，每一个角用点力往上提渐个提起就能拆开\r\n2.找个盆装废机油，找个六角螺丝板手用于扭开机油底壳放机油。机油格板手\r\n3.先扭螺母机油底壳放机油。同时拆机油格，面向车头往左手边扭，拆下后及时把新的机油格装上。\r\n装上新机油格之前要注意在机油格塑料垫那里放新机油。\r\n4.把机油底螺母扭紧。倒入新机油，使之剩余机油瓶一起称重在1.7斤左右就好了\r\n5.启动车子怠速3分钟', '2022-01-30 09:43:00', 'webserver'),
(209, 'https://www.oracle.com下载java帐号密码', '282246101@qq.com\r\nwww.360xyz.CN', '2022-03-12 07:21:00', 'webserver'),
(232, '火狐浏览器缓存', 'C:\\Users\\Administrator\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\k8lrn5xn.default-release\\cache2\\entries', '2023-06-20 01:03:00', 'webserver'),
(233, '2023年6月20号傍晚种的木瓜苗', '2023年6月20号傍晚种的木瓜，看看多久结果', '2023-06-28 04:38:00', 'webserver'),
(214, '惠普打印机墨盒型号 67', '惠普打印机墨盒型号 67', '2022-07-12 09:29:00', 'webserver'),
(215, 'CMCC-YUKY', '88888888', '2022-07-16 07:36:00', 'webserver'),
(230, '网络MAC地址', '6a:e4:07:75:d2:ee  #我的手机\r\n5a:ab:53:13:82:98  #小罗手机\r\nd0:fa:1d:11:a1:8f  #360摄像头\r\nb0:59:47:4c:68:76  #360夜视摄像头\r\n98:cd:ac:29:44:99  #大门\r\n3a:5e:d4:6e:f9:0f  #老豆手机\r\n2c:73:60:19:db:00  #邮政打印机\r\na4:56:02:36:c9:53  #360路由器', '2023-04-24 08:51:00', 'webserver'),
(220, 'FAST_6C5A 林', 'FAST_6C5A 林', '2022-08-30 06:46:00', 'webserver'),
(225, 'https://www.raspberrypi.org/downloads/raspberry-pi-os/', 'https://www.raspberrypi.org/downloads/raspberry-pi-os/', '2022-11-15 11:56:00', 'webserver'),
(228, '超能世界', '刀妹 13224武士+2罪恶 竞技场强袭+罪恶\r\n屠龙 飞刃 1322 2+2+2 狂热者罪恶审判强袭+罪恶龙女3443 女妖+进化\r\n大树 4445救赎+进化\r\n诗人/鹦鹉3422 武士+进化\r\n电龙1322 破绽+罪恶\r\n药剂/小猫 3422 武士+进化\r\n皇后 3445 女妖+进化\r\n万花 1321 破绽+罪恶/主宰+罪恶\r\n树女 3422 主宰+进化', '2023-01-27 09:55:00', 'webserver'),
(229, '喷墨打印机日常维护', '70张左右加墨(常加墨可以让墨盒寿命更长,主要是防止墨盒没有墨水后墨盒喷头过热)\r\n墨盒喷头堵了,可以用80-90度的开水泡墨头30秒左右\r\n\r\n\r\n', '2023-02-03 10:18:00', 'webserver'),
(236, 'php mysqli预处理', '/**\r\n * $a=new MysqliXyz;\r\n * $stmt=$a->sql($sql,"类型",?对应值);\r\n * $stmt->bind_result(...$list); //接收返回变量\r\n * $stmt->execute();\r\n * $stmt->fetch();  //单条数据查询\r\n * //多条数据\r\n $result=array();\r\n $temp=array();\r\n while($stmt->fetch()){\r\n		$temp["passwd"]= $passwd;\r\n		$result[]=$temp;\r\n }\r\n */\r\nclass MysqliXyz\r\n{\r\n	private $host="192.168.100.254";\r\n	//private $sqlUser="root";\r\n	private $sqlUser="root";\r\n	private $sqlPasswd="qq282246101";\r\n	private $sqlDb="xyz";\r\n	public $stmt="";\r\n	private $db=null;\r\n	function __construct(){\r\n\r\n		$this->db=new \\mysqli($this->host,$this->sqlUser,$this->sqlPasswd,$this->sqlDb,3306);\r\n		if ($this->db->connect_error) {\r\n			die("连接 Mysaql 失败 ".$this->db->connect_error);\r\n		}\r\n		$this->db->set_charset("utf8");\r\n	}\r\n	//参数1 sql语句  参数2 ?对应类型  参数3 ?对应值 \r\n	public function GetStmt($sql,$types,...$list){\r\n		$this->stmt=$this->db->prepare($sql);\r\n		$this->stmt->bind_param($types,...$list);\r\n		return $this->stmt;\r\n	}\r\n	public function __destruct(){\r\n		$this->stmt->close();\r\n		$this->db->close();\r\n	}\r\n}\r\n', '2023-07-20 09:11:00', 'webserver'),
(237, '15677817648缴费记录', '	//2022-06-28 新转网 现金交了50\r\n	date2022_6_28 := 50\r\n	date2022_10_01 := 30\r\n	date2023_01_03 := 20\r\n	a := date2022_6_28 + date2022_10_01 + date2023_01_03\r\n	date2023_03_01 := 30\r\n	date2023_04_04 := 30\r\n	date2023_05_04 := 30\r\n	date2023_07_04 := 30\r\n	date2023_08_04 := 46\r\n	b := date2023_03_01 + date2023_04_04 + date2023_05_04 + date2023_07_04 + date2023_08_04\r\n	c := a + b\r\n	fmt.Println(c)\r\n	d := float32(c) / 19\r\n	fmt.Println(d) //14个月 刚好 2022-06-28  到 2023-08-28 的所有费用', '2023-08-04 06:05:00', 'webserver'),
(244, 'NodeMCU ESP32 MAX98357', 'NodeMCU ESP32 MAX98357', '2023-09-28 08:34:00', 'webserver'),
(239, 'win10 删除运行记录', 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU，删除右边除“(默认)”之外的所有值，也可以选择性删除，可参照“数据”中命令内容来决定是否删除', '2023-08-13 09:27:00', 'webserver'),
(240, 'pc mac', '	"pc001": "74:d4:35:a0:69:73",\r\n	"pc002": "1c:b7:2c:af:ee:9c",\r\n	"pc003": "1c:1b:0d:8e:8b:fe",', '2023-08-14 04:53:00', 'webserver'),
(242, '电脑MQTT限时上网', '// 客户机\r\n1. 电脑主机 MQTT 订阅  "home/system/pc"\r\n2. 客户电脑主机 MQTT 断线自动重连\r\n3. 电脑每5分钟定时向服务器 home/system/pctosystem 发布 本机名, \r\n判断有返回 来确定是否已经掉线\r\n//服务器\r\n1. 服务器 MQTT服务器\r\n2. 服务器 建立一个协程 MQTT Client 监听 home/system/pctosystem  电脑主机 发送来的  消息\r\n消息信息是  客户机的主机名  然后 进行计算时间,当时间超过时\r\n向 home/system/pctosystem 发送 json  pcname:主机名 msg:关机\r\n3. 客户机 通过 web 192.168.100.254 主页查询上网剩余时间', '2023-08-16 01:08:00', 'webserver'),
(243, '获取网络时间网址', 'http://quan.suning.com/getSysTime.do', '2023-09-12 11:24:00', 'webserver'),
(245, 'https://github.com/topics/inmp441', 'https://github.com/topics/inmp441', '2023-10-09 08:55:00', 'webserver'),
(252, 'esp订单任务', 'esp订单任务', '2023-12-29 07:10:00', 'webserver'),
(247, 'ssh root@111.229.99.208 ', 'ssh root@111.229.99.208 \r\nqq@1234567', '2023-10-24 06:07:00', 'webserver'),
(248, '识别记账', '200开工定金\r\n1000元买 扫描机器\r\n500元 -109元域名费-60元快递费=330元\r\n\r\n请人美化页面 350元未给 ', '2023-10-30 06:08:00', 'webserver'),
(249, 'sub 汽车加机油量 净重 5.5 斤', 'sub 汽车加机油量 净重 5.5 斤', '2023-11-10 01:52:00', 'webserver'),
(250, '景安虚拟主机账号密码', 'golangjacob\r\nqq@282246101', '2023-12-04 08:18:00', 'webserver'),
(251, '换煤气时间', '2023 年 12 月 9 日 115', '2023-12-09 10:44:00', 'webserver'),
(254, 'arduino WIFI网页配网说明', '查看附近WIFI  有 192, 168, 168, 2     密码 nobiggie.cn\r\n连接后 手机打开IE浏览器  输入 192.168.168.2\r\n进入页面 会扫描出附近的WIFI,选择你自己的 \r\n下面打上你们家的wifi 密码 确定  等待20秒后就联网成功', '2024-01-04 04:32:00', 'webserver'),
(255, '2024年1月5号开始收果', '3箱', '2024-01-05 07:41:00', 'webserver'),
(256, 'xlsx 转sql ', 'CREATE TABLE `CommerceKdOther` (\r\n  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `name` varchar(64) NOT NULL DEFAULT ''0'',\r\n  `phone` char(11) NOT NULL DEFAULT ''0'',\r\n  `address` varchar(64) NOT NULL DEFAULT '''',\r\n  `kuaidi` varchar(25) NOT NULL DEFAULT '''',\r\n  `kuaidi_number` varchar(64) NOT NULL DEFAULT '''',\r\n  `sendphone` char(11) NOT NULL DEFAULT '''',\r\n  `province` varchar(64) NOT NULL DEFAULT '''',\r\n  `date` date NOT NULL,\r\n  `imagepath` varchar(100) NOT NULL DEFAULT '''',\r\n  PRIMARY KEY (`id`)\r\n) ENGINE=MyISAM AUTO_INCREMENT=142 DEFAULT CHARSET=utf8;', '2024-01-13 01:10:00', 'webserver'),
(260, 'https://yidian68.com/', 'https://yidian68.com/', '2024-01-28 09:40:00', 'webserver'),
(261, '2月2好快递费+810元', '2月2好快递费+810元', '2024-02-05 09:55:00', 'webserver'),
(259, '每日快递费', '111111', '2024-01-16 01:58:00', 'webserver'),
(262, '理赔单号', '理赔单号', '2024-02-08 08:59:00', 'webserver'),
(263, '3楼门宽99x188', '3楼门宽99x188', '2024-02-16 01:47:00', 'webserver'),
(264, '乡下快递', '乡下快递', '2024-02-18 08:49:00', 'webserver'),
(265, '1月份结算快递费13377', '1月份结算快递费13377', '2024-02-21 05:06:00', 'webserver'),
(266, 'ems 协议客户号', '账号：1100179214387\r\n密码：hj123456789', '2024-02-23 10:54:00', 'webserver'),
(267, 'php 账号密码', 'webserver golangjacob', '2024-03-06 08:30:00', 'webserver');

-- --------------------------------------------------------

--
-- 表的结构 `WisdomCategory`
--

CREATE TABLE IF NOT EXISTS `WisdomCategory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(20) NOT NULL DEFAULT '',
  `user` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=556 ;

--
-- 转存表中的数据 `WisdomCategory`
--

INSERT INTO `WisdomCategory` (`id`, `title`, `user`) VALUES
(1, '电磁炉', 'webserver'),
(2, '电压力锅', 'webserver'),
(4, '洗衣机', 'webserver'),
(5, '微波炉', 'webserver'),
(7, '电脑', 'webserver'),
(8, '冰箱/空调/饮水机', 'webserver'),
(10, '电风扇', 'webserver'),
(12, '液晶电视/显示器', 'webserver'),
(20, '单片机', 'webserver'),
(32, '燃油汽车/电动车', 'webserver'),
(55, '餐饮小吃店', 'webserver'),
(72, '电热燃气', 'webserver'),
(160, 'linux 树莓派', 'webserver'),
(321, 'mysql', 'webserver'),
(344, 'golang', 'webserver'),
(525, '手机维修', 'webserver'),
(529, '网址收藏', 'webserver'),
(554, 'c++', 'webserver'),
(555, '医学常识', 'webserver');

-- --------------------------------------------------------

--
-- 表的结构 `WisdomPreview`
--

CREATE TABLE IF NOT EXISTS `WisdomPreview` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL DEFAULT '0',
  `title` varchar(64) NOT NULL DEFAULT 'null',
  `content` text NOT NULL,
  `imgtext` varchar(100) NOT NULL DEFAULT '',
  `user` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8014 ;

--
-- 转存表中的数据 `WisdomPreview`
--

INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(107, 1, '按键面板不显示,不通电', '1.拆开,观察一下整体哪个部件有烧损的痕迹 \r\n2.测量保险丝开路 \r\n3.再测量IGBT管基极,集电极之间短路 \r\n4.拆下IGBT,在线测量整流桥,根据整流桥的原理可以在线测量,坏了更换 \r\n5.这个时候直接更换S8050,S8550三极管,如果是贴片的也必须要更换,直接更换0.3UF电容,避免再烧IGBT管 \r\n6.测量300V滤波电容两极是否存在短路,没有短路现象才能接通电源', '', 'webserver'),
(108, 1, '电源板更换损坏', '首先把300V直接电容正极断开,然后找到接大风扇的正负极接18V,找到7805输出极,拆下7805后5V电压接到该输出极,12V可以空着', '', 'webserver'),
(109, 1, '按键时而失效,受潮失效', '自来水刷子刷干净\r\n用电吹风吹干\r\n更换全部按键\r\n那就补焊一下每个焊点', '', 'webserver'),
(114, 2, '维修时注意防护 非常重要', '电压力锅和电饭锅，绝缘导线套里有石棉，不要去动它，粉尘极小看不见的，以够粉尘吸入有害', '', 'webserver'),
(115, 2, '换板注意事项', '交流220V直接出来接火线,另一根交流电源线经过发热盘一端的那根接地线,剩余一个接发热盘,两根交流电线接反会使发热盘不发热', '', 'webserver'),
(117, 4, '开机就报警，显示故障代码', '通常开机报警或者按启动就报警，都是水位开关问题。更换水位开关，检查连接线是否接触不良即可解决，如解决不了，再更换电脑板。', '', 'webserver'),
(118, 4, '其他程序正常，不能脱水，脱水跟洗衣服一样慢', '此故障为排水阀排水时候没有把离合器拉开故障，解决方法：调整离合器把手螺丝，把排水阀跟排水堵头之间距离调整短一点，把离合器把手拉开到位即可', '', 'webserver'),
(119, 4, '其他程序正常，不能脱水，排水完了，等4分钟左右就报警，或者不报警', '水位开关故障，解决方法：更换水位开关即可', '', 'webserver'),
(120, 4, '进水，洗衣服正常，不能排水，不能脱水', '排水阀烧坏，导致电脑板烧坏。解决方法：同时更换排水阀跟电脑板即可	\r\n删除\r\n', '', 'webserver'),
(121, 4, '其他程序都正常，就是不能脱水，排水完了或者开始排水就报警，显示故', '门开关坏，桶平衡开关坏。解决方法：短路电脑板门开关跟桶平衡开关插座即可（短路方法：找到电脑板对应插座，把插头插好在电脑板上面，在电脑板对应插座把线皮剥开，直接扭在一起即可）', '', 'webserver'),
(122, 4, '一直洗衣服，不能到排水脱水程序', '桶平衡故障，一般为衣服在桶里面偏一边问题。解决方法：短路电脑板桶平衡插座即可（短路方法：找到电脑板对应插座，把插头插好在电脑板上面，在电脑板对应插座把线皮剥开，直接扭在一起即可）', '', 'webserver'),
(123, 4, '进水完了，洗衣服时候报警', '一般桶平衡故障，其中LG.松下洗衣机有干簧管保护的，应该是盖子磁铁掉了，干簧管不能吸和故障，解决方法：调整桶平衡即可。干簧管问题的，把盖子上面的磁铁安装好即可解决。', '', 'webserver'),
(124, 4, '开机没有按启动排水阀就打开，按启动后一边排水一边进水', '排水阀坏，导致电脑板烧坏。解决方法：电脑板跟排水阀同时更换即可。', '', 'webserver'),
(125, 4, '进水正常，洗衣服程序会排水时', '此故障应该是有手搓功能洗衣机，排水牵引器都是三线的，是排水牵引器与排水阀堵头拉线距离太短问题。解决方法：调整离合器把手螺丝，让距离长一点即可，或者改单行程（把牵引器左右两边线并接，剪断接电脑板的手搓功能线即可解决故障。不需要更换电脑板', '', 'webserver'),
(126, 4, '开机没有启动就转,进水完了，洗衣服一边转或者不能转', '电脑板烧坏，电机局部短路或者烧坏，电容坏。解决方法：量电机阻值（正常阻值两个副绕组相加=主绕组），电机阻值正常，电容正常更换电脑板即可解决，如电机阻值不相等，需要电脑板跟电机。', '', 'webserver'),
(127, 4, '打开电源，没有按启动就进水', '水位开关故障，更换水位开关即可解决，如解决不了再更换电脑板', '', 'webserver'),
(128, 4, '启动后进水不停不能洗衣服', '水位开关坏，或者水位开关皮管漏气原因。解决方法：更换水位开关，用胶水密封皮管两头。如果还是解决不了，再更换电脑板', '', 'webserver'),
(129, 4, '波轮式洗衣机 可以甩干排水', '先测电容,再单独通电电机看是否转动,正反转,电机是正常的,更换电脑板故障排除', '', 'webserver'),
(130, 4, '单筒波轮式洗衣机启动线圈和运行线圈', '阻值一样，双筒不一样', '', 'webserver'),
(131, 5, '微波炉通电不加热,或不通电', '检测一下保险丝有没有断开,电阻测量微波管为1欧左右为正常,拆下高压二极管,用电阻200M档正向导通,在30M左右,反向为无穷大,为正常', '', 'webserver'),
(132, 5, '微波炉电容', '有时测量是正常的但其实是损坏了的,最好的办法是直接替换,测量正反向电容应该不差于0.003UF', '', 'webserver'),
(134, 7, '电脑开10分钟左右突然断电', '从散热不良方面考虑,如果换了散热风扇还是没有作用的话,请重新拔插一下CPU或更换CPU', '', 'webserver'),
(135, 7, '电脑蓝屏死机', '先从系统方面考虑,先重装一下系统,如果不行再考虑硬件问题 比如内存条有没有装好或者损坏', '', 'webserver'),
(136, 7, '电脑改装通电后延时几秒自动开机,', '开机器为5V供电,主板主供电插卡头朝上,从左边第四个黄线接5V正,第八根为黑线接负,继电器接机箱开关按钮', '', 'webserver'),
(137, 7, 'GHOST系统后不能从硬盘正常启动', '首先看一下硬盘有没有拿来做移动U盘,事前装过装机PE系统,没有返还空间,', '', 'webserver'),
(145, 1, 'IGBT管测量好坏', '电阻档200K,红接第三脚黑笔接中间脚,阻值在73K左右, 反向测量为无限大,为正常.电阻档200M档测正反电阻有跳动数字后变为无限大,为正常,如果导通为击穿损坏,第一脚和中间脚正反向电阻都为无限大为正常!', '', 'webserver'),
(147, 2, '开机几秒后显示E4错误代码', '一般为温度传感器损坏,还有一个可能就是压力开关断路了,正常时是导通的!', '', 'webserver'),
(148, 12, '创维液晶电视能遥控开机,开机后有声音没图像没字符且灰屏!', '首先 用遥控器试下能否待机,能待机遥控,问题应该不是主板\r\n\r\n用酒精清理一下排线,如还是不行故障可能出现在主板或显示屏驱动电路,因为有声音主板故障率不高,应该为屏驱动电路有问题,难修!', '', 'webserver'),
(149, 1, '线圈盘中心感温二极管', '阻值在73K左右为正常', '', 'webserver'),
(150, 1, '2n3904用8050 2n3906用c8550替换', '2n3904用8050 2n3906用c8550替换', '', 'webserver'),
(154, 4, '波轮洗衣机一直进水且溢出，能单独排水', '先用万用表测一下水位开关导线有无开路，在有装有水的状态下用牙签疏通一下水压导管进水处看到有明显水流出后，查看水压导管是否存在露气，插回水压导管', '', 'webserver'),
(157, 1, '故障代码E2', '拆开电磁炉,把锅盘感温器拆开不接,然后直接通电如果能正常,更换锅盘感温二极管故障排除', '', 'webserver'),
(181, 1, '烧IGBT管,换后不加热几秒后面板闪烁', '继续更换IGBT管两脚的稳压二极管,更新220V电源的2UF电容故障排除', '', 'webserver'),
(182, 4, '滚筒洗衣机按键失灵', '用电吹风加热某部位后就能正常使用,拆下电脑板对加热部位用酒精清洗,故障排除', '', 'webserver'),
(183, 5, '微波炉不加热保险丝未断', '拔开变压器初级,用万用表交流档测有无220V,如有220V测高压二极管,电容,更换微波管', '', 'webserver'),
(184, 5, '微波炉测量变压器', '微波炉变压器的初级线圈阻值1.1欧,次级线圈电阻：约100～200Ω', '', 'webserver'),
(186, 5, '微波炉电容好坏测量', '用电容档测量是否跟标识容量一致,然后用电阻20M档测电阻会在1M逐渐上升至10M左右,正反向电阻测量效果都是这样且最大值都误差不大为正常', '', 'webserver'),
(187, 5, '微波炉不加热', '高压保险丝没有烧断,测高压二极管和电容都为正常,门开关正常(电阻档,一表笔放在220V输入保险丝那,另一表笔分别测量门开关),测量高压变压器输入端电压是否有220V,如果没有肯定是机械开关或电脑板问题,还有一种是有220v电压的也是机械或电脑板问题,里面接触不良引起的.', '', 'webserver'),
(189, 7, '电脑屏幕重影', '更换数据线', '', 'webserver'),
(190, 4, '波轮洗衣机开机启动几秒后显示F1', '为水位传感器问题!更换水位开关或水管', '', 'webserver'),
(191, 7, '电脑时不时的卡，硬盘有声音', '如果是装系统GHOST的时候没有停卡现像，有时候很正常，有时卡得动不了，请更换一个质量好的电脑电源！', '', 'webserver'),
(232, 2, '电脑功能正常,但是不加热', '仔细听一下按上煮饭键后,\r\n有没有听到继电器吸合的声音,\r\n如果有,再测一下连接发热盘的导航有没有开路,没有开路,更换继电器->更换驱动三极管', '', 'webserver'),
(233, 1, '按键面板显示,按键无反应', '先测量该按键连接铜泊线是否通,如通,酒精清洗一下集成电路各引脚,再补焊上一般都可以解决', '', 'webserver'),
(234, 8, '空调加制冷剂', '1.先查看空调制冷剂型号和量度\r\n2.先使压缩机运行\r\n3.打开制冷剂的伐门\r\n4.打开两通伐的阀门(排一下管里的空气,两次1秒开关操作)\r\n5.加注大概需要30分钟左右,当压力表 在0.5到0.6MP时为加注量合适(冬天压力会偏低,冬天小阀会有点结箱)\r\n6.关制冷剂阀门,关两通伐的阀门\r\n7.制冷剂过多时表现为,小阀和大阀都结箱,看表的压力不明显\r\n8.制冷剂不够,小阀结箱,压力表只有0.2MP左右', '', 'webserver'),
(235, 8, '空调制冷剂过多放出制冷剂', '1.不能直接放制冷剂,要连接表阀来放,防止冻伤手 2.放制冷剂时表阀变化不明显,所以只能通过观察,小阀大阀结箱的状态来控制放量 3.大阀,小阀箱冻水化状态时,说明制冷剂放出量合适了', '', 'webserver'),
(239, 1, '开启3秒左右就停电', '检查一下，cpu傍的5UF电容有没膨胀或直接拆下来测量', '', 'webserver'),
(249, 8, '制冷原理', '压缩机→冷凝器→节流(毛细管)→蒸发 ( 吸热 ) 的制冷循环\r\n压缩机一般由壳体、电动机、缸体、活塞、控制设备 ( 启动器和热保护器 ) 及冷却系统组成\r\n压缩机吸气管吸入低温低压的制冷剂气体\r\n压缩机排气管排出高温高压的制冷剂气体\r\n为制冷循环提供动力\r\n经过冷凝器散热变成高压中温\r\n经过毛细管 毛细管末端变为低压低温\r\n在蒸发器内 汽化时必须吸热，使冷媒水因失热而降低了温度\r\n又被制冷压缩机吸入压缩，这样周而复始\r\n', '', 'webserver'),
(250, 8, '压缩机', '压缩机一般由壳体、电动机、缸体、活塞、控制设备 ( 启动器和热保护器 ) 及冷却系统组成\r\n启动器基本上有两种，即重锤式和 PTC 式。其中后者较为先进\r\n冷却方式有油冷和自然冷却两种\r\n一般家用冰箱的压缩机是以单相交流电作为电源，压缩机功率较小，通常在 250W 以下', '', 'webserver'),
(251, 8, '毛细管作用', '毛细管供液量小，蒸发器内的制冷剂偏少，制冷效果差\r\n供液量过大，蒸发压力会很高，蒸发温度高、温度达不到相应的温度等级，严重的还会造成压缩机无法停机故障\r\n毛细管供液能力与尺寸有关。长度长、内径小，供液量越小,反之越大\r\n电冰箱中使用的毛细管，一般使用内径为0.5～1mm、长度2～4m的紫铜管。其尺寸主要由电冰箱采用的压缩机功率与其相应温度等级确定\r\n', '', 'webserver'),
(253, 8, '压缩机好坏检测', '排出雪种,拆下压缩机剪断低压和高压端,用手堵高压端如堵不住就是正常的\r\n还有交流电流法和电阻法可以判断压缩机是否正常!启动电容也要测量一下\r\n', '', 'webserver'),
(254, 8, '打压检漏', '用自身压缩机打压比较适合打低压管，不适合打高压管。在实际应用中一般仅打低压就够了，只要低压不漏便是漏高压。正常使用中的冰箱两侧同时漏的概率不高。\r\n   打低压的方法：\r\n1、割开回气管\r\n2、在回气管端接上压力表\r\n3、通电开机并观察表压，当表压到4至5kg时断电，此时表压会继续上升，约8至10kg才停止\r\n4、封死过滤器出口处毛细管\r\n5、观察表压即可', '', 'webserver'),
(256, 8, '冰堵脏堵判断', '断电并清理冰箱箱里使雪全部融化,一个小时以上\r\n再通电开机,如果刚开始一段时间制冷之后不制冷为冰堵\r\n一直不能制冷为脏堵', '', 'webserver'),
(257, 8, '冰箱系统正常工作的压力', '600高压0.5低压负0.05\r\n12高压0.9低压0.04\r\n以上为正常工作后的压力', '', 'webserver'),
(259, 8, '焊堵检测方法', '压力为0的状态下,接表,然后开启冰箱,运行30秒左右,停机过一时间看看压力表如果归0就是通的,为负压就是有焊堵', '', 'webserver'),
(264, 8, '焊炬点火,停火顺序', '1.点火,打开液化气瓶阀,打开氧气瓶阀,先打开焊枪燃气点火,慢慢调焊枪氧气到合适\r\n2.停火,先关焊枪氧气,再关液化瓶气阀,再关焊枪燃气开关,再关氧气瓶阀', '', 'webserver'),
(271, 8, '冰箱维修步骤', '1. 9成以上缺氟就是漏气\r\n2. 不管冰箱是否有雪种,切开干燥过滤器和毛细管焊接处(切开哦不要焊,安全)\r\n3. 启动压缩机吹干净从冷凝器里的雪种(安全方法)\r\n4. 焊封住毛细管,回气管焊接单向阀,然后连接压力表三通阀,连接外置打压机,打0.8MPA,观察两个小时左右\r\n5. 压缩机工艺管焊接单向阀(加雪种抽真空用)\r\n6. 压力正常直接外挂冷凝器,否则要开背修了!\r\n7. 焊接点要圆润光滑\r\n8. 充制冷剂时要慢慢的充!\r\n9. 30分钟内压缩机回气管必须要结露,不然很可能有,冰,脏,堵现象!\r\n10. 如果压缩机 出现嗡 停一秒 嗡 停一秒 反复这样肯定就是冰堵严重了!\r\n11. 冰堵就要连续带雪种抽两到三次真空,抽真空时用电热吹风吹一下干燥过滤器!\r\n12. 真空泵,抽真空最少20分钟左右', '', 'webserver'),
(272, 8, '打压检漏', '一般常用压缩机打压,也有用氮气打压,千万不能用氧气打压,氧气遇油会爆炸', '', 'webserver'),
(273, 8, '空调压缩机参数', '正常运行有5.3A交流电流\r\n空载电流在3.2A左右', '', 'webserver'),
(275, 10, '风扇维修步骤', '1. 在未通电状态下,用镙丝刀推动一下扇叶,看是否灵活!(卡住,电机就上机油)\r\n2. 手握风扇塑料,用手去感觉,是否点击开启后有轻微抖动,同时用耳朵注意听是否有交流声!(如有更换电容)\r\n3. 没有任何反应,拆开风扇,定时器开启,测量是否导通,(不导通更换定时器)\r\n4. 焊开电容一脚,用数字万用表测量一下电容值(电容容量正常,更换风扇电机)', '', 'webserver'),
(278, 2, '时而按键失灵时而正常', '更换78L05不行再更换470UF电解电容', '', 'webserver'),
(279, 4, '波轮洗衣机边进水边自动放水', '拆开底下管子，里面应该是有什么异物卡住了！', '', 'webserver'),
(280, 10, '遥控风扇(遥控都正常,电机不转)', '拆开电路板测量双向可控硅两脚是否短路!如短路更换可控硅\r\n通电测量交流电压,在操作123档时分别测量对应档位是否有220V电压\r\n对应三档档位中只能有一个档位有220V电压为电路正常,电路正常更换电机就好了', '', 'webserver'),
(290, 7, '没有活动分区的固态硬盘', '固态硬盘是新的GPT分区表格式，没有活动分区\r\n指定EPS一个分区盘付,然后用U修复把引导信息写到ESP分区', '', 'webserver'),
(291, 1, '间断1秒反复加热', '1.查检锅回路有无虚焊 \r\n2.查功率管\r\n更换->5UF->0.33UF->2UF->8050 8550三极管或贴片3904 3906                        ', '', 'webserver'),
(294, 7, '启动电脑,CPU转了两秒就停了', '重新擦干净一下内存条,重插一下CPU,不行直接更换电脑电源试下', '', 'webserver'),
(296, 2, '当按下煮饭键后,显示板熄灭后无反应', '供电主板上更换稳压二极管,或开关二极管,不行就把三极管全换了', '', 'webserver'),
(298, 1, '开启一切显示都正常，就是不加热', '更换开关二极管4148和18v稳压二极管，更换8050 8550,不行更换LM339', '', 'webserver'),
(300, 1, '间断2秒反复加热', '首先在插电源的时候仔细听一下,电磁炉有没有18v风扇运行两秒后停止 \r\n如果有,那就是CPU有问题了,不用再检测了', '', 'webserver'),
(302, 1, '加热很慢', '先更换电容5UF，故障依旧,更换0.33UF，2UF更换后故障依旧, \r\n更换推动管8050 8550三极管或贴片3904 3906 等三极管,看下周边有没有虚焊的电容,故障排除', '', 'webserver'),
(303, 2, '感温电阻', '阻值为74.5K 到100K', '', 'webserver'),
(305, 1, '加热很慢(间歇性加热),按键开关时而失灵', '按键开关是好的状态下 \r\n更换功率管(功率管线性不好,这种状态下测量不出好坏)', '', 'webserver'),
(307, 7, '播放视频中不定时声音卡顿,振荡卡顿', '更换电脑硬盘,为保护电脑硬盘养成完全关机后再拔电源', '', 'webserver'),
(308, 2, '按键显示正常,不加热', '在按下煮饭键后,仔细听一下没有有继电器吸合声,如没有,更换驱动三极管8050或继电器', '', 'webserver'),
(309, 1, 'E0故障代码', '更换一下5UF/400V电容\r\n补焊大线圈电感\r\n不行的话 更换电源 IC 更换完成后\r\n用万用表测量一下5678脚对3.4脚的正反向电阻是否为短路，短路说明IC是坏的\r\n小功率电阻 200k 检查一下是否开路', '', 'webserver'),
(317, 1, 'E9故障代码', '检查。检锅回路电阻。5uf/400v电容', '', 'webserver'),
(318, 1, '能开机,无法关机', '能开机说明面板单片机没有问题,(之前更换过单片机也一样),更换主板上78L05,故障排除', '', 'webserver'),
(319, 1, '只能开关机,别的按键都失灵', '电磁炉电感线圈可能脱焊了', '', 'webserver'),
(320, 1, '加热一段时间后故障e3', '更换8脚电源芯片', '', 'webserver'),
(321, 1, '按开关键后，按键无效', '仔细观察一下,开机后屏幕显示在哪个档位,故障原因为个别按键开关粘合,导致开机后按键失效', '', 'webserver'),
(322, 1, '按开机键后E7', '检测推动三极管周围的电阻,或三极管有问题,可以在线测量,(查看电阻阻值,在线测量如果阻值大于标识拆下来测量),', '', 'webserver'),
(323, 7, '主机里面风扇呼呼响', '风扇坏了，更换CPU风扇', '', 'webserver'),
(324, 1, '面板按键失效', '补焊->清洁->更换IC->更换78l05', '', 'webserver'),
(333, 1, '按键有效果,但时而没有加热', '更换电源IC', '', 'webserver'),
(493, 2, '旋钮带电源驱动定时器', '插电就自动加热，触动压力开关动作后，跳到保压保温指示灯后，这时定时器电机才有供电，开始计时回旋，如中途压力不够会跳回加热，直到压力够了，又回保压保温，直到回到定时器起点，不会跳回加热为正常.更换定时器时按原来接线即可.', '', 'webserver'),
(497, 4, '波轮洗衣机只一个方向转动', '用钳表分别测量电脑板控制电机的两根控制线,在电流声间隔响声中,交流电流会随着一升一归0说明电脑板正常,更换电容故障排除', '', 'webserver'),
(521, 1, '电磁炉漏电相关', '电磁炉正常状态插电后没有按键启动,这时用220v电笔是不亮的,启动后用电笔测量会有一点暗亮是正常现像,如果很亮是真的漏电了', '', 'webserver'),
(523, 32, '汽车发动机调气门', '标准间隙排气的0.25毫米进气的0.20毫米\r\n顶筒的看筒内数字加+测量间隙再-标准间隙=新顶筒内数字厚度', '', 'webserver'),
(525, 32, '发动机油水混合', '有微型摄像机可以塞进火花塞查看气缸内部问题\r\n如果气门被顶,拆开发动机更换气门,调气门,活塞被顶坏了就更换活塞\r\n更换缸垫,更换水堵(很重要)', '', 'webserver'),
(527, 32, '清洗废机油', '用柴油或汽油清洗，化油器成本太高', '', 'webserver'),
(531, 32, '更换发动机缸垫 ', '直径大于缸头宽度的大砂轮片,厚度10毫米以上\r\n\r\n把缸头放水平整,从缸头 前双手用力向缸尾推\r\n\r\n再跑到缸头尾 双手用力向缸头前推,如此往复\r\n\r\n来回一共60次,即每边30次看到表面都被磨过即可\r\n\r\n如果是高温多次的缸体也要磨一次,往返一共30次即可', '', 'webserver'),
(533, 32, 'b12发动机凸轮轴固定标记', 'E0到E4代表排气\r\n1I到4I(不是11到41)为进气', '', 'webserver'),
(535, 32, '汽车发动机调气门', '标准间隙排气的0.25毫米进气的0.20毫米\r\n顶筒的看筒内数字加+测量间隙再-标准间隙=新顶筒内数字厚度\r\n排气最小不低于0.2毫米,最大不能超过0.4毫米\r\n进气最低就是有间隙就行,最大不能超过0.3毫米', '', 'webserver'),
(539, 32, '发动机抖动', '1.查看点火顺序连接是否正确\r\n2.缺缸运行检测,在运行的状态下,分别拔下连接火花塞的点火胶套,如果拔出后,发动机没有任何变化,此缸有问题\r\n3.在运行状态下,测量喷油嘴供电电源应有5v左右\r\n4.拔下喷油嘴,稍拔出点,在启动试机状态下,看喷油出口壁是否有油水印为正常', '', 'webserver'),
(541, 32, '正常发动机关闭发动机后会有吸气声', '正常发动机关闭发动机后会有吸气声', '', 'webserver'),
(545, 32, '发动机启动咔咔声,有时启动几次才成功', '两种原因\r\n1.电瓶老化,或者亏电\r\n2.启动器旁边的电磁开关或者继电器接触不良,拆下清理灰尘即可,时间太长的话连同启动马达一起清理灰尘', '', 'webserver'),
(547, 32, '装正时链条时,注意事项', '固定正时的螺丝不能拧太紧很容易断开\r\n正时没有对上千万不能转动曲轴,以免顶到气门\r\n装完后记得在正时链条和涨紧器上放机油润滑\r\n装好后,面朝正时链接条顺时针转动几圈,应有气缸气体压缩阻力感,能转动说明没有顶到气门,OK了', '', 'webserver'),
(549, 32, '更换排气管', '排气管连接是一个橡胶,拆时在橡胶上涂点机油,然后用长柄镙丝刀翘开', '', 'webserver'),
(551, 32, '变速箱齿轮油不可用发动机油替换', '手头上没齿轮油，变速箱加发动机机油暂时顶用最好不要超过50公里应马上换为齿轮油，这时排出来的油应该是黑色的了，如果是齿轮油几公里都是黄色的。', '', 'webserver'),
(557, 32, ' 更换水箱宝(防冷液)', '1.水箱散热铝片下面有个塑料镙丝,逆时针拆转动取下来,排出里面的水\r\n\r\n2.节温器拆下排水排锈渣,然后装好(记得放点防油胶水)\r\n\r\n3.水箱加入水超过标记处两指\r\n\r\n4.找到排空气镙丝,逆时针松开排空气(会听到吱吱气流声)直到镙丝有水出来就拧紧\r\n\r\n5.空档启动车子20秒左右,然后再找到排空气镙丝,再次排空气', '', 'webserver'),
(563, 32, '更换轮胎镙丝', '有的车子前后轮镙丝是有区别的\r\n如果放不进镙丝的话,试下在镙丝头旁边切一刀,就可以放进去了\r\n后轮镙丝能直接拆拿出来的话,装上去时把轮盘后面4个镙丝拆了,用个长的镙丝或镙丝刀,从后面镙丝口伸进来敲好新镙丝', '', 'webserver'),
(567, 32, '更换碟刹车片', '1.把轮胎拆下后,把刹车油管固定的U型卡扣拆下 \r\n\r\n2.用一字镙丝刀,杠杆顶缩回油钳活塞,拧下固定刹车片镙丝,转动方向盘配合把油钳拆下\r\n\r\n3.把刹车片旧的拆下换新,装回油钳,拧紧镙丝 \r\n\r\n4.转动轮盘,如有卡紧现象,把排油镙母拧松放油,直到轮盘轻松转动为止,拧紧排油镙母,装回轮胎 \r\n\r\n5.在启动车子后踩刹车不太灵,踩很深才有点效果,管里有空气引起的.顶起车子,把排油镙母拧松滴油为止,把刹车油壶帽打开,然后启动车子,深踩5到6次刹车使刹车油跟空气一起喷出来,拧紧排油镙母', '', 'webserver'),
(569, 32, '鼓刹片与碟刹片', '一部分车，前碟刹后鼓刹，一般换两次碟刹后即第三次换碟刹时才连同鼓刹一起换。\r\n\r\n一般大货车都是鼓刹的多', '', 'webserver'),
(573, 12, '液晶电视开机后约2分钟左右就自动黑屏', '判断为电源升压电路故障或灯管问题,从故障发作时间很短判断是电路问题更换电源升压板后,故障排除', '', 'webserver'),
(577, 4, '波轮洗衣机进水同时,排水管也出水', '1.先在断电状态下倒两勺水进去,看排水口是否有水出来\r\n2.如果排水口这时有水出来,那么就是排水口有异物卡住了排水阀使它关不紧\r\n3.拧开排水阀塑料镙母,这个角度看不到里面的情况,用手机拍照看一下里面的异物.取出异物即可\r\n', '', 'webserver'),
(579, 7, 'usb供电不足', '电脑电源老化更换好的电脑电源\r\n电源要选择CPU座旁有8口插座,即两条电源供电的,平常只要插一条也能点亮,但是如果供电不足最好是两根的都插', '', 'webserver'),
(581, 7, '主机开机无任何反应', '1.拔下电源开关线,万用表测量一下开关按键是否正常\r\n2.通电状态下,用镙丝刀直接短路主板电脑开关一,从个脚\r\n3.把BIOS电池取下,短接正负极放电,然后重新开机\r\n4.cpu拆了重装->更换电源->更换主板\r\n', '', 'webserver'),
(597, 55, '油条利润计算', '面粉/2元\r\n泡多源 15g(500g17元 每克0.034元)0.51元\r\n油条膨松剂 5g(400g 10元 每克0.025元) 0.125元\r\n食盐 8g \r\n色拉油 10g (500g 3元 每克0.006) 0.06元\r\n鸡蛋 0.5个 一个0.5元半个0.25元算\r\n油炸损耗3元\r\n面粉2元+1元<泡多源+膨松剂+食盐+色拉油+ 半个鸡蛋>=3元\r\n3元+油炸损耗3元=6元 每斤面至少要做出13根油条=13元\r\n13-6元=7元-1元电费燃气费=6\r\n一斤面至少要做出13根油条,不然是赚不到钱的', '', 'webserver'),
(599, 55, '豆浆利润计算', '大豆每斤3元左右\r\n1g水=1.166ml水\r\n1ml豆浆放0.08g白糖\r\n1杯豆浆放满是350ml留点空为320ml\r\n1斤(500g)大豆做9斤(4500g)豆浆\r\n那么4500g豆浆就是*1.166=5247ml\r\n5247ml / 320ml=16.39杯\r\n1杯子 1吸管费=0.1元成本费\r\n16杯=16元 -1.6元杯费=14.4元\r\n5247ml * 0.08=420g白糖(每斤4元算) =3.4元\r\n14.4-3.4=11 -3元/斤大豆=8元\r\n8-2元电费=6元利润\r\n一斤豆至少要做出9斤豆浆不然是赚不到钱的', '', 'webserver'),
(601, 55, '豆浆与油条配对制作量', '1斤大豆=16杯豆浆\r\n1斤面粉=13根油条\r\n2斤面=26根油条\r\n500g/16杯=31.25g 每杯需要的大豆量\r\n31.25g *26=812.5g /500= 1.625斤大豆', '', 'webserver'),
(603, 8, '冰箱维修', '1. 9成以上缺氟就是漏气\r\n2. 不管冰箱是否有雪种,距干燥过滤器8CM外切开毛细管(切开哦不要焊,安全)\r\n3. 启动压缩机吹干净从冷凝器里的雪种(安全方法)\r\n4. 封口钳封住低压路毛细管(封口钳能封住毛细管,别的封不紧)\r\n5. 启动自身压缩机抽真空20分钟左右,观察连接冷凝器刚切开的毛细管\r\n6. 如果有气出来说明是低压漏,如果没有气出来是高压漏(这个方法微漏不准确)\r\n7.留2个小时后把封号钳去掉让毛细管流通,这时有气流声说明低压正常\r\n8.压缩机连接冷凝器的管路不要割拆压缩机口,要留一段长度进行割焊(非常重要)', '', 'webserver'),
(605, 8, '氧焊技巧', '氧焊分三种火焰温度以小到大排列，碳化焰(三层火焰，中焰长），中性焰(三层火焰，短中焰锥形)，氧化焰(两层火焰，没有中焰且有强烈嘶嘶声)\r\n三种火焰又分大小，就是说虽然都是中性焰但是燃气，氧气开得大的中性焰温度比小的中性焰的温度差别很大(技巧就在这调大小中性焰)！\r\n焊接时用中性焰的中间火焰或内焰吹焊条，吹熔化的铜水，使均匀填在连接处，马上移开火焰', '', 'webserver'),
(607, 1, '开启就报警且没有加热效果,面板灯有微闪', '更换5UF', '', 'webserver'),
(748, 72, '燃气热水器点火器停止点火后就熄灭', '更换感应针,不行再更换煤气磁控阀', '', 'webserver'),
(890, 32, '手动变速箱1档2档挂不进', '检查挂档杆两线的固定镙母是否松动', '', 'webserver'),
(894, 12, '更换背光灯条步骤与注意事项', '仔细用电筒看一下屏幕表面，有内印不必修屏幕坏了\r\n液晶屏非常非常非常脆弱，一点不均匀平放都会使整个屏报废。\r\n拆开屏幕与主板连接线，\r\n准备一个可以平整而且无尘桌子（拆开后放屏幕用）\r\n把屏幕塑料框边的螺丝拆完\r\n带上塑料手套，防手摸到反光板弄脏了\r\n准备两条木条，屏幕左4分之1和右边4分之1分别竖放，用透明宽胶带粘屏幕跟木条，双手轻拉两木条取出屏幕', '', 'webserver'),
(898, 5, '微波炉只有下面底盘不转别的都正常', '更换220v转盘电机', '', 'webserver'),
(909, 1, '插电有滴声且面板亮一下就熄，之后按键无效', '把面板拆下来用水冲洗，刷子刷一下。\r\n电热吹风吹干\r\n把所有开关都更换。\r\n一般为开关潮湿漏电导致', '', 'webserver'),
(913, 72, '燃气灶更换点火时注意事项', '把两个风门关了，不然不易点火', '', 'webserver'),
(915, 4, '波轮洗衣机，进水排水都正常，不能洗衣服', '进水满后，有电机交替嗡嗡声就是不转，更换电机电容', '', 'webserver'),
(917, 4, '滚筒,更换电脑板,进水没动作,开机几秒后报警', '首先电脑板是新的可以排除问题\r\n进水阀没有动作.断电状态下测导线是否导通\r\n如导通以下操作\r\n查看门锁开关是否正常,可以短接的形式启动看\r\n短接开机正常,更换门锁开关\r\n', '', 'webserver'),
(941, 12, '开机无图像，检修', '拆开拔掉灯管连接线，用灯管测试仪加电，记得正负极别搞反，\r\n如果能点亮一般为电源板问题，不亮为灯管', '', 'webserver'),
(943, 4, '维修滚筒洗衣机注意事项', '更换电脑板前，一定要检查门锁是否短路，最后跟门锁一齐换了', '', 'webserver'),
(945, 20, '卷闸门直流电机原理', '2黑粗线 1黑细线 2红粗线 1红细线 1白细线 一共七根线 \r\n2黑粗是一条线 2红粗是一条线 是连接直流电机 剩下 1红1黑1白细线 可以通过 短接限位器开关的一个上升或下降接线, \r\n然后直流电压档,测量粗红 粗黑在遥控时看是否有电压,如果没有,说明故障在控制器\r\n24v直流电机电阻为1欧', '', 'webserver'),
(947, 20, '卷闸门限位器', '直流电机旁边有一个限位总成,用来调最低,最高的位置\r\n限位器有4条线连接进去,里面有两个触点开关 4根线分别人白白绿绿,其中白白连接\r\n一个触点开关,绿绿连接另一个触点开关\r\n限位器,红细线连接限位器绿线白线,另外两组,白白,黑绿\r\n红细线是带24v电压的,正常状态正是导通的,只触片开关闭合时是断开的\r\n限位器为达到限制位置时,断开. 即上升或下降达到触点断开连通,连接芯片正电压,这时继电器开路', '', 'webserver'),
(951, 20, '卷闸门手机遥控驱动电路图', '双六脚一开一断继电器', './public/upfiles/images/reply/IMG_20190623_091824.jpg', 'webserver'),
(953, 7, '笔记本电脑装系统时不认U盘', '把读卡器换成usb3.0就行了', '', 'webserver'),
(964, 1, '电磁炉线圈盘接法', '螺旋外圈接功率管C极', '', 'webserver'),
(1127, 10, '遥控电风扇不通电', '测量105j400v降压电容,测量5.6v1w稳压二极管，如果保险丝烧断了。后路有短路，记得检查一下可控硅1-3脚是否短路', '', 'webserver'),
(1297, 4, '滚筒洗衣机7脚门锁测量好坏', '左4右3面向，5,6脚252欧。6,7脚248欧\r\n5,7脚应该是两个之合502殴左右', '', 'webserver'),
(1488, 4, '滚筒洗衣机排水阀阻值', '滚筒洗衣机排水阀阻值在170欧左右为正常，测到地电阻为无穷大为正常', '', 'webserver'),
(1489, 4, '滚筒洗衣机三脚门锁检测好坏', '1和3脚有200多欧，推开推卡，1和2脚导通为正常', '', 'webserver'),
(1490, 7, '固态硬盘分区 esp msr分区方法', '创建第一个分区时esp msr都默认\r\n然后在之后的分区c盘上装系统,装好系统\r\nUEFI修复一下,记得esp指定一个分区一般都是指派最后一个分区名', '', 'webserver'),
(1679, 160, 'linux 服务器设置', '\r\nsudo passwd root //设置root密码\r\n密码\r\n密码\r\nsu root //登陆root\r\n//配置 ssh权限\r\nvi /etc/ssh/sshd_config\r\n\r\nLoginGraceTime 2m\r\nPermitRootLogin yes\r\n//把#号去掉,保存退出\r\n---------------------------------------------------\r\n//更新系统\r\napt-get update\r\n\r\n--------------------安装mysql ------------------------\r\nsudo apt-get install mysql-server mysql-client\r\n\r\n//设置 mysql 可以外网访问\r\nsudo vim /etc/mysql/mysql.conf.d/mysqld.cnf\r\nbind-address前添加 #注释掉该行\r\n\r\n//还没设置前用户不需要密码\r\nsudo mysql -uroot -p //回车 \r\n//远程访问数据库\r\nupdate mysql.user set host=''%'';\r\nflush privileges;\r\n//更改密码\r\nALTER USER ''root''@''%'' IDENTIFIED WITH mysql_native_password BY ''qq282246101'';\r\nflush privileges;\r\nexit\r\n------------------------------------------------------\r\n//杀死之前的相关进程\r\nps -e|grep apt-get \r\n//安装gcc\r\napt install gcc\r\n------------------------------------------------------\r\n//支持程序关机\r\nchmod 4777 /sbin/shutdown\r\n------------------------------------------------------\r\n//校准时间\r\nsudo dpkg-reconfigure tzdata\r\nAsia\r\nshanghai\r\n//查看时间是否准确\r\ndate \r\n//安装,设置开机同步时间\r\napt install ntpdate\r\ncrontab -e\r\n@reboot ntpdate ntp.ubuntu.com\r\n@reboot sleep 3; cd /opt/website; nohup ./main &\r\n------------------------------------------------------\r\n# 安装redis\r\nsudo apt install redis-server\r\n# 配置\r\nsudo vim /etc/redis/redis.conf\r\n# 找到 supervised 设置为 systemd\r\nsudo service redis restart  # 重新加载Redis服务文件\r\nsudo systemctl status redis # 查看 Redis 的运行状态\r\n# 一些操作\r\nsudo service redis start  # 启动\r\nsudo service redis stop  # 关闭\r\nsudo service redis restart  # 重启\r\nredis-cli  # 客户端连接\r\n# 远程连接 \r\nsudo vi /etc/redis/redis.conf\r\n# 将 bind 127.0.0.1 ::1 改为 bind 0.0.0.0\r\nsudo service redis restart  # 重启\r\n# 设置密码\r\nsudo vi /etc/redis/redis.conf\r\n# 设置：requirepass 自己的密码\r\n默认端口6379\r\nredis-server /etc/redis/redis.conf --test 用于找出配置错误', '', 'webserver'),
(1685, 160, ' php也能执行关机命令shutdown 网卡ifconfig', '//root用户登陆\r\nchmod 4755 /sbin/shutdown\r\n\r\nchmod 4755 /sbin/ifconfig\r\n          ', '', 'webserver'),
(1689, 160, 'ubuntu 18 设置wifi开机自动连接', 'apt install wireless-tools\r\n安装完后，就可以使用iwconfig按下面步骤设置无线网络了\r\niwconfig wlan0 power on\r\nifconfig wlan0 up\r\niwconfig wlan0 essid "无线名称"\r\n//然后使用wpa_passphrase生成无线密钥\r\nsudo -i \r\nwpa_passphrase 无线名称 密码 > /etc/wpa_supplicant.conf\r\nvim /etc/wpa_supplicant.conf\r\n//里面应该有大致以下内容\r\nnetwork={\r\n        ssid="my_network"   #注意ssid名区分大小写。\r\n        proto=RSN           #Robust Security Network:强健安全网络，表示这个网络配置比WEP模式要更安全。\r\n        key_mgmt=WPA-PSK    #请无论你是使用WPA-PSK，WPA2-PSK，都请在这里输入 WPA-PSK。这在wpa_supplicant看来WPA-PSK，WPA2-PSK都是 WPA-PSK\r\n        pairwise=CCMP TKIP  #关键点，wpa_supplicant目前还不认AES的加密标准\r\n        group=CCMP TKIP     #同上\r\n        psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515 #wpa_supplicant算出来的加密密码。\r\nchmod +wrx /etc/wpa_supplicant.conf\r\n//以上配置文件设置完成后，接下来手动应用配置\r\n//为了开机自动开启wifi，需要将启动脚本加到自动执行服务中，首先在/etc/rc.local中加入如下脚本：\r\n#!/bin/bash\r\nip link set wlan0 up && killall wpa_supplicant && wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf &&\r\ndhclient wlan0\r\nexit 0\r\nchmod a+x /etc/rc.local\r\n然后编辑 /lib/systemd/system/rc-local.service加入如下配置：\r\n[Unit]\r\nDescription=/etc/rc.local Compatibility\r\nDocumentation=man:systemd-rc-local-generator(8)\r\nConditionPathExists=/etc/rc.local\r\nAfter=network.target\r\n\r\n[Service]\r\nType=forking\r\nExecStart=/etc/rc.local start\r\nTimeoutSec=0\r\nRemainAfterExit=yes\r\nGuessMainPID=no\r\n[Install]\r\nWantedBy=multi-user.target\r\nAlias=rc-local.service\r\n\r\nsystemctl enable rc-local.service\r\nsystemctl disable rc-local.service\r\nsystemctl start rc-local.service\r\nsystemctl status rc-local.service\r\n如下内容为成功了\r\n● rc-local.service - /etc/rc.local Compatibility\r\n   Loaded: loaded (/lib/systemd/system/rc-local.service; enabled; vendor preset: enabled)\r\n  Drop-In: /lib/systemd/system/rc-local.service.d\r\n           └─debian.conf\r\n   Active: active (running) since Fri 2019-10-25 16:03:17 UTC; 26min ago\r\n     Docs: man:systemd-rc-local-generator(8)\r\n  Process: 1621 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)\r\n    Tasks: 2 (limit: 1056)\r\n   CGroup: /system.slice/rc-local.service\r\n           ├─1627 wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf\r\n           └─1647 dhclient wlan0\r\n//重启\r\nreboot ', '', 'webserver'),
(1691, 160, 'ffmpeg', 'ffmpeg -i 查看 视频文件属性\r\n1.pass1编码\r\n\r\nffmpeg -i 01.rmvb -an -vcodec libx264 -b 560k -pass 1 -f mp4 -y 新名.mp4\r\n\r\n-acodec libfaac output.aac 音频编码 aac\r\n-an : 不编码音频\r\n-vcodec : 设置视频的编码，我这里使用的是x264\r\n-b : 这个是码率\r\n-f : 强制使用格式\r\n-y : 自动输y确认\r\nNUL : 因为是pass1 所以不需要输出文件，直接用NUL\r\n\r\n2.pass2编码\r\n\r\nffmpeg -i 01.rmvb -acodec copy -vcodec libx264 -b 560k -pass 2 -f mp4 01.mp4\r\n\r\n因为现在很多rmvb的音频部分都是aac编码的，所以可以直接用-acodec copy复制音频部份\r\n3、针对某些文件的参数调整\r\n\r\n有些rmvb或着mkv之类的分辨率比较高，所以传到itouch需要调整一下。在ffmpeg里面可以用-s参数:\r\n\r\nffmpeg -i 01.rmvb -acodec copy -vcodec libx264 -b 560k -s 960x640 -f mp4 01.mp4\r\n\r\n960x640需要自己计算一下，按比例进行调整\r\n\r\n按时间截取:\r\n\r\nffmpeg -i 01.rmvb -acodec copy -vcodec libx264 -b 560k -ss 00:00:00 -t 00:01:00 -f mp4 01.mp4\r\n\r\n设置B-frame对动画片有些好处，2pass的时候不是很明显，1pass的比较明显:\r\n\r\nffmpeg -i 01.rmvb -acodec copy -vcodec libx264 -b 560k -bf 6 -f mp4 01.mp4\r\n\r\n', '', 'webserver'),
(1700, 160, 'ceate_ap开启热点', 'ifconfig wlan0 up\r\n//安装依赖库\r\nsudo apt-get install hostapd\r\nsudo apt-get install network-manager\r\nsudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq\r\n//也可以QQ云盘里下载create_ap-master.zip再安装\r\nsudo git clone https://github.com/oblique/create_ap\r\ncd create_ap\r\nsudo make install\r\n//临时启用热点 360xyz是wifi名  qq282246101是密码\r\n//sudo create_ap wlan0 eth0 360xyz qq282246101\r\n\r\n//修改 create_ap.service 服务功能的配置\r\nsudo vim /etc/create_ap.conf\r\n————————WiFi 2.4g 只需要改这三项————————\r\n//固定设置自己的 GATEWAY（网关）、SSID（热点名）、PASSPHRASE（密码）\r\nGATEWAY=???\r\nSSID=???\r\nPASSPHRASE=???\r\n\r\n//防止它人连接WIFI\r\nMAC_FILTER=0    //1代表使用MAC过滤\r\nMAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept   \r\n// 创建hostapd.accept 文件 这个文件存MAC地址，有地址才能访问网络\r\ntouch /etc/hostapd/hostapd.accept\r\ncd /etc/hostapd\r\nchmod ugo+x hostapd.accept\r\nvi hostapd.accept\r\n6a:e4:07:75:d2:ee  #我的手机\r\n5a:ab:53:13:82:98  #小罗手机\r\nd0:fa:1d:11:a1:8f   #360摄像头\r\n\r\n—————---WiFi 5G 配置增加如下修改——————---\r\n//149信道是5G信道\r\nCHANNEL=149 \r\nIEEE80211N=1\r\nIEEE80211AC=1\r\nCOUNTRY=US  \r\n\r\n\r\n//设置服务开机启动。\r\nsystemctl enable create_ap.service\r\n//查看服务是否开机启动。\r\nsystemctl is-enable create_ap\r\n\r\n# 启动服务：\r\nsystemctl start create_ap\r\n# 关闭服务：\r\nsystemctl stop create_ap\r\n# 重启服务：\r\nsystemctl restart create_ap\r\n# 显示服务状态：\r\nsystemctl status create_ap\r\n# 禁用服务开机启动：\r\nsystemctl disable create_ap.service\r\n//连接有线网络就是无线中继器,断开有线就是独立AP\r\n\r\n//设置发射功率 调小\r\nsudo iwconfig wlan0 txpower 5\r\nsudo create_ap --fix-unmanaged', '', 'webserver'),
(1701, 72, '燃气热水器火烧黑旁边', '用空压机吹通里面火路的灰尘', '', 'webserver'),
(1908, 160, 'Ubuntu下卸载nginx', 'sudo apt-get remove nginx nginx-common # 卸载删除除了配置文件以外的所有文件\r\nsudo apt-get purge nginx nginx-common # 卸载所有东东，包括删除配置文件\r\nsudo apt-get autoremove # 在上面命令结束后执行，主要是卸载删除Nginx的不再被使用的依赖包\r\nsudo apt-get remove nginx-full nginx-common #卸载删除两个主要的包。', '', 'webserver'),
(1909, 160, 'ubuntu 重装php7', '一、删除php的相关包及配置\r\n    sudo apt-get autoremove php7*\r\n二、删除关联\r\n    sudo find /etc -name "*php*" |xargs  rm -rf\r\n三、清除dept列表\r\n    sudo apt purge `dpkg -l | grep php| awk ''{print $2}'' |tr "\\n" " "`', '', 'webserver'),
(1923, 20, '卷闸门MQTT', '#include <ESP8266MQTT.h>\r\n//#include <ESP8266WiFi.h>\r\n//#include <PubSubClient.h>\r\n#include <ArduinoJson.h>\r\nint open = 5;\r\nint close = 4;\r\n\r\nint d5 = 14;\r\nint d6 = 12;\r\n\r\n//开关状态\r\nString doorstate;\r\n\r\nint i = 0;\r\n\r\n//网络连通 y否则n\r\nString network = "y";\r\n\r\nvoid onConnectionEstablished();\r\n\r\nESP8266MQTT client(\r\n  "www.360xyz.cn",             // Wifi ssid\r\n  "qq282246101",             // Wifi password\r\n  "WO9H67HZ0V.iotcloud.tencentdevices.com",    // MQTT broker ip\r\n  1883,               // MQTT broker port\r\n  "WO9H67HZ0Vdoor1_kfb;12010126;8X9SI;1642803630",              // MQTT username\r\n  "5582a4e48efbebc6748cbbe2d57a44d1041ff1fb8201af52a41babc7c2a08488;hmacsha256",         // MQTT password\r\n  "mydoor1",            // Client name\r\n  onConnectionEstablished, // Connection established callback\r\n  true,               // Enable web updater\r\n  true                // Enable debug messages\r\n);\r\n\r\nvoid setup() {\r\n  Serial.begin(19200);\r\n  pinMode(open, OUTPUT);\r\n  pinMode(close, OUTPUT);\r\n\r\n  //pinMode(stop, OUTPUT);\r\n  pinMode(d5, INPUT_PULLUP);\r\n  pinMode(d6, INPUT_PULLUP);\r\n  digitalWrite(open, LOW);\r\n  digitalWrite(close, LOW);\r\n\r\n}\r\n\r\nvoid onConnectionEstablished() {\r\n  // 订阅主题并且将该主题内收到的消息通过串口发送\r\n  client.subscribe("WO9H67HZ0V/door1_kfb/control", [](const String & payload) {\r\n    Serial.println(payload);\r\n    DynamicJsonDocument  jsonBuffer(200);\r\n    deserializeJson(jsonBuffer, payload);\r\n    JsonObject root = jsonBuffer.as<JsonObject>();\r\n    String user = root["user"];\r\n    String state = root["state"];\r\n    //限位开关导通时为低电平表明还没有达到限位 能正常下降,断开为高电平表明达到限位了\r\n    if (digitalRead(d6) == LOW) {\r\n      if (state == "0" && state != "max_down") {\r\n        //关 下降\r\n        Serial.println("关 下降");\r\n\r\n        digitalWrite(open, LOW);\r\n        delay(200);\r\n        digitalWrite(close, HIGH);\r\n        //腾讯云 设置好了发布必须为json\r\n        client.publish("WO9H67HZ0V/door1_kfb/event", payload);\r\n      }\r\n    }\r\n    //限位开关导通为低电平 表明还没有达到限位 能正常上升,断开为高电平表明达到限位了\r\n    if (digitalRead(d5) == LOW) {\r\n      if (state == "1" && state != "max_up") {\r\n        //开 上升\r\n        Serial.println("开 上升");\r\n\r\n        digitalWrite(close, LOW);\r\n        delay(200);\r\n        digitalWrite(open, HIGH);\r\n        client.publish("WO9H67HZ0V/door1_kfb/event", payload);\r\n      }\r\n    }\r\n\r\n    if (state == "2") {\r\n      //停\r\n      //每次状态改变的第一次执行 向服务器返回操作成功响应\r\n      //如果已经在上限或下限时只更新响应时间\r\n      if (state == "max_down" || state == "max_up") {\r\n        if (state == "max_down") {\r\n          Serial.println("max_down 停");\r\n\r\n          delay(200);\r\n          // 向某个主题发送消息\r\n          client.publish("WO9H67HZ0V/door1_kfb/event", "max_down");\r\n        } else {\r\n          Serial.println("max_up 停");\r\n\r\n          delay(200);\r\n          // 向某个主题发送消息\r\n          client.publish("WO9H67HZ0V/door1_kfb/event", "max_up");\r\n        }\r\n\r\n      } else {\r\n        Serial.println("停");\r\n\r\n        digitalWrite(open, LOW);\r\n        digitalWrite(close, LOW);\r\n        delay(200);\r\n        // 向某个主题发送消息\r\n        client.publish("WO9H67HZ0V/door1_kfb/event", payload);\r\n      }\r\n    }\r\n\r\n    //硬重启系统(系统运行太久定期重启)\r\n    if (state == "9") {\r\n      client.publish("UDUWVDFKFZ/mydoor1/event", "restart exec ok");\r\n      ESP.reset();\r\n    }\r\n\r\n    //Serial.println(payload);//此处可以编写一个函数来代替\r\n  });\r\n\r\n}\r\n\r\nvoid loop() {\r\n  client.loop();\r\n\r\n  //操作运行时 上升达到限位了,限位开关断开\r\n  if (digitalRead(d5) == HIGH && doorstate != "max_up") {\r\n    //Serial.println("上升达到限位");\r\n    digitalWrite(open, LOW);\r\n    delay(500);\r\n    doorstate = "max_up";\r\n  }\r\n  //操作运行时 下降达到限位了,限位开关开路\r\n  if (digitalRead(d6) == HIGH && doorstate != "max_down") {\r\n    //Serial.println("下降达到限位");\r\n    digitalWrite(close, LOW);\r\n    delay(500);\r\n    doorstate = "max_down";\r\n  }\r\n  //即没有上限也没有下限状态\r\n  if (digitalRead(d5) == LOW && digitalRead(d6) == LOW) {\r\n    doorstate = "";\r\n  }\r\n\r\n\r\n}', '', 'webserver'),
(2145, 20, 'arduino json解析,创建', '//payload 是json   \r\n DynamicJsonDocument  jsonBuffer(200);\r\n    deserializeJson(jsonBuffer, payload);\r\n    JsonObject root = jsonBuffer.as<JsonObject>();\r\n    const char* user = root["user"];\r\n    const char* date = root["date"];\r\n    int state = root["state"];', '', 'webserver'),
(2146, 20, 'AP模式', 'void wifi_ap() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 7, 2);\r\n  IPAddress gateway(192, 168, 7, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet) ;\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("mydoor1", "277791907");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    Serial.println("AP->ok");\r\n  } else {\r\n    Serial.println("AP->erorr");\r\n  }\r\n}', '', 'webserver'),
(2148, 12, '更换灯条注意事项', '找个大场地\r\n1.拆外壳\r\n2.拆排线\r\n3.贴胶布取屏幕\r\n4.拆荧光板\r\n5.单个测灯条,哪个坏换哪个\r\n6.过程反过来装回去', './public/upfiles/images/reply/QQ图片20210106082049.jpg', 'webserver'),
(2610, 7, '4线USB接线方法', '接9线座，1排有5个的。多出的线算1 接线2345对应黑绿白红线', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(2850, 160, 'crontab 定时任务', '#开机启动go程序\r\n@reboot sleep 3; cd /var/www/html; nohup ./main &\r\n#如果启动失败\r\n@reboot sleep 3; cd /var/www/html; nohup ./main\r\n#晚上关闭WIFI\r\n#0 20 * * * ifconfig wlan0 down\r\n\r\n#每天夜里1点30分备分远程服务器数据库到本地\r\n#30 1 * * * /var/www/html/mysql_source.sh\r\n\r\n#夜里关机 chmod 4777 /sbin/shutdown\r\n#30 2 * * * /sbin/shutdown -h now\r\n\r\n#每次重启后 清空redis数据 启动swoole_redis (限php swoole) 启动swoole_websocket\r\n#@reboot rm -f /var/www/html/app/Libraries/myclass/server/db\r\n#@reboot sleep 10; /usr/bin/php /var/www/html/app/Libraries/myclass/server/Swoole_redis.php > /dev/null &\r\n#@reboot sleep 20; /usr/bin/php /var/www/html/app/Libraries/myclass/server/Swoole_websocket.php > /dev/null &\r\n\r\n#4到8月份检测CPU温度过60度保护关机\r\n#* * * 4-8 * /usr/bin/curl http://localhost/service/CpuHighDown\r\n#定时提醒 每天早上6点触发\r\n0 6 * * * /usr/bin/curl http://localhost/service/TimeingSend\r\n\r\n#每天早上6点10分自动校准时间\r\n#10 6 * * * /usr/sbin/ntpdate ntp.ubuntu.com;/sbin/hwclock -w', '', 'webserver'),
(2852, 10, '风扇开几分钟就停 ，且是遥控风扇', '查一下降压电容105j是否有1uf', '', 'webserver'),
(2853, 20, '土壤湿度传感器', '                int shidu = 0; // 土壤传感器输入接模拟引脚 A0\r\nint value = 0; //初始化变量value\r\n\r\nvoid setup() {\r\n  Serial.begin(19200);//设置波特率为115200\r\n  Serial.println("\\n");//换行\r\n}\r\n\r\nvoid loop() {\r\n  value = analogRead(shidu);//模拟数据读取（A0脚输入的数据）\r\n  value = value / 10.2;    //上面的value值除以10.2 值得多少要看空悬时也就是干燥时为100%赋值给value\r\n  Serial.print(value);\r\n  Serial.println("%");\r\n  //value值小于50时，对结果进行判\r\n  if (value < 50){\r\n    Serial.println("土壤是湿润的");\r\n  }else{\r\n    Serial.println("土壤是干燥的");\r\n  }\r\n  delay(1000);//延时1s，每一秒读取一次\r\n}     \r\n\r\n/* 该传感器可以独立工作\r\nD0 LED灯不亮时  D0脚为高电平3.3v 亮为低电平，调节小电位器让其到指定的阀值LED灯点亮即低电平,\r\n如果需要读取湿度比例值就必须要接ESP单片机了\r\n*/        ', '', 'webserver'),
(2854, 20, 'mqtt开关', '#include <ESP8266MQTT.h>\r\n#include <ESP8266WiFi.h>\r\n#include <PubSubClient.h>\r\n#include <ArduinoJson.h>\r\nint open = 5;\r\nint close = 4;\r\n\r\nvoid onConnectionEstablished();\r\n\r\nESP8266MQTT client(\r\n  "www.360xyz.cn",             // Wifi ssid\r\n  "qq282246101",             // Wifi password\r\n  "5DY2NRSW8D.iotcloud.tencentdevices.com",    // MQTT broker ip\r\n  1883,               // MQTT broker port\r\n  "5DY2NRSW8DSwitchKfb1;12010126;VU8K5;1657637931",              // MQTT username\r\n  "7418dac5c7f14c94d80b67281ee4bce77879d3d28e6202489b26570766a958bf;hmacsha256",         // MQTT password\r\n  "SwitchKfb1",            // Client name\r\n  onConnectionEstablished, // Connection established callback\r\n  true,               // Enable web updater\r\n  true                // Enable debug messages\r\n);\r\n\r\nvoid setup() {\r\n  Serial.begin(19200);\r\n  pinMode(open, OUTPUT);\r\n  pinMode(close, OUTPUT);\r\n}\r\n\r\nvoid onConnectionEstablished() {\r\n  // 订阅主题并且将该主题内收到的消息通过串口发送\r\n  client.subscribe("5DY2NRSW8D/SwitchKfb1/control", [](const String & payload) {\r\n//    Serial.println(payload);\r\n//    DynamicJsonDocument  jsonBuffer(100);\r\n//    deserializeJson(jsonBuffer, payload);\r\n//    JsonObject root = jsonBuffer.as<JsonObject>();\r\n//    String user = payload;\r\n    String state = payload;\r\n    if (state == "1") {\r\n      //开\r\n      Serial.println("开");\r\n      digitalWrite(close, LOW);\r\n      delay(200);\r\n      digitalWrite(open, HIGH);\r\n      client.publish("5DY2NRSW8D/SwitchKfb1/event", payload);\r\n    }\r\n    if (state == "0") {\r\n      //关 \r\n      Serial.println("关");\r\n      digitalWrite(open, LOW);\r\n      delay(200);\r\n      digitalWrite(close, HIGH);\r\n      //腾讯云 设置好了发布必须为json\r\n      client.publish("5DY2NRSW8D/SwitchKfb1/event", payload);\r\n    }\r\n    Serial.println(payload);//此处可以编写一个函数来代替\r\n  });\r\n\r\n  // 向某个主题发送消息\r\n  client.publish("5DY2NRSW8D/SwitchKfb1/event", "This is a message");\r\n\r\n}\r\n\r\nvoid loop() {\r\n  client.loop();\r\n}', '', 'webserver'),
(2856, 20, '闪存 存数据', '闪存 相当于 电脑硬盘的C以外盘符\r\n每次重新烧录是不会被清除的只有手动操作<FS.h>库来清除\r\n比如 WIFI 帐号密码存到闪存中\r\n这样就不用向程序里写死WIFI帐号密码\r\n#include <FS.h> //库文件\r\nString flash_file = "/false.txt"; //被读取的文件位置和名称\r\n\r\n//是否存在数据\r\nif (SPIFFS.exists(flash_file)) {\r\n  Serial.print(file_name);\r\n  Serial.print(" FOUND");\r\n} else {\r\n  Serial.print(file_name);\r\n  Serial.println(" NOT FOUND");\r\n}\r\n\r\n//写入数据\r\n  SPIFFS.format();//格式化SPIFFS 慎用\r\n  delay(500);\r\n  SPIFFS.begin();//启动闪存写入模式\r\n  File dataFile = SPIFFS.open("./wifi.txt", "w");\r\n  dataFile.println(str);\r\n  dataFile.close();\r\n  return true;\r\n\r\n//读取数据  wra 代表 w r a a+  其中a代表追加数据 a+代表可读可追加\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists("./wifi.txt") == false) {\r\n    Serial.print(path);\r\n    Serial.println(" NOT FOUND");\r\n    return "";\r\n  }\r\n  File dataFile = SPIFFS.open("./wifi.txt", "r");\r\n  String result = dataFile.readString();\r\n  result.trim(); //清理字符两边的空格\r\n  Serial.print(result);\r\n\r\n\r\n//显示目录中文件内容以及文件大小\r\nDir dir = SPIFFS.openDir(flash_file); //建立“目录对象”dir\r\nwhile (dir.next()) //dir.next()用于检查目录中是否还有”下一个文件“\r\n{\r\n  Serial.println(dir.fileName());//输出文件名\r\n}\r\n\r\n//删除数据\r\nSPIFFS.remove(flash_file);      ', '', 'webserver'),
(2857, 20, 'esp8266 Flash按键 ', '上电前，一直按住Flash按键，\r\n然后第二次重启就可以重新写入闪存\r\n如果第二次重启不写入闪存数据，\r\n第三次启动又是原来的闪存数据', '', 'webserver'),
(2858, 20, '网页配置wifi帐号密码 ', '#include <ESP8266WiFi.h>\r\n#include <ESP8266WebServer.h>\r\n#include <ESP8266HTTPClient.h>\r\n#include <FS.h>\r\n#include <Ticker.h>\r\nTicker myTicker;\r\n//被读取的文件位置和名称\r\nString flash_wifi = "/wifi.txt";\r\nESP8266WebServer ESP8266webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString WiFiSsid = "";\r\nString WiFiPasswd = "";\r\n\r\nString html;\r\n\r\n\r\nvoid setup(void) {\r\n  if (FlashConnetWifi() == false) {\r\n    HtmlSetWifi();\r\n  }\r\n}\r\n\r\nvoid loop(void) {\r\n\r\n\r\n}\r\n\r\nvoid HtmlSetWifi() {\r\n  WifiScan();\r\n  ap_start();\r\n  delay(1000);\r\n  Serial.println("启动网页");\r\n  //5分后重启 防止停电后复电，路由器连接WIFI速度慢于ESP导致ESP连接不到路由器进入无限AP模式，所以这里只让AP 激活5分钟后就重启\r\n  myTicker.once(300, myesp_restrt);\r\n  delay(200);\r\n  webserver_start();\r\n  while (1) {\r\n    ESP8266webServer.handleClient();   // 检查网络服务请求并处理\r\n  }\r\n}\r\nvoid myesp_restrt() {\r\n  ESP.restart();\r\n}\r\n//扫描附件WIFI\r\nvoid WifiScan() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(100);\r\n  int n = WiFi.scanNetworks();\r\n  if (n > 0) {\r\n    Serial.println(n);\r\n    String a =  "附近WiFi <select id=\\"ssid\\">";\r\n    for (int i = 0; i < n; i++) {\r\n      Serial.println(WiFi.SSID(i));\r\n      a = a +  "<option value=\\"" + WiFi.SSID(i) + "\\">" + WiFi.SSID(i) + "</option>";\r\n      delay(50);\r\n    }\r\n    String HtmlStart = String("") + "<!DOCTYPE html>" +\r\n                       "<html>" +\r\n                       "<head>" +\r\n                       "<meta charset=\\"utf-8\\">" +\r\n                       "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />" +\r\n                       "<title>设置WiFi</title>" +\r\n                       "<link rel=\\"stylesheet\\" href=\\"\\">" +\r\n                       "</head>" +\r\n                       "<script>" +\r\n                       "onload  = function() {" +\r\n                       "document.getElementById(\\"up\\").onclick = function(){" +\r\n                       "var ssida=document.getElementById(\\"ssid\\").value;" +\r\n                       "var ssid=ssida.replace(/\\\\s+/g, \\" \\");" +\r\n                       "var passwda=document.getElementsByTagName(''input'')[0].value;" +\r\n                       "var passwd=passwda.replace(/\\\\s+/g, \\" \\");" +\r\n                       "xhr = new XMLHttpRequest();" +\r\n                       "xhr.open(\\"POST\\",\\"./set_wifi\\",true);" +\r\n                       "var posts = (\\"ssid=\\"+ssid+\\"&passwd=\\"+ passwd);" +\r\n                       "xhr.setRequestHeader(\\"Content-Type\\",\\"application/x-www-form-urlencoded\\");" +\r\n                       "xhr.send(posts);" +\r\n                       "xhr.onreadystatechange = function(){" +\r\n                       "if(this.readyState == 4 && this.status == 200){" +\r\n                       "alert(this.responseText);" +\r\n                       "}" +\r\n                       "}" +\r\n                       "}" +\r\n                       "}" +\r\n                       "</script>" +\r\n                       "<body>";\r\n    String HtmlEnd = String("") + "<p>WiFi密码<input type=\\"text\\" id=\\"passwd\\"></p>" +\r\n                     "<input type=\\"submit\\" id=\\"up\\" value=\\"设 置\\">" +\r\n                     "<hr/>" +\r\n                     "<div>如果附近WiFi没有显示到自己的WIFI<div>" +\r\n                     "<div>请重启或离信号近点</div>" +\r\n                     "<div>连接成功AP热点退出转WIFI_STA</div>" +\r\n                     "</body>" +\r\n                     "</html>";\r\n    a = a +  "</select>";\r\n    html = HtmlStart + a + HtmlEnd;\r\n  } else {\r\n    html = "扫描不到网络";\r\n    Serial.println("扫描不到网络");\r\n  }\r\n}\r\nvoid set_wifi() {\r\n\r\n  WiFiSsid = ESP8266webServer.arg(0);\r\n  WiFiPasswd = ESP8266webServer.arg(1);\r\n  String sp = WiFiSsid + "&" + WiFiPasswd;\r\n\r\n  Serial.println(sp);\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  const char* Ssid = WiFiSsid.c_str();\r\n  const char* Passwd = WiFiPasswd.c_str();\r\n  WiFi.begin(Ssid, Passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      ESP8266webServer.send(200, "text/plane", "Wifi密码正确，ESP准备重启");\r\n      ESP8266webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flash_wifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML连接成功");\r\n      delay(1000);\r\n      ESP.reset();\r\n    }\r\n  }\r\n  ESP8266webServer.send(200, "text/plane", "Wifi密码错误，请重新输入");\r\n  //HtmlSetWifi();\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  ESP8266webServer.send(500, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  ESP8266webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\n\r\n\r\nvoid ap_start() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet) ;\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    //Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserver_start() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  ESP8266webServer.begin(); // 启用网络服务\r\n  ESP8266webServer.on("/", handleRoot);   // / 在HTTP中，表示请求首页服务，\r\n  ESP8266webServer.on("/set_wifi", set_wifi);\r\n  ESP8266webServer.onNotFound(handleNotFound);    // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\n\r\nbool FlashConnetWifi() {\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flash_wifi) == false) {\r\n    Serial.print(flash_wifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flash_wifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n  WiFiSsid = result.substring(0, i);\r\n  WiFiPasswd = result.substring(i + 1);\r\n  const char* WifiName = WiFiSsid.c_str();\r\n  const char* WifiPw = WiFiPasswd.c_str();\r\n  Serial.println(WifiName);\r\n  Serial.println(WifiPw);\r\n  WiFi.begin(WifiName, WifiPw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("FlashConnetWifi->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 15; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("FlashConnetWifi 闪存配置连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("FlashConnetWifi->false");\r\n  return false;\r\n}', '', 'webserver'),
(2862, 20, 'esp8266 01 websocket 遥控 ', '#include <ESP8266WiFi.h>\r\n#include <ESP8266WebServer.h>\r\n#include <ESP8266HTTPClient.h>\r\n#include <FS.h>\r\n#include <WebSocketsClient.h>\r\n#include <ArduinoJson.h>\r\n#include <Ticker.h>\r\n//被读取的文件位置和名称\r\nString flash_wifi = "/wifi.txt";\r\nESP8266WebServer ESP8266webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString ssid = "";\r\nString passwd = "";\r\nString html;\r\nWebSocketsClient webSocket;\r\nTicker myTicker;\r\nWiFiClient wificlient;\r\n//定时时间防止断电重启后定时失效\r\nString flash_time = "time.txt";\r\nint service_i = 0;\r\n//普通开关\r\nint d0 = 0;\r\n//最近操作物联用户相关信息\r\nString UserExec = "";\r\nString str;\r\nDynamicJsonDocument  jsonBuffer(100);\r\nJsonObject root;\r\n\r\nvoid setup(void) {\r\n  pinMode(d0, OUTPUT);\r\n  digitalWrite(d0, HIGH);\r\n  delay(500);\r\n  if (FlashConnetWifi() == false) {\r\n    HtmlSetWifi();\r\n  }\r\n\r\n  //先读取定时数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flash_time) == true) {\r\n    File timeFile = SPIFFS.open(flash_time, "r");\r\n    String timef = timeFile.readString();\r\n    //去除前后空格\r\n    timef.trim();\r\n    String flash_t = timef.substring(0, 10);\r\n    String timenow = http_get("http://www.360xyz.cn/query/GetTime");\r\n    int timen = timenow.toInt();\r\n    int flash_ti = flash_t.toInt();\r\n    if ( timen < flash_ti) {\r\n      int ress = flash_ti - timen;\r\n      String on_off = timef.substring(10);\r\n      //等为0为关 1为开\r\n      if (on_off == "0") {\r\n        myTicker.once(ress, closea);\r\n        Serial.println(String(ress) + "定时关");\r\n      } else {\r\n        myTicker.once(ress, opena);\r\n        Serial.println(String(ress) + "定时开");\r\n      }\r\n    }\r\n  }\r\n  webSocket.beginSSL("www.360xyz.cn", 443, "/service/wss");\r\n  webSocket.onEvent(webSocketEvent);\r\n  webSocket.setAuthorization("user=switch1&password=efghijk&room=admin");\r\n  webSocket.setReconnectInterval(500);\r\n  webSocket.enableHeartbeat(15000, 3000, 2);\r\n\r\n\r\n}\r\n\r\nvoid loop(void) {\r\n  webSocket.loop();\r\n\r\n}\r\n\r\nvoid HtmlSetWifi() {\r\n  WifiScan();\r\n  ap_start();\r\n  delay(1000);\r\n  Serial.println("启动网页");\r\n  webserver_start();\r\n  while (1) {\r\n    ESP8266webServer.handleClient();   // 检查网络服务请求并处理\r\n  }\r\n}\r\n//扫描附件WIFI\r\nvoid WifiScan() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(100);\r\n  int n = WiFi.scanNetworks();\r\n  if (n > 0) {\r\n    Serial.println(n);\r\n    String a =  "附近WiFi <select id=\\"ssid\\">";\r\n    for (int i = 0; i < n; i++) {\r\n      Serial.println(WiFi.SSID(i));\r\n      a = a +  "<option value=\\"" + WiFi.SSID(i) + "\\">" + WiFi.SSID(i) + "</option>";\r\n      delay(50);\r\n    }\r\n    String HtmlStart = String("") + "<!DOCTYPE html>" +\r\n                       "<html>" +\r\n                       "<head>" +\r\n                       "<meta charset=\\"utf-8\\">" +\r\n                       "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />" +\r\n                       "<title>设置WiFi</title>" +\r\n                       "<link rel=\\"stylesheet\\" href=\\"\\">" +\r\n                       "</head>" +\r\n                       "<script>" +\r\n                       "onload  = function() {" +\r\n                       "document.getElementById(\\"up\\").onclick = function(){" +\r\n                       "var ssida=document.getElementById(\\"ssid\\").value;" +\r\n                       "var ssid=ssida.replace(/\\\\s+/g, \\" \\");" +\r\n                       "var passwda=document.getElementsByTagName(''input'')[0].value;" +\r\n                       "var passwd=passwda.replace(/\\\\s+/g, \\" \\");" +\r\n                       "xhr = new XMLHttpRequest();" +\r\n                       "xhr.open(\\"POST\\",\\"./set_wifi\\",true);" +\r\n                       "var posts = (\\"ssid=\\"+ssid+\\"&passwd=\\"+ passwd);" +\r\n                       "xhr.setRequestHeader(\\"Content-Type\\",\\"application/x-www-form-urlencoded\\");" +\r\n                       "xhr.send(posts);" +\r\n                       "xhr.onreadystatechange = function(){" +\r\n                       "if(this.readyState == 4 && this.status == 200){" +\r\n                       "alert(this.responseText);" +\r\n                       "}" +\r\n                       "}" +\r\n                       "}" +\r\n                       "}" +\r\n                       "</script>" +\r\n                       "<body>";\r\n    String HtmlEnd = String("") + "<p>WiFi密码<input type=\\"text\\" id=\\"passwd\\"></p>" +\r\n                     "<input type=\\"submit\\" id=\\"up\\" value=\\"设 置\\">" +\r\n                     "<hr/>" +\r\n                     "<div>如果附近WiFi没有显示到自己的WIFI<div>" +\r\n                     "<div>请重启或离信号近点</div>" +\r\n                     "<div>连接成功AP热点退出转WIFI_STA</div>" +\r\n                     "</body>" +\r\n                     "</html>";\r\n    a = a +  "</select>";\r\n    html = HtmlStart + a + HtmlEnd;\r\n  } else {\r\n    html = "扫描不到网络";\r\n    Serial.println("扫描不到网络");\r\n  }\r\n}\r\nvoid set_wifi() {\r\n  ssid = ESP8266webServer.arg(0);\r\n  passwd = ESP8266webServer.arg(1);\r\n  String sp = ssid + "&" + passwd;\r\n\r\n  Serial.println(sp);\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  WiFi.begin(ssid, passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      ESP8266webServer.send(200, "text/plane", "Wifi密码正确，ESP准备重启");\r\n      ESP8266webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flash_wifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML连接成功");\r\n      delay(1000);\r\n      ESP.reset();\r\n    }\r\n  }\r\n  ESP8266webServer.send(200, "text/plane", "Wifi密码错误，请重新输入");\r\n  //HtmlSetWifi();\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  ESP8266webServer.send(500, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  ESP8266webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\n\r\n\r\nvoid ap_start() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet) ;\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    //Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserver_start() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  ESP8266webServer.begin(); // 启用网络服务\r\n  ESP8266webServer.on("/", handleRoot);   // / 在HTTP中，表示请求首页服务，\r\n  ESP8266webServer.on("/set_wifi", set_wifi);\r\n  ESP8266webServer.onNotFound(handleNotFound);    // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\n\r\nbool FlashConnetWifi() {\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flash_wifi) == false) {\r\n    Serial.print(flash_wifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flash_wifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  Serial.println(wifiname);\r\n  Serial.println(wifipw);\r\n  WiFi.begin(wifiname, wifipw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("FlashConnetWifi->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 10; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("FlashConnetWifi 闪存配置连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("FlashConnetWifi->false");\r\n  return false;\r\n}\r\nvoid webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {\r\n  switch (type) {\r\n    case WStype_DISCONNECTED:\r\n      Serial.printf("[WSc] Disconnected!\\n");\r\n      service_i++;\r\n      if (service_i == 200) {\r\n        ESP.reset();\r\n      }\r\n      break;\r\n    case WStype_CONNECTED: {\r\n        Serial.printf("[WSc] Connected to url: %s\\n", payload);\r\n        // send message to server when Connected\r\n        webSocket.sendTXT("Connected");\r\n      }\r\n      break;\r\n    case WStype_TEXT:\r\n      Serial.printf("[WSc] get text: %s\\n", payload);\r\n      deserializeJson(jsonBuffer, payload);\r\n      root = jsonBuffer.as<JsonObject>();\r\n      if (root["message"] != "") {\r\n        String user = root["user"];\r\n        String date = root["date"];\r\n        String message = root["message"];\r\n        if (root["message"] == "switch1->0") {\r\n          //关\r\n          Serial.println("关");\r\n          webSocket.sendTXT("close ...");\r\n          digitalWrite(d0, HIGH);\r\n\r\n          UserExec = user + " -> 关闭 " + date;\r\n        }\r\n        if (root["message"] == "switch1->1") {\r\n          //开\r\n          Serial.println("开");\r\n          webSocket.sendTXT("open ...");\r\n          digitalWrite(d0, LOW);\r\n          String user = root["user"];\r\n          String date = root["date"];\r\n          UserExec = user + " -> 开启 " + date;\r\n        }\r\n        if (root["message"] == "AllState") {\r\n          delay(1000);\r\n          //查看设备是否在线，应做出回应\r\n          if (UserExec == "") {\r\n            webSocket.sendTXT("臣在 定时开启 秒|定时关闭 秒|定时状态|定时取消|reboot");\r\n          } else {\r\n            webSocket.sendTXT(UserExec);\r\n          }\r\n        }\r\n        //秒钟单位 关闭\r\n        if (message.indexOf("switch1->定时关闭") != -1) {\r\n          int alllen = message.length();\r\n          String re = message.substring(21);\r\n          int res = re.toInt();\r\n          myTicker.once(res, closea);\r\n          String timenow = http_get("http://www.360xyz.cn/query/GetTime");\r\n          String timestr = String(timenow.toInt() + res) + "0";\r\n          int timeint = timestr.toInt();\r\n          SPIFFS.begin();\r\n          File dataFile = SPIFFS.open(flash_time, "w");\r\n          dataFile.println(timestr);\r\n          dataFile.close();\r\n          String sendtemp = "定时关 设置成功 " + re + "秒";\r\n          webSocket.sendTXT(sendtemp);\r\n        }\r\n\r\n        //秒钟单位 开启\r\n        if (message.indexOf("switch1->定时开启") != -1) {\r\n          int alllen = message.length();\r\n          String re = message.substring(21);\r\n\r\n          int res = re.toInt();\r\n          myTicker.once(res, opena);\r\n          String timenow = http_get("http://www.360xyz.cn/query/GetTime");\r\n          String timestr = String(timenow.toInt() + res) + "1";\r\n          int timeint = timestr.toInt();\r\n          SPIFFS.begin();\r\n          File dataFile = SPIFFS.open(flash_time, "w");\r\n          dataFile.println(timestr);\r\n          dataFile.close();\r\n          String sendtemp = "定时开 设置成功 " + re + "秒";\r\n          webSocket.sendTXT(sendtemp);\r\n        }\r\n\r\n        if (root["message"] == "switch1->定时状态") {\r\n          bool b = myTicker.active();\r\n          if (b == true) {\r\n            webSocket.sendTXT("定时正在启用");\r\n          } else {\r\n            webSocket.sendTXT("定时未启用");\r\n          }\r\n        }\r\n        if (root["message"] == "switch1->定时取消") {\r\n          myTicker.detach();\r\n          SPIFFS.begin();\r\n          File dataFile = SPIFFS.open(flash_time, "w");\r\n          dataFile.println(123123123);\r\n          dataFile.close();\r\n          webSocket.sendTXT("定时已经取消");\r\n        }\r\n        if (root["message"] == "switch1->reboot") {\r\n          ESP.reset();\r\n        }\r\n      }\r\n\r\n      break;\r\n    case WStype_BIN:\r\n      Serial.printf("[WSc] get binary length: %u\\n", length);\r\n      hexdump(payload, length);\r\n\r\n      // send data to server\r\n      // webSocket.sendBIN(payload, length);\r\n      break;\r\n    case WStype_PING:\r\n      // pong will be send automatically\r\n      Serial.printf("[WSc] get ping\\n");\r\n      break;\r\n    case WStype_PONG:\r\n\r\n      Serial.printf("[WSc] get pong\\n");\r\n      break;\r\n  }\r\n}\r\nvoid closea() {\r\n  Serial.println("switch1定时触发 关");\r\n  digitalWrite(d0, HIGH);\r\n  delay(500);\r\n  //取消定时状态\r\n  myTicker.detach();\r\n  delay(500);\r\n  http_get("http://www.360xyz.cn/service/SendEmail?title=switch1->定时关闭|-s");\r\n}\r\nvoid opena() {\r\n  Serial.println("switch1定时触发 开");\r\n  digitalWrite(d0, LOW);\r\n  delay(500);\r\n  //取消定时状态\r\n  myTicker.detach();\r\n  delay(500);\r\n  http_get("http://www.360xyz.cn/service/SendEmail?title=switch1->定时开启|-s");\r\n}\r\n\r\n\r\nString http_get(String string) {\r\n  HTTPClient http;\r\n  String response;\r\n  http.begin(wificlient, string);\r\n  http.setTimeout(3000);\r\n  int httpCode = http.GET();\r\n  // httpCode will be negative on error\r\n  if (httpCode == 200) {\r\n    response = http.getString();\r\n    return response;\r\n  } else {\r\n    return "";\r\n  }\r\n  http.end();\r\n}', '', 'webserver'),
(2868, 20, 'wss DS18B20感温,d1 d6 定时开关,环境温湿度 加温,散温', '#include <ESP8266WiFi.h>\r\n#include <ESP8266WebServer.h>\r\n#include <ESP8266HTTPClient.h>\r\n#include <FS.h>\r\n#include <WebSocketsClient.h>\r\n#include <ArduinoJson.h>\r\n#include <OneWire.h>\r\n#include <DallasTemperature.h>\r\n#include <Ticker.h>\r\n\r\n#include <Adafruit_Sensor.h>\r\n#include <DHT.h>\r\n#include <DHT_U.h>\r\n\r\nWebSocketsClient webSocket;\r\nTicker myTicker;\r\n\r\n// 温度输入脚接开发板数字引脚13\r\n#define d7 13\r\nOneWire oneWire(d7);\r\nDallasTemperature sensors(&oneWire);\r\n//普通开关\r\nint d1 = 5;\r\n\r\n//加执\r\nint d2 = 4;\r\n//散温\r\nint d5 = 14;\r\n\r\n//加湿开关\r\nint d6 = 12;\r\n//开关状态\r\nString state;\r\n\r\n#define DHTPIN 3     // 数字引脚连接DHT传感器\r\n#define DHTTYPE    DHT11     // DHT 11\r\nDHT_Unified dht(DHTPIN, DHTTYPE);\r\n//最近操作物联用户相关信息\r\nString UserExec = "";\r\n//几个全局变量\r\nString str;\r\nDynamicJsonDocument  jsonBuffer(200);\r\nJsonObject root;\r\n\r\n\r\n//被读取的文件位置和名称\r\nString flash_wifi = "/wifi.txt";\r\nESP8266WebServer ESP8266webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString ssid = "";\r\nString passwd = "";\r\n\r\nString html = String("") + "<!DOCTYPE html>" +\r\n              "<html>" +\r\n              "<head>" +\r\n              "<meta charset=''utf-8''>" +\r\n              "<meta name=''viewport'' content=''width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no'' />" +\r\n              "<title>设置WiFi</title>" +\r\n              "<link rel=''stylesheet'' href=''''>" +\r\n              "</head>" +\r\n              "<script>" +\r\n              "onload  = function() {" +\r\n              "document.getElementById(''up'').onclick = function(){" +\r\n              "var ssid=document.getElementsByTagName(''input'')[0].value;" +\r\n              "var passwd=document.getElementsByTagName(''input'')[1].value;" +\r\n              "xhr = new XMLHttpRequest();" +\r\n              "xhr.open(''POST'',''./set_wifi'',true);" +\r\n              "var posts = (''ssid=''+ssid+''&passwd=''+ passwd);" +\r\n              "xhr.setRequestHeader(''Content-Type'',''application/x-www-form-urlencoded'');" +\r\n              "xhr.send(posts);" +\r\n              "xhr.onreadystatechange = function(){" +\r\n              " if(this.readyState == 4 && this.status == 200){" +\r\n              "alert(this.responseText);" +\r\n              " }" +\r\n              " }" +\r\n              "}" +\r\n              "}" +\r\n              "</script>" +\r\n              "<body>" +\r\n              "<p>WiFi帐号<input type=''text'' name=''ssid''></p>" +\r\n              "<p>WiFi密码<input type=''text'' name=''passwd''></p>" +\r\n              "<input type=''submit'' id=''up'' value=''设置''>" +\r\n              "<div>连接成功AP温点退出转WIFI_STA</div>" +\r\n              "</body>" +\r\n              "</html>";\r\n\r\nfloat DHTt;\r\nfloat DHTh;\r\nint DHTtMax; //环境温度最大值\r\nint DHTtMin; //环境温度最小值\r\nint DHThMax; //环境湿度最大值\r\nint DHThMin; //环境湿度最小值\r\nfloat DS18B20;//DS18B20感温\r\nint temperature = 9;\r\nint i = 0;\r\nbool show = false;\r\nvoid setup(void) {\r\n  pinMode(d1, OUTPUT);\r\n  pinMode(d2, OUTPUT);\r\n  pinMode(d5, OUTPUT);\r\n  pinMode(d6, OUTPUT);\r\n\r\n  digitalWrite(d1, LOW);\r\n  digitalWrite(d2, LOW);\r\n  digitalWrite(d5, LOW);\r\n  digitalWrite(d6, LOW);\r\n\r\n  dht.begin();\r\n  sensor_t sensor;\r\n  delay(1000);\r\n\r\n  bool wifibool = wifi_bool();\r\n  if (wifibool == false) {\r\n    ap_start();\r\n    delay(1000);\r\n    Serial.println("bei wang");\r\n    webserver_start();\r\n    while (1) {\r\n      ESP8266webServer.handleClient();   // 检查网络服务请求并处理\r\n    }\r\n  }\r\n\r\n  //灵活设置温度触发开关值,启动时先获取大棚散温触发温度值\r\n  String temp = http_get("http://www.360xyz.cn/automation/DapengDHT");\r\n  deserializeJson(jsonBuffer, temp);\r\n  root = jsonBuffer.as<JsonObject>();\r\n\r\n  String tmax = root["DHTtMax"];\r\n  String tmin = root["DHTtMin"];\r\n  DHTtMax = tmax.toInt();\r\n  DHTtMin = tmin.toInt();\r\n\r\n  String hmax = root["DHThMax"];\r\n  String hmin = root["DHThMin"];\r\n  DHThMax = hmax.toInt();\r\n  DHThMin = hmin.toInt();\r\n  String B20 = root["DS18B20"];\r\n  DS18B20 = B20.toInt();\r\n  // server address, port and URL\r\n  webSocket.beginSSL("www.360xyz.cn", 1000, "/wss");\r\n\r\n  // event handler\r\n  webSocket.onEvent(webSocketEvent);\r\n\r\n  // use HTTP Basic Authorization this is optional remove if not needed\r\n  webSocket.setAuthorization("user=dapeng&password=efghijk&room=root");\r\n\r\n  // try ever 5000 again if connection has failed\r\n  webSocket.setReconnectInterval(500);\r\n\r\n  // start heartbeat (optional)\r\n  // ping server every 15000 ms\r\n  // expect pong from server within 3000 ms\r\n  // consider connection disconnected if pong is not received 2 times\r\n  webSocket.enableHeartbeat(5000, 3000, 6);\r\n\r\n}\r\nvoid loop(void) {\r\n  webSocket.loop();\r\n}\r\nvoid set_wifi() {\r\n  ssid = ESP8266webServer.arg(0);\r\n  passwd = ESP8266webServer.arg(1);\r\n  String sp = ssid + "&" + passwd;\r\n  Serial.println(sp);\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  WiFi.begin(ssid, passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 30; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      ESP8266webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flash_wifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML连接成功");\r\n      delay(1000);\r\n      ESP.reset();\r\n    }\r\n  }\r\n\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  ESP8266webServer.send(300, "text / html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  ESP8266webServer.send(404, "text / plain", "404 - The page is not Found!");\r\n}\r\n\r\n\r\nvoid ap_start() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet) ;\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    //Serial.println(String("Soft - AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserver_start() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  ESP8266webServer.begin(); // 启用网络服务\r\n  ESP8266webServer.on(" / ", handleRoot);   // / 在HTTP中，表示请求首页服务，\r\n  ESP8266webServer.on(" / set_wifi", set_wifi);\r\n  ESP8266webServer.onNotFound(handleNotFound);    // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\nbool wifi_bool() {\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flash_wifi) == false) {\r\n    Serial.print(flash_wifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flash_wifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  Serial.println(wifiname);\r\n  Serial.println(wifipw);\r\n  WiFi.begin(wifiname, wifipw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("wifi_bool->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 300; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("wifi_bool 闪存配置连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("wifi_bool->false");\r\n  return false;\r\n}\r\n\r\nvoid webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {\r\n  switch (type) {\r\n    case WStype_DISCONNECTED:\r\n      Serial.printf("[WSc] Disconnected!\\n");\r\n      break;\r\n    case WStype_CONNECTED: {\r\n        Serial.printf("[WSc] Connected to url: % s\\n", payload);\r\n        // send message to server when Connected\r\n        webSocket.sendTXT("Connected");\r\n      }\r\n      break;\r\n    case WStype_TEXT:\r\n      Serial.printf("[WSc] get text: % s\\n", payload);\r\n      str = (const char*)payload;\r\n      deserializeJson(jsonBuffer, str);\r\n      root = jsonBuffer.as<JsonObject>();\r\n      if (root["message"] != "") {\r\n        String user = root["user"];\r\n        String date = root["date"];\r\n        String message = root["message"];\r\n        if (message == "dapeng->d1开") {\r\n          //关\r\n          webSocket.sendTXT("d1开,通电正常 ...");\r\n          digitalWrite(d1, HIGH);\r\n\r\n          UserExec = user + " -> open d1 " + date;\r\n        }\r\n        if (message == "dapeng->d1关") {\r\n          //关\r\n          webSocket.sendTXT("d1关 断电正常...");\r\n          digitalWrite(d1, LOW);\r\n          UserExec = user + " -> close d1 " + date;\r\n        }\r\n        if (message == "AllState") {\r\n          delay(1000);\r\n          //查看设备是否在线，应做出回应\r\n          if (UserExec == "") {\r\n            webSocket.sendTXT("DS18B20 | 温湿度 | 加温 | 散温 | d6开 | d6关 | d1开 | d1关 | d1-open-s秒数 d1-close-s 支持d1和d6|参数 | show |reboot");\r\n          } else {\r\n            webSocket.sendTXT(UserExec);\r\n          }\r\n        }\r\n        if (message == "dapeng->show") {\r\n          if (show == false) {\r\n            show = true;\r\n          } else {\r\n            show = false;\r\n          }\r\n        }\r\n        if (message == "dapeng->ds18b20") {\r\n          sensors.requestTemperatures(); // 发送命令获取温度\r\n          //浮点转换成字符串\r\n          float fb20 = sensors.getTempCByIndex(0);\r\n          //显示温度\r\n          //Serial.println( DHTt);\r\n          String b20 = "ds18b20温度" + String(fb20);\r\n          webSocket.sendTXT(b20);\r\n        }\r\n\r\n        if (message == "dapeng->散温") {\r\n          temperature = 0;\r\n          digitalWrite(d5, LOW);\r\n          delay(500);\r\n          digitalWrite(d2, HIGH);\r\n          delay(500);\r\n          webSocket.sendTXT("环境散温中...");\r\n        }\r\n        if (message == "dapeng->加温") {\r\n          temperature = 1;\r\n          digitalWrite(d2, LOW);\r\n          delay(500);\r\n          digitalWrite(d5, HIGH);\r\n          delay(500);\r\n          webSocket.sendTXT("环境加温中...");\r\n        }\r\n\r\n        if (message == "dapeng->d6开") {\r\n          digitalWrite(d6, HIGH);\r\n          delay(500);\r\n          webSocket.sendTXT("d6开 通电正常...");\r\n          UserExec = user + " -> open d6 " + date;\r\n        }\r\n        if (message == "dapeng->d6关") {\r\n          digitalWrite(d6, LOW);\r\n          delay(500);\r\n          webSocket.sendTXT("d6关 断电正常...");\r\n          UserExec = user + " -> close d6 " + date;\r\n        }\r\n        if (message == "dapeng->温湿度") {\r\n          // 获取温度事件并打印其值.\r\n          sensors_event_t event;\r\n          dht.temperature().getEvent(&event);\r\n          if (!isnan(event.temperature)) {\r\n            DHTt = event.temperature;\r\n          }\r\n          dht.humidity().getEvent(&event);\r\n          if (!isnan(event.relative_humidity)) {\r\n            DHTh = event.relative_humidity;\r\n          }\r\n          webSocket.sendTXT("环境温度" + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n        }\r\n\r\n        // D6 秒钟单位 关闭\r\n        if (message.indexOf("dapeng->d6-close-s") != -1) {\r\n          int alllen = message.length();\r\n          String re = message.substring(19);\r\n          int res = re.toInt();\r\n          myTicker.once(res, closed6);\r\n          webSocket.sendTXT("d6定时关 设置成功 " + re + "秒");\r\n        }\r\n        if (message.indexOf("dapeng->d6-open-s") != -1) {\r\n          int alllen = message.length();\r\n          String re = message.substring(18);\r\n          int res = re.toInt();\r\n          myTicker.once(res, opend6);\r\n          webSocket.sendTXT("d6定时开 设置成功 " + re + "秒");\r\n        }\r\n        // D1 秒钟单位 关闭\r\n        if (message.indexOf("dapeng->d1-close-s") != -1) {\r\n          int alllen = message.length();\r\n          String re = message.substring(19);\r\n          int res = re.toInt();\r\n          myTicker.once(res, closed1);\r\n          webSocket.sendTXT("d1定时关 设置成功 " + re + "秒");\r\n        }\r\n        if (message.indexOf("dapeng->d1-open-s") != -1) {\r\n          int alllen = message.length();\r\n          String re = message.substring(18);\r\n          int res = re.toInt();\r\n          myTicker.once(res, opend1);\r\n          webSocket.sendTXT("d1定时开 设置成功 " + re + "秒");\r\n        }\r\n\r\n        if (message == "dapeng->参数") {\r\n          webSocket.sendTXT("参数 温度大于" + String(DHTtMax) + "散温 温度小于" + String(DHTtMin) + "加温 DS18B20 大于" + String(DS18B20) + "关闭d6");\r\n        }\r\n        if (message == "dapeng->reboot") {\r\n          ESP.reset();\r\n        }\r\n      }\r\n      // send message to server\r\n      //       webSocket.sendTXT("message here");\r\n      break;\r\n    case WStype_BIN:\r\n      Serial.printf("[WSc] get binary length: % u\\n", length);\r\n      hexdump(payload, length);\r\n\r\n      // send data to server\r\n      // webSocket.sendBIN(payload, length);\r\n      break;\r\n    case WStype_PING:\r\n      // pong will be send automatically\r\n      Serial.printf("[WSc] get ping\\n");\r\n      break;\r\n    case WStype_PONG:\r\n      // answer to a ping we send\r\n      sensors_event_t event;\r\n      dht.temperature().getEvent(&event);\r\n\r\n      DHTt = event.temperature;\r\n      dht.humidity().getEvent(&event);\r\n      if (isnan(event.relative_humidity)) {\r\n        i++;\r\n        if (i > 10) {\r\n          i=0;\r\n          http_get("http://www.360xyz.cn/automation/SendToEmail?message=DHT传感器损坏");\r\n        }\r\n      }else{\r\n        i=0;\r\n      }\r\n      DHTh = event.relative_humidity;\r\n      i = 0;\r\n      //刚启动 温湿度会显示一样\r\n      if ((DHTt == DHTh) && (DHTt > 50)) {\r\n        Serial.println("刚启动");\r\n      } else {\r\n        //散温\r\n        if ((DHTt > DHTtMax) && (temperature != 1)) {\r\n          //这个值的作用是如果是开启状态,只运行一次开启\r\n          temperature = 1;\r\n          //大于大棚设置温度就启动散温\r\n          digitalWrite(d2, HIGH);\r\n          delay(500);\r\n          digitalWrite(d5, LOW);\r\n          delay(500);\r\n          http_get("http://www.360xyz.cn/automation/SendToEmail?message=散温中..." + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n          webSocket.sendTXT("散温中...温度" + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n\r\n        }\r\n        //加温\r\n        if ((DHTt < DHTtMin) && (temperature != 0)) {\r\n          temperature = 0;\r\n          digitalWrite(d2, LOW);\r\n          delay(300);\r\n          digitalWrite(d5, HIGH);\r\n          delay(300);\r\n          webSocket.sendTXT("加温中...温度" + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n          delay(300);\r\n          http_get("http://www.360xyz.cn/automation/SendToEmail?message=加温中..." + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n\r\n        }\r\n        //不加温和不散温状态\r\n        if ((DHTt < DHTtMax) && (DHTt > DHTtMin) && (temperature != 2)) {\r\n          temperature = 2;\r\n          digitalWrite(d2,  LOW);\r\n          delay(200);\r\n          digitalWrite(d5, LOW);\r\n          delay(200);\r\n          webSocket.sendTXT("最佳温湿度无状态...温度" + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n          delay(300);\r\n          http_get("http://www.360xyz.cn/automation/SendToEmail?message=最佳温湿度无状态..." + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n        }\r\n        if ((DHTh > DHThMax) || (DHTh < DHThMin) && (temperature != 3) ) {\r\n          temperature = 3;\r\n          webSocket.sendTXT("邮件提醒...温度" + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n          delay(300);\r\n          http_get("http://www.360xyz.cn/automation/SendToEmail?message=湿度异常...温度" + String(DHTt) + "°C 湿度" + String(DHTh) + "%");\r\n\r\n        }\r\n      }\r\n\r\n\r\n      sensors.requestTemperatures(); // 发送命令获取温度\r\n      //浮点转换成字符串\r\n      float fb20 = sensors.getTempCByIndex(0);\r\n      if (fb20 > DS18B20) {\r\n        digitalWrite(d6, LOW);\r\n        delay(500);\r\n        webSocket.sendTXT("DS18B20温度" + String(fb20) + "大于" + String(DS18B20) + " d6关 断电正常");\r\n      }\r\n      if (show == true) {\r\n        webSocket.sendTXT("环境温度" + String(DHTt) + "湿度" + String(DHTh) + "%");\r\n      }\r\n\r\n      Serial.printf("[WSc] get pong\\n");\r\n      break;\r\n  }\r\n}\r\nString http_get(String string) {\r\n  HTTPClient http;\r\n  String response;\r\n  http.begin(string);\r\n  http.setTimeout(5000);\r\n  int httpCode = http.GET();\r\n  if (httpCode == 200) {\r\n    //读取响应内容\r\n    response = http.getString();\r\n    //Serial.println(response);\r\n    return response;\r\n  }\r\n  return "false";\r\n  http.end();\r\n}\r\nvoid closed6() {\r\n  Serial.println("d6定时触发 关");\r\n  digitalWrite(d6, LOW);\r\n  delay(500);\r\n  //取消定时状态\r\n  myTicker.detach();\r\n  delay(500);\r\n  http_get("http://www.360xyz.cn/internet/send_email?title=d6定时触发 关 dapeng->d6-close-i|-s");\r\n}\r\nvoid opend6() {\r\n  Serial.println("d6定时触发 开");\r\n  digitalWrite(d6, HIGH);\r\n  delay(500);\r\n  //取消定时状态\r\n  myTicker.detach();\r\n  delay(500);\r\n  http_get("http://www.360xyz.cn/internet/send_email?title=d6定时触发 开 dapeng->d6-close-i|-s");\r\n}\r\nvoid closed1() {\r\n  Serial.println("d1定时触发 关");\r\n  digitalWrite(d1, LOW);\r\n  delay(500);\r\n  //取消定时状态\r\n  myTicker.detach();\r\n  delay(500);\r\n  http_get("http://www.360xyz.cn/internet/send_email?title=d1定时触发 关 dapeng->d1-close-i|-s");\r\n}\r\nvoid opend1() {\r\n  Serial.println("d1定时触发 开");\r\n  digitalWrite(d1, HIGH);\r\n  delay(500);\r\n  //取消定时状态\r\n  myTicker.detach();\r\n  delay(500);\r\n  http_get("http://www.360xyz.cn/internet/send_email?title=d1定时触发 开 dapeng->d1-close-i|-s");\r\n}', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(3087, 20, 'DHT 温湿度传感器', '                // DHT 温湿度传感器\r\n// 统一传感器库示例\r\n// 由Tony DiCola为Adafruit Industries写\r\n// 在麻省理工学院许可下发布。\r\n\r\n// 需要以下Arduino库:\r\n// - DHT 传感器库: https://github.com/adafruit/DHT-sensor-library\r\n// - Adafruit统一传感器库: https://github.com/adafruit/Adafruit_Sensor\r\n\r\n#include <Adafruit_Sensor.h>\r\n#include <DHT.h>\r\n#include <DHT_U.h>\r\n\r\n#define DHTPIN 3     // 数字引脚连接DHT传感器\r\n// Feather HUZZAH ESP8266 note: use pins 3, 4, 5, 12, 13 or 14 --\r\n// Pin 15可以工作，但在程序上传时必须断开DHT\r\n\r\n// 取消注释正在使用的传感器类型:\r\n#define DHTTYPE    DHT11     // DHT 11\r\n//#define DHTTYPE    DHT22     // DHT 22 (AM2302)\r\n//#define DHTTYPE    DHT21     // DHT 21 (AM2301)\r\n\r\n// 有关传感器接线和使用的详细信息，请参见指南:\r\n//   https://learn.adafruit.com/dht/overview\r\n\r\nDHT_Unified dht(DHTPIN, DHTTYPE);\r\n\r\nuint32_t delayMS;\r\n\r\nvoid setup() {\r\n  Serial.begin(19200);\r\n  // Initialize device.\r\n  dht.begin();\r\n  Serial.println(F("DHTxx Unified Sensor Example"));\r\n\r\n  sensor_t sensor;\r\n  dht.temperature().getSensor(&sensor);\r\n  Serial.println(F("------------------------------------"));\r\n  Serial.println(F("Temperature Sensor"));\r\n  Serial.print  (F("Sensor Type: ")); Serial.println(sensor.name);\r\n  Serial.print  (F("Driver Ver:  ")); Serial.println(sensor.version);\r\n  Serial.print  (F("Unique ID:   ")); Serial.println(sensor.sensor_id);\r\n  Serial.print  (F("Max Value:   ")); Serial.print(sensor.max_value); Serial.println(F("°C"));\r\n  Serial.print  (F("Min Value:   ")); Serial.print(sensor.min_value); Serial.println(F("°C"));\r\n  Serial.print  (F("Resolution:  ")); Serial.print(sensor.resolution); Serial.println(F("°C"));\r\n  Serial.println(F("------------------------------------"));\r\n  // Print humidity sensor details.\r\n  dht.humidity().getSensor(&sensor);\r\n  Serial.println(F("Humidity Sensor"));\r\n  Serial.print  (F("Sensor Type: ")); Serial.println(sensor.name);\r\n  Serial.print  (F("Driver Ver:  ")); Serial.println(sensor.version);\r\n  Serial.print  (F("Unique ID:   ")); Serial.println(sensor.sensor_id);\r\n  Serial.print  (F("Max Value:   ")); Serial.print(sensor.max_value); Serial.println(F("%"));\r\n  Serial.print  (F("Min Value:   ")); Serial.print(sensor.min_value); Serial.println(F("%"));\r\n  Serial.print  (F("Resolution:  ")); Serial.print(sensor.resolution); Serial.println(F("%"));\r\n  Serial.println(F("------------------------------------"));\r\n  // Set delay between sensor readings based on sensor details.\r\n  delayMS = sensor.min_delay / 1000;\r\n}\r\n\r\nvoid loop() {\r\n  delay(delayMS);\r\n  // 获取温度事件并打印其值.\r\n  sensors_event_t event;\r\n  dht.temperature().getEvent(&event);\r\n  if (isnan(event.temperature)) {\r\n    Serial.println(F("Error reading temperature!"));\r\n  }\r\n  else {\r\n    Serial.print(F("Temperature: "));\r\n    Serial.print(event.temperature);\r\n    Serial.println(F("°C"));\r\n  }\r\n  // Get humidity event and print its value.\r\n  dht.humidity().getEvent(&event);\r\n  if (isnan(event.relative_humidity)) {\r\n    Serial.println(F("Error reading humidity!"));\r\n  }\r\n  else {\r\n    Serial.print(F("Humidity: "));\r\n    Serial.print(event.relative_humidity);\r\n    Serial.println(F("%"));\r\n  }\r\n}   ', '', 'webserver'),
(3089, 1, '一通电没有按键就间断响', '拆开把面板和主机连接线断开,通电看是否还响响,如果没有响,为面板按键受潮问题', '', 'webserver'),
(3090, 10, '吊扇三线接法', '测量阻值居中的那根黑线接220V一端,\r\n另一根非黄线再接220V另一端', '', 'webserver'),
(3091, 160, ' 树莓派花生壳信息\r\n', ' Oray Phtunnel Raspberry 5.0.0 \r\n --------------------------------\r\n  SN: oray296b3a9ef73f \r\n  Default password: admin  |\r\n -------------------------------\r\n Remote Management Address http://b.oray.com\r\n\r\n1、输入命令：phddns回车，可以看到扩展功能。phddns start（启动）| status（状态）| stop（停止）|restart（重启）| reset（重置）|enable（开机自启动）|disable（关闭开机自启动）|version（版本）\r\n日志文件存放路径：/var/log/phddns\r\n在浏览器中访问远程管理地址http://b.oray.com ，在登录页面中输入SN码与默认密码（admin）登录\r\n\r\n卸载命令：dpkg -r phddns            ', '', 'webserver'),
(3093, 32, '加油无力', '查看汽车是不是外置汽油滤清器,\r\n内置的不需要更换,因为内置的在油箱里面,而且很大\r\n一般去大弄加油站8万公里左右换一次外置汽油滤清器\r\n小加油站6万公里左右就要换\r\n', '', 'webserver'),
(3097, 32, '涡轮增压发动机注意事项', '1.至少半合成机油以上\r\n2.涡轮不需要清理,清理不当反而容易损坏\r\n3.涡轮工作时温度800度到1000度的高温.好的机油可以更好的降温', '', 'webserver'),
(3321, 72, '电子热水器不通电检修步骤', '拆下漏电保护器单独测电压是否正常\r\n正常再测量一下发热管是否有几十欧阻值\r\n36欧 50欧 86欧 测对外金属外壳是否有短路或漏电现像\r\n如果正常，直接更换电脑板，看看显示板要不要换，一般都一起换', '', 'webserver'),
(3550, 321, 'mysql基础语句', '//增 添加插入数据\r\ninsert into table(a,b,c) values (''?'',''?'',''?'');\r\n//删 删除一条数据\r\ndelete from table where id=''?'';\r\n//更 修改数据\r\nupdate table set a=''?'',b=''?'' where id=''?''\r\n//查 查询一条数据\r\nselect id from table where name=''?'';\r\n//更改字段名称\r\nALTER TABLE 表名 CHANGE 原来字段 新字段  VARCHAR(字段长度)\r\n\r\n查看数据结构\r\ndesc table;\r\n\r\n删除字段\r\nALTER TABLE 表名 drop COLUMN 字段名;\r\n\r\n增加字段\r\nALTER TABLE 表名 ADD 字段名 类型  NOT NULL 默认(DEFAULT ''0''); \r\n指定字段kuaidi_number后追加字段\r\nALTER TABLE 表名 ADD 字段名 类型  NOT NULL DEFAULT ''0'' after kuaidi_number;\r\n\r\nmysql 更改字段类型\r\nALTER TABLE 表名 modify column 字段 类型 NOT NULL 默认(DEFAULT ''0'');  \r\n\r\n//更改字段名 及字段属性 默认值\r\nALTER TABLE 表名 change 旧字段 新字段 varchar(32) DEFAULT 1\r\n\r\n修改字段默认值语法：\r\nalter  table 表名 alter  column 字段名 drop default （本身存在默认值,则先删除）\r\nalter  table 表名 alter  column 字段名 set default 默认值 （本身不存在默认值可直接设定）  \r\n\r\n//修改字段 not null\r\nalter table CommerceCustomer modify address varchar(64)  not null\r\n\r\n//复制远程服务器数据库到本地数据库 \r\nmysqldump -h360xyz.cn -uroot -pqq282246101 --opt --compress xyz --skip-lock-tables | mysql -h localhost -uroot -pqq282246101 xyz \r\n\r\n//备份本地数据库成一个sql文件 并且文件大于5个自动删除最久一个文件\r\n/usr/bin/mysqldump -hlocalhost -uroot -pqq282246101 xyz > /var/www/html/vvwd/tool/sql/$(date +%Y%m%d%H%M).sql;\r\nrm -f /var/www/html/vvwd/tool/sql/$(date -d -5day +%Y%m%d%H%M).sql;  \r\n', '', 'webserver'),
(3551, 321, 'windows或linux备份远程mysql命令', '运行 cmd 到mysqldump.exe的目录下(mysqldump.exe可以从mysql目录里复制) 以下命令\r\nmysqldump -h服务器ip -u root -p密码 数据库名 > /路径/xyz.sql;\r\n或者写个.bat批处理文件直接点击就可以了            ', '', 'webserver'),
(3552, 321, 'ubuntu 安装mysql', '------------安装mysql-------------------\r\nsudo apt-get install mysql-server mysql-client\r\n\r\n//设置 mysql 可以外网访问\r\nsudo vim /etc/mysql/mysql.conf.d/mysqld.cnf\r\nbind-address前添加 #注释掉该行\r\n//刚安装完成时root用户不需要密码\r\nsudo mysql -uroot -p //回车 \r\n//远程访问数据库\r\nupdate mysql.user set host=''%'';\r\nflush privileges;\r\n//更改密码\r\nALTER USER ''root''@''%'' IDENTIFIED WITH mysql_native_password BY ''qq282246101'';\r\nflush privileges;\r\nsudo service mysql restart //重启', '', 'webserver'),
(3792, 10, '遥控风扇按开机键转一下就停,按住不放也不转 ', '更换5.6v1w稳压二极管         ', '', 'webserver'),
(3817, 160, 'nginx缺少fastcgi-php.conf 文件', '# regex to split $uri to $fastcgi_script_name and $fastcgi_path\r\nfastcgi_split_path_info ^(.+\\.php)(/.+)$;\r\n\r\n# Check that the PHP script exists before passing it\r\ntry_files $fastcgi_script_name =404;\r\n\r\n# Bypass the fact that try_files resets $fastcgi_path_info\r\n# see: http://trac.nginx.org/nginx/ticket/321\r\nset $path_info $fastcgi_path_info;\r\nfastcgi_param PATH_INFO $path_info;\r\n\r\nfastcgi_index index.php;\r\ninclude fastcgi.conf;\r\n', '', 'webserver'),
(3818, 321, 'windows下的mysql默认不是utf-8编码', '不是UTF-8编码中文时会现乱码或sql无法识别中文字符，需要手动更改一下为UTF-8\r\nmysql 下找到 my.ini\r\n查找 [mysqld]\r\n在它下面输入 character-set-server=utf8   保存后重启mysql\r\n', '', 'webserver'),
(3819, 20, '水中电压测量25v以内', '#include <ESP8266WiFi.h>\r\n#include <ESP8266WebServer.h>\r\n#include <ESP8266HTTPClient.h>\r\n#include <FS.h>\r\nint v = 0;\r\nfloat val11;\r\nfloat val2;\r\n//被读取的文件位置和名称\r\nString flash_wifi = "/wifi.txt";\r\nESP8266WebServer ESP8266webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString ssid = "";\r\nString passwd = "";\r\nString html = String("") + "<!DOCTYPE html>" +\r\n              "<html>" +\r\n              "<head>" +\r\n              "<meta charset=''utf-8''>" +\r\n              "<meta name=''viewport'' content=''width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no'' />" +\r\n              "<title>设置WiFi</title>" +\r\n              "<link rel=''stylesheet'' href=''''>" +\r\n              "</head>" +\r\n              "<script>" +\r\n              "onload  = function() {" +\r\n              "document.getElementById(''up'').onclick = function(){" +\r\n              "var ssid=document.getElementsByTagName(''input'')[0].value;" +\r\n              "var passwd=document.getElementsByTagName(''input'')[1].value;" +\r\n              "xhr = new XMLHttpRequest();" +\r\n              "xhr.open(''POST'',''./set_wifi'',true);" +\r\n              "var posts = (''ssid=''+ssid+''&passwd=''+ passwd);" +\r\n              "xhr.setRequestHeader(''Content-Type'',''application/x-www-form-urlencoded'');" +\r\n              "xhr.send(posts);" +\r\n              "xhr.onreadystatechange = function(){" +\r\n              " if(this.readyState == 4 && this.status == 200){" +\r\n              "alert(this.responseText);" +\r\n              " }" +\r\n              " }" +\r\n              "}" +\r\n              "}" +\r\n              "</script>" +\r\n              "<body>" +\r\n              "<p>WiFi帐号<input type=''text'' name=''ssid''></p>" +\r\n              "<p>WiFi密码<input type=''text'' name=''passwd''></p>" +\r\n              "<input type=''submit'' id=''up'' value=''设置''>" +\r\n              "<div>连接成功AP热点退出转WIFI_STA</div>" +\r\n              "</body>" +\r\n              "</html>";\r\nint d5 = 14;\r\nString flash_sql = "/sql.txt";\r\n//连网状态\r\nbool wifibool = false;\r\nvoid setup(void) {\r\n  pinMode(d5, INPUT_PULLUP);//默认是高电平\r\n  bool wifibool = wifi_bool();\r\n  if (wifibool == false) {\r\n    ap_start();\r\n    delay(1000);\r\n    Serial.println("bei wang");\r\n    webserver_start();\r\n    while (1) {\r\n      ESP8266webServer.handleClient();   // 检查网络服务请求并处理\r\n    }\r\n  }\r\n  SPIFFS.remove(flash_sql);\r\n}\r\nvoid loop(void) {\r\n  // put your main code here, to run repeatedly:\r\n  float temp;\r\n  val11 = analogRead(v);\r\n  temp = val11 / 6.492;\r\n  //val11=(int)temp;//\r\n  val2 = temp * 0.1;\r\n  Serial.println(val2);\r\n  SPIFFS.begin();\r\n  //网络是否连通\r\n  for (int i = 0; i < 10; i++) {\r\n    if (http_get("http://www.360xyz.cn/server/ping_websocket") != "") {\r\n      wifibool = true;\r\n      break;\r\n    }\r\n    delay(500);\r\n  }\r\n  //追加内容 可读可写\r\n  File dataFile = SPIFFS.open(flash_sql, "a+");\r\n\r\n  //给D5对地短接 表示要发送消息到服务器\r\n  if (digitalRead(d5) == LOW) {\r\n    if (wifibool == false) {\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //连接WIFI\r\n      wifibool = wifi_bool();\r\n    }\r\n    //连接成功\r\n    if (wifibool == true) {\r\n      String result = dataFile.readString();\r\n      Serial.println(result);\r\n      if (result.length() > 10) {\r\n        http_post("http://www.360xyz.cn/internet/RuestEspData", "user=Taurus_Feb&data=" + result);\r\n        Serial.println("发送");\r\n      }\r\n    }\r\n    //发送完毕，清除文件\r\n    SPIFFS.remove(flash_sql);\r\n  }\r\n  //把数据存到 flash闪存里\r\n  String result = dataFile.readString();\r\n  Serial.println(result);\r\n  if (val2 > 0) {\r\n    String aabb = "|" + String(val2);\r\n    dataFile.print(aabb);\r\n    delay(200);\r\n\r\n    dataFile.close();\r\n  }\r\n\r\n  delay(60000);\r\n}\r\nvoid set_wifi() {\r\n  ssid = ESP8266webServer.arg(0);\r\n  passwd = ESP8266webServer.arg(1);\r\n  String sp = ssid + "&" + passwd;\r\n  Serial.println(sp);\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  WiFi.begin(ssid, passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 30; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      ESP8266webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flash_wifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML连接成功");\r\n      delay(1000);\r\n      ESP.reset();\r\n    }\r\n  }\r\n\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  ESP8266webServer.send(300, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  ESP8266webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\n\r\n\r\nvoid ap_start() {\r\n  Serial.begin(19200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet) ;\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    //Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserver_start() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  ESP8266webServer.begin(); // 启用网络服务\r\n  ESP8266webServer.on("/", handleRoot);   // / 在HTTP中，表示请求首页服务，\r\n  ESP8266webServer.on("/set_wifi", set_wifi);\r\n  ESP8266webServer.onNotFound(handleNotFound);    // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\nbool wifi_bool() {\r\n  Serial.begin(19200);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flash_wifi) == false) {\r\n    Serial.print(flash_wifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flash_wifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  Serial.println(wifiname);\r\n  Serial.println(wifipw);\r\n  WiFi.begin(wifiname, wifipw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("wifi_bool->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 300; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("wifi_bool 闪存配置连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("wifi_bool->false");\r\n  return false;\r\n}\r\nString http_post(String url, String postStr) {\r\n  HTTPClient http;\r\n  String response;\r\n  http.begin(url);\r\n  http.setTimeout(3000);\r\n  //需要传输的数据\r\n  char dataBuff[postStr.length()];\r\n  strcpy(dataBuff, postStr.c_str());\r\n  //头信息，需要的反注释就可以\r\n  //http.addHeader("Content-Type", "application/json;charset=utf-8");\r\n  http.addHeader("Content-Type", "application/x-www-form-urlencoded");\r\n  int httpCode = http.POST(dataBuff);\r\n  if (httpCode == 200) {\r\n    response = http.getString();\r\n    //Serial.println(response);\r\n    return response;\r\n  }\r\n  http.end();\r\n}\r\nString http_get(String string) {\r\n  HTTPClient http;\r\n  String response;\r\n  http.begin(string);\r\n  http.setTimeout(3000);\r\n  int httpCode = http.GET();\r\n  if (httpCode == 200) {\r\n    //读取响应内容\r\n    response = http.getString();\r\n    //Serial.println(response);\r\n    http.end();\r\n    return response;\r\n  }\r\n  http.end();\r\n  return "";\r\n}', '', 'webserver'),
(3821, 160, 'ubuntu 更新php新版本', '一、删除php的相关包及配置\r\n    sudo apt-get autoremove php7*\r\n二、删除关联\r\n    sudo find /etc -name "*php*" |xargs  rm -rf\r\n三、清除dept列表\r\n    sudo apt purge `dpkg -l | grep php| awk ''{print $2}'' |tr "\\n" " "`\r\n//这行代码可有可无\r\nsudo apt install software-properties-common\r\n//电信网络有时连接不了,使用别的网络\r\nsudo add-apt-repository ppa:ondrej/php\r\napt install php{新版}-fpm\r\nphp{新版}-mysql \r\nphp{新版}-gd\r\nphp{新版}-json\r\nphp{新版}-shmop\r\nphp{新版}-sqlite3\r\nphp{新版}-mbstring\r\nphp{新版}-sockets\r\nphp{新版}-redis\r\nphp{新版}-intl\r\nphp{新版}-xml   \r\nphp{新版}-curl\r\nphp{新版}-swoole  ', '', 'webserver'),
(3840, 1, '间歇2秒循环报警', '放锅上去间歇2秒左右报警，\r\n检查检锅电路，大电阻是否断开或者阻值变大\r\n功率管周边的大电阻焊下测一下阻值是否正常一般不超过1M阻值为正常', '', 'webserver'),
(3841, 1, '不通电,保险丝没有烧', '更换 IC 然后听一下IC旁边变压器是否有嘶嘶声，如有，焊下220v4.7uf测量阻值，电容阻值正常，直接更换变压器', '', 'webserver'),
(3860, 160, '\r\nlinux 添加环境变量', 'vi~/.bashrc \r\n在里面写入环境变量\r\nsource ~/.bashrc\r\nreboot  //看效果\r\n', '', 'webserver'),
(3861, 160, 'centos8 安装lnmp', 'yum -y upgrade 只更新软件包,不更新内核\r\nyum install nginx\r\nsystemctl restart nginx -y\r\n网站根目录 /usr/share/nginx/html\r\n//nginx 重写 rewrite\r\n/etc/nginx/nginx.conf文件下\r\n//在 location / { 　} 上\r\ninclude /网站根目录/nginx.htaccess\r\n//nginx.htaccess 写入以下内容\r\nif (!-e $request_filename) {\r\n         rewrite  ^(.*)$  /index.php?s=$1  last;\r\n         break;\r\n} \r\nsystemctl restart nginx\r\n------------ 安装php7.2 -----------------\r\nyum install php -y\r\nyum install php-sqlite3 -y\r\nyum install php-pdo php-gd\r\nyum install php-mysqlnd\r\n//后台返回数据json报错记得安装php-json\r\nyum install php-json\r\nvim /etc/nginx/nginx.conf.default \r\nindex.html前加入index.php\r\n------------ 安装mysql-----------------\r\nyum install mysql-server\r\nsystemctl restart mysqld.service\r\nmysql -uroot -p //回车\r\n//远程访问数据库\r\nupdate mysql.user set host=''%'';\r\nflush privileges;\r\n//更改密码\r\nALTER USER ''root''@''%'' IDENTIFIED WITH mysql_native_password BY ''qq282246101'';\r\nflush privileges;\r\nexit;', '', 'webserver'),
(3862, 160, 'linux常用命令', '#更改ip地址\r\nifconfig eth0 192.168.100.254 netmask 255.255.255.0\r\n#更改网关\r\nroute add default gw  192.168.100.1\r\n#关闭防火墙\r\nsystemctl stop firewalld.service\r\n#设置开机自动启动\r\nsystemctl enable 程序名.service\r\n\r\n#循环定时      crontab -e\r\n#在下面进行编辑 每天夜里3点30分执行备份\r\n30 3 * * * /执行文件路径/mysql.sh\r\n\r\n#记得给文件权限\r\nchmod ugo+x /执行文件路径/mysql.sh\r\n　　u 表示“用户（user）”，即文件或目录的所有者\r\n　　g 表示“同组（group）用户”，即与文件属主有相同组ID的所有用户\r\n　　o 表示“其他（others）用户\r\n+-增加或减少  r读取 x执行 w写入\r\n\r\n#复制文件 -v 是显示进度的意思\r\ncp -f -v /源文件/  /目标文件目录\r\n#复制文件夹及文件夹下的所有子目录文件 -v 是显示进度的意思\r\ncp -r -v /源文件目录/  /目标文件目录\r\n\r\n#安装支持ntfs格式的磁盘\r\napt install ntfs-3g -y  \r\nblkid  或者 fdisk -l#查看Linux系统每个磁盘与分区的信息\r\n#挂载磁盘\r\nmount /dev/sda1 /mnt\r\n#卸载磁盘\r\numount /mnt  \r\n\r\nrm -r /路径    	#删除文件夹\r\nrm -f /路径/文件名    #删除文件\r\nrm -r -f *                   #删除该目录所有文件夹和文件\r\n#mysql 备份命令 mysql密码跟-p之间没有空格\r\n/usr/bin/mysqldump -u root -p密码 数据库名 > /路径/$(date +%Y%m%d%H%M).sql;\r\ntouch /路径/文件  #新建文件     \r\nmkdir -p /路径/文件夹  #新建文件夹   \r\napt-get remove packagename --purge #卸截软件及配置文件\r\n\r\nlast -x|grep shutdown #查看关机时间日志\r\nlast -x|grep shutdown|head -1 #查看最后一次关机时间\r\n让php 也能执行关机命令shutdown\r\n#root用户登陆\r\nchmod u+s,u=rwx,go=rx /sbin/shutdown   #(4755)\r\n/sbin/shutdown\r\n\r\napt-get install unrar\r\nunrar x 文件.rar  /解压目录 \r\napt-get install unzip \r\nunzip  文件.zip  /解压目录 \r\ntar -xvf 包名  #普通没有进行压缩的文件解压 \r\ntar -zxvf 包名  #对于进行过压缩的文件解压 \r\ntar -cvf renwolesshel.tar.gz  renwolesshel  #不压缩打包\r\ntar -czvf renwolesshel.tar.gz  renwolesshel  #压缩打包\r\n\r\nnetstat -tunlp|grep 端口  #查看某个服务\r\nkill -9 端口下的id  #关闭某个服务\r\n\r\nsudo dpkg-reconfigure tzdata #校准时间\r\nAsia\r\nshanghai\r\ntop -o %MEM  #查看程序内存占用情况，同时也可以查看CPU使用率', '', 'webserver'),
(3863, 160, 'linux 循环自动定时备份mysql数据库', '//新建mysql.sh \r\ntouch /路径/mysql.sh\r\nvim /路径/mysql.sh  //写入以下内容\r\n/usr/bin/mysqldump -u root -p密码 数据库名 > /路径/$(date +%Y%m%d%H%M).sql;\r\n//备份远程云主机方法\r\n/usr/bin/mysqldump -h云主机ip -u root -p密码 数据库名 > /路径/$(date +%Y%m%d%H%M).sql;\r\n//设置可执行权限\r\nchmod -x /路径/mysql.sh\r\ncrontab -e \r\n//定时每天夜里3.30分进行备份\r\n30 3 * * * /路径/mysql.sh\r\n//自动删除前5天的备份\r\nrm -f /路径/$(date -d -5day +%Y%m%d%H%M).sql; \r\n//6点到23点间执行\r\n* 6-23 **** /', '', 'webserver'),
(3867, 20, 'MQTT连接服务器', '=======固定报头======\r\n10 ??(后面做完,再数有几个再转16进制值)\r\n\r\n======可变报头 协议名======\r\n00 04   4D 51 54 54(MQTT 转换成16进制的值)\r\n======可变报头 协议级别\r\n04\r\n======可变报头 连接标示======\r\n1(用户名) 1(密码) 0 0 0 0 1 0\r\n转换16进制是\r\nC2\r\n======可变报头 保持连接======\r\n00 78(120秒十进制转换16进制是78)\r\n可变报头串连\r\n10 ?? 00 04 4D 51 54 54 04 C2 00 78\r\n\r\n=========有效载荷=============\r\n//没有遗嘱\r\n有效载荷 = 客户ID + 用户 + 密码\r\nclient id的16进制长度+client id+mqtt username的16进制长度+mqtt username+mqtt password的16进\r\n\r\n制长度+mqtt password\r\n//有遗嘱\r\n有效载荷 = 客户ID + 遗嘱主题 + 遗嘱消息 + 用户 + 密码\r\n?? 超过128字节 请查看 第二条 MQTT剩余长度规则\r\n服务器返回 20 02 00 00 (00)代表成功', '', 'webserver'),
(3868, 20, 'MQTT剩余长度规则', '小于128个字节的可以用 一个字节表示\r\n等于128就要用两个字节表示\r\n计算公式  剩余长度=128*a+b\r\nb是10进制转换成2进制 从后面开始数第8位置为1\r\n比如b=33 二进制是100001 第8位置1那么就等于\r\n10100001 再转换成16进制就是A1\r\n记往低位放前 A1 下面计算放后面的高位\r\na=1 二进制就是1 转换成16进制也是1 那行得到\r\nA1 01\r\n', '', 'webserver'),
(3869, 20, 'MQTT订阅主题 ', '固定报头 + (可变报头16进制长度(00 xx)+可变报头)+权限等级01\r\n如下\r\n82 ?? 00 0A \r\n(可变报头16进制长度(00 xx)+可变报头)+权限等级01\r\n?? 是(可变报头16进制长度(00 xx)+可变报头)+权限等级01的总长度16进制\r\n服务器返回 90 03 00 0A 01 代表成功\r\n如权限等级是0则返回 90 03 00 0A 00', '', 'webserver'),
(3870, 20, 'MQTT发布消息 固定报头+可变报头+', '30 ?? +发布可变报头长度+发布可变报头+01+消息内容长度+消息内容', '', 'webserver'),
(3871, 20, 'MQTT取消订阅', '====取消订阅=====\r\n固定报头+可变报头+有效载荷\r\nA2 ??(固定报)\r\n00 0A (可变报头)\r\n之前 订阅主题 的16进制的长度+  订阅主题 的16进制(有效载荷)\r\n返回 B0 02 00 0A(代表退订成功)', '', 'webserver'),
(3872, 20, '腾讯云 MQTT', '地址 \r\nGAQ8DJJP94.iotcloud.tencentdevices.com 1883\r\n两个设备互通 -> 引擎规则\r\n筛选数据 为控制端\r\n行为操作 -> 数据转发到另一个Topic ( Republish )\r\n为受控端 control', '', 'webserver'),
(3876, 344, 'vscode golang 安装插件', 'https://goproxy.io/zh/ 一个全球代理为 Go 模块而生\r\n\r\ngo env -w GO111MODULE=on\r\n\r\n可选一  go env -w GOPROXY=https://goproxy.io,direct\r\n可选二 go env -w GOPROXY=https://goproxy.cn,direct\r\n或者 # 还可以设置不走 proxy 的私有仓库或组，多个用逗号相隔（可选）\r\ngo env -w GOPRIVATE = "git.mycompany.com,github.com/my/private"', '', 'webserver'),
(3877, 344, 'golang 调用异步协程', '//定义这个WaitGroup是为了 go协程执行完毕后wg.Wait() 放行主线程继续往下	\r\n	wg := sync.WaitGroup{}\r\n	wg.Add(10)//表示调用异步次数\r\n	for i := 0; i < 10; i++ {\r\n		go func(i int) {\r\n			fmt.Println(i)\r\n		wg.Done()//调用次数减1\r\n		}(i)\r\n	}\r\n//wg 是为了等待异步执行完毕 有这句话就算主程序完成了程序还是要等待 直到异步完成为止\r\n	wg.Wait()\r\n	fmt.Println("ok")\r\n\r\n//示例如下\r\n\r\nfunc Aaa(wg *sync.WaitGroup) {\r\n	fmt.Println("Aaa")\r\n	wg.Done()\r\n}\r\nfunc Baa(wg *sync.WaitGroup) {\r\n	fmt.Println("Baa")\r\n	wg.Done()\r\n}\r\nfunc Caa(wg *sync.WaitGroup) {\r\n	fmt.Println("Caa")\r\n	wg.Done()\r\n}\r\nfunc Daa(wg *sync.WaitGroup) {\r\n	fmt.Println("Daa")\r\n	wg.Done()\r\n}\r\nfunc main() {\r\n	wg := sync.WaitGroup{}\r\n	wg.Add(4)\r\n	go Aaa(&wg)\r\n	go Baa(&wg)\r\n	go Caa(&wg)\r\n	go Daa(&wg)\r\n	wg.Wait()\r\n	fmt.Println("ok")\r\n}', '', 'webserver'),
(3879, 344, 'linux 手动安装golang或更新版本 ', '官网下载最新包\r\n如果是 树莓派 就下载 arm构架的包\r\n下载后放到 /usr/local/下面 这里是linux默认安装的地方 当然也可以装到别的地方\r\n把包放到这个目录下 cd 到该目录\r\ntar -zxvf 包名  //进行解压\r\n\r\n最重要一点来了  设置环境变量\r\n\r\nvi ~/.bashrc\r\n\r\n里面添加\r\n\r\n//更新golang版本 直接进入/usr/local/\r\nrm -r go\r\n//然后把包放到这个目录下解压就可以了\r\n//我们的工作目录设置是 /opt/go\r\n//下面有三个目录 bin  pkg(这个目录是依赖包目录很重要千万别删) src(代码目录 也就是工作目录 写完代码直接命令运行或编译 go run main.go   或者 go build main.go)\r\n\r\nexport GOROOT=/usr/local/go  //就是你包解压的地方\r\n\r\nexport GOPATH=/opt/go  //你网站运行的目录\r\n\r\nexport PATH=$GOPATH/bin:$GOROOT/bin:$PATH\r\n\r\n保存退出\r\n\r\n再  source ~/.bashrc\r\n//下载beego\r\ngo get github.com/astaxie/beego\r\ngo get github.com/beego/bee', '', 'webserver'),
(3880, 344, 'defer 关键名', 'defer 关键名 相当于c# finaly\r\n\r\n\r\n\r\ndefer conn.close()\r\n\r\ndb.select()...\r\n\r\n//它是会等待db.select()...再进行conn.close() 它会等他代码下一行语句执行完毕再调用到它', '', 'webserver'),
(3881, 344, 'go 判断客户端是是手机还是电脑', 'import (\r\n\r\n	"strings"\r\n\r\n	"github.com/astaxie/beego"\r\n\r\n)\r\n\r\ntype Isphome struct{\r\n\r\n	beego.Controller\r\n\r\n}\r\n\r\nfunc (c *Isphome)Isphone() bool{\r\n\r\n	//User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0\r\n\r\n	UserAgent := c.Ctx.Request.Header.Get("User-Agent")\r\n\r\n	//找不到返回 -1 成功为正数\r\n\r\n	i := strings.Index(UserAgent, "Windows")\r\n\r\n	if i> -1 {\r\n\r\n		return true\r\n\r\n	}else{\r\n\r\n		return false\r\n\r\n	}\r\n\r\n}\r\n', '', 'webserver'),
(3883, 344, 'golang 执行先后', '先执行引入包的 全局变量 -> init方法\r\n\r\n再执行本文件的 全局变量 -> init方法\r\n\r\n再到 main()方法', '', 'webserver'),
(3884, 344, 'golang mysql自定义 类 ', 'package models\r\n\r\nimport (\r\n	"database/sql"\r\n	"fmt"\r\n	"reflect"\r\n\r\n	_ "github.com/go-sql-driver/mysql"\r\n)\r\n\r\ntype Gdo struct {\r\n	conn *sql.DB\r\n	arr  []interface{}\r\n	stmt *sql.Stmt\r\n}\r\n\r\nfunc NewGdo(dbDatabase string) *Gdo {\r\n	conn, err := sql.Open("mysql", "root:qq282246101@tcp(localhost:3306)/"+dbDatabase+"?charset=utf8")\r\n	if err != nil {\r\n		fmt.Println("连接数据库失败")\r\n		conn.Close()\r\n		return nil\r\n	}\r\n	conn.SetConnMaxLifetime(100)\r\n	conn.SetMaxOpenConns(30)\r\n	g := &Gdo{}\r\n	g.conn = conn\r\n	return g\r\n}\r\nfunc (this *Gdo) Sql(sql string, arr ...interface{}) *Gdo {\r\n	Stmt, err := this.conn.Prepare(sql)\r\n	if err != nil {\r\n		fmt.Printf("prepare sql failed, err:%v\\n", err)\r\n		this.conn.Close()\r\n		return nil\r\n	}\r\n	this.stmt = Stmt\r\n	this.arr = arr\r\n	return this\r\n}\r\n\r\n// 查询成功 返回 true 返回值是 bool 手动写 指针取值\r\nfunc (this *Gdo) Row(show ...interface{}) bool {\r\n	row, err := this.stmt.Query(this.arr...)\r\n	if err != nil {\r\n		return false\r\n	}\r\n	defer row.Close()\r\n	bl := row.Next()\r\n	if bl == false {\r\n		return false\r\n	}\r\n	row.Scan(show...)\r\n\r\n	return true\r\n}\r\n\r\n// 返回*sql.Rows, error 手动写 指针取值\r\nfunc (this *Gdo) RowS() (*sql.Rows, error) {\r\n	rows, err := this.stmt.Query(this.arr...)\r\n	return rows, err\r\n}\r\n\r\n// 失败返回空MAP 返回数据全部是string 数据库字段默认null即sql.NullString之类不能使用该方法\r\nfunc (this *Gdo) Fetch() map[string]string {\r\n	result := make(map[string]string)\r\n	row, err := this.stmt.Query(this.arr...)\r\n	if err != nil {\r\n		return result\r\n	}\r\n	column, err1 := row.Columns()\r\n	if err1 != nil {\r\n		return result\r\n	}\r\n	values := make([][]byte, len(column))\r\n	scans := make([]interface{}, len(column))\r\n	for i := range values {\r\n		scans[i] = &values[i]\r\n	}\r\n	defer row.Close()\r\n	bl := row.Next()\r\n	if bl == false {\r\n		return result\r\n	}\r\n	row.Scan(scans...)\r\n	for i, v := range values {\r\n		key := column[i]\r\n		result[key] = string(v)\r\n	}\r\n	return result\r\n}\r\n\r\n// 失败返回空MAP 返回数据全部是string 数据库字段默认null即sql.NullString之类不能使用该方法\r\nfunc (this *Gdo) FetchAll() map[int]map[string]string {\r\n	result := make(map[int]map[string]string)\r\n	rows, err := this.stmt.Query(this.arr...)\r\n	if err != nil {\r\n		return result\r\n	}\r\n	//得到 select 查询字段名与个数\r\n	column, err1 := rows.Columns()\r\n	if err1 != nil {\r\n		return result\r\n	}\r\n	values := make([][]byte, len(column))\r\n	//fmt.Println(values)\r\n	scans := make([]interface{}, len(column))\r\n	for i := range values {\r\n		scans[i] = &values[i]\r\n	}\r\n	//fmt.Println(scans)\r\n	i := 0\r\n	defer rows.Close()\r\n	for rows.Next() {\r\n		rows.Scan(scans...)\r\n		row := make(map[string]string)\r\n		for i, v := range values {\r\n			key := column[i]\r\n			row[key] = string(v)\r\n		}\r\n		result[i] = row\r\n		i++\r\n	}\r\n	return result\r\n}\r\n\r\n// 失败返回0 成功返回 受影响行的个数\r\nfunc (this *Gdo) Execute() int64 {\r\n	crow, err := this.stmt.Exec(this.arr...)\r\n	if err != nil {\r\n		return 0\r\n	}\r\n	re, err1 := crow.RowsAffected()\r\n	if err1 != nil {\r\n		return 0\r\n	}\r\n	return re\r\n}\r\n\r\n// 失败返回0 成功返回 行的id\r\nfunc (this *Gdo) Insert() int64 {\r\n	crow, err := this.stmt.Exec(this.arr...)\r\n	if err != nil {\r\n		return 0\r\n	}\r\n	re, err1 := crow.LastInsertId()\r\n	if err1 != nil {\r\n		return 0\r\n	}\r\n	return re\r\n}\r\nfunc (this *Gdo) AutoInsert(table string, m map[string]interface{}) int64 {\r\n	sql := "INSERT INTO " + table + " ("\r\n	//(rid,user,password) VALUES (?,?,?)\r\n	ik := ""\r\n	iv := ""\r\n	var mv []interface{}\r\n	for k, v := range m {\r\n		if ik == "" {\r\n			ik = k + ","\r\n		} else {\r\n			ik = ik + k + ","\r\n		}\r\n		if iv == "" {\r\n			iv = "?,"\r\n		} else {\r\n			iv = iv + "?" + ","\r\n		}\r\n		mv = append(mv, v)\r\n	}\r\n	ik = ik[0 : len(ik)-1]\r\n	iv = iv[0 : len(iv)-1]\r\n	sql = sql + ik + ") VALUES (" + iv + ")"\r\n	return this.Sql(sql, mv...).Insert()\r\n}\r\nfunc StructToMap(obj interface{}) map[string]interface{} {\r\n	t := reflect.TypeOf(obj)\r\n\r\n	//获取到里面的值 一维数组 {100 beego gobee}\r\n	v := reflect.ValueOf(obj)\r\n	data := make(map[string]interface{})\r\n	for i := 0; i < t.NumField(); i++ {\r\n		//得到键名                //得到里面的值\r\n		data[t.Field(i).Name] = v.Field(i)\r\n	}\r\n	return data\r\n}\r\nfunc StructToMapS(obj interface{}) map[string]string {\r\n	t := reflect.TypeOf(obj)\r\n\r\n	//获取到里面的值 一维数组 {100 beego gobee}\r\n	v := reflect.ValueOf(obj)\r\n	data := make(map[string]string)\r\n	for i := 0; i < t.NumField(); i++ {\r\n		//得到键名                //得到里面的值\r\n		data[t.Field(i).Name] = v.Field(i).String()\r\n	}\r\n	return data\r\n}\r\n', '', 'webserver'),
(3885, 344, 'bee 分页', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"strconv"\r\n	"strings"\r\n)\r\n\r\ntype Pages struct {\r\n	PageNo     int    //当前页\r\n	PageSize   int    //每页多少数据\r\n	TotalPage  int    //总共多少页\r\n	TotalCount int    //总共多少条数据\r\n	FirstPage  int    //第一页\r\n	LastPage   int    //最后一页\r\n	Url        string //链接\r\n}\r\n\r\nfunc NewPage(PageNo int, PageSize int, TotalCount int, Url string) Pages {\r\n	return Pages{PageNo: PageNo, PageSize: PageSize, TotalCount: TotalCount, Url: Url}\r\n}\r\n\r\n//计算总页数\r\nfunc (c *Pages) getPageCount() {\r\n	var tp float32 = float32(c.TotalCount) / float32(c.PageSize)\r\n	if tp < 1 {\r\n		c.TotalPage = 1\r\n	}\r\n	var tpint float32 = float32(int(tp))\r\n\r\n	if tp > tpint {\r\n		tpint += 1\r\n	}\r\n	c.TotalPage = int(tpint)\r\n	c.LastPage = int(tpint)\r\n	c.FirstPage = 1\r\n	c.execUrl()\r\n}\r\n\r\n//格式化URL地址\r\nfunc (c *Pages) execUrl() {\r\n	if strings.Contains(c.Url, "?") {\r\n		c.Url = strings.Join([]string{c.Url, "&page="}, "")\r\n	} else {\r\n		c.Url = strings.Join([]string{c.Url, "?page="}, "")\r\n	}\r\n}\r\n\r\n//获取URL组织\r\nfunc (c *Pages) getUrl(page int) string {\r\n	return strings.Join([]string{c.Url, strconv.Itoa(page)}, "")\r\n}\r\n\r\nfunc (c *Pages) getNum(page int, num int) (int, int) {\r\n	var k = 1\r\n	//分布显示数量\r\n	var v = 5\r\n	if page > 3 {\r\n		k = page - 2\r\n		v = page + 2\r\n		if v > num {\r\n			k = num - 4\r\n			v = num\r\n		}\r\n	} else {\r\n		if v > num {\r\n			v = num\r\n		}\r\n	}\r\n	return k, v\r\n}\r\nfunc (c *Pages) LimitStart() int {\r\n	return (c.PageNo - 1) * c.PageSize\r\n}\r\nfunc (c *Pages) Show() string {\r\n	c.getPageCount()\r\n	var style bytes.Buffer\r\n	style.WriteString("<style> .pageing{ width:360px; list-style-type:none; margin: 0px;padding: 0px; } .pageing>li {  float: left; width: 30px; line-height:23px; text-align: center; border: 1px solid #7B7B7B; margin:3px; }  </style>")\r\n	var buf bytes.Buffer\r\n	str := "<div style=\\"clear:both;\\"></div><ul class=\\"pageing\\"><li><a href=\\"" + c.getUrl(1) + "\\">1</a></li>"\r\n	buf.WriteString(str)\r\n	if c.PageNo > 1 {\r\n		buf.WriteString("<li><a href=\\"" + c.getUrl(c.PageNo-1) + "\\"><<</a></li>")\r\n	}\r\n\r\n	k, v := c.getNum(c.PageNo, c.TotalPage)\r\n\r\n	for i := k; i <= v; i++ {\r\n		if i == c.PageNo {\r\n			buf.WriteString("<li style=\\"background-color: green;\\">")\r\n			buf.WriteString(strconv.Itoa(i))\r\n		} else {\r\n			buf.WriteString("<li><a href=\\"" + c.getUrl(i) + "\\">")\r\n			buf.WriteString(strconv.Itoa(i))\r\n		}\r\n		buf.WriteString("</a></li>")\r\n	}\r\n\r\n	if c.PageNo < c.TotalPage {\r\n		var nextPage int = c.PageNo + 1\r\n		buf.WriteString("<li><a href=\\"" + c.getUrl(nextPage) + "\\">>></a></li>")\r\n	}\r\n\r\n	buf.WriteString("<li><a href=\\"" + c.getUrl(c.TotalPage) + "\\">" + strconv.Itoa(c.TotalPage) + "</a></li></ul>")\r\n	return style.String() + buf.String()\r\n}\r\n', '', 'webserver'),
(3886, 344, 'beego 验证码', 'import (\r\n	"beego/models"\r\n	"encoding/base64"\r\n	"encoding/json"\r\n	"fmt"\r\n	"strings"\r\n\r\n	"github.com/astaxie/beego"\r\n	"github.com/astaxie/beego/cache"\r\n	captcha2 "github.com/astaxie/beego/utils/captcha"\r\n)\r\n\r\ntype VcodeController struct {\r\n	beego.Controller\r\n}\r\n\r\n// 全局验证码结构体\r\nvar captcha *captcha2.Captcha\r\n\r\n// init函数初始化captcha\r\nfunc init() {\r\n	// 验证码功能\r\n	// 使用Beego缓存存储验证码数据\r\n	store := cache.NewMemoryCache()\r\n	// 创建验证码\r\n	captcha = captcha2.NewWithFilter("/captcha", store)\r\n	// 设置验证码长度\r\n	captcha.ChallengeNums = 4\r\n	// 设置验证码模板高度\r\n	captcha.StdHeight = 50\r\n	// 设置验证码模板宽度\r\n	captcha.StdWidth = 120\r\n}\r\n\r\n\r\n <p> {{create_captcha}}<--刷新 </p> \r\n\r\n// if !captcha.VerifyReq(c.Ctx.Request) {\r\n	// 	c.Ctx.WriteString("验证码错误")\r\n	// 	return\r\n	// }', '', 'webserver'),
(3889, 344, 'map数组', 'make(map[string]interface{})\r\n\r\nmap[string]string{ "k":"v", } //map数组 初始值声明方式', '', 'webserver'),
(3890, 344, 'map转换  json', 'data, _ := json.Marshal(map_array)\r\nc.Ctx.WriteString(string(data))  //返回json响应', '', 'webserver'),
(3891, 321, '计算所有行某个字段的相加总合', 'SELECT sum(字段名) FROM TABLE', '', 'webserver'),
(3893, 344, '* 和 & 的区别', '* 代表取指针地址中存的值\r\n& 代表取一个值的内存地址\r\nfunc main() {\r\n	a := 100\r\n	var ptr *int\r\n\r\n	ptr = &a\r\n	fmt.Println(ptr)\r\n	fmt.Println(*ptr)//获取值\r\n	fmt.Println(*&a)//获取值\r\n}\r\n', '', 'webserver'),
(3896, 344, '管道 chan', 'chan   \r\nchan:=make(chan int,3) //(管道 类型,容量 ) 这个是双向管道 \r\nchan<-20  //管道赋值\r\naa:=<-chan //管道赋值给变量\r\nmake(chan<- int,3) //单向只写 只能这与不能取\r\nmake(<-chan int,3) //单向只读 只能取不能写\r\n管道特性 不管使用协程与否，管道都是排顺序 存取 主要应用于 协程+管道\r\n特别注意 chan存多少次就要取多少次\r\n\r\nchan<-10\r\nchan<-20\r\nchan<-30\r\n<-chan\r\n<-chan\r\n<-chan', '', 'webserver'),
(3897, 344, '互斥锁', 'golang\r\nvar mutex sync.Mutex //互斥锁 防止开启协程后 同时1个以上协程同时抢占全局变量报错\r\n// 互斥锁 变成非协程\r\nmutex.Lock //锁上\r\n协程都变成列队\r\nmutex.UnLock //解锁\r\n//主要应用 于商品抢购 可以读并发协程，写锁列队\r\nvar mutex sync.RWMutex\r\n//RWMutex可以mutex.Lock //锁上\r\n//协程都变成列队，写时不能读\r\n//mutex.UnLock //解锁\r\nmutex.RLock()\r\n并发协程读操作 特别注意 这里不是协程都变成列队\r\n读时不能写\r\nmutex.RUnlock()', '', 'webserver'),
(3902, 344, 'float32 float64 string 互转换', '//float32转float64\r\nfloat64(float32)\r\n//float64转float32\r\nfloat32(float64)\r\n//float32转string\r\n//先转64再转string 第三个参数是保留小数点后几位数\r\nstrconv.FormatFloat(float64(results), ''f'', 2, 64)', '', 'webserver'),
(3903, 344, 'go 浏览文件夹', 'import (\r\n	"fmt"\r\n	"io/ioutil"\r\n)\r\n\r\nfunc readDir(dirPath string) {\r\n	str := []string{}\r\n	files, err := ioutil.ReadDir(dirPath)\r\n	if err != nil {\r\n		fmt.Println("文件打开失败")\r\n	}\r\n	for _, v := range files {\r\n		if v.IsDir() {\r\n			str = append(str, "<"+v.Name()+">")\r\n		} else {\r\n			str = append(str, v.Name())\r\n		}\r\n	}\r\n	fmt.Println(str)\r\n}', '', 'webserver'),
(3907, 344, 'go编译后的程序关联详情', '编译后 可删除的文件夹\r\n1.控制器 controllers 文件夹\r\n2.static文件夹\r\n但是views是不可以删除的', '', 'webserver'),
(3908, 344, 'go 删除文件', 'os.Remove("123123.jpg")', '', 'webserver'),
(3909, 344, 'go 发送邮件', 'package models\r\n\r\nimport (\r\n	"strconv"\r\n\r\n	"gopkg.in/gomail.v2"\r\n)\r\n\r\ntype MyMail struct {\r\n	to     []string\r\n	title  string\r\n	body   string\r\n	attach string\r\n}\r\n\r\nfunc (class *MyMail) To(to string) *MyMail {\r\n	class.attach = ""\r\n	class.to = append(class.to, to)\r\n	return class\r\n}\r\nfunc (class *MyMail) Title(str string) *MyMail {\r\n	class.title = str\r\n	return class\r\n}\r\nfunc (class *MyMail) Body(str string) *MyMail {\r\n	class.body = str\r\n	return class\r\n}\r\nfunc (class *MyMail) Attach(path string) *MyMail {\r\n	class.attach = path\r\n	return class\r\n}\r\nfunc (class *MyMail) Send() error {\r\n	mailConn := map[string]string{\r\n		"user": "282246101@qq.com",\r\n		"pass": "jwssaevivurwcbai",\r\n		"host": "smtp.qq.com",\r\n		"port": "465",\r\n	}\r\n	port, _ := strconv.Atoi(mailConn["port"]) //转换端口类型为int\r\n\r\n	m := gomail.NewMessage()\r\n\r\n	m.SetHeader("From", m.FormatAddress(mailConn["user"], "360xyz"))\r\n	//这种方式可以添加别名，即“XX官方”\r\n	//说明：如果是用网易邮箱账号发送，以下方法别名可以是中文，如果是qq企业邮箱，以下方法用中文别名，会报错，需要用上面此方法转码\r\n	//m.SetHeader("From", "FB Sample"+"<"+mailConn["user"]+">") //这种方式可以添加别名，即“FB Sample”， 也可以直接用<code>m.SetHeader("From",mailConn["user"])</code> 读者可以自行实验下效果\r\n	//m.SetHeader("From", mailConn["user"])\r\n	m.SetHeader("To", class.to...)      //发送给多个用户\r\n	m.SetHeader("Subject", class.title) //设置邮件主题\r\n	m.SetBody("text/html", class.body)  //设置邮件正文\r\n	if class.attach != "" {\r\n		m.Attach(class.attach) //设置邮件附件\r\n	}\r\n	d := gomail.NewDialer(mailConn["host"], port, mailConn["user"], mailConn["pass"])\r\n\r\n	err := d.DialAndSend(m)\r\n	return err\r\n}\r\n', '', 'webserver'),
(3910, 344, 'go 防止表单重复提交', 'package models\r\n\r\nimport (\r\n	"math/rand"\r\n	"strconv"\r\n	"time"\r\n\r\n	"github.com/astaxie/beego"\r\n)\r\n\r\nfunc FormValidation(c *beego.Controller) {\r\n	PostFormSession, _ := strconv.Atoi(c.GetString("FormSession"))\r\n	if c.GetSession("FormSession") != PostFormSession {\r\n		c.Ctx.Output.ContentType("text/html;chart=utf8")\r\n		c.Ctx.Output.Body([]byte("<script>alert(''表单重复提交了,已被拦截,生效一个'');location.href=''../''</script>"))\r\n		return\r\n	}\r\n}\r\nfunc FormSessionStart(c *beego.Controller) {\r\n	rand.Seed(time.Now().UnixNano())\r\n	t := rand.Intn(999)\r\n	c.SetSession("FormSession", t)\r\n	c.Data["FormSession"] = t\r\n}\r\n', '', 'webserver'),
(3911, 344, 'go程序linux crontab开机后台自动运行', '@reboot sleep 3;cd /opt/gogin;nohup ./man >/dev/null 2>& 1 &', '', 'webserver'),
(3912, 344, 'golang 类似php php parse_str()', '//类似php php parse_str()\r\nfunc parse_str(uri string) (map[string]string, error) {\r\n	m := make(map[string]string)\r\n	if len(uri) < 1 { // 空字符串\r\n		return m, errors.New("uri is none")\r\n	}\r\n	if uri[0:1] == "?" { // 有没有包含？,有的话忽略。\r\n		uri = uri[1:]\r\n	}\r\n\r\n	// 首先分解&（sessionid=22222&token=3333 )变成\r\n	// sessionid=222222 和 token=3333\r\n	pars := strings.Split(uri, "&")\r\n	for _, par := range pars {\r\n		// 然后分解 sessionid=222222 和 token=3333\r\n		parkv := strings.Split(par, "=")\r\n		m[parkv[0]] = parkv[1] // 等号前面是key,后面是value\r\n	}\r\n	return m, nil\r\n}', '', 'webserver'),
(3913, 344, 'golang time date 详细', ' //时间 to 时间戳\r\n   loc, _ := time.LoadLocation("Asia/Shanghai")        //设置时区\r\n   tt, _ := time.ParseInLocation("2006-01-02 15:04:05", "2018-07-11 15:07:51", loc) //2006-01-02 15:04:05是转换的格式如php的"Y-m-d H:i:s"\r\n   fmt.Println(tt.Unix())                             //1531292871\r\n  \r\n   //时间戳 to 时间\r\n   tm := time.Unix(1531293019, 0)\r\n   fmt.Println(tm.Format("2006-01-02 15:04:05")) //2018-07-11 15:10:19\r\n//12小时制\r\ntime.Now().Format("2006-01-02 03:04:05")\r\n\r\n//24小时制 15刚好是下午3点\r\ntime.Now().Format("2006-01-02 15:04:05")\r\n//当天0点时间戳\r\n	a := time.Now().Format("2006-01-02")\r\n	tt, _ := time.Parse("2006-01-02", a)\r\n	timeNumber := tt.Unix()\r\n	today_start := timeNumber - 28800\r\n	//当天23:59:59 时间戳\r\n	today_end := today_start + 86399\r\n	fmt.Print(today_end)', '', 'webserver'),
(3914, 321, 'windows 下修改mysql密码', ' set password for root@localhost=password(''qq282246101'');', '', 'webserver'),
(3915, 344, 'golan map range 随机问题', 'golan map range 每次输出都是随机顺序的\r\n如果需要 map[int]map[string]interface{}\r\n这种 map 前面或后面添加map 可以使用 range k,v 中的k 方法如下\r\n			arr[0] = make(map[string]interface{})\r\n			for k, _ := range result {\r\n				m := make(map[string]interface{})\r\n				m["date"] = result[k]["date"]\r\n				m["kuaidi"] = result[k]["kuaidi"]\r\n				m["kuaidi_number"] = result[k]["kuaidi_number"]\r\n				if send == true {\r\n					m["name"] = result[k]["name"]\r\n				}\r\n				arr[k+1] = m\r\n			}', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(3916, 344, '自己写的golang websocket', 'package main\r\n\r\nimport (\r\n	"database/sql"\r\n	"errors"\r\n	"fmt"\r\n	"net/http"\r\n	"reflect"\r\n	"strconv"\r\n	"strings"\r\n	"time"\r\n\r\n	_ "github.com/go-sql-driver/mysql"\r\n\r\n	"github.com/gorilla/websocket"\r\n)\r\n\r\nvar Clients = make(map[int]*Client)\r\n\r\ntype Gdo struct {\r\n	conn *sql.DB\r\n}\r\n\r\nfunc (g *Gdo) Connet() {\r\n	conn, err := sql.Open("mysql", "root:qq282246101@tcp(localhost:3306)/xyz?charset=utf8")\r\n	if err != nil {\r\n		fmt.Println("连接数据库失败")\r\n		conn.Close()\r\n	}\r\n	conn.SetConnMaxLifetime(100)\r\n	conn.SetMaxOpenConns(20)\r\n	g.conn = conn\r\n}\r\n\r\nfunc (g *Gdo) Sql(sql string) *sql.Stmt {\r\n	stmt, err := g.conn.Prepare(sql)\r\n	if err != nil {\r\n		fmt.Printf("prepare sql failed, err:%v\\n", err)\r\n		g.conn.Close()\r\n	}\r\n	return stmt\r\n\r\n}\r\n\r\nfunc (g *Gdo) StructToMap(obj interface{}) map[string]interface{} {\r\n	t := reflect.TypeOf(obj)\r\n	//获取到里面的值 一维数组 {100 beego gobee}\r\n	v := reflect.ValueOf(obj)\r\n	data := make(map[string]interface{})\r\n	for i := 0; i < t.NumField(); i++ {\r\n		//得到键名                //得到里面的值\r\n		data[t.Field(i).Name] = v.Field(i)\r\n	}\r\n	return data\r\n}\r\n\r\ntype MyGdo struct {\r\n	Gdo\r\n}\r\n\r\n//通过id 找到conn是谁\r\ntype Client struct {\r\n	Client *websocket.Conn\r\n	//组名\r\n	GroupUser []string\r\n	//哪个用户\r\n	user string\r\n	fd   int\r\n}\r\ntype BroadcastMessageType struct {\r\n	To      string\r\n	Msg     []byte\r\n	MsgType int\r\n}\r\n\r\n//用户唯一标识 fd\r\nvar fd int\r\n\r\n//组成员唯一标识 fd\r\nvar GroupFd = make(map[string][]int)\r\n\r\n//组成员名 user\r\nvar GroupUser = make(map[string][]string)\r\n\r\nvar ws = websocket.Upgrader{\r\n	WriteBufferSize: 10240,\r\n	ReadBufferSize:  10240,\r\n	//跨域\r\n	CheckOrigin: func(r *http.Request) bool {\r\n		return true\r\n	},\r\n}\r\n\r\nfunc parse_str(uri string) (map[string]string, error) {\r\n	m := make(map[string]string)\r\n	if len(uri) < 1 { // 空字符串\r\n		return m, errors.New("uri is none")\r\n	}\r\n	if uri[0:1] == "?" { // 有没有包含？,有的话忽略。\r\n		uri = uri[1:]\r\n	}\r\n\r\n	// 首先分解&（sessionid=22222&token=3333 )变成\r\n	// sessionid=222222 和 token=3333\r\n	pars := strings.Split(uri, "&")\r\n	for _, par := range pars {\r\n		// 然后分解 sessionid=222222 和 token=3333\r\n		parkv := strings.Split(par, "=")\r\n		m[parkv[0]] = parkv[1] // 等号前面是key,后面是value\r\n	}\r\n	return m, nil\r\n}\r\nfunc main() {\r\n	http.HandleFunc("/wss", func(w http.ResponseWriter, request *http.Request) {\r\n		gdo := MyGdo{}\r\n		gdo.Connet()\r\n		user := ""\r\n		passwd := ""\r\n		room := ""\r\n		if request.URL.Query()["user"] != nil {\r\n			user = request.URL.Query()["user"][0]\r\n			passwd = request.URL.Query()["password"][0]\r\n			room = request.URL.Query()["room"][0]\r\n		} else {\r\n			//单片机接收\r\n			authorization := request.Header["Authorization"][0]\r\n			fmt.Println(authorization)\r\n			arr, err7 := parse_str(authorization)\r\n			if err7 != nil {\r\n				fmt.Print("单片机字符串解析失败")\r\n				return\r\n			}\r\n			fmt.Println(arr)\r\n			user = arr["user"]\r\n			fmt.Println(user)\r\n			passwd = arr["password"]\r\n			room = arr["room"]\r\n		}\r\n		if len(room) < 2 {\r\n			return\r\n		}\r\n		//查询 room对应的id\r\n		row1, _ := gdo.Sql("SELECT id FROM WebsocketRoom WHERE name=?").Query(room)\r\n		var rid int\r\n		defer row1.Close()\r\n		row1.Next()\r\n		row1.Scan(&rid)\r\n		if rid == 0 {\r\n			return\r\n		}\r\n		//验证 帐号密码，房间room\r\n		_, err := gdo.Sql("SELECT id FROM WebsocketUsers WHERE user=? AND passwd=? AND rid=?").Query(user, passwd, rid)\r\n		if err != nil {\r\n			return\r\n		}\r\n		//正确 升级为websocket\r\n		conn, _ := ws.Upgrade(w, request, nil)\r\n\r\n		//检查一下 自己组里有没有相同名字的,如果有把之前登录的同名用户下线\r\n		bl := false //如果有同名用户 为 true\r\n		Gstr := []string{}\r\n		if len(GroupFd[room]) > 0 {\r\n			for _, v := range GroupFd[room] {\r\n				if Clients[v].user == user {\r\n					bl = true\r\n					//下线该用户名\r\n					Clients[v].Client.Close()\r\n				}\r\n				if bl == true {\r\n					//重组在线成员列表\r\n					Gint := []int{}\r\n					for _, vv := range GroupFd[room] {\r\n						if v != vv {\r\n							Gint = append(Gint, vv)\r\n							Gstr = append(Gstr, Clients[vv].user)\r\n							//同时向在线该组成员 推送 用户重新上线消息\r\n							Clients[vv].Client.WriteMessage(websocket.TextMessage, []byte("系统消息: "+user+" 重新上线了"))\r\n						}\r\n					}\r\n					//得到去除同名的在线组成员 下一步把自己 加到该分组中\r\n					GroupFd[room] = Gint\r\n					GroupUser[room] = Gstr\r\n\r\n					break\r\n				}\r\n			}\r\n			//加到 自己的fd 加到分组中 把自己的用户名 加到 在线组成员列表中\r\n			GroupFd[room] = append(GroupFd[room], fd)\r\n			GroupUser[room] = append(GroupUser[room], user)\r\n		} else {\r\n			GroupFd[room] = []int{fd}\r\n			GroupUser[room] = []string{user}\r\n		}\r\n		// 	//注册到系统 room fd user\r\n		client := Client{conn, GroupUser[room], user, fd}\r\n		Clients[fd] = &client\r\n\r\n		fmt.Println(GroupFd[room], GroupUser[room])\r\n		if len(GroupFd[room]) > 1 {\r\n			//推送在线组成员到每个成员中\r\n			for _, v := range GroupFd[room] {\r\n				//不同名 向在该组在线成员推送 上线消息\r\n				if bl == false && v != fd {\r\n					//fmt.Println(Clients[v].user)\r\n					Clients[v].Client.WriteMessage(websocket.TextMessage, []byte("系统消息: "+user+" 上线了"))\r\n				}\r\n				tmp := map[string][]string{}\r\n				tmp["Group"] = GroupUser[room]\r\n				Clients[v].Client.WriteJSON(tmp)\r\n			}\r\n		}\r\n\r\n		// 	Gstr = []string{}\r\n		//返回true 向客户表示连接成功\r\n		conn.WriteMessage(websocket.TextMessage, []byte("true"))\r\n\r\n		//监听客户端close事件或者非常断开\r\n		conn.SetCloseHandler(func(code int, text string) error {\r\n			Gint := []int{}\r\n			for _, v := range GroupFd[room] {\r\n				if v != client.fd {\r\n					Gint = append(Gint, v)\r\n				}\r\n			}\r\n			//GroupFd[room] = []int{}\r\n			GroupFd[room] = Gint\r\n			//清除Client 连接\r\n			Clients[client.fd].Client.Close()\r\n			Gint = []int{}\r\n			Gstr = []string{}\r\n			//向组里广播该用户已经下线\r\n			for _, v := range GroupFd[room] {\r\n				Clients[v].Client.WriteMessage(websocket.TextMessage, []byte("系统消息: "+client.user+"下线了"))\r\n				if Clients[v].user != client.user {\r\n					Gint = append(Gint, v)\r\n					Gstr = append(Gstr, Clients[v].user)\r\n				}\r\n			}\r\n			GroupFd[room] = Gint\r\n			GroupUser[room] = Gstr\r\n			for _, v := range GroupFd[room] {\r\n				Clients[v].GroupUser = Gstr\r\n				//组里有人下线就更新 所有成员里的 GroupFd\r\n				tmp := map[string][]string{}\r\n				tmp["Group"] = GroupUser[room]\r\n				Clients[v].Client.WriteJSON(tmp)\r\n			}\r\n			fmt.Println("客户端"+strconv.Itoa(client.fd)+"关闭", GroupFd[room])\r\n			return nil\r\n		})\r\n		fd++\r\n		for {\r\n			//第一个参数是数据类型，只是一个int，1代表String，2代表[]byte\r\n			//接收时是普通字符串。服务器返回给客户端是json\r\n			_, data, err := conn.ReadMessage()\r\n			if err != nil {\r\n				fmt.Println(err)\r\n				return\r\n			}\r\n			mm := make(map[string]string)\r\n			date := time.Now().Format("01-02 15:04:05")\r\n			mm["user"] = user\r\n			mm["message"] = string(data)\r\n			mm["date"] = date\r\n			fmt.Println(GroupFd[room], client.fd)\r\n			for _, v := range GroupFd[room] {\r\n				if client.fd != v {\r\n					fmt.Println(v)\r\n					Clients[v].Client.WriteJSON(mm)\r\n				}\r\n			}\r\n		}\r\n\r\n	})\r\n	//证书先用其它 放在根目录 tls  即wss\r\n	err := http.ListenAndServeTLS(":1000", "360xyz.cn_bundle.crt", "360xyz.cn.key", nil)\r\n	//下面这个是ws\r\n	//err := http.ListenAndServe(":1000", nil)\r\n	if err != nil {\r\n		fmt.Println("服务器建立失败")\r\n	}\r\n\r\n}\r\n', '', 'webserver'),
(3917, 344, 'golang 图片上传', 'file,h,err:=c.Ctx.Request.FormFile("imgaaa")\r\nif err != nil {\r\nfmt.Println("获取上传文件失败")\r\nreturn \r\n}\r\ndefer file.Close()\r\nf, err := os.OpenFile("vvwd/"+h.Filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)\r\nif err != nil {\r\nfmt.Println("创建文件失败")\r\n}\r\ndefer f.Close()\r\nio.Copy(f, file)\r\n\r\nc.TplName = "index.html"', '', 'webserver'),
(5308, 344, 'js POST GET 两边空格', 'request过来的字符串两边都有好多空格\r\n必须用 js 处理一下 str.replace(/\\s+/g, '' '')\r\n清除两边空格才正常', '', 'webserver'),
(5310, 344, '跨域请求', '跨域请求要在被请求服务器上设置\r\nc.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Origin", "*")\r\n微信小程序为什么不设置Access-control-allow-origin也可以实现跨域请求？\r\n跨域请求限制是浏览器做的事情，而小程序的『浏览器』是微信，它想限制就限制不想限制就不限制', '', 'webserver'),
(5311, 344, '复制字符串到剪贴板', 'import "github.com/atotto/clipboard"\r\nclipboard.WriteAll(str)', '', 'webserver'),
(5312, 344, 'golang程序开机启动方法', '@reboot sleep 3; cd /var/www/html; nohup ./main &\r\n', '', 'webserver'),
(5313, 72, '燃气热水器有打电火声,没着火', '有电火声说明其它都正常就是煤气通道不通或未开,\r\n先更换电池,不行再更换煤气电磁阀', '', 'webserver'),
(6423, 344, 'go判断目录或文件是否存在，并创建', '	d := time.Now().Format("2006-1-02")\r\n	_, err := os.Stat(d)\r\n	if err != nil {\r\n		//fmt.Println("目录不存在")\r\n		os.Mkdir(d, os.ModePerm)\r\n		fmt.Println("创建目录")\r\n	}\r\n', '', 'webserver'),
(6424, 344, 'go拍照自动填快递单号', 'package main\r\n\r\nimport (\r\n	"bytes"\r\n	"encoding/base64"\r\n	"fmt"\r\n	"io"\r\n	"io/ioutil"\r\n	"net/http"\r\n	"os"\r\n	"time"\r\n)\r\n\r\nfunc JsonPost() {\r\n	d := time.Now().Format("2006-1-02")\r\n	_, err := os.Stat(d)\r\n	if err != nil {\r\n		//fmt.Println("目录不存在")\r\n		os.Mkdir(d, os.ModePerm)\r\n		fmt.Println("创建目录")\r\n	}\r\n	url := "https://tysbgpu.market.alicloudapi.com/api/predict/ocr_general"\r\n	appcode := "5bdfc02ebd4c4f31bc9d3e0b62b8ec49"\r\n	f, err1 := os.Open("a.jpg")\r\n	if err1 != nil {\r\n		fmt.Println("err1")\r\n		fmt.Println(err1)\r\n		return\r\n	}\r\n\r\n	defer f.Close()\r\n	buf := bytes.NewBuffer(nil)\r\n	io.Copy(buf, f)\r\n	//buf.Bytes()\r\n	imgstr := base64.StdEncoding.EncodeToString(buf.Bytes())\r\n	bodys := "{\\"image\\": \\"" + imgstr + "\\",\\"configure\\":{\\"min_size\\":16,\\"output_prob\\":true,\\"output_keypoints\\":false,\\"skip_detection\\":false,\\"without_predicting_direction\\":false}}"\r\n	req, _ := http.NewRequest("POST", url, bytes.NewBuffer([]byte(bodys)))\r\n	req.Header.Set("Content-Type", "application/json; charset=UTF-8")\r\n	req.Header.Set("Authorization", "APPCODE "+appcode)\r\n	client := &http.Client{}\r\n	resp, err2 := client.Do(req)\r\n	if err2 != nil {\r\n		fmt.Println("err2")\r\n		fmt.Println(err2)\r\n		return\r\n	}\r\n	defer resp.Body.Close()\r\n	// fmt.Println("status", resp.Status)\r\n	// fmt.Println("headers", resp.Header)\r\n	body, _ := ioutil.ReadAll(resp.Body)\r\n	fmt.Println(string(body))\r\n}\r\n\r\nfunc main() {\r\n	JsonPost()\r\n\r\n}\r\n', '', 'webserver'),
(6426, 344, 'windows下编译linux GO程序', 'cmd cd到GO程序根目录下\r\nset GOARCH=amd64\r\nset GOOS=linux\r\n然后直接  go build main.go\r\n----------------------------------\r\ngo env -w CGO_ENABLED=0\r\ngo env -w GOARCH=amd64\r\ngo env -w GOOS=windows\r\n', '', 'webserver'),
(6428, 525, '手机屏开机一闪亮一下就熄灭 ', '升压电感或升压电容问题\r\n手机升压电路  \r\n由 升压电感 IC 整流二极管 滤波电容组成', '', 'webserver'),
(6439, 344, 'golang 定时任务', 'func init() {\r\n	go func() {\r\n		MyCron()\r\n	}()\r\n}\r\n/*\r\n*内置定时任务 非使用linux crontab 比linux crontab 多一位定时时间 秒 这个是6位\r\n*定时每天早上6点查询定时任务\r\n*每周六夜里1.30分数据库导出到sql文件\r\n*每周六早上9点提取数据库备份sql附件形式发给QQ邮箱\r\n*每天早上6点40 开广告牌   19点关广告牌\r\n*只能放在init() 初始化 方法里，如果放在request是无效的\r\n */\r\nfunc MyCron() {\r\n	mycron := cron.New()\r\n	//服务器为arm64\r\n	if runtime.GOARCH == "arm64" {\r\n		//周六夜里1点备份远程数据库到本地\r\n		mycron.AddFunc("0 0 1 * * 6", func() {\r\n			beegoPath, _ := os.Getwd()\r\n			cmd := exec.Command("/bin/sh", "-c", beegoPath+"/RemoteToMysql.sh")\r\n			cmd.StdoutPipe()\r\n			cmd.StderrPipe()\r\n			cmd.Start()\r\n		})\r\n		//周六夜里1点半 导出本地数据库\r\n		mycron.AddFunc("0 30 1 * * 6", func() {\r\n			beegoPath, _ := os.Getwd()\r\n			cmd := exec.Command("/bin/sh", "-c", beegoPath+"/mysql.sh")\r\n			cmd.StdoutPipe()\r\n			cmd.StderrPipe()\r\n			cmd.Start()\r\n		})\r\n		//周六早上9点 邮件附件备份数据库\r\n		mycron.AddFunc("0 0 9 * * 6", func() {\r\n			date := time.Now().Format("2006-01-02")\r\n			date = strings.Replace(date, "-", "", -1)\r\n			date = strings.Replace(date, "-", "", -1)\r\n			sqldate := "./tool/sql/" + date + ".sql"\r\n			m := models.MyMail{}\r\n			m.SendMail([]string{"282246101@qq.com"}, "树莓派数据库定时附件备份", "数据库定时附件备份", sqldate)\r\n		})\r\n		//每天早上6点40分 开启广告牌灯箱  多加参数  email=true 表示发邮件提醒自己\r\n		mycron.AddFunc(beego.AppConfig.String("BillboardStart"), func() {\r\n			models.MyHttpGet("http://localhost/service/GetToPostWebsoket?room=admin&message=mydoor1->灯箱开&key=www.360xyz.cn")\r\n		})\r\n		//每天晚上19点 关闭广告牌灯箱\r\n		mycron.AddFunc(beego.AppConfig.String("BillboardEnd"), func() {\r\n			models.MyHttpGet("http://localhost/service/GetToPostWebsoket?room=admin&message=mydoor1->灯箱关&key=www.360xyz.cn")\r\n		})\r\n	} else {\r\n		mycron.AddFunc("0 0 6 * * *", selectRemind)\r\n		//每天早上6点40分 开启广告牌灯箱  多加参数  email=true 表示发邮件提醒自己\r\n		mycron.AddFunc(beego.AppConfig.String("BillboardStart"), func() {\r\n			models.MyHttpGet("http://www.360xyz.cn/service/GetToPostWebsoket?room=admin&message=mydoor1->灯箱开&key=www.360xyz.cn")\r\n		})\r\n		//每天晚上19点 关闭广告牌灯箱\r\n		mycron.AddFunc(beego.AppConfig.String("BillboardEnd"), func() {\r\n			models.MyHttpGet("http://www.360xyz.cn/service/GetToPostWebsoket?room=admin&message=mydoor1->灯箱关&key=www.360xyz.cn")\r\n		})\r\n		mycron.AddFunc("0 * * * * *", func() {\r\n			fmt.Println("每分钟执行一次")\r\n		})\r\n	}\r\n	fmt.Println("cron ---> start")\r\n	mycron.Run()\r\n}', '', 'webserver'),
(6441, 344, 'golang windows关机命令', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"log"\r\n	"net/url"\r\n	"os"\r\n	"os/exec"\r\n	"time"\r\n\r\n	"github.com/gorilla/websocket"\r\n)\r\n\r\ntype websocketClientManager struct {\r\n	conn        *websocket.Conn\r\n	addr        *string\r\n	path        string\r\n	Userinfo    interface{}\r\n	sendMsgChan chan string\r\n	recvMsgChan chan string\r\n	isAlive     bool\r\n	timeout     int\r\n	wtype       string\r\n	user        string\r\n	password    string\r\n	room        string\r\n}\r\n\r\n// 构造函数\r\nfunc NewWsClientManager(addrIp, addrPort, path string, timeout int, wtype string, password string, room string) *websocketClientManager {\r\n	addrString := addrIp + ":" + addrPort\r\n	var sendChan = make(chan string, 10)\r\n	var recvChan = make(chan string, 10)\r\n	var conn *websocket.Conn\r\n	//获取本机电脑名\r\n	usertemp, _ := os.Hostname()\r\n	user := usertemp\r\n\r\n	return &websocketClientManager{\r\n		addr:        &addrString,\r\n		path:        path,\r\n		conn:        conn,\r\n		sendMsgChan: sendChan,\r\n		recvMsgChan: recvChan,\r\n		isAlive:     false,\r\n		timeout:     timeout,\r\n		wtype:       wtype,\r\n		user:        user,\r\n		password:    password,\r\n		room:        room,\r\n	}\r\n}\r\n\r\n// 链接服务端\r\nfunc (this *websocketClientManager) dail(wtype string, user string, password string, room string) {\r\n	var err error\r\n\r\n	u := url.URL{Scheme: "wss", Host: *this.addr, Path: this.path, ForceQuery: true, RawQuery: "user=" + user + "&password=" + password + "&room=" + room}\r\n	log.Printf("connecting to %s", u.String())\r\n	this.conn, _, err = websocket.DefaultDialer.Dial(u.String(), nil)\r\n	if err != nil {\r\n		fmt.Println(err)\r\n		os.Exit(1)\r\n		return\r\n	}\r\n	this.isAlive = true\r\n	log.Printf("connecting to %s 链接成功！！！", u.String())\r\n	//主动向服务端发送断开连接消息\r\n	this.conn.WriteControl(websocket.CloseMessage, websocket.FormatCloseMessage(4001, "close"), time.Now().Add(time.Second))\r\n	ShutDownEXE()\r\n}\r\n\r\nfunc ShutDownEXE() {\r\n	fmt.Println("关闭主机")\r\n	arg := []string{"-s", "-t", "0"}\r\n	cmd := exec.Command("shutdown", arg...)\r\n	_, err := cmd.CombinedOutput()\r\n	if err != nil {\r\n		fmt.Println("Error:", err)\r\n		return\r\n	}\r\n}\r\nfunc main() {\r\n	wss := "wss"\r\n	password := "efghijk"\r\n	room := "admin"\r\n	t := NewWsClientManager("www.360xyz.cn", "443", "/service/wss", 10, wss, password, room)\r\n	t.dail(t.wtype, t.user, t.password, t.room)\r\n}\r\n', '', 'webserver'),
(6443, 344, 'go 短时间定时循环', '	//设置定时器为15秒\r\n	timer := time.NewTimer(15 * time.Second)\r\n	fmt.Println("定时开始")\r\n	for {\r\n		<-timer.C\r\n\r\n		//15秒后执行这条\r\n		fmt.Println("send")\r\n		//重设定时时间\r\n		timer.Reset(15 * time.Second)\r\n		fmt.Println("已经重设定时时间，正在回滚for 循环")\r\n	}', '', 'webserver'),
(6444, 20, '单片机电路原理', '单片机就像一台微型电脑\r\ncpu  负责控制 与 运算 执行代码指令\r\n只读存储器 ROM (像电脑硬盘) 程序都是烧录在ROM\r\n临时存储器 RAM (像电脑内存)\r\n\r\n', '', 'webserver'),
(6445, 344, 'golang websocket 客户端', 'package main\r\n\r\nimport (\r\n	"encoding/json"\r\n	"fmt"\r\n	"net/url"\r\n	"os"\r\n	"os/exec"\r\n	"strings"\r\n	"syscall"\r\n	"time"\r\n	"unsafe"\r\n\r\n	"github.com/gorilla/websocket"\r\n	//"github.com/spf13/viper"\r\n)\r\n\r\n/*\r\ngo build -o xxx.exe -ldflags "-s -w -H=windowsgui"\r\n运行命令\r\nshell:startup\r\n把程序扔到里面\r\n*/\r\nvar Tt = 3\r\n\r\nfunc main() {\r\n	go func() {\r\n		//设置定时器为3小时\r\n		timer := time.NewTimer(10800 * time.Second)\r\n		fmt.Println("定时开始")\r\n		for {\r\n			<-timer.C\r\n			//3小时后执行这条\r\n			x := WindowsAlert{}\r\n			if Tt > 3 {\r\n				x.ShowMessage("弹窗提示", "您已经连续使用电脑 "+fmt.Sprintf("%d", Tt)+" 小时了,劳逸结合,准备自动关机")\r\n				time.Sleep(time.Second * 10)\r\n				fmt.Println("关闭主机")\r\n				arg := []string{"-s", "-t", "0"}\r\n				cmd := exec.Command("shutdown", arg...)\r\n				cmd.CombinedOutput()\r\n			} else {\r\n				x.ShowMessage("弹窗提示", "您已经连续使用电脑 "+fmt.Sprintf("%d", Tt)+" 小时了,请关闭电脑休息一下,劳逸结合")\r\n			}\r\n\r\n			//重设定时时间\r\n			timer.Reset(10800 * time.Second)\r\n			Tt = Tt + 3\r\n			fmt.Println("已经重设定时时间,正在回滚for 循环")\r\n		}\r\n	}()\r\n	wss := "ws"\r\n	//获取电脑主机名\r\n	user, _ := os.Hostname()\r\n	password := "efghijk"\r\n	room := "pc"\r\n	w := WebsocketClient{}\r\n	w.NewInit("192.168.100.254", 80, "/service/wss", 10, wss, user, password, room).Start()\r\n\r\n}\r\n\r\ntype WebsocketClient struct {\r\n	conn        *websocket.Conn\r\n	addr        *string\r\n	path        string\r\n	Userinfo    interface{}\r\n	sendMsgChan chan string\r\n	isAlive     bool //联网状态\r\n	timeout     int\r\n	wtype       string //连接 wss 还是ws\r\n	user        string\r\n	password    string\r\n	room        string\r\n	StartDate   string // 上线时间\r\n	Ch          chan os.Signal\r\n}\r\n\r\n// 初始化 NewInit("www.360xyz.cn", 443, "/service/wss", 10, wss,user, password, room).Start()\r\nfunc (class *WebsocketClient) NewInit(addrIp string, addrPort int, path string, timeout int, wtype, user, password, room string) *WebsocketClient {\r\n	var conn *websocket.Conn\r\n	temp := addrIp + ":" + fmt.Sprintf("%d", addrPort)\r\n	class.conn = conn\r\n	class.addr = &temp\r\n	class.path = path\r\n	class.sendMsgChan = make(chan string, 10)\r\n	class.isAlive = false\r\n	class.timeout = timeout\r\n	class.wtype = wtype\r\n	class.user = user\r\n	class.password = password\r\n	class.room = room\r\n	class.Ch = make(chan os.Signal, 1)\r\n	class.StartDate = time.Now().Format("2006-01-02 15:04")\r\n\r\n	return class\r\n}\r\n\r\n// 链接服务端\r\nfunc (class *WebsocketClient) dail(wtype, user, password, room string) {\r\n	var err error\r\n	u := url.URL{Scheme: wtype, Host: *class.addr, Path: class.path, ForceQuery: true, RawQuery: "user=" + user + "&password=" + password + "&room=" + room}\r\n	fmt.Println("connecting to " + u.String())\r\n	class.conn, _, err = websocket.DefaultDialer.Dial(u.String(), nil)\r\n	if err != nil {\r\n		fmt.Println(err)\r\n		class.isAlive = false\r\n		//os.Exit(1)\r\n		return\r\n	}\r\n	class.isAlive = true\r\n	fmt.Println("链接成功！！！")\r\n	class.StartDate = time.Now().Format("2006-01-02 15:04")\r\n	class.conn.WriteMessage(websocket.TextMessage, []byte("上线时间"+class.StartDate))\r\n\r\n}\r\n\r\n// 发送消息\r\nfunc (class *WebsocketClient) sendMsgThread() {\r\n	go func() {\r\n		for {\r\n			msg := <-class.sendMsgChan\r\n			err := class.conn.WriteMessage(websocket.TextMessage, []byte(msg))\r\n			if err != nil {\r\n				fmt.Println("write:", err)\r\n				continue\r\n			}\r\n		}\r\n	}()\r\n}\r\n\r\n// 读取消息\r\nfunc (class *WebsocketClient) readMsgThread() {\r\n	go func() {\r\n		for {\r\n			if class.conn != nil {\r\n				i9, message, err := class.conn.ReadMessage()\r\n				if err != nil {\r\n					//fmt.Println("read:", err)\r\n					return\r\n				}\r\n				if i9 == 9 {\r\n					//响应服务器主动发来的pong 表示我还在线\r\n					class.conn.WriteControl(websocket.PongMessage, []byte{}, time.Now().Add(time.Second))\r\n				}\r\n				var messages map[string]string\r\n				json.Unmarshal(message, &messages)\r\n				fmt.Println(messages["message"])\r\n				if len(messages["message"]) > 1 {\r\n					if temp1 := strings.Index(messages["message"], class.user+"."); temp1 != -1 {\r\n						if messages["message"] == class.user+".关机" {\r\n							class.conn.WriteMessage(websocket.TextMessage, []byte("执行关机中..."+class.StartDate))\r\n							//主动向服务端发送断开连接消息\r\n							class.conn.WriteControl(websocket.CloseMessage, websocket.FormatCloseMessage(4001, "close"), time.Now().Add(time.Second))\r\n							time.Sleep(time.Millisecond * 100)\r\n							class.ShutDown()\r\n							return\r\n						}\r\n						x := WindowsAlert{}\r\n						a := []rune(messages["message"])[6:]\r\n						x.ShowMessage("弹窗提示", string(a))\r\n					}\r\n				}\r\n			}\r\n\r\n		}\r\n	}()\r\n	go func() {\r\n		for {\r\n			s := <-class.Ch\r\n			switch s {\r\n			case syscall.SIGINT:\r\n				class.conn.WriteControl(websocket.CloseMessage, websocket.FormatCloseMessage(4001, "close"), time.Now().Add(time.Millisecond*100))\r\n				//fmt.Println("退出前执行")\r\n			case syscall.SIGILL:\r\n				//fmt.Println("null")\r\n			default:\r\n				//fmt.Println("default")\r\n			}\r\n		}\r\n	}()\r\n}\r\n\r\n// 开启服务并重连\r\nfunc (class *WebsocketClient) Start() {\r\n	for {\r\n		if !class.isAlive {\r\n			class.dail(class.wtype, class.user, class.password, class.room)\r\n			if class.isAlive {\r\n				class.sendMsgThread()\r\n				class.readMsgThread()\r\n			}\r\n		}\r\n		time.Sleep(time.Second * time.Duration(class.timeout))\r\n	}\r\n}\r\nfunc (class *WebsocketClient) ShutDown() {\r\n	fmt.Println("关闭主机")\r\n	arg := []string{"-s", "-t", "0"}\r\n	cmd := exec.Command("shutdown", arg...)\r\n	cmd.CombinedOutput()\r\n}\r\n\r\ntype WindowsAlert struct {\r\n}\r\n\r\nfunc (class *WindowsAlert) StrPtr(s string) uintptr {\r\n	return uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(s)))\r\n}\r\nfunc (class *WindowsAlert) ShowMessage(title, text string) {\r\n	user32dll, _ := syscall.LoadLibrary("user32.dll")\r\n	user32 := syscall.NewLazyDLL("user32.dll")\r\n	MessageBoxW := user32.NewProc("MessageBoxW")\r\n	defer syscall.FreeLibrary(user32dll)\r\n	MessageBoxW.Call(uintptr(0), class.StrPtr(text), class.StrPtr(title), uintptr(0))\r\n	time.Sleep(time.Second * 3)\r\n}\r\n', '', 'webserver'),
(6446, 344, 'golang windows开机自启动隐藏窗口', 'go build -o xxx.exe -ldflags "-s -w -H=windowsgui"\r\n运行命令\r\nshell:startup\r\n把程序扔到里面', '', 'webserver'),
(6447, 344, 'go.sum', 'github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=\r\ngithub.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=\r\ngithub.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=\r\ngithub.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=\r\ngithub.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=\r\ngithub.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=\r\ngithub.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=\r\ngithub.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=\r\ngithub.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ=\r\ngithub.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA=\r\ngithub.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=\r\ngithub.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=\r\ngithub.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=\r\ngithub.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=\r\ngithub.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=\r\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\r\ngithub.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=\r\ngithub.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=\r\ngithub.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=\r\ngithub.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\r\ngithub.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=\r\ngithub.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=\r\ngithub.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=\r\ngithub.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=\r\ngithub.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=\r\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\r\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\r\ngithub.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=\r\ngithub.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=\r\ngithub.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=\r\ngithub.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=\r\ngithub.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=\r\ngithub.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=\r\ngithub.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=\r\ngithub.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=\r\ngithub.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=\r\ngithub.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=\r\ngithub.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=\r\ngithub.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=\r\ngithub.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=\r\ngithub.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=\r\ngithub.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=\r\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\r\ngithub.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\r\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\r\ngithub.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=\r\ngithub.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=\r\ngithub.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=\r\ngithub.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=\r\ngithub.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=\r\ngithub.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=\r\ngithub.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=\r\ngithub.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=\r\ngithub.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=\r\ngithub.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=\r\ngithub.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\r\ngithub.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\r\ngithub.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\r\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\r\ngithub.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=\r\ngithub.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=\r\ngithub.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=\r\ngithub.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=\r\ngithub.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=\r\ngithub.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=\r\ngithub.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=\r\ngithub.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=\r\ngithub.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=\r\ngithub.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=\r\ngithub.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=\r\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\r\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\r\ngithub.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=\r\ngithub.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=\r\ngithub.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=\r\ngithub.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=\r\ngithub.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=\r\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\r\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\r\ngithub.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=\r\ngithub.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=\r\ngithub.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=\r\ngithub.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=\r\ngithub.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=\r\ngithub.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=\r\ngithub.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=\r\ngithub.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=\r\ngithub.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=\r\ngithub.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=\r\ngithub.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\r\ngithub.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\r\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\r\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\r\ngithub.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=\r\ngithub.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=\r\ngithub.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=\r\ngithub.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=\r\ngithub.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=\r\ngithub.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\r\ngithub.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=\r\ngithub.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\r\ngithub.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=\r\ngithub.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=\r\ngithub.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=\r\ngithub.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=\r\ngithub.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=\r\ngithub.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=\r\ngithub.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=\r\ngithub.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=\r\ngithub.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=\r\ngithub.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=\r\ngithub.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=\r\ngithub.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=\r\ngithub.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=\r\ngithub.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=\r\ngithub.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=\r\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\r\ngithub.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\r\ngithub.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=\r\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\r\ngithub.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=\r\ngithub.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=\r\ngithub.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=\r\ngithub.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=\r\ngithub.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=\r\ngithub.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=\r\ngolang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=\r\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\r\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=\r\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\r\ngolang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\r\ngolang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\r\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\r\ngolang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\r\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=\r\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\r\ngolang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\r\ngolang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\r\ngolang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\r\ngolang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\r\ngolang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\r\ngolang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\r\ngolang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\r\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\r\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\r\ngolang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\r\ngolang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\r\ngolang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\r\ngolang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80=\r\ngolang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\r\ngolang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=\r\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\r\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\r\ngoogle.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=\r\ngoogle.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=\r\ngoogle.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=\r\ngoogle.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=\r\ngoogle.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=\r\ngoogle.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=\r\ngoogle.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\r\ngopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=\r\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\r\ngopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\r\ngopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\r\ngopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=\r\ngopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=\r\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=\r\ngopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\r\ngopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\r\ngopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\r\ngopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\r\ngopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=\r\ngopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\r\ngithub.com/nosixtools/solarlunar@v0.0.0-20211112060703-1b6dea7b4a19', '', 'webserver'),
(6448, 72, '燃气热水器不打火', '手动短接看是否打火，如果打火更换水压膜片\r\n否则拔开插口用镙丝刀直接短接，\r\n如果打火更换水动开头\r\n否则更换点火器，如果更换点火器还是不打火\r\n测电池电压正常，那应该是电池盒里生锈了，更换电池盒', '', 'webserver'),
(6449, 344, 'golang 阳历 阴历互转换', 'import (\r\n	"fmt"\r\n	"time"\r\n\r\n	"github.com/nosixtools/solarlunar"\r\n)\r\n\r\nfunc main() {\r\n	//阳历转阴历 中文\r\n	solarDate := time.Now().Format("2006-01-02")\r\n	fmt.Println(solarlunar.SolarToChineseLuanr(solarDate))\r\n\r\n	//阳历转阴历 数字\r\n	fmt.Println(solarlunar.SolarToSimpleLuanr(solarDate))\r\n\r\n	//阴历转阳历\r\n	lunarDate := "2022-02-26"\r\n	fmt.Println(solarlunar.LunarToSolar(lunarDate, false))\r\n}', '', 'webserver'),
(6451, 344, 'git 使用', 'cd 到仓库目录 \r\ngit init 初始化成本地仓库\r\ngit add .   //添加所有\r\n\r\ngit config --global user.email "任意邮箱名都行"\r\ngit config --global user.name ""\r\n\r\ngit commit -m "添加到仓库的备注"\r\ngit branch -M  分支名\r\ngit push -u origin main\r\n\r\n//-b 表示从分支下载\r\ngit clone -b 分支名 url', '', 'webserver'),
(6452, 7, '查看系统是否是已久激活', '运行 cmd\r\nslmgr.vbs -xpr', '', 'webserver'),
(6454, 529, 'https://github.com/', 'https://github.com/', '', 'webserver'),
(6456, 529, 'B站', 'https://www.bilibili.com/', '', 'webserver'),
(6458, 529, '单机游戏网', 'https://www.3dmgame.com/', '', 'webserver'),
(6459, 529, '有道翻译', 'https://fanyi.youdao.com/', '', 'webserver'),
(6460, 529, '西西软件', 'https://www.cr173.com/', '', 'webserver'),
(6461, 529, 'php官网', 'https://www.php.net/', '', 'webserver'),
(6462, 529, '风行影视', 'http://www.fun.tv/', '', 'webserver'),
(6463, 529, '河池同城游', 'http://www.tcy365.com/hc/', '', 'webserver'),
(6464, 529, '单片机arduino官网', 'https://www.arduino.cn/', '', 'webserver'),
(6465, 529, 'https://cn.vuejs.org/', 'https://cn.vuejs.org/', '', 'webserver'),
(6466, 529, '改图宝', 'https://www.gaitubao.com/', '', 'webserver'),
(6468, 529, '爱纯净系统', 'http://www.aichunjing.com/', '', 'webserver'),
(6470, 7, 'GHOST还原恢复系统失败', 'cmd cd 到GHOST程序目录下\r\n执行命令 Ghost64.exe -ntexact\r\n//必须是GHOST 12版本以上\r\n如果使用的PE系统中没有这个版本可以电脑手动下载后放到U盘里\r\n使用时cmd cd到存放位置 \r\n版本12.0.0.8006 使用正常(备份恢复时都是使用这个版本)', '', 'webserver'),
(6471, 344, 'go 抽奖', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"math/rand"\r\n	"time"\r\n)\r\n\r\n//查询数组是否有重复 返回重复数组位置 没有重复返回0\r\nfunc RepeatInt(arr []int) int {\r\n	m := make(map[int]int)\r\n	for k, v := range arr {\r\n		_, ok := m[v]\r\n		if ok {\r\n			return k\r\n		} else {\r\n			m[v] = 1\r\n		}\r\n\r\n	}\r\n	return 0\r\n}\r\n\r\n//从 ii 个数随机取 getCount个 随机数\r\nfunc IntRan(ii int, getCount int) []int {\r\n	a := time.Now().Unix()\r\n	rand.Seed(a)\r\n	arr := []int{}\r\n	for i := 0; i < getCount; i++ {\r\n		a := rand.Intn(ii) + 1\r\n		arr = append(arr, a)\r\n	}\r\n	return arr\r\n}\r\nfunc GetCj() []int {\r\n	arr := []int{}\r\n	for {\r\n		arr = IntRan(99, 10)\r\n		if RepeatInt(arr) == 0 {\r\n			break\r\n		}\r\n	}\r\n	fmt.Println(arr)\r\n	a := []int{}\r\n	for {\r\n		a = IntRan(9, 3)\r\n		//fmt.Println(a)\r\n		if RepeatInt(a) == 0 {\r\n			break\r\n		}\r\n	}\r\n	fmt.Println(a)\r\n	result := []int{}\r\n	for _, v := range a {\r\n		result = append(result, arr[v])\r\n	}\r\n	return result\r\n}\r\nfunc main() {\r\n	a := GetCj()\r\n	fmt.Println(a)\r\n}\r\n', '', 'webserver'),
(6472, 344, '用fmt.Sprintf 其它类型转换 string', '格  式 	描  述\r\n%v 	按值的本来值输出\r\n%+v 	在 %v 基础上，对结构体字段名和值进行展开\r\n%#v 	输出 Go 语言语法格式的值\r\n%T 	输出 Go 语言语法格式的类型和值\r\n%% 	输出 % 本体\r\n%b 	整型以二进制方式显示\r\n%o 	整型以八进制方式显示\r\n%d 	整型以十进制方式显示\r\n%x 	整型以十六进制方式显示\r\n%X 	整型以十六进制、字母大写方式显示\r\n%U 	Unicode 字符\r\n%f 	浮点数\r\n%p 	指针，十六进制方式显示\r\n\r\nint 转string  fmt.Sprintf("%d",int)\r\nfloat 转string  fmt.Sprintf("%f",float) //保留6位小数，如果要只保留两位小数  fmt.Sprintf("%.2f",float)\r\nbool 转string  fmt.Sprintf("%t",float)\r\nbyte 转string  fmt.Sprintf("%c",float) //单字符\r\n一般常用的是用 strconv 包转换', '', 'webserver'),
(6473, 344, '字符串修改 ', '一个英文字母占用一个字节，一个汉字占用三个字节\r\nbyte  //支持英文\r\ns2:="big"\r\nbyte2:=[]byte(s2)\r\nbyte2[0]="p"\r\nfmt.Println(string(byte2)) //pig\r\nnune //支持utf-8 \r\ns2:="大家好golang"\r\nrune2:=[]rune(s2)\r\nrune2[0]="家"\r\nfmt.println(string(rune2))   //家家好golang', '', 'webserver'),
(6474, 344, '获取当前项目根目录路径', 'beegoPath, _ := os.Getwd()', '', 'webserver'),
(6475, 344, 'golang yaml读取配置文件类', 'package models\r\n\r\nimport (\r\n	"fmt"\r\n	"io/ioutil"\r\n\r\n	"gopkg.in/yaml.v2"\r\n)\r\n\r\ntype YmlRead struct {\r\n}\r\n\r\nfunc (this *YmlRead) Read(filePath string) (map[string]interface{}, error) {\r\n	data, err := ioutil.ReadFile(filePath)\r\n	if err != nil {\r\n		fmt.Println("err")\r\n		return nil, err\r\n	}\r\n	a := make(map[string]interface{})\r\n	err1 := yaml.Unmarshal([]byte(data), &a)\r\n	if err1 != nil {\r\n		fmt.Println("err1")\r\n		return nil, err1\r\n	}\r\n	return a, nil\r\n}\r\n', '', 'webserver'),
(6477, 12, '屏幕出现规则横线纹', '断开一边屏线,一边就能显示正常\r\n更换逻辑板\r\n', '', 'webserver'),
(6802, 529, '树莓派系统官网', 'https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit', '', 'webserver'),
(6804, 5, '微波炉电脑板故障', '按键与显示都正常就是不加热\r\n如果已经确定是电脑板问题,试一下更换电脑板上面的部份三极管,一般能解决问题', '', 'webserver'),
(6805, 344, 'go 递归删除全部文件', 'package models\r\n\r\nimport (\r\n	"io/ioutil"\r\n	"os"\r\n	"runtime"\r\n)\r\n\r\ntype DeleteAll struct {\r\n}\r\n\r\n// 递归循环删除目录及文件\r\nfunc (this *DeleteAll) Dir(d string) bool {\r\n	if d[len(d)-1:] == "/" {\r\n		d = d[0 : len(d)-1]\r\n	}\r\n	files, err := ioutil.ReadDir(d)\r\n	if err != nil {\r\n		return false\r\n	}\r\n	fuhk := "/"\r\n	if runtime.GOOS == "windows" {\r\n		fuhk = "\\\\"\r\n	}\r\n	for _, v := range files {\r\n		if v.IsDir() {\r\n			path := d + fuhk + v.Name()\r\n			this.Dir(path)\r\n		} else {\r\n			os.Remove(v.Name())\r\n		}\r\n	}\r\n	return true\r\n}\r\n', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(6806, 525, '更换充电尾插', '拆开手机壳\r\n扭开螺丝\r\n取出充电小板\r\n固定小板\r\n热风枪吹\r\n吸锡带清理底坐\r\n酒精清洗底座\r\n放入锡膏\r\n装入新的插口\r\n热风枪吹\r\n如果有引脚粘连 用电烙铁吸锡带吸一下就行', '', 'webserver'),
(6808, 20, '安装arduino与esp8266 32库系列 ', '1.先安装好ArduinoIDE（如果已安装，直接跳到第二步）\r\n下载Arduino IDE\r\n\r\n2.打开Arduino IDE菜单 > 文件 >首选项，在 附加开发板管理器网址 输入框中，填入以下网址：\r\nhttps://www.arduino.cn/package_esp8266com_index.json\r\nhttps://www.arduino.cn/package_esp32_index.json\r\nArduino1.8.13 是可以省略这一步,是自动扫描%LOCALAPPDATA%/Arduino15/packages下的目录而之后版本是网络请求返回目录列表\r\n3.下载社区打包的esp32安装包，直接运行并解压即可。\r\n\r\n下载地址2 社区成员 鱼小黑 提供：https://cloud.codess-nas.top:5213/s/2Ocn\r\n\r\n\r\n如果安装过其他版本的esp8266sdk，请先删除，再使用本安装包，删除方法：文件管理器地址栏输入 %LOCALAPPDATA%/Arduino15/packages，回车进入，然后删除掉其中的esp8266文件夹\r\n\r\n双击运行即可解压，解压完成后，再打开Arduino IDE，即可在 菜单栏>工具>开发板 中找到你使用的esp8266开发板\r\n\r\n\r\n包\r\n32_package_2.0.2_arduinocn.exe\r\n8266_package_3.0.2_arduinocn.exe', '', 'webserver'),
(6809, 2, '按键显示都正常就是不加热', '开启后，听一下没有吸合的声音\r\n测量电压是否有12v\r\n如果没有12v 断开70L05输入脚后，电压12v左右正常\r\n说明CPU 或者 连接CPU 供电另一路分支出现问题\r\n直接断开压力开关传感器，开机看看是否报错E4\r\n如果没有报错测量连接CPU引脚到传感器是否正常连接\r\n如果正常 CPU坏了\r\n\r\n如果报错E4了 检查cpu供电引脚电源另一分支线路\r\n', '', 'webserver'),
(6812, 72, '电热水器显示按键正常但不加热', '拆开\r\n断开加热管连线，测量其电阻值\r\n100欧以内正常, 阻值越小其功率瓦数越大\r\n\r\n把继电器连接的加热管断开，通电测量继电器在开机加热状态下有没有220V电压(一般没有电压)\r\n直接更换继电器再测量，\r\n如果还是没有电压更换电源板', '', 'webserver'),
(6813, 7, '电脑开不了机，或者更换主板点不亮', '首先检查重启开关是否沾连，如果沾连直接导通，也会使主板点不亮', '', 'webserver'),
(6814, 555, '小孩咳嗽 雾化+抗生素', '小孩咳嗽 雾化+抗生素', '', 'webserver'),
(6815, 555, '预防肺炎 ', '1.喂完奶粉千万记得要让宝宝坐着喂，喂完十分钟后再让宝宝自由活动，不然吐奶就会呛到，引起肺炎\r\n2.正常情况下，新生儿的呼吸频率可达40-45次/分，1个月至一岁，宝宝呼吸频率30-40次/分，一岁至3岁，呼吸频率为25-30次/分，4-7岁，呼吸频率为20-25次/分，八岁以上，呼吸频率接近成人，18-20次/分。年龄越小，呼吸频率相对较快，小儿以腹式呼吸为主，成人以胸式呼吸为主\r\n3.发烧达到39度就要服用退烧药，千万记得这时要吃消炎药，消炎药是杀死细菌的卫兵，退烧药只能让你不能再烧下去不然烧坏了，消炎药最少吃三天，最多8天 \r\n4.头孢克肟和头孢哌酮舒巴坦钠的区别\r\n都是第三代头孢，区别在前者是口服，后者是输液\r\n5.小孩子呛到了记得及时拍背', '', 'webserver'),
(6816, 555, '感冒感染区分', '感冒分为病毒和细菌感染\r\n流青鼻涕为病毒感染 使用 利韦巴林\r\n流浓鼻涕为细菌感染 使用 头孢或阿莫西林，阿奇霉素\r\n', '', 'webserver'),
(6817, 555, '胃不舒服 ', '反酸 打咳 一般是幽门螺旋杆菌感染\r\n一般使用三联药物治疗  \r\n奥美拉挫 阿莫西林 克拉霉素\r\n坚持吃 最多能吃8天\r\n\r\n最好的方法是食疗 每天早晚各一大碗豆浆,最好不放糖,7天就好了', '', 'webserver'),
(6818, 344, '获取变量类型', '两种方法\r\nfmt.Println(fmt.Sprintf("%T", a))\r\nfmt.Println(reflect.TypeOf(a))', '', 'webserver'),
(6820, 555, '儿童一般3岁以后不容易得肺炎', '儿童3岁以后免疫功能逐渐增强,6岁时免疫功能基本与成人相似', '', 'webserver'),
(6821, 555, '肺炎判断', '1 呼吸频率判断 不同年龄频率不同,超过5次就有感染风险\r\n2 肚皮呼吸,有感染风险\r\n3.发烧,有感染风险', '', 'webserver'),
(6825, 4, '美的波轮洗衣机F8故障代码', '检测水位开关导管，水位开关，还有接口是否漏气', '', 'webserver'),
(6826, 555, '拉肚子 用药方法 ', '18岁以下使用蒙脱石散\r\n18岁以上可以使用诺氟沙星\r\n ', '', 'webserver'),
(6827, 20, 'arduino Ticker 自带函数库', 'Ticker myTicker;\r\nmyTicker.once(秒为单位只执行一次,方法名);\r\nmyTicker.once_ms(毫秒为单位只执行一次,方法名);\r\n\r\nmyTicker.attach(秒为单位死循环,方法名);\r\nmyTicker.attach_ms(毫秒为单位死循环,方法名);\r\n//也可以加第三个参数为 回调函数\r\n\r\nmyTicker.detch(); //停止定时\r\n\r\nmyTicker.active(); //查看是否有定时状态', '', 'webserver'),
(6828, 1, '一通电在没有任务按键操作下 报警 ', '先更换4.7UF/400V电解电容\r\n一般都是大件问题或大件虚焊或者感温器问题，\r\n一个感温器在线圈盘中心，还有一个在场效应管附近', '', 'webserver'),
(6829, 20, 'arduino 函数方法 小写字母为全局方法', 'arduino 函数方法 小写字母为全局方法', '', 'webserver'),
(6843, 55, '豆腐圆', '馅 配方 \r\n豆腐圆 每斤肉放1.33两糯米饭，1斤肉放0.02斤盐，葱花每斤肉放一两，每斤肉放0.012味精,柠檬叶看情况份量不定\r\n煎豆腐圆使用的豆油 \r\n为节约成本,用食用豆油3.5元/斤混合专用煎油 比例1比1', '', 'webserver'),
(7157, 554, 'window 窗口创建使用', '#include <windows.h>\r\n#include <commctrl.h>>\r\nUINT IDC_BUTTON_1=200;\r\n/* This is where all the input to the window goes to这是窗口的所有输入的位置 */\r\nLRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {\r\n\r\n	switch(Message) {\r\n		//在创建窗口过程时 未显示窗口前 接收 WM_CREATE 这时可以创建控件 \r\n		case WM_CREATE: {\r\n			UINT IDC_BUTTON_1=200;\r\n			HWND hButtonWnd=CreateWindow(WC_BUTTON,"确定",WS_CHILD|BS_PUSHBUTTON|WS_VISIBLE,100,100,50,20,hwnd,(HMENU)IDC_BUTTON_1,NULL,NULL);\r\n\r\n		}\r\n		break;\r\n		//接收 来自button的点击事件 WM_COMMAND\r\n		case WM_COMMAND: {\r\n			UINT buttio_id=LOWORD(wParam);\r\n			UINT nCode=HIWORD(wParam);\r\n			if(nCode==BN_CLICKED && buttio_id==IDC_BUTTON_1) {\r\n				MessageBox(hwnd,"弹出消息了","tip",MB_OK);\r\n			}\r\n		}\r\n		break;\r\n		/* Upon destruction, tell the main thread to stop 销毁时，告诉主线程停止*/\r\n		case WM_DESTROY: {\r\n			PostQuitMessage(0);\r\n			break;\r\n		}\r\n\r\n		/* All other messages (a lot of them) are processed using default procedures */\r\n		default:\r\n			return DefWindowProc(hwnd, Message, wParam, lParam);\r\n	}\r\n	return 0;\r\n}\r\n\r\n/* The ''main'' function of Win32 GUI programs: this is where execution starts */\r\nint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {\r\n	WNDCLASSEX wc; /* A properties struct of our window  窗口的一个属性结构体*/\r\n	HWND hwnd; /* A ''HANDLE'', hence the H, or a pointer to our window 一个''HANDLE''，也就是H，或者一个指向窗口的指针*/\r\n	MSG msg; /* A temporary location for all messages 所有消息的临时位置*/\r\n\r\n	/* zero out the struct and set the stuff we want to modify 将结构归零并设置我们想要修改的内容 */\r\n	memset(&wc,0,sizeof(wc));\r\n	wc.cbSize		 = sizeof(WNDCLASSEX);\r\n	wc.lpfnWndProc	 = WndProc; /* This is where we will send messages to 这是我们要发送消息的地方*/\r\n	wc.hInstance	 = hInstance;\r\n	wc.hCursor		 = LoadCursor(NULL, IDC_ARROW);\r\n\r\n	/* White, COLOR_WINDOW is just a #define for a system color, try Ctrl+Clicking it 白色，COLOR_WINDOW只是一个系统颜色的#定义，尝试Ctrl+点击它*/\r\n	wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);\r\n	wc.lpszClassName = "WindowClass";\r\n	wc.hIcon		 = LoadIcon(NULL, IDI_APPLICATION); /* Load a standard icon 加载一个标准图标*/\r\n	wc.hIconSm		 = LoadIcon(NULL, IDI_APPLICATION); /* use the name "A" to use the project icon 使用名称“A”来使用项目图标*/\r\n	//MessageBox(NULL,"111111","标题",MB_ICONEXCLAMATION|MB_OK);\r\n	if(!RegisterClassEx(&wc)) {\r\n		MessageBox(NULL, "Window Registration Failed!","Error!",MB_ICONEXCLAMATION|MB_OK);\r\n		return 0;\r\n	}\r\n\r\n	hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,"WindowClass","Caption123",WS_VISIBLE|WS_OVERLAPPEDWINDOW,\r\n	                      CW_USEDEFAULT, /* x */\r\n	                      CW_USEDEFAULT, /* y */\r\n	                      640, /* width */\r\n	                      480, /* height */\r\n	                      NULL,NULL,hInstance,NULL);\r\n\r\n	if(hwnd == NULL) {\r\n		MessageBox(NULL, "Window Creation Failed!","Error!",MB_ICONEXCLAMATION|MB_OK);\r\n		return 0;\r\n	}\r\n\r\n\r\n\r\n\r\n	/*\r\n		This is the heart of our program where all input is processed and\r\n		sent to WndProc. Note that GetMessage blocks code flow until it receives something, so\r\n		this loop will not produce unreasonably high CPU usage\r\n	*/\r\n	while(GetMessage(&msg, NULL, 0, 0) > 0) { /* If no error is received... */\r\n		TranslateMessage(&msg); /* Translate key codes to chars if present */\r\n		DispatchMessage(&msg); /* Send it to WndProc */\r\n	}\r\n	return msg.wParam;\r\n}', '', 'webserver'),
(7158, 554, 'window窗口API开发一些常用函数', '都是在WndProc 里面响应\r\nWM_CREATE  //窗口创建前\r\n\r\nWM_COMMAND  //窗口点击事件\r\nUINT nCode=HIWORD(wParam);\r\nnCode==BN_CLICKED\r\n//WS_CHILD子窗口\r\n//WS_VISIBLE 显示的意思\r\n\r\n//HMENU  UINT强制类型转换HMENU\r\nhwnd H= CreateWindow(窗口类型,控件名,样式(WS_CHILD|WS_VISIBLE),坐标x, 坐标y,宽,高,句柄,(HMENU)菜单(控件id),NULL,NULL );\r\n', '', 'webserver'),
(7159, 20, 'ESP32 AP配网', '#include <WiFi.h>\r\n#include <WebServer.h>\r\n#include <HTTPClient.h>\r\n#include <FS.h>\r\n#include "SPIFFS.h"\r\n#include "ESPmDNS.h"\r\n#include <Ticker.h>\r\n\r\nTicker myTicker;\r\nString flashWifi = "/wifi.txt";  //wifi密码存放文件\r\nWebServer webServer;\r\nString ssid;\r\nString passwd;\r\nString html;\r\n#define baudRate 115200\r\nvoid setup(void) {\r\n  if (FlashConnetWifi() == false) {\r\n    HtmlSetWifi();\r\n  }\r\n}\r\n\r\nvoid loop(void) {\r\n}\r\n\r\nvoid HtmlSetWifi() {\r\n  WifiScan();\r\n  apStart();\r\n  delay(1000);\r\n  Serial.println("start webserver");\r\n  //5分后重启 防止停电后复电，路由器连接WIFI速度慢于ESP导致ESP连接不到路由器进入无限AP模式，所以这里只让AP激活5分钟后就重启\r\n  myTicker.once(300, espReboot);\r\n  delay(200);\r\n  webserverStart();\r\n  while (1) {\r\n    webServer.handleClient();  //检查网络服务请求并处理\r\n  }\r\n}\r\nvoid espReboot() {\r\n  ESP.restart();\r\n}\r\n//扫描附件WIFI\r\nvoid WifiScan() {\r\n  WiFi.disconnect();\r\n  Serial.begin(baudRate);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(100);\r\n  int n = WiFi.scanNetworks();\r\n  if (n > 0) {\r\n    String a = "附近WiFi <select id=\\"ssid\\">";\r\n    for (int i = 0; i < n; i++) {\r\n      Serial.println(WiFi.SSID(i));\r\n      a = a + "<option value=\\"" + WiFi.SSID(i) + "\\">" + WiFi.SSID(i) + "</option>";\r\n      delay(50);\r\n    }\r\n    String HtmlStart = String("") + "<!DOCTYPE html>" + "<html>" + "<head>" + "<meta charset=\\"utf-8\\">" + "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />" + "<title>设置WiFi</title>" + "<link rel=\\"stylesheet\\" href=\\"\\">" + "</head>" + "<script>" + "onload  = function() {" + "document.getElementById(\\"up\\").onclick = function(){" + "var ssida=document.getElementById(\\"ssid\\").value;" + "var ssid=ssida.replace(/\\\\s+/g, \\" \\");" + "var passwda=document.getElementsByTagName(''input'')[0].value;" + "var passwd=passwda.replace(/\\\\s+/g, \\" \\");" + "xhr = new XMLHttpRequest();" + "xhr.open(\\"POST\\",\\"./setWifi\\",true);" + "var posts = (\\"ssid=\\"+ssid+\\"&passwd=\\"+ passwd);" + "xhr.setRequestHeader(\\"Content-Type\\",\\"application/x-www-form-urlencoded\\");" + "xhr.send(posts);" + "xhr.onreadystatechange = function(){" + "if(this.readyState == 4 && this.status == 200){" + "alert(this.responseText);" + "}" + "}" + "}" + "}" + "</script>" + "<body>";\r\n    String HtmlEnd = String("") + "<p>WiFi密码<input type=\\"text\\" id=\\"passwd\\"></p>" + "<input type=\\"submit\\" id=\\"up\\" value=\\"设 置\\">" + "<hr/>" + "<div>如果附近WiFi没有显示到自己的WIFI<div>" + "<div>请重启或离信号近点</div>" + "<div>连接成功AP热点退出转WIFI_STA</div>" + "</body>" + "</html>";\r\n    a = a + "</select>";\r\n    html = HtmlStart + a + HtmlEnd;\r\n  } else {\r\n    html = "扫描不到网络";\r\n  }\r\n}\r\nvoid setWifi() {\r\n  ssid = webServer.arg(0);\r\n  passwd = webServer.arg(1);\r\n  const char* Ssid = ssid.c_str();\r\n  const char* Passwd = passwd.c_str();\r\n  String sp = ssid + "&" + passwd;\r\n  Serial.println(sp);\r\n  Serial.begin(baudRate);\r\n  delay(500);\r\n  WiFi.begin(Ssid, Passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      webServer.send(200, "text/plane", "Wifi密码正确,ESP准备重启");\r\n      webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flashWifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML设置网络连接成功");\r\n      delay(500);\r\n      ESP.restart();\r\n    }\r\n  }\r\n  webServer.send(200, "text/plane", "Wifi密码错误,请重新输入");\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  webServer.send(500, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\nvoid apStart() {\r\n  Serial.begin(baudRate);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet);\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "nobiggie.cn");\r\n  if (result) {\r\n    Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserverStart() {\r\n  webServer.begin(80);            // 启用网络服务\r\n  webServer.on("/", handleRoot);  // / 在HTTP中，表示请求首页服务，\r\n  webServer.on("/setWifi", setWifi);\r\n  webServer.onNotFound(handleNotFound);  // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\nbool FlashConnetWifi() {\r\n  Serial.begin(baudRate);\r\n  delay(200);\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flashWifi) == false) {\r\n    Serial.println("NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flashWifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  const char* WifiName = wifiname.c_str();\r\n  const char* WifiPw = wifipw.c_str();\r\n  Serial.println(WifiName);\r\n  Serial.println(WifiPw);\r\n  WiFi.begin(WifiName, WifiPw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("FlashConnet...");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("flash connet success");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("flash read error");\r\n  return false;\r\n}', '', 'webserver'),
(7160, 1, '控制面板按键无反应', '测量5伏电压正常。\r\n更换按键开关。故障依旧。\r\n更换贴片芯片。故障依旧。\r\n更换瓷片电容101\r\n故障排除。', '', 'webserver'),
(7161, 20, 'vscode 写arduino', '1. vscode 插件 里搜索 arduino 然后安装\r\n2. 点击arduino插件 选择 扩展设置\r\n3. 设置 页面上找到 在 settings.json 中设置\r\n    在"arduino.path": "C:\\\\Program Files (x86)\\\\Arduino\\\\",下加入\r\n\r\n"C_Cpp.intelliSenseEngineFallback": "Disabled",\r\n"C_Cpp.intelliSenseEngine": "Tag Parser",\r\n//意思是递归查找库文件\r\n保存\r\n\r\n4. 回到项目下 .vscode文件夹\r\narduino.json \r\n加入\r\n"output": "./build"\r\n\r\n5. .vscode文件夹 c_cpp_properties.json\r\n\r\n"includePath": [\r\n"输入库文件目录"\r\n]\r\n\r\n6. vscode 菜单中间下方 Arduino Board Configuration 选择使用的开发板\r\n\r\n7. Select Serial Port 选择usb连接开发板的端口\r\n\r\n//esp8266 库文件 \r\n            "includePath": [\r\n                "C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Arduino15\\\\packages\\\\esp8266\\\\hardware\\\\esp8266\\\\3.0.2\\\\libraries\\\\**",\r\n                "C:\\\\Users\\\\Administrator\\\\sketchbook\\\\libraries\\\\**",\r\n                "${workspaceFolder}/**"\r\n            ],\r\n//esp32 库文件 \r\n            "includePath": [\r\n                "C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Arduino15\\\\packages\\\\esp32\\\\hardware\\\\esp32\\\\2.0.2\\\\libraries\\\\**",\r\n                "C:\\\\Users\\\\Administrator\\\\sketchbook\\\\libraries\\\\**",\r\n                "${workspaceFolder}/**"\r\n            ],\r\n\r\n\r\n', '', 'webserver'),
(7164, 344, 'golang get post请求', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"io"\r\n	"time"\r\n\r\n	"net/http"\r\n	"strings"\r\n)\r\n\r\ntype XyzRequest struct {\r\n}\r\n\r\n// Get请求 url里携带参数\r\nfunc (class *XyzRequest) Get(url string) (string, error) {\r\n	var err error\r\n	myhttp := &http.Client{}\r\n	myhttp.Timeout = time.Duration(3 * time.Second)\r\n	resp, err1 := myhttp.Get(url)\r\n	if err1 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	body, err2 := io.ReadAll(resp.Body)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n}\r\n\r\n// post地址 请求参数，string格式\r\nfunc (class *XyzRequest) Post(url string, KVstring string) (string, error) {\r\n	var err error\r\n	myhttp := &http.Client{}\r\n	myhttp.Timeout = time.Duration(3 * time.Second)\r\n	resp, err1 := myhttp.Post(url, "application/x-www-form-urlencoded; charset=UTF-8", strings.NewReader(KVstring))\r\n	if err1 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	body, err2 := io.ReadAll(resp.Body)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n}\r\n\r\n// post地址 请求参数，json格式 返回json\r\nfunc (class *XyzRequest) PostJson(url string, strJson string) (string, error) {\r\n	var err error\r\n	req, _ := http.NewRequest("POST", url, bytes.NewBuffer([]byte(strJson)))\r\n	req.Header.Set("Content-Type", "application/json; charset=UTF-8")\r\n	client := &http.Client{}\r\n	client.Timeout = time.Duration(3 * time.Second)\r\n	resp, err2 := client.Do(req)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	// fmt.Println("status", resp.Status)\r\n	// fmt.Println("headers", resp.Header)\r\n	body, err3 := io.ReadAll(resp.Body)\r\n	if err3 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n}\r\n', '', 'webserver'),
(7165, 4, '波轮洗衣机一直进水不转', '更换水位传感器\r\n更新时必须注意以下几点\r\n1.必须在排完水后更换\r\n2.更换时最好拿铜丝绑紧接口处让其密封好\r\n3.通水\r\n4.调水位开关上面那个镙帽可以调节水位对应相对电子档位，向外转是调低水位', '', 'webserver'),
(7166, 529, '在线视频转换', 'https://convertio.co/zh/', '', 'webserver'),
(7167, 4, '滚筒洗衣机运行10多分钟就停', '滚筒洗衣机排水采用抽水方式\r\n如果不排水也会有这种现象\r\n测量220v两脚电阻正常180欧左右\r\n无穷大或过小就更换', '', 'webserver'),
(7168, 344, 'golang 连接数据库类', 'package models\r\n\r\nimport (\r\n	"database/sql"\r\n	"fmt"\r\n	"reflect"\r\n\r\n	_ "github.com/go-sql-driver/mysql"\r\n)\r\n\r\ntype Gdo struct {\r\n	conn *sql.DB\r\n	arr  []interface{}\r\n	stmt *sql.Stmt\r\n}\r\n\r\nfunc NewGdo(dbDatabase string) *Gdo {\r\n	conn, err := sql.Open("mysql", "root:qq282246101@tcp(localhost:3306)/"+dbDatabase+"?charset=utf8")\r\n	if err != nil {\r\n		fmt.Println("连接数据库失败")\r\n		conn.Close()\r\n	}\r\n	conn.SetConnMaxLifetime(100)\r\n	conn.SetMaxOpenConns(30)\r\n	g := &Gdo{}\r\n	g.conn = conn\r\n	return g\r\n}\r\nfunc (this *Gdo) Sql(sql string, arr ...interface{}) *Gdo {\r\n	Stmt, err := this.conn.Prepare(sql)\r\n	if err != nil {\r\n		fmt.Printf("prepare sql failed, err:%v\\n", err)\r\n		this.conn.Close()\r\n		return nil\r\n	}\r\n	this.stmt = Stmt\r\n	this.arr = arr\r\n	return this\r\n}\r\n\r\n// 查询成功 返回 true 返回值是 bool 手动写 指针取值\r\nfunc (this *Gdo) Row(show ...interface{}) bool {\r\n	row, _ := this.stmt.Query(this.arr...)\r\n	defer row.Close()\r\n	bl := row.Next()\r\n	if bl == false {\r\n		return false\r\n	}\r\n	row.Scan(show...)\r\n\r\n	return true\r\n}\r\n\r\n// 返回*sql.Rows, error 手动写 指针取值\r\nfunc (this *Gdo) RowS() (*sql.Rows, error) {\r\n	rows, err := this.stmt.Query(this.arr...)\r\n	return rows, err\r\n}\r\n\r\n// 失败返回空MAP 返回数据全部是string 数据库字段默认null即sql.NullString之类不能使用该方法\r\nfunc (this *Gdo) Fetch() map[string]string {\r\n	result := make(map[string]string)\r\n	row, _ := this.stmt.Query(this.arr...)\r\n	column, err := row.Columns()\r\n	if err != nil {\r\n		return result\r\n	}\r\n	values := make([][]byte, len(column))\r\n	scans := make([]interface{}, len(column))\r\n	for i, _ := range values {\r\n		scans[i] = &values[i]\r\n	}\r\n	defer row.Close()\r\n	bl := row.Next()\r\n	if bl == false {\r\n		return result\r\n	}\r\n	row.Scan(scans...)\r\n	for i, v := range values {\r\n		key := column[i]\r\n		result[key] = string(v)\r\n	}\r\n	return result\r\n}\r\n\r\n// 失败返回空MAP 返回数据全部是string 数据库字段默认null即sql.NullString之类不能使用该方法\r\nfunc (this *Gdo) FetchAll() map[int]map[string]string {\r\n	result := make(map[int]map[string]string)\r\n	rows, _ := this.stmt.Query(this.arr...)\r\n	//得到 select 查询字段名与个数\r\n	column, err := rows.Columns()\r\n	if err != nil {\r\n		return result\r\n	}\r\n	values := make([][]byte, len(column))\r\n	//fmt.Println(values)\r\n	scans := make([]interface{}, len(column))\r\n	for i, _ := range values {\r\n		scans[i] = &values[i]\r\n	}\r\n	//fmt.Println(scans)\r\n	i := 0\r\n	defer rows.Close()\r\n	for rows.Next() {\r\n		rows.Scan(scans...)\r\n		row := make(map[string]string)\r\n		for i, v := range values {\r\n			key := column[i]\r\n			row[key] = string(v)\r\n		}\r\n		result[i] = row\r\n		i++\r\n	}\r\n	return result\r\n}\r\n\r\n// 失败返回0 成功返回 受影响行的个数\r\nfunc (this *Gdo) Execute() int64 {\r\n	crow, _ := this.stmt.Exec(this.arr...)\r\n	re, err := crow.RowsAffected()\r\n	if err != nil {\r\n		return 0\r\n	}\r\n	return re\r\n}\r\n\r\n// 失败返回0 成功返回 行的id\r\nfunc (this *Gdo) Insert() int64 {\r\n	crow, _ := this.stmt.Exec(this.arr...)\r\n	re, err := crow.LastInsertId()\r\n	if err != nil {\r\n		return 0\r\n	}\r\n	return re\r\n}\r\nfunc (this *Gdo) AutoInsert(table string, m map[string]interface{}) int64 {\r\n	sql := "INSERT INTO " + table + " ("\r\n	//(rid,user,password) VALUES (?,?,?)\r\n	ik := ""\r\n	iv := ""\r\n	var mv []interface{}\r\n	for k, v := range m {\r\n		if ik == "" {\r\n			ik = k + ","\r\n		} else {\r\n			ik = ik + k + ","\r\n		}\r\n		if iv == "" {\r\n			iv = "?,"\r\n		} else {\r\n			iv = iv + "?" + ","\r\n		}\r\n		mv = append(mv, v)\r\n	}\r\n	ik = ik[0 : len(ik)-1]\r\n	iv = iv[0 : len(iv)-1]\r\n	sql = sql + ik + ") VALUES (" + iv + ")"\r\n	return this.Sql(sql, mv...).Insert()\r\n}\r\nfunc StructToMap(obj interface{}) map[string]interface{} {\r\n	t := reflect.TypeOf(obj)\r\n\r\n	//获取到里面的值 一维数组 {100 beego gobee}\r\n	v := reflect.ValueOf(obj)\r\n	data := make(map[string]interface{})\r\n	for i := 0; i < t.NumField(); i++ {\r\n		//得到键名                //得到里面的值\r\n		data[t.Field(i).Name] = v.Field(i)\r\n	}\r\n	return data\r\n}\r\nfunc StructToMapS(obj interface{}) map[string]string {\r\n	t := reflect.TypeOf(obj)\r\n\r\n	//获取到里面的值 一维数组 {100 beego gobee}\r\n	v := reflect.ValueOf(obj)\r\n	data := make(map[string]string)\r\n	for i := 0; i < t.NumField(); i++ {\r\n		//得到键名                //得到里面的值\r\n		data[t.Field(i).Name] = v.Field(i).String()\r\n	}\r\n	return data\r\n}\r\n', '', 'webserver'),
(7169, 344, 'go 泛型 ', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n)\r\n\r\n// 定义一个inteface 里面包含多个数据类型\r\ntype Cde interface {\r\n	int64 | float64 | ~string\r\n}\r\n\r\nfunc add[T Cde](x, y T) T {\r\n	return x + y\r\n}\r\nfunc main() {\r\n	var c, d int64\r\n	c = 3\r\n	d = 8\r\n	a := add(c, d)\r\n	fmt.Println(a)\r\n}\r\n', '', 'webserver'),
(7497, 32, '4冲程割草机 难启动或启动一下就停', '更换 化油器', '', 'webserver'),
(7498, 8, '饮水机不制冷', '拆下制冷片测量电阻 例如tec1-2706 正向向电阻正常为 0欧和45欧左右，如果阻值差别很大更换，更换后还是一样，更换主板', '', 'webserver'),
(7504, 529, '国家中小学智慧教育网', 'https://basic.smartedu.cn/', '', 'webserver'),
(7505, 344, '重定向301 302区别', '301是永久访问a直接跳转b， 缓存了跳转连接\r\n下次访问a直接跳转b了,不会经过b后台程序\r\n\r\n302是临时的 关了网页就没了,用302多', '', 'webserver'),
(7834, 344, '获取随机字符串', '//获取随机字符串\r\nfunc GetRandString(length int) string {\r\n	if length < 1 {\r\n		return ""\r\n	}\r\n	char := "abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWSYZ0123456789"\r\n	charArr := strings.Split(char, "")\r\n	//fmt.Println(charArr)\r\n	charlen := len(charArr)\r\n\r\n	b := rand.New(rand.NewSource(time.Now().Unix()))\r\n	//fmt.Println(b)\r\n	str := ""\r\n	for i := 1; i <= length; i++ {\r\n		r := b.Intn(charlen)\r\n		str = str + charArr[r]\r\n	}\r\n	return str\r\n}\r\n', '', 'webserver'),
(7837, 344, 'go 微信小程序登录解密', 'package main\r\n\r\nimport (\r\n	"crypto/aes"\r\n	"crypto/cipher"\r\n	"encoding/base64"\r\n	"fmt"\r\n	"strings"\r\n)\r\n\r\nfunc main() {\r\n	var appid = "wx4f4bc4dec97d474b"\r\n	var sessionKey = "tiihtNczf5v6AKRyjwEUhQ=="\r\n	var iv = "r7BXXKkLb8qrSNn05n0qiA=="\r\n	var encryptedData = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=="\r\n	str := DecryptWXOpenData(sessionKey, encryptedData, iv)\r\n	if strings.Index(str, appid) != -1 {\r\n		fmt.Println("解析成功")\r\n	} else {\r\n		fmt.Println("失败")\r\n	}\r\n\r\n}\r\nfunc DecryptWXOpenData(sessionKey, encryptData, iv string) string {\r\n	decodeBytes, err := base64.StdEncoding.DecodeString(encryptData)\r\n	if err != nil {\r\n		return ""\r\n	}\r\n	sessionKeyBytes, err := base64.StdEncoding.DecodeString(sessionKey)\r\n	if err != nil {\r\n		return ""\r\n	}\r\n	ivBytes, err := base64.StdEncoding.DecodeString(iv)\r\n	if err != nil {\r\n		return ""\r\n	}\r\n	dataBytes, err := AesDecrypt(decodeBytes, sessionKeyBytes, ivBytes)\r\n	return string(dataBytes)\r\n}\r\n\r\nfunc AesDecrypt(crypted, key, iv []byte) ([]byte, error) {\r\n	block, err := aes.NewCipher(key)\r\n	if err != nil {\r\n		return nil, err\r\n	}\r\n	//blockSize := block.BlockSize()\r\n	blockMode := cipher.NewCBCDecrypter(block, iv)\r\n	origData := make([]byte, len(crypted))\r\n	blockMode.CryptBlocks(origData, crypted)\r\n	//获取的数据尾端有''/x0e''占位符,去除它\r\n	for i, ch := range origData {\r\n		if ch == ''\\x0e'' {\r\n			origData[i] = '' ''\r\n		}\r\n	}\r\n	//{"phoneNumber":"15082726017","purePhoneNumber":"15082726017","countryCode":"86","watermark":{"timestamp":1539657521,"appid":"wx4c6c3ed14736228c"}}//<nil>\r\n	return origData, nil\r\n}\r\n', '', 'webserver'),
(7838, 8, '冰箱封口焊接步骤注意事项', '必须在断电停止运行的状态下进行封口焊接，因为运行的时候管道内是负压很危险的\r\n用封口钳压两道，在压第三道的时候，封口钳要一直留在那里等风封口焊接完再拿下来\r\n用割管器把封口钳前面20mm左右割开\r\n封口稍微往上抬，做好周围部件的防热，就可以用氧焊口', '', 'webserver'),
(7839, 4, '甩干内桶呼呼响，内桶撞到内壁', '更换4个平衡杆', '', 'webserver'),
(7840, 529, '火狐浏览器视频缓存', '浏览器上输入 about:cache\r\n\r\nC:\\Users\\Administrator\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\6m23yd8k.default-release-1\\cache2 ', '', 'webserver'),
(7841, 344, 'rune 的作用', 'rune 是把中文也计算进字符串，不会出现乱码报错\r\n[]rune("")', '', 'webserver'),
(7842, 344, '* 和 & 的区别 ', '任何变量都有 内存地址和值 组成\r\n指针也是\r\n\r\n指针的值 是一个变量的内存地址\r\n这个指针它也有自己的内存地址\r\n\r\n* 代表取指针地址中存的值\r\n& 代表取一个值的内存地址\r\nfunc main() {\r\n	a := 100\r\n	var ptr *int\r\n\r\n	ptr = &a\r\n	fmt.Println(ptr)\r\n	fmt.Println(*ptr)//获取值\r\n	fmt.Println(*&a)//获取值\r\n}\r\n', '', 'webserver'),
(7843, 344, 'golang file_get_content', '	res, err := http.Get("https://img2.baidu.com/it/u=9107913,2560446129&fm=253&fmt=auto&app=138&f=JPEG?w=281&h=500")\r\n	if err != nil {\r\n		fmt.Println("err")\r\n	}\r\n	robots, _ := ioutil.ReadAll(res.Body)\r\n	res.Body.Close(', '', 'webserver'),
(7844, 344, '移动ORC ', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"crypto/hmac"\r\n	"crypto/sha1"\r\n	"crypto/sha256"\r\n	"encoding/hex"\r\n	"errors"\r\n	"fmt"\r\n	"io"\r\n	"io/ioutil"\r\n	"net/http"\r\n	"net/url"\r\n	"strconv"\r\n	"strings"\r\n	"time"\r\n)\r\n\r\n/* 	ocr := YiDsOcr{}\r\nresultM := ocr.New().UrlAddSignIsPostUrl().PostGetAllJson(this.GetString("image")).RemoveOtherGetItems().GetItemM()\r\nfmt.Println(resultM) */\r\n\r\ntype YiDsOcr struct {\r\n	host        string\r\n	urlPath     string\r\n	url         string\r\n	query       string\r\n	AccessKey   string\r\n	Secretkey   string\r\n	Sign        string\r\n	RequestType string\r\n	PostUrl     string\r\n	AllJson     string\r\n\r\n	items  string\r\n	i      int\r\n	itemsM map[int]string\r\n}\r\n\r\n// ok\r\nfunc (this *YiDsOcr) New() *YiDsOcr {\r\n	this.RequestType = "GET"\r\n	this.AllJson = ""\r\n	this.host = "https://api-wuxi-1.cmecloud.cn:8443"\r\n	this.urlPath = "/api/ocr/v1/general"\r\n	this.url = this.host + this.urlPath\r\n	this.AccessKey = "566fb5cc631047c9b8e330246522c6a9"\r\n	this.Secretkey = "cbea3dde4d414ef3915a570d1f61afb0"\r\n	bq := "AccessKey=" + this.AccessKey +\r\n		"&SignatureMethod=HmacSHA1&SignatureNonce=" + this.Sha1(strconv.Itoa(int(time.Now().Unix()))) +\r\n		"&SignatureVersion=V2.0&Timestamp=" + time.Now().Format("2006-01-02T15:04:05Z") +\r\n		"&Version=2016-12-05"\r\n	this.query = bq\r\n\r\n	this.items = ""\r\n	this.i = 0\r\n	this.itemsM = make(map[int]string)\r\n	return this\r\n}\r\n\r\nfunc (this *YiDsOcr) Sha256(str string) string {\r\n	m := sha256.New()\r\n	m.Write([]byte(str))\r\n	res := hex.EncodeToString(m.Sum(nil))\r\n	return res\r\n}\r\n\r\nfunc (this *YiDsOcr) Sha1(s string) string {\r\n	o := sha1.New()\r\n	o.Write([]byte(s))\r\n	res := hex.EncodeToString(o.Sum(nil))\r\n	return res\r\n}\r\n\r\nfunc (this *YiDsOcr) HmacSha1(v, keyStr string) string {\r\n	h := sha1.New()\r\n	io.WriteString(h, v)\r\n	h.Sum(nil)\r\n	//hmac ,use sha1\r\n	key := []byte(keyStr)\r\n	mac := hmac.New(sha1.New, key)\r\n	// mac := hmac.New(md5.New, key)\r\n	mac.Write([]byte(v))\r\n	a := fmt.Sprintf("%x", mac.Sum(nil))\r\n	return a\r\n}\r\n\r\nfunc (this *YiDsOcr) UrlAddSignIsPostUrl() *YiDsOcr {\r\n	this.RequestType = "POST"\r\n	Urr := this.url + "?" + this.query + "&Signature=" + this.GetSign()\r\n	this.PostUrl = Urr\r\n	return this\r\n\r\n}\r\n\r\nfunc (this *YiDsOcr) Pencode(str string) string {\r\n	str = strings.Replace(str, "+", "%20", -1)\r\n	str = strings.Replace(str, "*", "%2A", -1)\r\n	str = strings.Replace(str, "%7E", "~", -1)\r\n	return str\r\n\r\n}\r\n\r\nfunc (this *YiDsOcr) ToASCII(str string) string {\r\n	s := strconv.QuoteToASCII(str)\r\n	true_utf := s[1 : len(s)-1]\r\n	return true_utf\r\n}\r\n\r\nfunc (this *YiDsOcr) GetSign() string {\r\n	m := make(map[int]map[string]string)\r\n	uri := this.query\r\n	if len(uri) < 1 { // 空字符串\r\n		return "error"\r\n	}\r\n	if uri[0:1] == "?" { // 有没有包含？,有的话忽略。\r\n		uri = uri[1:]\r\n	}\r\n\r\n	// 首先分解&（sessionid=22222&token=3333 )变成\r\n	// sessionid=222222 和 token=3333\r\n	pars := strings.Split(uri, "&")\r\n	i := 0\r\n	for _, par := range pars {\r\n		mm := make(map[string]string)\r\n		// 然后分解 sessionid=222222 和 token=3333\r\n		parkv := strings.Split(par, "=")\r\n		mm[parkv[0]] = parkv[1] // 等号前面是key,后面是value\r\n		m[i] = mm\r\n		i++\r\n	}\r\n	result := ""\r\n	for i := 0; i < len(m); i++ {\r\n		for k, v := range m[i] {\r\n			result = result + this.Pencode(url.QueryEscape(this.ToASCII(k))) + "=" + this.Pencode(url.QueryEscape(this.ToASCII(v))) + "&"\r\n		}\r\n	}\r\n	result = result[0 : len(result)-1]\r\n\r\n	//url utf8编码\r\n	re := this.RequestType + "\\n" +\r\n		this.Pencode(url.QueryEscape(this.urlPath)) + "\\n" +\r\n		this.Sha256(result)\r\n	key := this.ToASCII("BC_SIGNATURE&" + this.Secretkey)\r\n	res := this.HmacSha1(re, key)\r\n\r\n	return url.QueryEscape(res)\r\n}\r\n\r\n// ok\r\nfunc (this *YiDsOcr) Parse_str(uri string) (map[string]string, error) {\r\n	m := make(map[string]string)\r\n	if len(uri) < 1 { // 空字符串\r\n		return m, errors.New("uri is none")\r\n	}\r\n	if uri[0:1] == "?" { // 有没有包含？,有的话忽略。\r\n		uri = uri[1:]\r\n	}\r\n\r\n	// 首先分解&（sessionid=22222&token=3333 )变成\r\n	// sessionid=222222 和 token=3333\r\n	pars := strings.Split(uri, "&")\r\n	for _, par := range pars {\r\n		// 然后分解 sessionid=222222 和 token=3333\r\n		parkv := strings.Split(par, "=")\r\n		m[parkv[0]] = parkv[1] // 等号前面是key,后面是value\r\n	}\r\n	return m, nil\r\n}\r\n\r\n// 注意一点js 发送的Base64必须把头文件去除 不然报错 这API要求不能包含有头文件\r\nfunc (this *YiDsOcr) PostGetAllJson(base64 string) *YiDsOcr {\r\n	bodys := "{\\"image\\": \\"" + base64 + "\\"}"\r\n	//fmt.Println(bodys)\r\n	req, _ := http.NewRequest("POST", this.PostUrl, bytes.NewBuffer([]byte(bodys)))\r\n	req.Header.Set("Content-Type", "application/json; charset=UTF-8")\r\n	client := &http.Client{}\r\n	resp, err2 := client.Do(req)\r\n	if err2 != nil {\r\n		return nil\r\n	}\r\n	defer resp.Body.Close()\r\n	// fmt.Println("status", resp.Status)\r\n	// fmt.Println("headers", resp.Header)\r\n	body, _ := ioutil.ReadAll(resp.Body)\r\n	this.AllJson = string(body)\r\n	return this\r\n}\r\n\r\n// 过滤掉不需要的 只要返回内容 items\r\nfunc (this *YiDsOcr) RemoveOtherGetItems() *YiDsOcr {\r\n	//fmt.Println(restr)\r\n	start := strings.Index(this.AllJson, "items")\r\n	end := strings.Index(this.AllJson, "class")\r\n	this.items = this.AllJson[start+7 : end-2]\r\n	this.items = strings.ReplaceAll(this.items, " ", "")\r\n	return this\r\n}\r\n\r\n// items 长在3000多个字符串中 找到对应 "itemstring":后面的值 合并到一个 map[int]string 想要的数据都在这里面\r\nfunc (this *YiDsOcr) GetItemM() map[int]string {\r\n	start := -1\r\n	end := 0\r\n	if strings.Index(this.items, "itemstring") != -1 {\r\n		start = strings.Index(this.items, "itemstring") + 12\r\n		this.items = this.items[start:]\r\n		end = strings.Index(this.items, ",")\r\n		this.itemsM[this.i] = this.items[0:end]\r\n		this.items = this.items[end+1:]\r\n		this.i++\r\n		this.GetItemM()\r\n	}\r\n	this.AllJson = ""\r\n	this.i = 0\r\n	return this.itemsM\r\n}\r\n', '', 'webserver'),
(7845, 344, 'HmacSha1 加密 ', 'func HmacSha1(v, keyStr string) string {\r\n	h := sha1.New()\r\n	io.WriteString(h, v)\r\n	h.Sum(nil)\r\n	//hmac ,use sha1\r\n	key := []byte(keyStr)\r\n	mac := hmac.New(sha1.New, key)\r\n	// mac := hmac.New(md5.New, key)\r\n	mac.Write([]byte(v))\r\n	a := fmt.Sprintf("%x", mac.Sum(nil))\r\n	return a\r\n}', '', 'webserver'),
(7846, 344, 'sha1 加密 ', 'func Sha1(s string) string {\r\n	o := sha1.New()\r\n	o.Write([]byte(s))\r\n	res := hex.EncodeToString(o.Sum(nil))\r\n	return res\r\n}', '', 'webserver'),
(7847, 344, 'sha256 加密 ', 'func Sha256(str string) string {\r\n	m := sha256.New()\r\n	m.Write([]byte(str))\r\n	res := hex.EncodeToString(m.Sum(nil))\r\n	return res\r\n}', '', 'webserver'),
(7848, 344, 'utf8编码', 'func ToASCII(str string) string {\r\n	s := strconv.QuoteToASCII(str)\r\n	true_utf := s[1 : len(s)-1]\r\n	return true_utf\r\n}', '', 'webserver'),
(7849, 344, 'Ocr遍历items放到MAP', '/*\r\nocr := OcrItems{}\r\nm := ocr.New().Getitems(jsonS)\r\n*/\r\ntype OcrItems struct {\r\n	items string\r\n	i     int\r\n	m     map[int]string\r\n}\r\n\r\nfunc (this *OcrItems) New() *OcrItems {\r\n	this.items = ""\r\n	this.i = 0\r\n	this.m = make(map[int]string)\r\n	return this\r\n}\r\n\r\nfunc (this *OcrItems) Getitems(str string) map[int]string {\r\n	start := -1\r\n	end := 0\r\n	this.items = str\r\n	if strings.Index(this.items, "itemstring") != -1 {\r\n		start = strings.Index(this.items, "itemstring") + 12\r\n		this.items = this.items[start:]\r\n		end = strings.Index(this.items, ",")\r\n		this.m[this.i] = this.items[0:end]\r\n		this.items = this.items[end+1:]\r\n		this.i++\r\n		this.Getitems(this.items)\r\n	}\r\n	return this.m\r\n}\r\n', '', 'webserver'),
(7850, 344, '数据库导出成Excel或Excel导入数据库类', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"strconv"\r\n	"strings"\r\n\r\n	"github.com/xuri/excelize/v2"\r\n)\r\n\r\ntype MyExcel struct {\r\n	f *excelize.File\r\n}\r\n\r\n// pages 文件里生成几页 默认1 生成两页写2\r\nfunc (this *MyExcel) WriteBegin(pages int) *MyExcel {\r\n	f := excelize.NewFile()\r\n	this.f = f\r\n	if pages > 1 {\r\n		//创建工作表\r\n		for i := 2; i <= pages; i++ {\r\n			f.NewSheet("Sheet" + strconv.Itoa(i))\r\n		}\r\n	}\r\n	return this\r\n}\r\n\r\n/*\r\ncurrent当前执行插入页 不能超过总页数\r\ntableK插入到表格的哪行哪列\r\ntableV插入的值\r\n*/\r\nfunc (this *MyExcel) WriteExcel(current int, tableK string, tableV string) *MyExcel {\r\n	this.f.SetCellValue("Sheet"+strconv.Itoa(current), tableK, tableV)\r\n	return this\r\n}\r\n\r\n// Save 生成Excel文件名(路径)\r\nfunc (this *MyExcel) Save(filaname string) error {\r\n	//设置打开后默认 页\r\n	//f.SetActiveSheet(index)\r\n	err := this.f.SaveAs(filaname)\r\n	if err != nil {\r\n		return err\r\n	}\r\n	return nil\r\n}\r\n\r\n// filename 文件名  readCount代表要读取Excel第几页（如果多页的话）\r\nfunc (this *MyExcel) ReadExcel(filename string, readCount int) ([][]string, error) {\r\n	f, err := excelize.OpenFile(filename)\r\n\r\n	if err != nil {\r\n		fmt.Println(err)\r\n	}\r\n	if readCount > 0 {\r\n		readCount--\r\n	} else {\r\n		readCount = 0\r\n	}\r\n	//f.GetSheetName(0)里面的012分别代表是123页\r\n	firstSheet := f.GetSheetName(readCount)\r\n	defer f.Close()\r\n	rows, err1 := f.GetRows(firstSheet)\r\n	return rows, err1\r\n}\r\n\r\n// strArr  := []string{"name", "phone", "address", "quantity"} Map字段   再通过map[int]map[string]interface{} 遍历插入数据库\r\nfunc (this *MyExcel) ExcelToMaps(filename string, readCount int, strArr []string) map[int]map[string]interface{} {\r\n	rows1, _ := this.ReadExcel(filename, 13)\r\n	mm := make(map[int]map[string]interface{})\r\n	mmi := 0\r\n	for _, v := range rows1 {\r\n		i := 0\r\n		m := make(map[string]interface{})\r\n		for _, v2 := range v {\r\n			strS := strings.Split(v2, " ")\r\n			switch i {\r\n			case 0:\r\n				m[strArr[i]] = strS[0]\r\n			case 1:\r\n				m[strArr[i]] = strS[0]\r\n			case 2:\r\n				m[strArr[i]] = strS[0]\r\n			case 3:\r\n				m[strArr[i]] = strS[0]\r\n			}\r\n			i++\r\n		}\r\n		mm[mmi] = m\r\n		mmi++\r\n	}\r\n	return mm\r\n}\r\n\r\n/*  //数据库导出Excel\r\ne := MyExcel{}\r\nvar name, phone, address string\r\nvar quantity, cid int\r\ni := 1\r\nthisI := 1\r\nDb := NewGdo("xyz")\r\nDb.Sql("SELECT count(id) FROM CommerceCustomer WHERE user=?", "webserver").Fetch(&cid)\r\npage := cid / 40\r\nif cid > (page * 40) {\r\n	page++\r\n}\r\nfmt.Println(cid)\r\nfmt.Println(page)\r\ne.WriteBegin(page)\r\nrows, _ := Db.Sql("SELECT name,phone,address,quantity FROM CommerceCustomer WHERE user=?", "webserver").FetchAll()\r\n\r\ndefer rows.Close()\r\nfor rows.Next() {\r\n	rows.Scan(&name, &phone, &address, &quantity)\r\n	e.WriteExcel(thisI, "A"+strconv.Itoa(i), name)\r\n	e.WriteExcel(thisI, "B"+strconv.Itoa(i), phone)\r\n	e.WriteExcel(thisI, "C"+strconv.Itoa(i), address)\r\n	e.WriteExcel(thisI, "D"+strconv.Itoa(i), strconv.Itoa(quantity))\r\n	//就翻页插入\r\n	if i == 40 {\r\n		//翻页第几页\r\n		thisI++\r\n		i = 0\r\n	}\r\n	i++\r\n}\r\ne.Save("xyz.xlsx")\r\n*/\r\n', '', 'webserver'),
(7852, 344, 'gorilla/websocket 客户端主动关闭连接', 'this.conn.WriteControl(websocket.CloseMessage, websocket.FormatCloseMessage(4001, "close"), time.Now().Add(time.Second))', '', 'webserver'),
(7853, 344, '网络传输原理', '网卡MAC   链路层 \r\nip        网络层\r\n端口      传输层\r\n程序      应用层', '', 'webserver'),
(7854, 344, 'golang获取MAC地址', 'func GetMac() string {\r\n	netInterfaces, err := net.Interfaces()\r\n	if err != nil {\r\n		return ""\r\n	}\r\n	for _, i2 := range netInterfaces {\r\n		//fmt.Println(i2.Name)\r\n		mac := i2.HardwareAddr\r\n		//fmt.Println(mac)\r\n		return mac.String()\r\n	}\r\n	return ""\r\n}', '', 'webserver'),
(7858, 344, '交叉编译', '不支持 cgo交叉编译 sqlite数据库\r\narm64 ->  amd64\r\nexport CGO_ENABLED=0 GOOS=linux GOARCH=amd64\r\n//CGO_ENABLED=0 代表禁用CGO\r\ngo build main.go\r\n//重启系统 GOARCH 会自动变为arm64    CGO_ENABLED=1\r\ngo env  //查看是否已经更改\r\n\r\nwindows arm64 -> linux arm64\r\nset GOOS=linux\r\nset CGO_ENABLED=0\r\ngo build main.go', '', 'webserver'),
(7860, 344, 'gin 微服务或mvc', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"goweb/models"\r\n	"goweb/routers"\r\n	"html/template"\r\n	"net/http"\r\n\r\n	"github.com/gin-contrib/sessions"\r\n	"github.com/gin-contrib/sessions/cookie"\r\n	"github.com/gin-gonic/gin"\r\n	"github.com/unrolled/secure"\r\n)\r\n\r\nfunc main() {\r\n	yaml := models.YmlRead{}\r\n	yml, _ := yaml.Read("conf/app.yml")\r\n	myttps := fmt.Sprintf("%v", yml["HttpS"])\r\n	if myttps == "" {\r\n		myttps = "false"\r\n	}\r\n\r\n	gin.SetMode(gin.ReleaseMode)\r\n	//r := gin.Default()\r\n	r := gin.New()\r\n	r.SetFuncMap(template.FuncMap{\r\n		"strhtml": func(s string) template.HTML {\r\n			return template.HTML(s)\r\n		},\r\n		"substr": func(s string, start int, end int) string {\r\n			return s[start:end]\r\n		},\r\n	})\r\n	//静态目录 css js\r\n	r.Static("static", "static")\r\n	//前端多级目录views/admin/xxx.html\r\n	r.LoadHTMLGlob("views/**/**/*")\r\n	//文件服务器\r\n	r.StaticFS("tool", http.Dir("tool"))\r\n	// 创建基于cookie的存储引擎，secret11111 参数是用于加密的密钥\r\n	Store := cookie.NewStore([]byte("360xyz"))\r\n	// 设置session中间件，参数mysession，指的是session的名字，也是cookie的名字\r\n	// store是前面创建的存储引擎，我们可以替换成其他存储引擎\r\n	//session过期时间30分\r\n	Store.Options(sessions.Options{\r\n		MaxAge: 1800,\r\n		Path:   "/",\r\n	})\r\n\r\n	r.Use(sessions.Sessions("mysession", Store))\r\n	//调用路由\r\n	routers.GinRouterInit(r)\r\n\r\n	if myttps == "true" {\r\n		https := gin.New()\r\n		https.SetFuncMap(template.FuncMap{\r\n			"strhtml": func(s string) template.HTML {\r\n				return template.HTML(s)\r\n			},\r\n			"substr": func(s string, start int, end int) string {\r\n				return s[start:end]\r\n			},\r\n		})\r\n		https.Static("static", "static")\r\n		https.LoadHTMLGlob("views/**/**/*")\r\n		https.Use(sessions.Sessions("mysession", Store))\r\n		routers.GinRouterInit(https)\r\n		https.Use(func(ctx *gin.Context) {\r\n			secureMiddleware := secure.New(secure.Options{\r\n				SSLRedirect: true,\r\n				SSLHost:     "localhost:443",\r\n			})\r\n			err := secureMiddleware.Process(ctx.Writer, ctx.Request)\r\n			if err != nil {\r\n				return\r\n			}\r\n			ctx.Next()\r\n		})\r\n		go func() {\r\n			err7 := http.ListenAndServeTLS(":"+fmt.Sprintf("%v", yml["HttpsPort"]), fmt.Sprintf("%v", yml["certFile"]), fmt.Sprintf("%v", yml["keyFile"]), https)\r\n			if err7 != nil {\r\n				fmt.Println("httpsError")\r\n			}\r\n		}()\r\n	}\r\n	//不指定端口，默认8080\r\n	r.Run(":80")\r\n\r\n}\r\n', '', 'webserver'),
(7861, 344, '验证码', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"net/http"\r\n	"time"\r\n\r\n	"github.com/dchest/captcha"\r\n	"github.com/gin-contrib/sessions"\r\n	"github.com/gin-gonic/gin"\r\n)\r\n\r\ntype CaptchaXyz struct {\r\n}\r\n\r\nfunc (this *CaptchaXyz) Captcha(ctx *gin.Context, length ...int) {\r\n	l := captcha.DefaultLen\r\n	w, h := 107, 36\r\n	if len(length) == 1 {\r\n		l = length[0]\r\n	}\r\n	if len(length) == 2 {\r\n		w = length[1]\r\n	}\r\n	if len(length) == 3 {\r\n		h = length[2]\r\n	}\r\n	captchaId := captcha.NewLen(l)\r\n	session := sessions.Default(ctx)\r\n	session.Set("captcha", captchaId)\r\n	_ = session.Save()\r\n	_ = this.Serve(ctx.Writer, ctx.Request, captchaId, ".png", "zh", false, w, h)\r\n}\r\nfunc (this *CaptchaXyz) CaptchaVerify(c *gin.Context, code string) bool {\r\n	session := sessions.Default(c)\r\n	if captchaId := session.Get("captcha"); captchaId != nil {\r\n		session.Delete("captcha")\r\n		_ = session.Save()\r\n		if captcha.VerifyString(captchaId.(string), code) {\r\n			return true\r\n		} else {\r\n			return false\r\n		}\r\n	} else {\r\n		return false\r\n	}\r\n}\r\nfunc (this *CaptchaXyz) Serve(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool, width, height int) error {\r\n	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")\r\n	w.Header().Set("Pragma", "no-cache")\r\n	w.Header().Set("Expires", "0")\r\n\r\n	var content bytes.Buffer\r\n	switch ext {\r\n	case ".png":\r\n		w.Header().Set("Content-Type", "image/png")\r\n		_ = captcha.WriteImage(&content, id, width, height)\r\n	case ".wav":\r\n		w.Header().Set("Content-Type", "audio/x-wav")\r\n		_ = captcha.WriteAudio(&content, id, lang)\r\n	default:\r\n		return captcha.ErrNotFound\r\n	}\r\n\r\n	if download {\r\n		w.Header().Set("Content-Type", "application/octet-stream")\r\n	}\r\n	http.ServeContent(w, r, id+ext, time.Time{}, bytes.NewReader(content.Bytes()))\r\n	return nil\r\n}\r\nif !Cpt.CaptchaVerify(ctx, ctx.PostForm("captcha")) {\r\n			ctx.Writer.Write([]byte("<script>alert(''验证码错误'');location.href=''../account/login''</script>"))\r\n		}', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(7862, 344, 'Beego  Gin 区别', 'Beego                             Gin区别\r\n----------------------------------------------------Context 区别---------------------------------------------\r\nContext集成在控制器controller类里        方法里转入 func xxx(ctx *gin.Context)\r\n\r\n-----------------------------------------------get请求-----------------------------------------------------------\r\nthis.Ctx.Input.Query("key")                                  ctx.Query("key")\r\n\r\n-----------------------------------------------post请求------------------------------------------------------------\r\nthis.Ctx.Request.PostFormValue("key")              ctx.Request.PostFormValue("key")\r\n\r\n------------------------------------------网页返回字符串-------------------------------------------------------\r\nthis.Ctx.WriteString("返回的字符串")                 ctx.String(200,"返回的字符串")\r\n\r\n------------------------------------------网页弹出提示框-------------------------------------------------------\r\nthis.Ctx.Output.ContentType("text/html;chart=utf8")\r\nthis.Ctx.Output.Body([]byte("<script>alert(''不能重复登录'');location.href=''../''</script>"))\r\n\r\nctx.Writer.Write([]byte("<script>alert(''不能重复登录'');location.href=''../''</script>"))\r\n-----------------------------------------------Cookie操作-------------------------------------------------------\r\nthis.Ctx.SetCookie("key", "value", time.Now().Unix()+3600)    ctx.SetCookie("key","value",int(time.Now().Unix()),"/",ctx.Request.Host,false,true)\r\n\r\nthis.Ctx.GetCookie("key")                           cookie, err := ctx.Cookie("key")\r\n\r\n---------------------------------------------Session操作----------------------------------------------------------\r\n                              		//传Context获取session := sessions.Default(ctx)\r\nthis.SetSession("key")                                  session.Set("key", value)\r\n//必须执行保存操作session.Save()\r\n\r\nthis.GetSession("key")                                      session.Get("key")                 \r\n----------------------------------------------------前端加载------------------------------------------------------\r\nthis.Data[“key”]=value\r\nthis.TplName = "test/index.html"             ctx.HTML(200, "test/index.html", data)\r\n--------------------------------------获取前端提交的图片---------------------------------------------------\r\nc.Ctx.Request.FormFile("imageKey")               ctx.Request.FormFile("imageKey")\r\n\r\n\r\n\r\n', '', 'webserver'),
(7863, 344, 'Beego VS  Gin', 'Beego                                           Gin区别\r\n\r\nContext 区别\r\nContext集成在控制器controller类里        方法里转入 func xxx(ctx *gin.Context)\r\n\r\n\r\nget请求\r\nthis.Ctx.Input.Query("key")                                  ctx.Query("key")\r\n\r\n\r\npost请求\r\nthis.Ctx.Request.PostFormValue("key")              ctx.Request.PostFormValue("key")\r\n\r\n\r\n网页返回字符串-\r\nthis.Ctx.WriteString("返回的字符串")                 ctx.String(200,"返回的字符串")\r\n\r\n\r\n网页弹出提示框-\r\nthis.Ctx.Output.ContentType("text/html;chart=utf8")\r\nthis.Ctx.Output.Body([]byte("<script>alert(''不能重复登录'');location.href=''../''</script>"))\r\n\r\nctx.Writer.Write([]byte("<script>alert(''不能重复登录'');location.href=''../''</script>"))\r\n\r\n\r\n-Cookie操作-\r\nthis.Ctx.SetCookie("key", "value", time.Now().Unix()+3600)    ctx.SetCookie("key","value",int(time.Now().Unix()),"/",ctx.Request.Host,false,true)\r\n\r\nthis.Ctx.GetCookie("key")                           cookie, err := ctx.Cookie("key")\r\n\r\n\r\nSession操作\r\n                              		//传Context获取session := sessions.Default(ctx)\r\nthis.SetSession("key")                                  session.Set("key", value)\r\n//必须执行保存操作session.Save()\r\nthis.GetSession("key")                                      session.Get("key")   \r\n\r\n              \r\n前端加载-\r\nthis.Data[“key”]=value\r\nthis.TplName = "test/index.html"             ctx.HTML(200, "test/index.html", data)\r\n\r\n\r\n获取前端提交的图片-\r\nc.Ctx.Request.FormFile("imageKey")               ctx.Request.FormFile("imageKey")\r\n\r\n\r\n\r\n', '', 'webserver'),
(7864, 529, 'http://www.huayunengxiang.com/', 'http://www.huayunengxiang.com/', '', 'webserver'),
(7866, 344, 'interface 转 string', 'fmt.Sprintf("%v", interface)', '', 'webserver'),
(7869, 344, 'RESTful 风格', 'GET    //获取\r\nPOST  //创建\r\nPUT    //更改\r\nDELETE //删除', '', 'webserver'),
(7871, 344, '文件读写类 ', 'package models\r\n\r\nimport (\r\n	"fmt"\r\n	"io"\r\n	"os"\r\n)\r\n\r\n// 文件读写\r\ntype FileWR struct {\r\n}\r\n\r\n// 只读\r\nfunc (this *FileWR) Open(path string) string {\r\n	file, err := os.Open(path)\r\n	defer file.Close()\r\n	if err != nil {\r\n		fmt.Println(err)\r\n		return ""\r\n	}\r\n	result := []byte{}\r\n	for {\r\n		mm := make([]byte, 1024)\r\n		_, errR := file.Read(mm)\r\n		if errR != nil && errR == io.EOF {\r\n			fmt.Println("读取完毕")\r\n			break\r\n		}\r\n		result = append(result, mm...)\r\n	}\r\n	return string(result)\r\n}\r\n\r\n// 清空重新写入\r\nfunc (this *FileWR) Put(path string, str string) bool {\r\n	file, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0666)\r\n	defer file.Close()\r\n	if err != nil {\r\n		fmt.Println(err)\r\n		return false\r\n	}\r\n	file.WriteString(str)\r\n	return true\r\n}\r\n', '', 'webserver'),
(7872, 529, 'https://www.ktkkt2.com/', 'https://www.ktkkt2.com/', '', 'webserver'),
(7873, 344, 'Windows PowerShell进行ssh服务器连接', 'root@xxx.xxx.xxx.x\r\nyes\r\npassword', '', 'webserver'),
(7874, 1, '电磁炉面板无显示5V供电不正常未烧保险', '更换电源IC\r\n更换电源小变压器', '', 'webserver'),
(7882, 344, '停车收费系统', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"strconv"\r\n	"time"\r\n	"tyieih/models"\r\n\r\n	"github.com/gin-gonic/gin"\r\n)\r\n\r\nvar Db = models.Gdo{}\r\n\r\nfunc init() {\r\n	Db = *models.NewGdo()\r\n}\r\n\r\ntype VehicleSql struct {\r\n	id      int\r\n	name    string\r\n	indate  string\r\n	outdate string\r\n	day     int\r\n	monthly string\r\n}\r\n\r\n/*\r\n车牌号     ->ocr 自动拍照识别 并存到数据库   	string\r\n进场时间   ->记录时间 并存到数据库 		date\r\n出场时间    ->\r\n\r\n	10分钟内免费   ->出场时对比时间戳 少于600秒免费\r\n	3小时内 5元     ->  大于600秒 小于10800秒\r\n	3-10小时 10元   -> 大于10800秒 小于 36000秒\r\n	10-23小时15元  -> 大于36000秒 小于82800秒\r\n	0-7点过夜5元   ->如果0点前进场并且小于3小时 5元 +5元 =10元\r\n	月票400月          直接记录充值时间 +30天的到期时间date    -> 字段 monthly  string\r\n	包月到期时 如果车子还在停车场则按非包月进行计费\r\n\r\n白天和夜晚累计计费以电脑计时为准，24小时全天封顶收费20元\r\n\r\nCREATE TABLE `vehicle` (\r\n\r\n	`id` int(11) NOT NULL AUTO_INCREMENT,\r\n	`name` varchar(30) NOT NULL DEFAULT '''',\r\n	`indate` datetime NOT NULL DEFAULT ''1000-01-01 00:00:00'',\r\n	`outdate` datetime NOT NULL DEFAULT ''1000-01-01 00:00:00'',\r\n	 `monthly` datetime DEFAULT ''1000-01-01 00:00:00'',\r\n	PRIMARY KEY (`id`)\r\n\r\n) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\r\n*/\r\nfunc main() {\r\n	r := gin.Default()\r\n	//车辆进场\r\n	r.POST("in", func(ctx *gin.Context) {\r\n		//1.ocr提取车辆车牌号\r\n		numberStr := ""\r\n		//进场 记录车牌号 进场时间\r\n		inDate := time.Now().Format("2006-01-02 15:04-05")\r\n		i64 := Db.Sql("INSERT INTO vehicle (name,indate) VALUES (?,?)", numberStr, inDate).Insert()\r\n		if i64 > 0 {\r\n			ctx.String(200, "true")\r\n		} else {\r\n			ctx.String(200, "false")\r\n		}\r\n\r\n	})\r\n	//车辆出场\r\n	r.POST("out", func(ctx *gin.Context) {\r\n		//1.ocr提取车辆车牌号\r\n		u := VehicleSql{}\r\n		bl := Db.Sql("SELECT * FROM vehicle WHERE name=?").Row(&u.id, &u.name, &u.indate, &u.outdate, &u.day, &u.monthly)\r\n		if !bl {\r\n			ctx.String(200, "车辆查询失败,请重新识别")\r\n			return\r\n		}\r\n		loc, _ := time.LoadLocation("Asia/Shanghai")\r\n		tt, _ := time.ParseInLocation("2006-01-02 15:04:05", u.indate, loc) //2006-01-02 15:04:05是转换的格式如php的"Y-m-d H:i:s"\r\n		inTime := tt.Unix()\r\n		tt1, _ := time.ParseInLocation("2006-01-02 15:04:05", u.outdate, loc) //2006-01-02 15:04:05是转换的格式如php的"Y-m-d H:i:s"\r\n		outTime := tt1.Unix()\r\n		//停车秒数\r\n		result := outTime - inTime\r\n		if result < 600 {\r\n			ctx.String(200, "车辆10分钟内免费")\r\n			return\r\n		}\r\n		//包月用户\r\n		if u.monthly > time.Now().Format("2006-01-02 15:04:05") {\r\n			ctx.String(200, "车辆为包月客户,免费")\r\n			return\r\n		}\r\n		h := int64(360)\r\n		reH := result / h\r\n		//夜里0-7点进场,出场 ,并且停车时间不大于7个小时,否则以白天和夜晚累计计费以电脑计时为准\r\n		dateH, _ := strconv.Atoi(u.outdate[5:7])\r\n		if dateH < 8 && reH <= 7 {\r\n			ctx.String(200, "夜里0-7点停车,收费5元")\r\n			return\r\n		}\r\n\r\n		day, h, f := Calculate(result)\r\n		//停车一天内\r\n		if day == 0 {\r\n			//3-10小时 10元\r\n			if h < 3 {\r\n				ctx.String(200, "停车"+fmt.Sprintf("%d", reH)+"小时"+fmt.Sprintf("%d", f)+"分,收费5元")\r\n				return\r\n			}\r\n			//3-10小时 10元\r\n			if h < 10 {\r\n				ctx.String(200, "停车"+fmt.Sprintf("%d", reH)+"小时"+fmt.Sprintf("%d", f)+"分,收费10元")\r\n				return\r\n			}\r\n			//10-23小时15元\r\n			if h < 24 {\r\n				ctx.String(200, "停车"+fmt.Sprintf("%d", reH)+"小时"+fmt.Sprintf("%d", f)+"分,收费15元")\r\n				return\r\n			}\r\n			return\r\n		}\r\n		dayMoney := day * 10\r\n		hMoney := int64(0)\r\n		showStr := ""\r\n		//3-10小时 10元\r\n		if h < 3 {\r\n			hMoney = 5\r\n			showStr = fmt.Sprintf("%d", h) + "小时" + fmt.Sprintf("%d", f) + "分,收费"\r\n		}\r\n		//3-10小时 10元\r\n		if h < 10 {\r\n			hMoney = 10\r\n			showStr = fmt.Sprintf("%d", h) + "小时" + fmt.Sprintf("%d", f) + "分,收费"\r\n		}\r\n		//10-23小时15元\r\n		if h < 24 {\r\n			hMoney = 15\r\n			showStr = fmt.Sprintf("%d", h) + "小时" + fmt.Sprintf("%d", f) + "分,收费"\r\n		}\r\n		Money := dayMoney + hMoney\r\n		showStr = "停车 " + fmt.Sprintf("%d", day) + " 天" + showStr + " " + fmt.Sprintf("%d", Money) + " 元"\r\n		ctx.String(200, showStr)\r\n	})\r\n	//管理员登录 管理车辆\r\n	r.GET("vehicle", func(ctx *gin.Context) {\r\n\r\n	})\r\n	r.Run(":80")\r\n}\r\n\r\n// 返回 天数 小时 分钟\r\nfunc Calculate(result int64) (int64, int64, int64) {\r\n	resulD := int64(0)\r\n	resulH := int64(0)\r\n	resulF := int64(0)\r\n	//一小时3600秒\r\n	h := int64(3600)\r\n	//停车总小时数\r\n	countH := result / h\r\n	//停车一天内\r\n	if countH < 24 {\r\n		miao := result - (countH * h)\r\n		if miao > 60 {\r\n			resulF = miao / 60\r\n			return 0, resulH, resulF\r\n		}\r\n		return 0, resulH, resulF\r\n	}\r\n	//停车天数\r\n	resulD = resulH / 24\r\n	//得到小时数\r\n	resulH = resulH - (resulD * 24)\r\n	//得到剩余秒数\r\n	mm := result - (countH * h)\r\n	if mm > 60 {\r\n		//得到剩余分钟\r\n		resulF = mm / 60\r\n		return resulD, resulH, resulF\r\n	} else {\r\n		//小于1分的剩余秒数 忽略\r\n		return resulD, resulH, resulF\r\n	}\r\n\r\n}\r\n', '', 'webserver'),
(7883, 321, 'debian 11 安装MYSQL5.7.39 ', 'https://downloads.mysql.com/archives/community/\r\n选择debian适合的版本\r\ncd 到预定安装目录\r\n解压\r\ntar -xvf mysql-server_5.7.39-1debian10_amd64.deb-bundle.tar\r\n\r\n依赖安装\r\napt install psmisc libaio1 libnuma1 libatomic1 libmecab2\r\n\r\n安装MySQL程序（需要按照顺序依次安装）\r\n\r\n    dpkg -i mysql-common_5.7.39-1debian10_amd64.deb\r\n    dpkg -i mysql-community-client_5.7.39-1debian10_amd64.deb\r\n    dpkg -i mysql-client_5.7.39-1debian10_amd64.deb\r\n    dpkg -i mysql-community-server_5.7.39-1debian10_amd64.deb\r\n# 期间会提示输入密码, 并确认密码\r\n    dpkg -i mysql-server_5.7.39-1debian10_amd64.deb\r\n\r\n# 配置客户端默认字符集，新增参数default-character-set=utf8\r\n    vim /etc/mysql/conf.d/mysql.cnf\r\n     \r\n    default-character-set=utf8\r\n     \r\n', '', 'webserver'),
(7884, 321, 'windows source命令导入报错', 'mysql -uroot --default-character-set=utf8 -p', '', 'webserver'),
(7885, 344, '发送POST GET PostJson请求', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"io/ioutil"\r\n	"net/http"\r\n	"strings"\r\n)\r\n\r\ntype XyzRequest struct {\r\n}\r\n\r\n// Get请求 url里携带参数\r\nfunc (class *XyzRequest) GetSend(url string) (string, error) {\r\n	var err error\r\n	resp, err1 := http.Get(url)\r\n	if err1 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	body, err2 := ioutil.ReadAll(resp.Body)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n\r\n}\r\n\r\n// post地址 请求参数，string格式\r\nfunc (class *XyzRequest) PostSend(url string, KVstring string) (string, error) {\r\n	var err error\r\n	resp, err1 := http.Post(url, "application/x-www-form-urlencoded", strings.NewReader(KVstring))\r\n	if err1 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	body, err2 := ioutil.ReadAll(resp.Body)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n}\r\n\r\n// post地址 请求参数，json格式 返回json\r\nfunc (class *XyzRequest) PostJson(url string, strJson string) (string, error) {\r\n	var err error\r\n	req, _ := http.NewRequest("POST", url, bytes.NewBuffer([]byte(strJson)))\r\n	req.Header.Set("Content-Type", "application/json; charset=UTF-8")\r\n	client := &http.Client{}\r\n	resp, err2 := client.Do(req)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	// fmt.Println("status", resp.Status)\r\n	// fmt.Println("headers", resp.Header)\r\n	body, err3 := ioutil.ReadAll(resp.Body)\r\n	if err3 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n}\r\n', '', 'webserver'),
(7886, 160, '树莓派 debian 安装', '1.刷好系统之后，新建一个文件 userconf.txt 来设置初始话账号密码\r\npi:$6$/4.VdYgDm7RJ0qM1$FwXCeQgDKkqrOU3RIRuDSKpauAbBvP11msq9X58c8Que2l1Dwq3vdJMgiZlQSbEXGaY5esVHGBNbCxKLVNqZW1\r\n用户名：pi\r\n密码：raspberry\r\n2.新建一个空白文件，文件名：ssh，不要后缀，不用写入数据\r\n', '', 'webserver'),
(7887, 344, 'golang 讲解1', '// 代表 main 包里\r\npackage main\r\n\r\nimport "fmt"\r\n\r\n//程序入口\r\nfunc main() {\r\n	/*Abc 功能 传入两个参数 2 3\r\n	Abc功能里面进行的是 两个参数相加\r\n	返回值 赋予 result变量\r\n	:=代表result变量类型随Abc返回类型一样\r\n	也可以写成\r\n	var result=Abc(2, 3) 意思一样的\r\n	*/\r\n	result := Abc(2, 3)\r\n	//fmt.Println 代表在控制台打印输出 值\r\n	fmt.Println(result)\r\n}\r\n\r\n/*\r\n定义一个功能 func 英文就是 功能 的意思\r\nAbc 就是功能名\r\n首字母大写 代表 别的地方引用这个包就可以调用该 Abc功能 (像 java public)\r\n首字母小写 代表 不支持外部调用,只能本文件包里调用 (像 java private)\r\n小括号里 参数可以根据需要定义需要个数\r\n小括号后面 int64 代表最后返回 什么类型\r\n*/\r\nfunc Abc(a int64, b int64) int64 {\r\n	return a + b\r\n}\r\n', '', 'webserver'),
(7888, 344, '在Ubuntu Linux实现图片识别', '1、安装tesseract ocr包\r\nsudo apt install tesseract-ocr\r\nsudo apt install libtesseract-dev\r\nsudo apt install tesseract-ocr-chi-sim\r\n\r\n2、安装完成后使用以下命令查看语言安装包\r\ntesseract --list-langs\r\n\r\n\r\n//测试\r\ntesseract 234.png output.txt -l chi_sim\r\n', '', 'webserver'),
(7889, 321, 'linux redis安装配置 ', 'sudo apt update\r\n\r\n# 安装\r\nsudo apt install redis-server\r\n\r\n# 配置\r\nsudo vim /etc/redis/redis.conf\r\n# 找到 supervised 设置为 systemd\r\nsudo service redis restart  # 重新加载Redis服务文件\r\nsudo systemctl status redis # 查看 Redis 的运行状态\r\n\r\n# 一些操作\r\nsudo service redis start  # 启动\r\nsudo service redis stop  # 关闭\r\nsudo service redis restart  # 重启\r\nredis-cli  # 客户端连接\r\n\r\n# 远程连接 \r\nsudo vi /etc/redis/redis.conf\r\n# 将 bind 127.0.0.1 ::1 改为 bind 0.0.0.0\r\nsudo service redis restart  # 重启\r\n\r\n# 设置密码\r\nsudo vi /etc/redis/redis.conf\r\n# 设置：requirepass 自己的密码\r\n\r\n默认端口6379', '', 'webserver'),
(7890, 344, 'go 操作Redis数据库', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n\r\n	"github.com/go-redis/redis"\r\n)\r\n\r\nfunc main() {\r\n	rdb := redis.NewClient(&redis.Options{\r\n		Addr:     "192.168.100.254:6379", //地址  端口\r\n		Password: "qq282246101",          //密码\r\n		DB:       0,                      //连接哪个redis reids有16个数据库\r\n		PoolSize: 10,                     //连接池大小\r\n	})\r\n	//检测连接是否成功 成功返回 pong\r\n	_, err := rdb.Ping().Result()\r\n	if err != nil {\r\n		fmt.Println("Ping出错")\r\n		return\r\n	}\r\n	//插入数据是否成功，成功返回ok 第三个参数表示过期时间 0表示 永不过期\r\n	// _, err1 := rdb.Set("name", "webserver", 0).Result()\r\n	// if err1 != nil {\r\n	// 	fmt.Println("设置数据失败:", err1)\r\n	// 	return\r\n	// }\r\n	res, err2 := rdb.Get("name").Result()\r\n	if err2 != nil {\r\n		fmt.Println("获取数据失败:", err2)\r\n		return\r\n	}\r\n	fmt.Println(res)\r\n	//3 SetNX:key不存在时才设置（新增操作）\r\n	//rdb.SetNX("name", 19, 0) // name存在，不会修改\r\n\r\n	//4 SetXX:key存在时才设置（修改操作）\r\n	//rdb.SetXX("name", "pyy", 0)\r\n\r\n	// 5 Incr\r\n	rdb.Incr("age")\r\n\r\n	// 6 strlen\r\n	l, _ := rdb.StrLen("name").Result()\r\n	fmt.Println(l)\r\n\r\n}\r\n', '', 'webserver'),
(7893, 554, 'c++类', '#include <iostream>\r\nusing namespace std;\r\n\r\nclass Xyz\r\n{\r\n    int sz;\r\n    // 构造方法\r\npublic:\r\n    Xyz(int size)\r\n    {\r\n        sz = size;\r\n    }\r\n\r\npublic:\r\n    int Show()\r\n    {\r\n        return sz;\r\n    }\r\n\r\npublic:\r\n    string abc()\r\n    {\r\n        return "Hello Worde";\r\n    }\r\n    // 析构方法\r\npublic:\r\n    ~Xyz()\r\n    {\r\n    }\r\n};\r\n//main函数 是必须 放最后面 不然调用不了上面的类\r\nint main()\r\n{\r\n    Xyz abc(456);\r\n    cout << abc.abc();\r\n    return 0;\r\n}\r\n', '', 'webserver'),
(7894, 554, 'c++引用 指针', '#include <iostream>\r\nusing namespace std;\r\nint main()\r\n{\r\n    string a = "123";\r\n    // b变量是引用变量 a变量是本体\r\n    // 随着本体变量a的变化而变化\r\n    string &b = a;\r\n    a = "321";\r\n\r\n    // c是指针变量 存储的是a变量的内存地址\r\n    string *c = &a;\r\n    cout << b << endl;\r\n    cout << c << endl;\r\n    return 0;\r\n}\r\n输出结果 \r\n321\r\n0x12ebfffb90', '', 'webserver'),
(7895, 554, 'c++ 获取当前时间', '#include <ctime>\r\nusing namespace std;\r\nclass NowTime\r\n{\r\npublic:\r\n	int Time()\r\n	{\r\n		return time(0);\r\n	}\r\n\r\npublic:\r\n	string DateTime()\r\n	{\r\n		time_t now = time(0);\r\n		tm *p = localtime(&now);\r\n		int a = printf("%d-%d-%d %02d:%02d:%02d\\n", 1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);\r\n		return to_string(a);\r\n	}\r\n};', '', 'webserver'),
(7896, 529, 'springboot框架在线生成', 'https://start.spring.io/', '', 'webserver'),
(7898, 344, 'golang 讲解2 循环', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n)\r\n\r\nfunc main() {\r\n	ii := 10\r\n	//ii=10 循环10次\r\n	for i := 0; i < ii; i++ {\r\n		if i == 5 {\r\n			//跳过 i值为5 本次循环 后面 6 7 8 9继续\r\n			continue\r\n		}\r\n		fmt.Println(i)\r\n		//输出 0 1 2 3 4 6 7 8 9\r\n	}\r\n	//ii=10 循环10次\r\n	for i := 0; i < ii; i++ {\r\n		if i == 5 {\r\n			//跳出 for循环体 后面不继续\r\n			break\r\n		}\r\n		fmt.Println(i)\r\n		//输出 0 1 2 3 4\r\n	}\r\n	//永远循环 只要不break\r\n	for {\r\n		//永远循环\r\n	}\r\n}\r\n', '', 'webserver'),
(7899, 344, '新旧日历润星期日月天', 'package models\r\n\r\nimport (\r\n	"errors"\r\n	"fmt"\r\n	"strconv"\r\n	"strings"\r\n	"time"\r\n)\r\n\r\ntype Lunar struct {\r\n	MIN_YEAR             int\r\n	MAX_YEAR             int\r\n	DATELAYOUT           string\r\n	STARTDATESTR         string\r\n	CHINESENUMBER        []string\r\n	CHINESENUMBERSPECIAL []string\r\n	MONTHNUMBER          map[string]int\r\n	LUNAR_INFO           []int\r\n}\r\n\r\nfunc (class *Lunar) Init() {\r\n	class.MIN_YEAR = 1900\r\n	class.MAX_YEAR = 2049\r\n\r\n	class.DATELAYOUT = "2006-01-02"\r\n	class.STARTDATESTR = "1900-01-30"\r\n\r\n	class.CHINESENUMBER = []string{"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"}\r\n	class.CHINESENUMBERSPECIAL = []string{"正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "腊"}\r\n	class.MONTHNUMBER = map[string]int{"January": 1, "February": 2, "March": 3, "April": 4, "May": 5, "June": 6, "July": 7, "August": 8, "September": 9, "October": 10, "November": 11, "December": 12}\r\n	class.LUNAR_INFO = []int{\r\n		0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2,\r\n		0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,\r\n		0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,\r\n		0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950,\r\n		0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557,\r\n		0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0,\r\n		0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0,\r\n		0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0, 0x195a6,\r\n		0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570,\r\n		0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0,\r\n		0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5,\r\n		0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930,\r\n		0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530,\r\n		0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45,\r\n		0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0}\r\n}\r\n\r\n// 旧历转新历leapMonthFlag =false\r\nfunc (class *Lunar) LunarToSolar(date string, leapMonthFlag bool) string {\r\n	date, offset := class.dealWithSpecialFebruaryDate(date)\r\n	loc, _ := time.LoadLocation("Local")\r\n	lunarTime, err := time.ParseInLocation(class.DATELAYOUT, date, loc)\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n	}\r\n	lunarYear := lunarTime.Year()\r\n	lunarMonth := class.MONTHNUMBER[lunarTime.Month().String()]\r\n	lunarDay := lunarTime.Day()\r\n	err = class.checkLunarDate(lunarYear, lunarMonth, lunarDay, leapMonthFlag)\r\n\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n		return ""\r\n	}\r\n\r\n	for i := class.MIN_YEAR; i < lunarYear; i++ {\r\n		yearDaysCount := class.getYearDays(i) // 求阴历某年天数\r\n		offset += yearDaysCount\r\n	}\r\n	//计算该年闰几月\r\n	leapMonth := class.getLeapMonth(lunarYear)\r\n	if leapMonthFlag && leapMonth != lunarMonth {\r\n		panic("您输入的闰月标志有误！")\r\n	}\r\n	if leapMonth == 0 || (lunarMonth < leapMonth) || (lunarMonth == leapMonth && !leapMonthFlag) {\r\n		for i := 1; i < lunarMonth; i++ {\r\n			tempMonthDaysCount := class.getMonthDays(lunarYear, uint(i))\r\n			offset += tempMonthDaysCount\r\n		}\r\n\r\n		// 检查日期是否大于最大天\r\n		if lunarDay > class.getMonthDays(lunarYear, uint(lunarMonth)) {\r\n			panic("不合法的农历日期！")\r\n		}\r\n		offset += lunarDay // 加上当月的天数\r\n	} else { //当年有闰月，且月份晚于或等于闰月\r\n		for i := 1; i < lunarMonth; i++ {\r\n			tempMonthDaysCount := class.getMonthDays(lunarYear, uint(i))\r\n			offset += tempMonthDaysCount\r\n		}\r\n		if lunarMonth > leapMonth {\r\n			temp := class.getLeapMonthDays(lunarYear) // 计算闰月天数\r\n			offset += temp                            // 加上闰月天数\r\n\r\n			if lunarDay > class.getMonthDays(lunarYear, uint(lunarMonth)) {\r\n				panic("不合法的农历日期！")\r\n			}\r\n			offset += lunarDay\r\n		} else { // 如果需要计算的是闰月，则应首先加上与闰月对应的普通月的天数\r\n			// 计算月为闰月\r\n			temp := class.getMonthDays(lunarYear, uint(lunarMonth)) // 计算非闰月天数\r\n			offset += temp\r\n\r\n			if lunarDay > class.getLeapMonthDays(lunarYear) {\r\n				panic("不合法的农历日期！")\r\n			}\r\n			offset += lunarDay\r\n		}\r\n	}\r\n\r\n	myDate, err := time.ParseInLocation(class.DATELAYOUT, class.STARTDATESTR, loc)\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n	}\r\n\r\n	myDate = myDate.AddDate(0, 0, offset)\r\n	return myDate.Format(class.DATELAYOUT)\r\n}\r\n\r\nfunc (class *Lunar) dealWithSpecialFebruaryDate(date string) (string, int) {\r\n	items := strings.Split(date, "-")\r\n	year, _ := strconv.Atoi(items[0])\r\n	if items[1] == "02" {\r\n		if (year/4 == 0 && year/100 != 0) || (year/400 == 0) {\r\n			if items[2] == "30" {\r\n				return items[0] + "-" + items[1] + "-29", 1\r\n			}\r\n		} else {\r\n			if items[2] == "30" {\r\n				return items[0] + "-" + items[1] + "-28", 2\r\n			}\r\n			if items[2] == "29" {\r\n				return items[0] + "-" + items[1] + "-28", 1\r\n			}\r\n		}\r\n	}\r\n	return date, 0\r\n}\r\n\r\nfunc (class *Lunar) SolarToChineseLuanr(date string) string {\r\n	lunarYear, lunarMonth, lunarDay, leapMonth, leapMonthFlag := class.calculateLunar(date)\r\n	result := class.cyclical(lunarYear) + "年"\r\n	if leapMonthFlag && (lunarMonth == leapMonth) {\r\n		result += "闰"\r\n	}\r\n	result += class.CHINESENUMBERSPECIAL[lunarMonth-1] + "月"\r\n	result += class.chineseDayString(lunarDay) + "日"\r\n	return result\r\n}\r\n\r\nfunc (class *Lunar) SolarToSimpleLuanr(date string) string {\r\n	lunarYear, lunarMonth, lunarDay, leapMonth, leapMonthFlag := class.calculateLunar(date)\r\n	result := strconv.Itoa(lunarYear) + "-"\r\n	if leapMonthFlag && (lunarMonth == leapMonth) {\r\n		result += "闰"\r\n	}\r\n	if lunarMonth < 10 {\r\n		result += "0" + strconv.Itoa(lunarMonth) + "-"\r\n	} else {\r\n		result += strconv.Itoa(lunarMonth) + "-"\r\n	}\r\n	if lunarDay < 10 {\r\n		result += "0" + strconv.Itoa(lunarDay) + ""\r\n	} else {\r\n		result += strconv.Itoa(lunarDay) + ""\r\n	}\r\n	return result\r\n}\r\n\r\nfunc (class *Lunar) SolarToLuanr(date string) (string, bool) {\r\n	lunarYear, lunarMonth, lunarDay, leapMonth, leapMonthFlag := class.calculateLunar(date)\r\n	result := strconv.Itoa(lunarYear) + "-"\r\n	if lunarMonth < 10 {\r\n		result += "0" + strconv.Itoa(lunarMonth) + "-"\r\n	} else {\r\n		result += strconv.Itoa(lunarMonth) + "-"\r\n	}\r\n	if lunarDay < 10 {\r\n		result += "0" + strconv.Itoa(lunarDay)\r\n	} else {\r\n		result += strconv.Itoa(lunarDay)\r\n	}\r\n\r\n	if leapMonthFlag && (lunarMonth == leapMonth) {\r\n		return result, true\r\n	} else {\r\n		return result, false\r\n	}\r\n}\r\n\r\nfunc (class *Lunar) calculateLunar(date string) (lunarYear, lunarMonth, lunarDay, leapMonth int, leapMonthFlag bool) {\r\n	loc, _ := time.LoadLocation("Local")\r\n	i := 0\r\n	temp := 0\r\n	leapMonthFlag = false\r\n	isLeapYear := false\r\n\r\n	myDate, err := time.ParseInLocation(class.DATELAYOUT, date, loc)\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n	}\r\n	startDate, err := time.ParseInLocation(class.DATELAYOUT, class.STARTDATESTR, loc)\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n	}\r\n\r\n	offset := class.daysBwteen(myDate, startDate)\r\n	for i = class.MIN_YEAR; i < class.MAX_YEAR; i++ {\r\n		temp = class.getYearDays(i) //求当年农历年天数\r\n		if offset-temp < 1 {\r\n			break\r\n		} else {\r\n			offset -= temp\r\n		}\r\n	}\r\n	lunarYear = i\r\n\r\n	leapMonth = class.getLeapMonth(lunarYear) //计算该年闰哪个月\r\n\r\n	//设定当年是否有闰月\r\n	if leapMonth > 0 {\r\n		isLeapYear = true\r\n	} else {\r\n		isLeapYear = false\r\n	}\r\n\r\n	for i = 1; i <= 12; i++ {\r\n		if i == leapMonth+1 && isLeapYear {\r\n			temp = class.getLeapMonthDays(lunarYear)\r\n			isLeapYear = false\r\n			leapMonthFlag = true\r\n			i--\r\n		} else {\r\n			temp = class.getMonthDays(lunarYear, uint(i))\r\n		}\r\n		offset -= temp\r\n		if offset <= 0 {\r\n			break\r\n		}\r\n	}\r\n	offset += temp\r\n	lunarMonth = i\r\n	lunarDay = offset\r\n	return\r\n}\r\n\r\nfunc (class *Lunar) checkLunarDate(lunarYear, lunarMonth, lunarDay int, leapMonthFlag bool) error {\r\n	if (lunarYear < class.MIN_YEAR) || (lunarYear > class.MAX_YEAR) {\r\n		return errors.New("非法农历年份！")\r\n	}\r\n	if (lunarMonth < 1) || (lunarMonth > 12) {\r\n		return errors.New("非法农历月份！")\r\n	}\r\n	if (lunarDay < 1) || (lunarDay > 30) { // 中国的月最多30天\r\n		return errors.New("非法农历天数！")\r\n	}\r\n\r\n	leap := class.getLeapMonth(lunarYear) // 计算该年应该闰哪个月\r\n	if (leapMonthFlag) && (lunarMonth != leap) {\r\n		return errors.New("非法闰月！")\r\n	}\r\n	return nil\r\n}\r\n\r\n// 计算该月总天数\r\nfunc (class *Lunar) getMonthDays(lunarYeay int, month uint) int {\r\n	if (month > 31) || (month < 0) {\r\n		fmt.Println("error month")\r\n	}\r\n	// 0X0FFFF[0000 {1111 1111 1111} 1111]中间12位代表12个月，1为大月，0为小月\r\n	bit := 1 << (16 - month)\r\n	if ((class.LUNAR_INFO[lunarYeay-1900] & 0x0FFFF) & bit) == 0 {\r\n		return 29\r\n	} else {\r\n		return 30\r\n	}\r\n}\r\n\r\n// 计算阴历年的总天数\r\nfunc (class *Lunar) getYearDays(year int) int {\r\n	sum := 29 * 12\r\n	for i := 0x8000; i >= 0x8; i >>= 1 {\r\n		if (class.LUNAR_INFO[year-1900] & 0xfff0 & i) != 0 {\r\n			sum++\r\n		}\r\n	}\r\n	return sum + class.getLeapMonthDays(year)\r\n}\r\n\r\n// 计算阴历年闰月多少天\r\nfunc (class *Lunar) getLeapMonthDays(year int) int {\r\n	if class.getLeapMonth(year) != 0 {\r\n		if (class.LUNAR_INFO[year-1900] & 0xf0000) == 0 {\r\n			return 29\r\n		} else {\r\n			return 30\r\n		}\r\n	} else {\r\n		return 0\r\n	}\r\n}\r\n\r\n// 计算阴历年闰哪个月 1-12 , 没闰传回 0\r\nfunc (class *Lunar) getLeapMonth(year int) int {\r\n	return (int)(class.LUNAR_INFO[year-1900] & 0xf)\r\n}\r\n\r\n// 计算差的天数\r\nfunc (class *Lunar) daysBwteen(myDate time.Time, startDate time.Time) int {\r\n	subValue := float64(myDate.Unix()-startDate.Unix())/86400.0 + 0.5\r\n	return int(subValue)\r\n}\r\n\r\nfunc (class *Lunar) cyclicalm(num int) string {\r\n	tianGan := []string{"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"}\r\n	diZhi := []string{"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"}\r\n	animals := []string{"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}\r\n	return tianGan[num%10] + diZhi[num%12] + animals[num%12]\r\n}\r\n\r\nfunc (class *Lunar) cyclical(year int) string {\r\n	num := year - 1900 + 36\r\n	return class.cyclicalm(num)\r\n}\r\n\r\nfunc (class *Lunar) chineseDayString(day int) string {\r\n	chineseTen := []string{"初", "十", "廿", "三"}\r\n	n := 0\r\n	if day%10 == 0 {\r\n		n = 9\r\n	} else {\r\n		n = day%10 - 1\r\n	}\r\n	if day > 30 {\r\n		return ""\r\n	}\r\n	if day == 20 {\r\n		return "二十"\r\n	} else if day == 10 {\r\n		return "初十"\r\n	} else {\r\n		return chineseTen[day/10] + class.CHINESENUMBER[n]\r\n	}\r\n}\r\n\r\n// 获取当月最后一天的天数\r\nfunc (class *Lunar) LastDayOfMonth() int {\r\n	t := time.Time{}\r\n	firstDay := time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, time.UTC)\r\n	lastDay := firstDay.AddDate(0, 1, 0).Add(-time.Nanosecond)\r\n	return lastDay.Day()\r\n}\r\n\r\n// 获取指定日期对应的时间 xxxx-xx-xx 格式不对返回0\r\nfunc (class *Lunar) GetWeek(dateYMD string) int {\r\n	if len(dateYMD) != 10 {\r\n		return 0\r\n	}\r\n	t, _ := time.Parse("2006-01-02", dateYMD)\r\n	s := t.Weekday().String()\r\n	weekI := 0\r\n	switch s {\r\n	case "Monday":\r\n		weekI = 1\r\n	case "Tuesday":\r\n		weekI = 2\r\n	case "Wednesday":\r\n		weekI = 3\r\n	case "Thursday":\r\n		weekI = 4\r\n	case "Friday":\r\n		weekI = 5\r\n	case "Saturday":\r\n		weekI = 6\r\n	case "Sunday":\r\n		weekI = 7\r\n	}\r\n	return weekI\r\n}\r\n', '', 'webserver'),
(7900, 344, '大文件上转', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"io"\r\n	"os"\r\n\r\n	"github.com/gin-gonic/gin"\r\n)\r\n\r\ntype UpBigFile struct {\r\n	SaveDir   string //保存路径\r\n	temporary string //临时文件\r\n}\r\n\r\nfunc (class *UpBigFile) SetSaveDir(dir string) *UpBigFile {\r\n	if dir == "" {\r\n		return nil\r\n	}\r\n	dirLen := len(dir)\r\n	if dir[dirLen-1:] != "/" {\r\n		class.SaveDir = dir + "/"\r\n	} else {\r\n		class.SaveDir = dir\r\n	}\r\n	return class\r\n}\r\n\r\nfunc (class *UpBigFile) Up(ctx *gin.Context) {\r\n	if class.SaveDir == "" {\r\n		return\r\n	}\r\n	if ctx.Request.PostFormValue("FileName") != "" {\r\n		name := ctx.Request.PostFormValue("FileName")\r\n		err := os.Rename(class.SaveDir+"blob", class.SaveDir+name)\r\n		if err != nil {\r\n			ctx.String(200, "false")\r\n		} else {\r\n			ctx.String(200, "true")\r\n		}\r\n	} else {\r\n		if _, err := os.Stat(class.temporary); err != nil { //欲上传目录下没有这个文件\r\n			file, h, err := ctx.Request.FormFile("part")\r\n			if err != nil {\r\n				//获取上传文件失败\r\n				return\r\n			}\r\n			buf := bytes.NewBuffer(nil)\r\n			defer file.Close()\r\n			io.Copy(buf, file)\r\n			f, _ := os.OpenFile(class.SaveDir+h.Filename, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0777)\r\n			defer f.Close()\r\n			f.Write(buf.Bytes())\r\n		} else {\r\n			file, h, _ := ctx.Request.FormFile("part")\r\n			buf := bytes.NewBuffer(nil)\r\n			defer file.Close()\r\n			io.Copy(buf, file)\r\n			f, _ := os.OpenFile(class.SaveDir+h.Filename, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0777)\r\n			defer f.Close()\r\n			f.Write(buf.Bytes())\r\n		}\r\n	}\r\n}', '', 'webserver'),
(7901, 525, '360通话录音', '手机识别码 0bda0bi0\r\n激活码212  有规律  b代表2 隔一个算一个。a代表1', '', 'webserver'),
(7902, 344, '获取网络时间API', 'package models\r\n\r\nimport (\r\n	"encoding/json"\r\n	"io/ioutil"\r\n	"net/http"\r\n	"os/exec"\r\n	"strconv"\r\n	"time"\r\n)\r\n\r\ntype NetworkTime struct {\r\n	Ntime string\r\n	Ndate string\r\n}\r\n\r\n// 结构体两个参数是Ntime 第二个参数是Ndate\r\nfunc (class *NetworkTime) Init() *NetworkTime {\r\n	url := "http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp"\r\n	myhttp := &http.Client{}\r\n	myhttp.Timeout = time.Duration(3 * time.Second)\r\n	resp, err1 := myhttp.Get(url)\r\n	if err1 != nil {\r\n		return nil\r\n	}\r\n	defer resp.Body.Close()\r\n	body, err2 := ioutil.ReadAll(resp.Body)\r\n	if err2 != nil {\r\n		return nil\r\n	}\r\n	m := make(map[string]interface{})\r\n	json.Unmarshal(body, &m)\r\n	mm := m["data"].(map[string]interface{})\r\n	str := mm["t"].(string)\r\n	result := str[0:10]\r\n	class.Ntime = result\r\n	reI, _ := strconv.ParseInt(result, 10, 64)\r\n	tm := time.Unix(reI, 0)\r\n	class.Ndate = tm.Format("2006-01-02 15:04:05")\r\n	return class\r\n}\r\n\r\n// linux 校准时间\r\nfunc (class *NetworkTime) Calibration() bool {\r\n	if class == nil {\r\n		return false\r\n	}\r\n	err := exec.Command("date", "-s", class.Ndate).Run()\r\n	if err != nil {\r\n		return false\r\n	} else {\r\n		return true\r\n	}\r\n}\r\n', '', 'webserver'),
(7903, 344, 'ip解析地址api', '"https://ip.useragentinfo.com/json?ip=" + ip', '', 'webserver'),
(7904, 20, 'ESP8266 HTTPS GET', '#include <ArduinoJson.h>\r\n#include <ESP8266WiFi.h>\r\n\r\nconst char* ssid = "CMCC-j3vt";\r\nconst char* password = "qq282246101";\r\n\r\n\r\nvoid setup() {\r\n  Serial.begin(115200);\r\n  delay(10);\r\n\r\n  Serial.println();\r\n  Serial.print("Connecting to ");\r\n  Serial.println(ssid);\r\n\r\n  WiFi.begin(ssid, password);\r\n\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(".");\r\n  }\r\n\r\n  Serial.println("");\r\n  Serial.println("WiFi connected");\r\n  Serial.println("IP address: ");\r\n  Serial.println(WiFi.localIP());\r\n}\r\nString MyHttpsGet(String host, String url) {\r\n  // Use WiFiClient class to create TCP connections\r\n  WiFiClientSecure client;\r\n  const int httpPort = 443;\r\n  client.setInsecure(); \r\n  if (!client.connect(host, httpPort)) { \r\n    Serial.println("connection failed");\r\n    return "";\r\n  }\r\n\r\n  // This will send the request to the server\r\n  client.print(String("GET ") + url + " HTTP/1.1\\r\\n" +\r\n               "Host: " + host + "\\r\\n" +\r\n               "Connection: close\\r\\n\\r\\n");\r\n  String ss;\r\n  while (client.connected())\r\n  {\r\n    String line = client.readStringUntil(''\\n'');\r\n    if (line.length() != 0) {\r\n      ss = ss + line;\r\n    }\r\n  }\r\n  return ss.substring(ss.lastIndexOf("Connection: close") + 17);\r\n  client.stop();\r\n}\r\nvoid loop() {\r\n  String host = "www.360xyz.cn";\r\n  String url = "/query/GetDate";\r\n\r\n  String a = MyHttpsGet(host, url);\r\n  Serial.println(a);\r\n  delay(10000);\r\n}', '', 'webserver'),
(7905, 4, '滚筒洗衣机通电就报警', '看看显示面板 门锁有没有关闭\r\n门锁关闭了 更换 水位传感器 ', '', 'webserver'),
(7906, 529, '另一个微信号', '\r\n密码 qq@277791907', '', 'webserver'),
(7907, 344, '电脑定时故障', 'package main\r\n\r\nimport (\r\n	"encoding/base64"\r\n	"io"\r\n	"net"\r\n	"net/http"\r\n	"os/exec"\r\n	"strings"\r\n	"time"\r\n)\r\n\r\nfunc main() {\r\n	//POST参数 mac="0x"+base64加密(mac地址)+&product=产品名称+&user=?\r\n	mac := GetMac()\r\n	url := "https://www.360xyz.cn/api/app-login"\r\n	kvString := "mac=0x" + base64.StdEncoding.EncodeToString([]byte(mac)) + "&product=电脑定时故障&user=webserver"\r\n	//fmt.Println(kvString)\r\n	//设置定时器为100秒\r\n	timer := time.NewTimer(60 * time.Second)\r\n	//fmt.Println("定时开始")\r\n	for {\r\n		<-timer.C\r\n		//100秒后执行这条\r\n		re, err1 := Post(url, kvString)\r\n		if err1 == nil {\r\n			//fmt.Println(re)\r\n			if re != "登陆成功" {\r\n				arg := []string{"-s", "-t", "0"}\r\n				cmd := exec.Command("shutdown", arg...)\r\n				cmd.CombinedOutput()\r\n			}\r\n		} else {\r\n			timer.Reset(60 * time.Second)\r\n		}\r\n	}\r\n\r\n}\r\nfunc GetMac() string {\r\n	netInterfaces, err := net.Interfaces()\r\n	if err != nil {\r\n		return ""\r\n	}\r\n	for _, i2 := range netInterfaces {\r\n		//fmt.Println(i2.Name)\r\n		mac := i2.HardwareAddr\r\n		//fmt.Println(mac)\r\n		return mac.String()\r\n	}\r\n	return ""\r\n}\r\nfunc Post(url string, KVstring string) (string, error) {\r\n	var err error\r\n	myhttp := &http.Client{}\r\n	myhttp.Timeout = time.Duration(3 * time.Second)\r\n	resp, err1 := myhttp.Post(url, "application/x-www-form-urlencoded; charset=UTF-8", strings.NewReader(KVstring))\r\n	if err1 != nil {\r\n		return "", err\r\n	}\r\n	defer resp.Body.Close()\r\n	body, err2 := io.ReadAll(resp.Body)\r\n	if err2 != nil {\r\n		return "", err\r\n	}\r\n	return string(body), nil\r\n}\r\n', '', 'webserver'),
(7908, 20, 'arduino 头文件库的创建', '在libraries文件夹里创建 头文件名相同的文件夹\r\n创建  头文件名.h     头文件名.cpp  两个头文件名必须相同\r\n--------------------------------------------------------------------------\r\n头文件名.h   \r\n第一行  #ifndef _头文件名_h\r\n第二行  #define _头文件名     //用于指向下面这个类\r\n第三行  #include "Arduino.h"   //不可少\r\n\r\nclass 头文件名{\r\n  public:\r\n  void HtmlShow();\r\n};\r\n#endif\r\n--------------------------------------------------------------------------\r\n头文件名.cpp 这个文件主要任务是去实现 头文件名.h   类方法\r\n第一行  #include "Arduino.h"   //不可少\r\n第二行  #include"头文件名.h"\r\n\r\n返回类型(void,String,int) 头文件名::类方法(){\r\n}', '', 'webserver'),
(7909, 20, 'ESP32WebSocketServer', '/*\r\n * WebSocketServer.ino\r\n *\r\n *  Created on: 22.05.2015\r\n *\r\n */\r\n\r\n#include <Arduino.h>\r\n\r\n#include <WiFi.h>\r\n#include <WiFiMulti.h>\r\n#include <WiFiClientSecure.h>\r\n\r\n#include <WebSocketsServer.h>\r\n\r\nWiFiMulti WiFiMulti;\r\nWebSocketsServer webSocket = WebSocketsServer(81);\r\n\r\n#define USE_SERIAL Serial\r\n\r\nvoid hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {\r\n	const uint8_t* src = (const uint8_t*) mem;\r\n	USE_SERIAL.printf("\\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);\r\n	for(uint32_t i = 0; i < len; i++) {\r\n		if(i % cols == 0) {\r\n			USE_SERIAL.printf("\\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);\r\n		}\r\n		USE_SERIAL.printf("%02X ", *src);\r\n		src++;\r\n	}\r\n	USE_SERIAL.printf("\\n");\r\n}\r\n\r\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {\r\n\r\n    switch(type) {\r\n        case WStype_DISCONNECTED:\r\n            USE_SERIAL.printf("[%u] Disconnected!\\n", num);\r\n            break;\r\n        case WStype_CONNECTED:\r\n            {\r\n                IPAddress ip = webSocket.remoteIP(num);\r\n                USE_SERIAL.printf("[%u] Connected from %d.%d.%d.%d url: %s\\n", num, ip[0], ip[1], ip[2], ip[3], payload);\r\n\r\n				// send message to client\r\n				webSocket.sendTXT(num, "Connected");\r\n            }\r\n            break;\r\n        case WStype_TEXT:\r\n            USE_SERIAL.printf("[%u] get Text: %s\\n", num, payload);\r\n\r\n            // send message to client\r\n            webSocket.sendTXT(num, payload);\r\n\r\n            // send data to all connected clients\r\n            // webSocket.broadcastTXT("message here");\r\n            break;\r\n        case WStype_BIN:\r\n            USE_SERIAL.printf("[%u] get binary length: %u\\n", num, length);\r\n            hexdump(payload, length);\r\n\r\n            // send message to client\r\n            // webSocket.sendBIN(num, payload, length);\r\n            break;\r\n		case WStype_ERROR:			\r\n		case WStype_FRAGMENT_TEXT_START:\r\n		case WStype_FRAGMENT_BIN_START:\r\n		case WStype_FRAGMENT:\r\n		case WStype_FRAGMENT_FIN:\r\n			break;\r\n    }\r\n\r\n}\r\n\r\nvoid setup() {\r\n    // USE_SERIAL.begin(921600);\r\n    USE_SERIAL.begin(115200);\r\n\r\n    //Serial.setDebugOutput(true);\r\n    USE_SERIAL.setDebugOutput(true);\r\n\r\n    USE_SERIAL.println();\r\n    USE_SERIAL.println();\r\n    USE_SERIAL.println();\r\n\r\n    for(uint8_t t = 4; t > 0; t--) {\r\n        USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\\n", t);\r\n        USE_SERIAL.flush();\r\n        delay(1000);\r\n    }\r\n\r\n    WiFiMulti.addAP("CMCC-j3vt", "qq282246101");\r\n\r\n    while(WiFiMulti.run() != WL_CONNECTED) {\r\n        delay(100);\r\n    }\r\n\r\n    webSocket.begin();\r\n    webSocket.onEvent(webSocketEvent);\r\n}\r\n\r\nvoid loop() {\r\n    webSocket.loop();\r\n}\r\n', '', 'webserver'),
(7914, 20, 'esp8266 pwm 控制直流电机速度', 'const int ledPin = 3; \r\n\r\nvoid setup() {\r\n  // put your setup code here, to run once:\r\n  pinMode(ledPin, OUTPUT);\r\n  //频率为 1kHz 默认也是1kHz\r\n  analogWriteFreq(1000);\r\n  //设置 最大值  默认情况下为 1023\r\n  analogWriteRange(100);\r\n  Serial.begin(115200);\r\n}\r\nvoid loop() {\r\n  // 增加电机速度\r\n  for(int dutyCycle = 0; dutyCycle < 100; dutyCycle++){   \r\n    // 通过PWM改变速度\r\n    analogWrite(ledPin, dutyCycle);\r\n    delay(5);\r\n  }\r\n  // 降低电机速度\r\n  for(int dutyCycle = 100; dutyCycle > 0; dutyCycle--){\r\n    // 通过PWM改变速度\r\n    analogWrite(ledPin, dutyCycle);\r\n    delay(5);\r\n  }\r\n\r\n}', '', 'webserver'),
(7915, 529, '在线图片转文字', 'http://imagetotxt.com/', '', 'webserver'),
(7916, 20, 'esp32 pwm', '//PWM控制\r\nint pwm1 = 21;\r\n//管道esp32有16个管道,0-7为80hz 高速管道  8-16为低速管道\r\nconst int channel1 = 0;\r\n//分辨率  2的8次方 256\r\nconst int resolution = 8;\r\n//PWM频率\r\nconst int freq = 1000;\r\n//初始值 49%\r\nint PwmNow = 125;\r\n//累加数\r\nint fadeAmount = 5;  \r\nvoid setup(void) {\r\npinMode(pwm1, OUTPUT);\r\n  ledcSetup(channel1, freq, resolution);\r\n  ledcAttachPin(pwm1, channel1);\r\n  ledcWrite(channel1, PwmNow);\r\n  pinMode(infrared1, INPUT_PULLUP);\r\n  digitalWrite(infrared1, LOW);\r\n}\r\nvoid loop(void) {\r\n  if(PwmNow<255){\r\n      PwmNow = PwmNow + fadeAmount;\r\n      ledcWrite(channel1, PwmNow);\r\n      int temp=PwmNow*100/255;\r\n      String tempStr=String(temp)+"%";\r\nSerial.println(tempStr);\r\ndelay(1000);\r\n  }\r\n\r\n\r\n', '', 'webserver'),
(7918, 529, 'www.41114.tv', 'www.41114.tv', '', 'webserver'),
(7919, 20, 'esp8266连接ESP32遥控小车', '#include <ESP8266WiFi.h>\r\n#include <ESP8266HTTPClient.h>\r\nWiFiClient wificlient;\r\n//14 13 12 4 都是高电平\r\nint advance = 14;\r\nint recoil = 12;\r\nint turnLeft = 13;\r\nint turnRight = 0;\r\nint stop=2;\r\nint speedA = 5;\r\nint speedB = 4;\r\nString serverUrl = "http://192.168.168.2/xyzgo";\r\nString State = "■";\r\nbool speedBL=false;\r\nvoid setup() {\r\n  pinMode(stop,INPUT_PULLUP);\r\n  pinMode(advance, INPUT_PULLUP);\r\n  pinMode(recoil, INPUT_PULLUP);\r\n  pinMode(turnLeft, INPUT_PULLUP);\r\n  pinMode(turnRight, INPUT_PULLUP);\r\n  pinMode(speedA, INPUT_PULLUP);\r\n  pinMode(speedB, INPUT_PULLUP);\r\n  delay(500);\r\n  Serial.begin(115200);\r\n  WiFi.begin("esp32WebServer192.168.168.2", "www.360xyz.cn");\r\n  WiFi.mode(WIFI_STA);\r\n  delay(5000);\r\n  int i=0;\r\n  for (i; i < 20; i++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("WIFI连接成功");\r\n    }\r\n  }\r\n  Serial.println("WIFI连接失败");\r\n}\r\n\r\nvoid loop() {\r\n  \r\n  if (digitalRead(advance) == HIGH && digitalRead(recoil) == HIGH && digitalRead(turnLeft) == HIGH && digitalRead(turnRight) == HIGH && digitalRead(speedA) == HIGH && digitalRead(speedB) == HIGH) {\r\n    if (State != "■") {\r\n      MyHttpPost(serverUrl, "xyz=■");\r\n      State="■";\r\n    }\r\n  } else {\r\n    if (digitalRead(stop) ==LOW) {\r\n      MyHttpPost(serverUrl, "xyz=■");\r\n      State = "■";\r\n      Serial.print(" 停 ");\r\n    }\r\n    if (digitalRead(advance) ==LOW) {\r\n      MyHttpPost(serverUrl, "xyz=↑");\r\n      State = "↑";\r\n      Serial.print(" 上 ");\r\n    }\r\n    if (digitalRead(recoil) ==LOW) {\r\n      MyHttpPost(serverUrl, "xyz=↓");\r\n      State = "↓";\r\n      Serial.print(" 下 ");\r\n    }\r\n    if (digitalRead(turnLeft) ==LOW) {\r\n      MyHttpPost(serverUrl, "xyz=←");\r\n      State = "←";\r\n      Serial.print(" 左 ");\r\n    }\r\n    if (digitalRead(turnRight) ==LOW) {\r\n      MyHttpPost(serverUrl, "xyz=→");\r\n      State = "→";\r\n      Serial.print(" 右 ");\r\n    }\r\n    if (digitalRead(speedA) ==LOW) {\r\n      if(speedBL==false){\r\n        speedBL=true;\r\n        MyHttpPost(serverUrl, "xyz=speedA");\r\n        State = "speedA";\r\n        Serial.print(" ++++++ ");\r\n        delay(1000);\r\n        speedBL=false;\r\n      }\r\n    }\r\n    if (digitalRead(speedB) ==LOW) {\r\n      if(speedBL==false){\r\n        speedBL=true;\r\n        MyHttpPost(serverUrl, "xyz=speedB");\r\n        State = "speedB";\r\n        Serial.print(" ---- ");\r\n        delay(1000);\r\n        speedBL=false;\r\n      }\r\n    }\r\n  }\r\n}\r\nvoid MyHttpPost(String url, String postStr) {\r\n  HTTPClient http;\r\n  String response;\r\n  http.begin(wificlient, url);\r\n  http.setTimeout(2000);\r\n  //需要传输的数据\r\n  char dataBuff[postStr.length()];\r\n  strcpy(dataBuff, postStr.c_str());\r\n  //头信息，需要的反注释就可以\r\n  //http.addHeader("Content-Type", "application/json;charset=utf-8");\r\n  http.addHeader("Content-Type", "application/x-www-form-urlencoded");\r\n  int httpCode = http.POST(dataBuff);\r\n  if (httpCode == 200) {\r\n    response = http.getString();\r\n   Serial.println(response);\r\n  }\r\n  http.end();\r\n}', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(7920, 20, 'esp32遥控小车AP(电容感应切换车头,射频遥控)', '/*\r\n面向车尾   \r\np32  左边电机  左正\r\np33  右边电机  右正\r\np25  左边电机  左反\r\np26  右边电机  右反\r\np27  升   正\r\np14  降   反\r\np12  关发动机  触动3秒后断开\r\nP15  开机通电一直手摸线 可以遥控方向相互转换\r\np4   设置 射频遥控 与 WIFI遥控 切换\r\np21  PWM脚\r\np0   Power8266 输出高电平增加射频遥控 8键射频433遥控\r\n手机要用火狐浏览器\r\n\r\n\r\nP36 前进\r\nP39 后退\r\nP34 左拐弯\r\nP35 右拐弯\r\nP17 移动速度+\r\nP16 移动速度-\r\n*/\r\n#include <WiFi.h>\r\n#include <WebServer.h>\r\n#include <HTTPClient.h>\r\n#include <FS.h>\r\n#include "SPIFFS.h"\r\n#include "ESPmDNS.h"\r\n\r\n#include <Arduino.h>\r\n#include <WiFi.h>\r\n#include <WiFiMulti.h>\r\n#include <WiFiClientSecure.h>\r\n#include <ArduinoJson.h>\r\n#include <WebSocketsClient.h>\r\n\r\nString direction = "/boolStr.txt";\r\nString controlMode="/controlMode.txt";\r\nWebServer webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString request = "";\r\n\r\n//方向相互转换\r\nint touch15 = 15;\r\n//射频遥控  感应切换开关\r\nint touch4=4;\r\n\r\nboolean globalBL=false;\r\n\r\n//转换成功指示灯\r\nint light22 = 22;\r\n\r\n//PWM控制\r\nint pwm1 = 21;\r\n//管道esp32有16个管道,0-7为80hz 高速管道  8-16为低速管道\r\nconst int channel1 = 0;\r\n//分辨率  2的8次方 256\r\nconst int resolution = 8;\r\n//PWM频率\r\nconst int freq = 1000;\r\n//初始值 41%\r\nint PwmNow = 105;\r\n//累加数\r\nint fadeAmount = 5;\r\n//接通esp8266电源\r\nint Power8266 = 0;\r\n\r\nWiFiMulti WiFiMulti;\r\nWebSocketsClient webSocket;\r\nDynamicJsonDocument jsonBuffer(100);\r\nJsonObject root;\r\n\r\nvoid hexdump(const void* mem, uint32_t len, uint8_t cols = 16) {\r\n  const uint8_t* src = (const uint8_t*)mem;\r\n  Serial.printf("\\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);\r\n  for (uint32_t i = 0; i < len; i++) {\r\n    if (i % cols == 0) {\r\n      Serial.printf("\\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);\r\n    }\r\n    Serial.printf("%02X ", *src);\r\n    src++;\r\n  }\r\n  Serial.printf("\\n");\r\n}\r\n\r\nString html = String("")+\r\n"<!DOCTYPE html><html lang=\\"en\\">"+\r\n"<head>"+\r\n    "<meta charset=\\"UTF-8\\">"+\r\n    "<meta name=\\"viewport\\" <meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />"+\r\n    "<title>遥控车</title>"+\r\n    "<script>window.onload = function () {"+\r\n            "document.getElementById(\\"xyzUp\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest();"+\r\n                "xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=↑\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"xyzLeft\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\"); xhr.send(\\"xyz=←\\");"+\r\n                "xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"xyzLeft\\").addEventListener(\\"touchend\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\"); xhr.send(\\"xyz=■\\");"+\r\n                "xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"xyzStop\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=■\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"xyzRight\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=→\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"xyzRight\\").addEventListener(\\"touchend\\", function () {"+\r\n                "let xhr = new XMLHttpRequest();"+\r\n                "xhr.open(\\"POST\\", \\"./xyzgo\\", true); xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=■\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"xyzDonw\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=↓\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"rise\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest();"+\r\n                "xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=rise\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"rise\\").addEventListener(\\"touchend\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=■\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"decline\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=decline\\"); xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"decline\\").addEventListener(\\"touchend\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\"); xhr.send(\\"xyz=■\\");"+\r\n                "xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"TurnOff\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=TurnOff\\");"+\r\n                "xhr.onreadystatechange = function () {"+\r\n                   "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"speedA\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=speedA\\");"+\r\n                "xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n            "document.getElementById(\\"speedB\\").addEventListener(\\"touchstart\\", function () {"+\r\n                "let xhr = new XMLHttpRequest(); xhr.open(\\"POST\\", \\"./xyzgo\\", true);"+\r\n                "xhr.setRequestHeader(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\");"+\r\n                "xhr.send(\\"xyz=speedB\\");"+\r\n                "xhr.onreadystatechange = function () {"+\r\n                    "if (this.readyState == 4 && this.status == 200) {"+\r\n                        "document.getElementById(\\"show\\").innerHTML = this.responseText;"+\r\n                    "}}});"+\r\n        "}</script>"+\r\n"</head>"+\r\n"<style> *{ -moz-user-select: none; -ms-user-select:none; user-select:none; } </style>"+\r\n"<body>"+\r\n    "<div style=\\"width: auto;margin-top:30px;text-align: center;\\" id=\\"show\\"></div>"+\r\n    "<div style=\\"padding: 20px;width:auto;margin: 80px auto auto; background-color: #EEF0F2;\\">"+\r\n        "<p><input type=\\"submit\\" style=\\"margin:auto auto 20% 42%;\\" id=\\"xyzUp\\" value=\\"&nbsp ↑ &nbsp\\"></p>"+\r\n        "<p><input type=\\"submit\\" style=\\"margin-left: 10%;\\" id=\\"xyzLeft\\" value=\\"&nbsp ← &nbsp\\">"+\r\n        "<input type=\\"submit\\" style=\\"margin:auto 17% auto 17%\\" id=\\"xyzStop\\" value=\\"&nbsp ■ &nbsp\\">"+\r\n        "<input type=\\"submit\\" style=\\"margin-right: 10%;\\" id=\\"xyzRight\\" value=\\"&nbsp → &nbsp\\"></p>"+\r\n        "<p></p><input type=\\"submit\\" style=\\"margin:20% auto auto 42%;\\" id=\\"xyzDonw\\" value=\\"&nbsp ↓ &nbsp\\"></p>"+\r\n    "</div>"+\r\n    "<div style=\\"width:auto;margin: 50px auto;text-align: center; background-color: #EEF0F2;\\">"+\r\n        "<p><input type=\\"submit\\" style=\\"float:left;\\" id=\\"rise\\" value=\\"&nbsp 机器升 &nbsp\\"></p>"+\r\n        "<p><input type=\\"submit\\" style=\\"margin-left:50%;\\" id=\\"decline\\" value=\\"&nbsp 机器降 &nbsp\\"><br />"+\r\n        "<p><input type=\\"submit\\" value=\\"速度+\\" id=\\"speedA\\"></p>"+\r\n        "<p><input type=\\"submit\\" value=\\"速度-\\" id=\\"speedB\\"></p><br />"+\r\n        "<p><input type=\\"submit\\" id=\\"TurnOff\\" value=\\"&nbsp 关闭发动机 &nbsp\\"></p>"+\r\n    "</div></body></html>";\r\n\r\nint LeftAdvance = 32;\r\nint RightAdvance = 33;\r\nint LeftRetreat = 25;\r\nint RightRetreat = 26;\r\nint rise = 27;\r\nint decline = 14;\r\n//发动机\r\nint TurnOff = 12;\r\n\r\n//touch 最大65  手摸20以下 但是运行环境 触摸达不到20以下,20-50间,应该设置为50\r\nconst int ConstTouch = 50;\r\nString runState = "■";\r\nString WebSocKetUserName="cart1";\r\n\r\nvoid setup(void) {\r\n  pinMode(LeftAdvance, OUTPUT);\r\n  pinMode(LeftRetreat, OUTPUT);\r\n  pinMode(RightAdvance, OUTPUT);\r\n  pinMode(RightRetreat, OUTPUT);\r\n  pinMode(rise, OUTPUT);\r\n  pinMode(decline, OUTPUT);\r\n  pinMode(TurnOff, OUTPUT);\r\n  pinMode(light22, OUTPUT);\r\n  //pinMode(d5, INPUT_PULLUP);\r\n  //pinMode(d6, INPUT_PULLUP);\r\n\r\n  digitalWrite(LeftAdvance, LOW);\r\n  digitalWrite(LeftRetreat, LOW);\r\n  digitalWrite(RightAdvance, LOW);\r\n  digitalWrite(RightRetreat, LOW);\r\n\r\n  digitalWrite(rise, LOW);\r\n  digitalWrite(decline, LOW);\r\n  digitalWrite(TurnOff, LOW);\r\n  digitalWrite(light22, LOW);\r\n\r\n  pinMode(pwm1, OUTPUT);\r\n  ledcSetup(channel1, freq, resolution);\r\n  ledcAttachPin(pwm1, channel1);\r\n  ledcWrite(channel1, PwmNow);\r\n  pinMode(Power8266, OUTPUT);\r\n  digitalWrite(Power8266, LOW);\r\n\r\n  Serial.begin(115200);\r\n  delay(500);\r\n\r\n  if (!SPIFFS.begin(true)) {\r\n    Serial.println("SPIFFS加载失败");\r\n  }\r\n  if (SPIFFS.exists(direction) == false) {\r\n    //写入数据\r\n    SetSPIFFS(direction, "true");\r\n    delay(300);\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(direction, "r");\r\n  String boolStr;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    boolStr += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  boolStr.trim();\r\n  Serial.println(boolStr);\r\n  delay(500);\r\n  int intto = touchRead(touch15);\r\n  delay(1000);\r\n  if (intto < ConstTouch) {\r\n    if (boolStr == "true") {\r\n        Serial.println("转换遥控方向成 重");\r\n        SetSPIFFS(direction, "false");\r\n        delay(200);\r\n        globalBL=false;\r\n        ledFlicker();\r\n    } else {\r\n        Serial.println("转换遥控方向成 轻");\r\n        SetSPIFFS(direction, "true");\r\n        delay(200);\r\n        globalBL=true;\r\n        ledFlicker();\r\n    }\r\n  }\r\n  delay(500);\r\n  int intto4 = touchRead(touch4);\r\n  delay(500);\r\n  //touch4 是否触摸操作 true为触摸\r\n  bool touch4BL=false;\r\n  if(intto4 < ConstTouch){\r\n    touch4BL=true;\r\n    if (!SPIFFS.begin(true)) {\r\n      Serial.println("SPIFFS加载失败");\r\n    }\r\n    if (SPIFFS.exists(controlMode) == false) {\r\n      //写入数据  true代表 增加射频遥控 模式\r\n      SetSPIFFS(controlMode, "false");\r\n      delay(300);\r\n    }else{\r\n      String boolStr1;\r\n      File dateFile = SPIFFS.open(controlMode, "r");\r\n      for (int i = 0; i < dateFile.size(); i++) {\r\n      //Serial.print((char)dateFile.read());\r\n      boolStr1 += (char)dateFile.read();\r\n      }\r\n      //去除前后空格\r\n      boolStr1.trim();\r\n      Serial.println(boolStr1);\r\n      //上次是true射频模式 现在就关闭射频模式\r\n      if(boolStr1=="true"){\r\n        Serial.println("关闭射频模式");\r\n        SetSPIFFS(controlMode, "false");\r\n      }else{\r\n        //开户射频模式\r\n        SetSPIFFS(controlMode, "true");\r\n        Serial.println("开启射频模式");\r\n        digitalWrite(Power8266,HIGH);\r\n      }\r\n    }\r\n    ledFlicker();\r\n  }\r\n\r\n  if(touch4BL==false){\r\n    if (!SPIFFS.begin(true)) {\r\n      Serial.println("SPIFFS加载失败");\r\n    }else{\r\n      String boolStr2;\r\n      File dateFile = SPIFFS.open(controlMode, "r");\r\n      for (int i = 0; i < dateFile.size(); i++) {\r\n      //Serial.print((char)dateFile.read());\r\n      boolStr2 += (char)dateFile.read();\r\n      }\r\n      //去除前后空格\r\n      boolStr2.trim();\r\n      Serial.println(boolStr2);\r\n      \r\n      if(boolStr2=="true"){\r\n        digitalWrite(Power8266,HIGH);\r\n      }\r\n    }\r\n  }\r\n\r\n  delay(200);\r\n  ApStart();\r\n  delay(200);\r\n  Serial.println("启动网页遥控AP");\r\n  delay(200);\r\n  WebServerStart();\r\n}\r\n\r\nvoid loop(void) {\r\n  webServer.handleClient();\r\n\r\n}\r\n\r\n\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  webServer.send(500, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\nvoid xyzgo() {\r\n  request = webServer.arg("xyz");\r\n  //Serial.println(request);\r\n  if (request == "↑") {\r\n    if(globalBL==false){\r\n      LeftFore();\r\n      RightFore();\r\n    }else{\r\n      LeftAft();\r\n      RightAft();\r\n    }\r\n    runState = "↑";\r\n    webServer.send(200, "text/plane", request);\r\n    Serial.println("↑");\r\n    return;\r\n  }\r\n  if (request == "↓") {\r\n    if(globalBL==false){\r\n      LeftAft();\r\n      RightAft();\r\n    }else{\r\n      LeftFore();\r\n      RightFore();\r\n    }\r\n    runState = "↓";\r\n    webServer.send(200, "text/plane", request);\r\n    Serial.println("↓");\r\n    return;\r\n  }\r\n  if (request == "■") {\r\n    StopAllExec();\r\n    runState = "■";\r\n    webServer.send(200, "text/plane", request);\r\n    Serial.println("■");\r\n    return;\r\n  }\r\n  if (request == "←") {\r\n      RightFore();\r\n      LeftAft();\r\n    runState = "←";\r\n    webServer.send(200, "text/plane", request);\r\n    Serial.println("←");\r\n    return;\r\n  }\r\n  if (request == "→") {\r\n      LeftFore();\r\n      RightAft();\r\n    \r\n    runState = "→";\r\n    webServer.send(200, "text/plane", request);\r\n    Serial.println("→");\r\n    return;\r\n  }\r\n  if (request == "rise") {\r\n    digitalWrite(decline, LOW);\r\n    digitalWrite(rise, HIGH);\r\n    webServer.send(200, "text/plane", request);\r\n    return;\r\n  }\r\n  if (request == "decline") {\r\n    digitalWrite(rise, LOW);\r\n    digitalWrite(decline, HIGH);\r\n    webServer.send(200, "text/plane", request);\r\n    return;\r\n  }\r\n  if (request == "TurnOff") {\r\n    digitalWrite(TurnOff, HIGH);\r\n    webServer.send(200, "text/plane", request);\r\n    delay(3000);\r\n    digitalWrite(TurnOff, LOW);\r\n    return;\r\n  }\r\n  if (request == "speedA") {\r\n    if (PwmNow >= 178) {\r\n      webServer.send(200, "text/plane", "已达到70%限速,无法继续加速");\r\n    } else {\r\n      PwmNow = PwmNow + fadeAmount;\r\n      ledcWrite(channel1, PwmNow);\r\n      int temp=PwmNow*100/255;\r\n      String tempStr=String(temp)+"%";\r\n      webServer.send(200, "text/plane", tempStr);\r\n      Serial.println("speedA");\r\n    }\r\n    return;\r\n  }\r\n  if (request == "speedB") {\r\n    if (PwmNow <= 77) {\r\n      webServer.send(200, "text/plane", "已达到30%限速,无法继续减速");\r\n    } else {\r\n      PwmNow = PwmNow - fadeAmount;\r\n      ledcWrite(channel1, PwmNow);\r\n      int temp=PwmNow*100/255;\r\n      String tempStr=String(temp)+"%";\r\n      webServer.send(200, "text/plane", tempStr);\r\n      Serial.println("speedB");\r\n    }\r\n\r\n    return;\r\n  }\r\n  //HtmlSetWifi();\r\n}\r\n\r\nvoid ApStart() {\r\n  Serial.begin(115200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet);\r\n  String mymac=WiFi.macAddress();\r\n  Serial.println(mymac);\r\n  mymac.replace(":","");\r\n  mymac.toLowerCase();\r\n  String temp1=mymac.substring(0,2);\r\n  String temp2=mymac.substring(10,12);\r\n  String ApPasswd=temp1+temp2;\r\n  Serial.println(ApPasswd);\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("esp32WebServer192.168.168.2", "www.360xyz.cn");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\n//------- 展示页面-------\r\n\r\nvoid WebServerStart() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  webServer.begin();              // 启用网络服务\r\n  webServer.on("/", handleRoot);  // / 在HTTP中，表示请求首页服务，\r\n  webServer.on("/xyzgo", xyzgo);\r\n  webServer.onNotFound(handleNotFound);  // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\n\r\nvoid SetSPIFFS(String direction, String str) {\r\n  //写入数据\r\n  SPIFFS.remove(direction);\r\n  delay(500);\r\n  SPIFFS.begin();\r\n  File dataFile = SPIFFS.open(direction, "w");\r\n  dataFile.println(str);\r\n  dataFile.close();\r\n}\r\n//左轮前进\r\nvoid LeftFore() {\r\n  digitalWrite(LeftRetreat, LOW);\r\n  digitalWrite(LeftAdvance, HIGH);\r\n}\r\n//左轮后退\r\nvoid LeftAft() {\r\n  digitalWrite(LeftAdvance, LOW);\r\n  digitalWrite(LeftRetreat, HIGH);\r\n}\r\n//右轮前进\r\nvoid RightFore() {\r\n  digitalWrite(RightRetreat, LOW);\r\n  digitalWrite(RightAdvance, HIGH);\r\n}\r\n//右轮后退\r\nvoid RightAft() {\r\n  digitalWrite(RightAdvance, LOW);\r\n  digitalWrite(RightRetreat, HIGH);\r\n}\r\nvoid StopAllExec() {\r\n  digitalWrite(LeftAdvance, LOW);\r\n  digitalWrite(RightAdvance, LOW);\r\n  digitalWrite(LeftRetreat, LOW);\r\n  digitalWrite(RightRetreat, LOW);\r\n  digitalWrite(rise, LOW);\r\n  digitalWrite(decline, LOW);\r\n  delay(500);\r\n}\r\n//LED 闪烁\r\nvoid ledFlicker(){\r\n  digitalWrite(light22, HIGH);\r\n  delay(500);\r\n  digitalWrite(light22, LOW);\r\n  delay(500);\r\n  digitalWrite(light22, HIGH);\r\n  delay(500);\r\n  digitalWrite(light22, LOW);\r\n}', '', 'webserver'),
(7921, 344, 'zip压缩类', 'package models\r\n\r\nimport (\r\n	"archive/zip"\r\n	"errors"\r\n	"io"\r\n	"os"\r\n	"path/filepath"\r\n	"strings"\r\n)\r\n\r\n/*\r\n	z := MyZip{}\r\n\r\n要压缩成一个zip的多个文件的路径\r\nfiles := []string{"abc/SelectRvvwd.jpg", "abc/SelectRvvwd (1).jpg", "SelectRvvwd (2).jpg"}\r\n//设置输出的zip的路径\r\noutput := "./xyz.zip"\r\nerr := z.ZipFiles(output, files)\r\n\r\n	if err != nil {\r\n		fmt.Println(err)\r\n	}\r\n\r\noutput := "C:\\\\Users\\\\Administrator\\\\Desktop\\\\gotest"\r\nerr1:=z.UnZip(output, "xyz.zip")\r\n\r\n	if err != nil {\r\n		fmt.Println(err)\r\n	}\r\n*/\r\ntype MyZip struct {\r\n}\r\n\r\n// 1.压缩包保存路径+名字   2.文件名 数组\r\nfunc (class *MyZip) ZipFiles(filename string, files []string) error {\r\n	//创建输出文件目录\r\n	newZipFile, err := os.Create(filename)\r\n	if err != nil {\r\n		return err\r\n	}\r\n	defer newZipFile.Close()\r\n	//创建空的zip档案，可以理解为打开zip文件，准备写入\r\n	zipWriter := zip.NewWriter(newZipFile)\r\n	defer zipWriter.Close()\r\n	// Add files to zip\r\n	for _, file := range files {\r\n		if err = class.AddFileToZip(zipWriter, file); err != nil {\r\n			return err\r\n		}\r\n	}\r\n	return nil\r\n}\r\n\r\nfunc (class *MyZip) AddFileToZip(zipWriter *zip.Writer, filename string) error {\r\n	//打开要压缩的文件\r\n	fileToZip, err := os.Open(filename)\r\n	if err != nil {\r\n		return err\r\n	}\r\n	defer fileToZip.Close()\r\n	//获取文件的描述\r\n	info, err := fileToZip.Stat()\r\n	if err != nil {\r\n		return err\r\n	}\r\n	//FileInfoHeader返回一个根据fi填写了部分字段的Header，可以理解成是将fileinfo转换成zip格式的文件信息\r\n	header, err := zip.FileInfoHeader(info)\r\n	if err != nil {\r\n		return err\r\n	}\r\n	header.Name = filename\r\n	/*\r\n	   预定义压缩算法。\r\n	   archive/zip包中预定义的有两种压缩方式。一个是仅把文件写入到zip中。不做压缩。一种是压缩文件然后写入到zip中。默认的Store模式。就是只保存不压缩的模式。\r\n	   Store   unit16 = 0  //仅存储文件\r\n	   Deflate unit16 = 8  //压缩文件\r\n	*/\r\n	header.Method = zip.Deflate\r\n	//创建压缩包头部信息\r\n	writer, err := zipWriter.CreateHeader(header)\r\n	if err != nil {\r\n		return err\r\n	}\r\n	//将源复制到目标，将fileToZip 写入writer   是按默认的缓冲区32k循环操作的，不会将内容一次性全写入内存中,这样就能解决大文件的问题\r\n	_, err = io.Copy(writer, fileToZip)\r\n	return err\r\n}\r\n\r\n// 解压缩 1.输出路径 2.解压缩的文件名\r\nfunc (class *MyZip) UnZip(output string, zipName string) error {\r\n	archive, err := zip.OpenReader(zipName)\r\n	if err != nil {\r\n		return errors.New("打开压缩文件失败")\r\n	}\r\n	defer archive.Close()\r\n	for _, f := range archive.File {\r\n		filePath := filepath.Join(output, f.Name)\r\n		if !strings.HasPrefix(filePath, filepath.Clean(output)+string(os.PathSeparator)) {\r\n			return errors.New("路径错误")\r\n		}\r\n		if f.FileInfo().IsDir() {\r\n			os.MkdirAll(filePath, os.ModePerm)\r\n			continue\r\n		}\r\n		if err := os.MkdirAll(filepath.Dir(filePath), os.ModePerm); err != nil {\r\n			return errors.New("创建文件夹失败")\r\n		}\r\n		dstFile, err := os.OpenFile(filePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())\r\n		if err != nil {\r\n			return errors.New("创建文件失败")\r\n		}\r\n		fileInArchive, err := f.Open()\r\n		if err != nil {\r\n			return errors.New("读取压缩包文件失败")\r\n		}\r\n		if _, err := io.Copy(dstFile, fileInArchive); err != nil {\r\n			return errors.New("解压失败")\r\n		}\r\n		dstFile.Close()\r\n		fileInArchive.Close()\r\n		return nil\r\n	}\r\n	return errors.New("压缩包文件为空")\r\n}\r\n', '', 'webserver'),
(7922, 529, 'arm64 mysql5.7', 'https://blog.csdn.net/qq_40875195/article/details/129215341', '', 'webserver'),
(7923, 344, 'windows弹窗提示类', 'func main() {\r\n	x := WindowsAlert{}\r\n	x.ShowMessage("弹窗标题", "你好啊")\r\n	time.Sleep(time.Second * 1)\r\n}\r\n\r\ntype WindowsAlert struct {\r\n}\r\n\r\nfunc (class *WindowsAlert) IntPtr(n int) uintptr {\r\n	return uintptr(n)\r\n}\r\nfunc (class *WindowsAlert) StrPtr(s string) uintptr {\r\n	return uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(s)))\r\n}\r\nfunc (class *WindowsAlert) ShowMessage(title, text string) {\r\n\r\n	user32dll, _ := syscall.LoadLibrary("user32.dll")\r\n	user32 := syscall.NewLazyDLL("user32.dll")\r\n	MessageBoxW := user32.NewProc("MessageBoxW")\r\n	MessageBoxW.Call(class.IntPtr(0), class.StrPtr(text), class.StrPtr(title), class.IntPtr(0))\r\n	syscall.FreeLibrary(user32dll)\r\n}', '', 'webserver'),
(7924, 529, 'https://hanime1.me/watch?v=37590', 'https://hanime1.me/watch?v=37590', '', 'webserver'),
(7925, 529, 'https://xanimu.com/', 'https://xanimu.com/', '', 'webserver'),
(7926, 344, '复制文件到指定目录', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"io"\r\n	"os"\r\n)\r\n\r\nfunc main() {\r\n	fs, err := os.ReadDir("setup")\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n		return\r\n	}\r\n	strName := fs[0].Name()\r\n	f, err1 := os.Open(strName)\r\n	if err1 != nil {\r\n		fmt.Println(err1.Error())\r\n		return\r\n	}\r\n	creat, err2 := os.Create("C:\\\\Users\\\\Administrator\\\\AppData\\\\Roaming\\\\Microsoft\\\\Windows\\\\Start Menu\\\\Programs\\\\Startup\\\\" + strName)\r\n	if err2 != nil {\r\n		fmt.Println(err2.Error())\r\n		return\r\n	}\r\n	_, err3 := io.Copy(creat, f)\r\n	if err3 != nil {\r\n		fmt.Println(err3.Error())\r\n	}\r\n}\r\n', '', 'webserver'),
(7927, 344, '加密解密类', 'package models\r\n\r\nimport (\r\n	"bytes"\r\n	"crypto/aes"\r\n	"crypto/cipher"\r\n	"crypto/des"\r\n	"encoding/base64"\r\n	"encoding/hex"\r\n	"errors"\r\n	"fmt"\r\n)\r\n\r\n// 加解密类\r\ntype EnDeCryption struct {\r\n}\r\n\r\n// AES 加解密 key 只能是16 24 31位\r\nfunc (class *EnDeCryption) AesEncrypt(orig string, key string) string {\r\n	// 转成字节数组\r\n	origData := []byte(orig)\r\n	k := []byte(key)\r\n\r\n	// 分组秘钥\r\n	block, err := aes.NewCipher(k)\r\n	if err != nil {\r\n		panic(fmt.Sprintf("key 长度必须 16/24/32长度: %s", err.Error()))\r\n	}\r\n	// 获取秘钥块的长度\r\n	blockSize := block.BlockSize()\r\n	// 补全码\r\n	origData = class.pkcs7Padding(origData, blockSize)\r\n	// 加密模式\r\n	blockMode := cipher.NewCBCEncrypter(block, k[:blockSize])\r\n	// 创建数组\r\n	cryted := make([]byte, len(origData))\r\n	// 加密\r\n	blockMode.CryptBlocks(cryted, origData)\r\n	//使用RawURLEncoding 不要使用StdEncoding\r\n	//不要使用StdEncoding  放在url参数中回导致错误\r\n	return base64.RawURLEncoding.EncodeToString(cryted)\r\n\r\n}\r\n\r\nfunc (class *EnDeCryption) AesDecrypt(cryted string, key string) string {\r\n	//使用RawURLEncoding 不要使用StdEncoding\r\n	//不要使用StdEncoding  放在url参数中回导致错误\r\n	crytedByte, _ := base64.RawURLEncoding.DecodeString(cryted)\r\n	k := []byte(key)\r\n\r\n	// 分组秘钥\r\n	block, err := aes.NewCipher(k)\r\n	if err != nil {\r\n		panic(fmt.Sprintf("key 长度必须 16/24/32长度: %s", err.Error()))\r\n	}\r\n	// 获取秘钥块的长度\r\n	blockSize := block.BlockSize()\r\n	// 加密模式\r\n	blockMode := cipher.NewCBCDecrypter(block, k[:blockSize])\r\n	// 创建数组\r\n	orig := make([]byte, len(crytedByte))\r\n	// 解密\r\n	blockMode.CryptBlocks(orig, crytedByte)\r\n	// 去补全码\r\n	orig = class.pkcs7UnPadding(orig)\r\n	return string(orig)\r\n}\r\n\r\n// 补码\r\nfunc (class *EnDeCryption) pkcs7Padding(ciphertext []byte, blocksize int) []byte {\r\n	padding := blocksize - len(ciphertext)%blocksize\r\n	padtext := bytes.Repeat([]byte{byte(padding)}, padding)\r\n	return append(ciphertext, padtext...)\r\n}\r\n\r\n// 去码\r\nfunc (class *EnDeCryption) pkcs7UnPadding(origData []byte) []byte {\r\n	length := len(origData)\r\n	unpadding := int(origData[length-1])\r\n	return origData[:(length - unpadding)]\r\n}\r\n\r\n//DES 加解密\r\n//Encrypted: 5d2333b9fbbe5892379e6bcc25ffd1f3a51b6ffe4dc7af62beb28e1270d5daa1\r\n//Decrypted: I love this beautiful world!\r\n\r\nfunc (class *EnDeCryption) zeroPadding(ciphertext []byte, blockSize int) []byte {\r\n	padding := blockSize - len(ciphertext)%blockSize\r\n	padtext := bytes.Repeat([]byte{0}, padding)\r\n	return append(ciphertext, padtext...)\r\n}\r\n\r\nfunc (class *EnDeCryption) zeroUnPadding(origData []byte) []byte {\r\n	return bytes.TrimFunc(origData,\r\n		func(r rune) bool {\r\n			return r == rune(0)\r\n		})\r\n}\r\n\r\n// DEC 加密更安全 key 8个字符以内\r\nfunc (class *EnDeCryption) DecEncrypt(text string, key []byte) (string, error) {\r\n	src := []byte(text)\r\n	block, err := des.NewCipher(key)\r\n	if err != nil {\r\n		return "", err\r\n	}\r\n	bs := block.BlockSize()\r\n	src = class.zeroPadding(src, bs)\r\n	if len(src)%bs != 0 {\r\n		return "", errors.New("Need a multiple of the blocksize")\r\n	}\r\n	out := make([]byte, len(src))\r\n	dst := out\r\n	for len(src) > 0 {\r\n		block.Encrypt(dst, src[:bs])\r\n		src = src[bs:]\r\n		dst = dst[bs:]\r\n	}\r\n	return hex.EncodeToString(out), nil\r\n}\r\n\r\n// DEC解密\r\nfunc (class *EnDeCryption) DecDecrypt(decrypted string, key []byte) (string, error) {\r\n	src, err := hex.DecodeString(decrypted)\r\n	if err != nil {\r\n		return "", err\r\n	}\r\n	block, err := des.NewCipher(key)\r\n	if err != nil {\r\n		return "", err\r\n	}\r\n	out := make([]byte, len(src))\r\n	dst := out\r\n	bs := block.BlockSize()\r\n	if len(src)%bs != 0 {\r\n		return "", errors.New("crypto/cipher: input not full blocks")\r\n	}\r\n	for len(src) > 0 {\r\n		block.Decrypt(dst, src[:bs])\r\n		src = src[bs:]\r\n		dst = dst[bs:]\r\n	}\r\n	out = class.zeroUnPadding(out)\r\n	return string(out), nil\r\n}\r\n', '', 'webserver'),
(7928, 344, '请求限流类', 'import (\r\n	"sync"\r\n	"time"\r\n)\r\n\r\n/*\r\n	限流类\r\n\r\nlimiter:=Limiter{}\r\n// 一秒内只允许10次请求\r\nlimiter.Init(10,time.Second)\r\n\r\n	if limit.Allow() {\r\n		fmt.Println(i, "限流中")\r\n	}\r\n*/\r\ntype Limiter struct {\r\n	sync.Mutex\r\n	limit  int       //表示每秒允许的请求数量\r\n	count  int       //表示当前已经处理的请求数量\r\n	expire time.Time //表示过期时间\r\n}\r\n\r\nfunc (class *Limiter) Init(limit int, expire time.Duration) *Limiter {\r\n	return &Limiter{\r\n		limit:  limit,\r\n		count:  0,\r\n		expire: time.Now().Add(expire),\r\n	}\r\n}\r\nfunc (class *Limiter) Allow() bool {\r\n	class.Lock()\r\n	defer class.Unlock()\r\n	if class.count < class.limit {\r\n		class.count++\r\n		return true\r\n	}\r\n	//判断当前时间是否在指定时间之后\r\n	if time.Now().After(class.expire) {\r\n		class.count = 1\r\n		//当前时间加上时间区间\r\n		class.expire = time.Now().Add(time.Second)\r\n		return true\r\n	}\r\n	return false\r\n}\r\n', '', 'webserver'),
(7929, 4, '波轮洗衣机桶不转,点击有交流声', '用交流电流表测量是否有交替的交流电,\r\n有交替的交流电流,测量一下电容,\r\n电容容量没问题,把电容装回去,测量电机连接电容的两根线是否有电容容量,如果没有,查一下线路是否被老鼠咬\r\n如果两根线有电容容量,拆下电机接电容单独测试看看扭力够不够', '', 'webserver'),
(7930, 344, 'golang mqtt服务端类', 'package models\r\n\r\nimport (\r\n	"context"\r\n	"errors"\r\n	"fmt"\r\n	"net"\r\n	_ "net/http/pprof"\r\n	"os"\r\n	"os/signal"\r\n	"syscall"\r\n\r\n	"github.com/DrmagicE/gmqtt"\r\n	_ "github.com/DrmagicE/gmqtt/persistence"\r\n	"github.com/DrmagicE/gmqtt/pkg/packets"\r\n	"github.com/DrmagicE/gmqtt/server"\r\n	_ "github.com/DrmagicE/gmqtt/topicalias/fifo"\r\n)\r\n\r\ntype XyzMqttServer struct {\r\n}\r\n\r\nfunc (class XyzMqttServer) Init() {\r\n\r\n	ln, err := net.Listen("tcp", ":1883")\r\n	if err != nil {\r\n		fmt.Println(err.Error())\r\n		return\r\n	}\r\n\r\n	hooks := server.Hooks{\r\n		OnAccept:       nil,\r\n		OnStop:         nil,\r\n		OnSubscribe:    nil,\r\n		OnSubscribed:   nil,\r\n		OnUnsubscribe:  nil,\r\n		OnUnsubscribed: nil,\r\n		OnMsgArrived:   nil,\r\n		OnBasicAuth: func(ctx context.Context, client server.Client, req *server.ConnectRequest) error {\r\n			//验证账号\r\n			username := string(req.Connect.Username)\r\n			passwd := string(req.Connect.Password)\r\n			cid := string(req.Connect.ClientID)\r\n			//fmt.Println(username, passwd, cid)\r\n			bl := Db.Sql("SELECT id FROM Mqtt WHERE username=? AND passwd=? AND clientId=?", username, passwd, cid).Row()\r\n			if bl {\r\n				return nil\r\n			}\r\n			return errors.New("失败")\r\n		},\r\n		OnEnhancedAuth:      nil,\r\n		OnReAuth:            nil,\r\n		OnConnected:         nil,\r\n		OnSessionCreated:    nil,\r\n		OnSessionResumed:    nil,\r\n		OnSessionTerminated: nil,\r\n		OnDelivered:         nil,\r\n		OnClosed:            nil,\r\n		OnMsgDropped:        nil,\r\n		OnWillPublish:       nil,\r\n		OnWillPublished:     nil,\r\n	}\r\n\r\n	srv := server.New(\r\n		server.WithTCPListener(ln),\r\n		server.WithHook(hooks),\r\n	)\r\n	// 保留服务\r\n	retainedService := srv.RetainedService()\r\n\r\n	// 发布服务\r\n	//pub := srv.Publisher()\r\n	// 添加保留消息\r\n	retainedService.AddOrReplace(&gmqtt.Message{\r\n		QoS:      packets.Qos1,\r\n		Retained: true,\r\n		Topic:    "a/b/c",\r\n		Payload:  []byte("retained message"),\r\n	})\r\n\r\n	go func() {\r\n		signalCh := make(chan os.Signal, 1)\r\n		signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM)\r\n		<-signalCh\r\n		srv.Stop(context.Background())\r\n	}()\r\n	err = srv.Run()\r\n	if err != nil {\r\n		panic(err)\r\n	}\r\n\r\n}\r\n', '', 'webserver'),
(7931, 344, 'mqtt 客户端类', 'package models\r\n\r\nimport (\r\n	"errors"\r\n	"fmt"\r\n	"time"\r\n\r\n	MQTT "github.com/eclipse/paho.mqtt.golang"\r\n)\r\n\r\ntype MqttClient struct {\r\n	Client MQTT.Client\r\n}\r\n\r\n// bl是否保留在服务器 true为保留\r\nfunc (class *MqttClient) PublishText(username, passwd, clientId, publish, payload string, qos int, bl bool) error {\r\n	opts := MQTT.NewClientOptions().AddBroker("tcp://localhost:1883")\r\n	opts.SetUsername(username)\r\n	opts.SetPassword(passwd)\r\n	opts.SetClientID(clientId)\r\n	opts.SetDefaultPublishHandler(func(c MQTT.Client, m MQTT.Message) {\r\n		fmt.Println(m.Topic())\r\n		fmt.Println(m.Payload())\r\n	})\r\n	class.Client = MQTT.NewClient(opts)\r\n	//连接并等待连接成功\r\n	if token := class.Client.Connect(); token.Wait() && token.Error() != nil {\r\n		if token.WaitTimeout(3 * time.Second) {\r\n			return errors.New("连接失败,参数错误")\r\n		}\r\n		panic(token.Error())\r\n	}\r\n\r\n	//等待发布成功 true代表订阅该主题就算是离线,只要上线就能收到(消息保存在服务器)\r\n	if token := class.Client.Publish(publish, byte(qos), bl, payload); token.Wait() && token.Error() != nil {\r\n		if token.WaitTimeout(3 * time.Second) {\r\n			return errors.New("发布失败")\r\n		}\r\n		panic(token.Error())\r\n	}\r\n	class.Client.Disconnect(250)\r\n	return nil\r\n}\r\n\r\n// 系统MQTT接收消息,邮件提示站长\r\nfunc (class *MqttClient) SystemSubscribeToEmail() {\r\n	username := "system"\r\n	passwd := "0xvBYVdYOFLGlSFuJNtAJ+Uw=="\r\n	clientId := "email"\r\n	topic := "home/system/email"\r\n	opts := MQTT.NewClientOptions().AddBroker("tcp://localhost:1883")\r\n	opts.SetUsername(username)\r\n	opts.SetPassword(passwd)\r\n	opts.SetClientID(clientId)\r\n	opts.SetDefaultPublishHandler(func(c MQTT.Client, m MQTT.Message) {\r\n		fmt.Println(m.Topic())\r\n		fmt.Println(m.Payload())\r\n	})\r\n	class.Client = MQTT.NewClient(opts)\r\n	//连接并等待连接成功\r\n	if token := class.Client.Connect(); token.Wait() && token.Error() != nil {\r\n		if token.WaitTimeout(3 * time.Second) {\r\n			return\r\n		}\r\n		panic(token.Error())\r\n	}\r\n\r\n	class.Client.Subscribe(topic, byte(1), func(c MQTT.Client, m MQTT.Message) {\r\n		mail := XyzMail{}\r\n		temp := string(m.Payload())\r\n		mail.To("282246101@qq.com").Title("MQTT邮件提示").Body(temp).Send()\r\n	})\r\n}\r\n', '', 'webserver'),
(7932, 20, 'esp32 mqtt client', '#include <WiFi.h>\r\n#include <PubSubClient.h>\r\n#include <WebServer.h>\r\n#include <HTTPClient.h>\r\n#include <FS.h>\r\n#include "SPIFFS.h"\r\n#include "ESPmDNS.h"\r\n#include <Ticker.h>\r\n\r\nconst char* mqttServer = "bemfa.com";\r\nconst int mqttPort = 9501;\r\nconst char* mqttUser = "door1";\r\nconst char* mqttPassword = "abcdefg";\r\nconst char* mqttClientId = "07b120062a7972cf9831d7d9bc8012bc";\r\nconst char* mqttTopic = "door1";\r\n\r\nint botelu = 19200;\r\nTicker myTicker;\r\n//被读取的文件位置和名称\r\nString flashWifi = "/wifi.txt";\r\nWebServer webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString ssid = "";\r\nString passwd = "";\r\nString html;\r\n\r\nWiFiClient espClient;\r\nPubSubClient client(espClient);\r\n\r\n//PWM控制\r\n#define pwm1  21\r\n//管道esp32有16个管道,0-7为80hz 高速管道  8-16为低速管道\r\nconst int channel1 = 0;\r\n//分辨率  2的8次方 256\r\nconst int resolution = 8;\r\n//PWM频率\r\nconst int freq = 1000;\r\n//初始值 41%\r\nint PwmNow = 105;\r\n//累加数\r\nint fadeAmount = 5;\r\n\r\n#define p22  22\r\n#define p32  32\r\n#define p33  33\r\n#define p25  25\r\n#define p26  26\r\n#define p27  27\r\n#define p14  14\r\n#define p12  12\r\n#define p0  0\r\n\r\nvoid setup() {\r\n  pinMode(p22, OUTPUT);\r\n  pinMode(p32, OUTPUT);\r\n  pinMode(p33, OUTPUT);\r\n  pinMode(p25, OUTPUT);\r\n  pinMode(p26, OUTPUT);\r\n  pinMode(p27, OUTPUT);\r\n  pinMode(p14, OUTPUT);\r\n  pinMode(p12, OUTPUT);\r\n  pinMode(p0, OUTPUT);\r\n\r\n  digitalWrite(p22, LOW);\r\n  digitalWrite(p32, LOW);\r\n  digitalWrite(p33, LOW);\r\n  digitalWrite(p25, LOW);\r\n  digitalWrite(p26, LOW);\r\n  digitalWrite(p27, LOW);\r\n  digitalWrite(p14, LOW);\r\n  digitalWrite(p12, LOW);\r\n  digitalWrite(p0, LOW);\r\n\r\n  pinMode(pwm1, OUTPUT);\r\n  ledcSetup(channel1, freq, resolution);\r\n  ledcAttachPin(pwm1, channel1);\r\n  ledcWrite(channel1, PwmNow);\r\n\r\n  Serial.begin(botelu);\r\n  if (FlashConnetWifi() == false) {\r\n    HtmlSetWifi();\r\n  }\r\n  Serial.println("连接WIFIi成功");\r\n  client.setServer(mqttServer, mqttPort);\r\n  client.setCallback(callback);\r\n  while (!client.connected()) {\r\n    Serial.println("正在连接MQTT");\r\n    if (client.connect(mqttClientId, mqttUser, mqttPassword)) {\r\n      Serial.println("正在连接MQTT成功");\r\n      client.subscribe(mqttTopic);\r\n    } else {\r\n      Serial.println("正在连接MQTT失败");\r\n      delay(5000);\r\n    }\r\n  }\r\n}\r\nvoid loop() {\r\n  if (!client.connected()) {\r\n    reconnect();\r\n  }\r\n  client.loop();\r\n}\r\nvoid callback(char* topic, byte* payload, unsigned int length) {\r\n  //Serial.println(topic);\r\n  String msg = "";\r\n  for (int i = 0; i < length; i++) {\r\n    msg += (char)payload[i];\r\n  }\r\n  Serial.print("Msg:");\r\n  Serial.println(msg);\r\n  if (msg == "开") {\r\n    //向home/system/email主题发送,让服务器向站长发邮件提示该操作已经执行\r\n    client.publish("home/system/email", "开");\r\n    return;\r\n  }\r\n  if (msg == "关") {\r\n\r\n    return;\r\n  }\r\n  msg = "";\r\n}\r\n\r\nvoid reconnect() {\r\n  // Loop until we''re reconnected\r\n  while (!client.connected()) {\r\n    Serial.print("Attempting MQTT connection...");\r\n    // Attempt to connect\r\n    if (client.connect(mqttClientId)) {\r\n      Serial.println("connected");\r\n      Serial.print("subscribe:");\r\n      Serial.println(mqttTopic);\r\n      //订阅主题，如果需要订阅多个主题，可发送多条订阅指令client.subscribe(topic2);client.subscribe(topic3);\r\n      client.subscribe(mqttTopic);\r\n    } else {\r\n      Serial.print("failed, rc=");\r\n      Serial.print(client.state());\r\n      Serial.println(" try again in 5 seconds");\r\n      // Wait 5 seconds before retrying\r\n      delay(5000);\r\n    }\r\n  }\r\n}\r\n\r\n\r\nvoid HtmlSetWifi() {\r\n  WifiScan();\r\n  apStart();\r\n  delay(1000);\r\n  Serial.println("启动网页");\r\n  //5分后重启 防止停电后复电，路由器连接WIFI速度慢于ESP导致ESP连接不到路由器进入无限AP模式，所以这里只让AP激活5分钟后就重启\r\n  myTicker.once(300, EspReboot);\r\n  delay(200);\r\n  webserverStart();\r\n  while (1) {\r\n    webServer.handleClient();  // 检查网络服务请求并处理\r\n  }\r\n}\r\n\r\n//扫描附件WIFI\r\nvoid WifiScan() {\r\n  Serial.begin(botelu);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(100);\r\n  int n = WiFi.scanNetworks();\r\n  if (n > 0) {\r\n    Serial.println(n);\r\n    String a = "附近WiFi <select id=\\"ssid\\">";\r\n    for (int i = 0; i < n; i++) {\r\n      Serial.println(WiFi.SSID(i));\r\n      a = a + "<option value=\\"" + WiFi.SSID(i) + "\\">" + WiFi.SSID(i) + "</option>";\r\n      delay(50);\r\n    }\r\n    String HtmlStart = String("") + "<!DOCTYPE html>" + "<html>" + "<head>" + "<meta charset=\\"utf-8\\">" + "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />" + "<title>设置WiFi</title>" + "<link rel=\\"stylesheet\\" href=\\"\\">" + "</head>" + "<script>" + "onload  = function() {" + "document.getElementById(\\"up\\").onclick = function(){" + "var ssida=document.getElementById(\\"ssid\\").value;" + "var ssid=ssida.replace(/\\\\s+/g, \\" \\");" + "var passwda=document.getElementsByTagName(''input'')[0].value;" + "var passwd=passwda.replace(/\\\\s+/g, \\" \\");" + "xhr = new XMLHttpRequest();" + "xhr.open(\\"POST\\",\\"./setWifi\\",true);" + "var posts = (\\"ssid=\\"+ssid+\\"&passwd=\\"+ passwd);" + "xhr.setRequestHeader(\\"Content-Type\\",\\"application/x-www-form-urlencoded\\");" + "xhr.send(posts);" + "xhr.onreadystatechange = function(){" + "if(this.readyState == 4 && this.status == 200){" + "alert(this.responseText);" + "}" + "}" + "}" + "}" + "</script>" + "<body>";\r\n    String HtmlEnd = String("") + "<p>WiFi密码<input type=\\"text\\" id=\\"passwd\\"></p>" + "<input type=\\"submit\\" id=\\"up\\" value=\\"设 置\\">" + "<hr/>" + "<div>如果附近WiFi没有显示到自己的WIFI<div>" + "<div>请重启或离信号近点</div>" + "<div>连接成功AP热点退出转WIFI_STA</div>" + "</body>" + "</html>";\r\n    a = a + "</select>";\r\n    html = HtmlStart + a + HtmlEnd;\r\n  } else {\r\n    html = "扫描不到网络";\r\n    Serial.println("扫描不到网络");\r\n  }\r\n}\r\nvoid setWifi() {\r\n  ssid = webServer.arg(0);\r\n  passwd = webServer.arg(1);\r\n  const char* Ssid = ssid.c_str();\r\n  const char* Passwd = passwd.c_str();\r\n  String sp = ssid + "&" + passwd;\r\n\r\n  Serial.println(sp);\r\n  Serial.begin(botelu);\r\n  delay(500);\r\n  WiFi.begin(Ssid, Passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      webServer.send(200, "text/plane", "Wifi密码正确,ESP准备重启");\r\n      webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flashWifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML连接成功");\r\n      delay(1000);\r\n      ESP.restart();\r\n    }\r\n  }\r\n  webServer.send(200, "text/plane", "Wifi密码错误,请重新输入");\r\n  //HtmlSetWifi();\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  webServer.send(500, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\n\r\n\r\nvoid apStart() {\r\n  Serial.begin(botelu);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet);\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    //Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserverStart() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  webServer.begin();              // 启用网络服务\r\n  webServer.on("/", handleRoot);  // / 在HTTP中，表示请求首页服务，\r\n  webServer.on("/setWifi", setWifi);\r\n  webServer.onNotFound(handleNotFound);  // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\n\r\nbool FlashConnetWifi() {\r\n  Serial.begin(botelu);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flashWifi) == false) {\r\n    Serial.print(flashWifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flashWifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  const char* WifiName = wifiname.c_str();\r\n  const char* WifiPw = wifipw.c_str();\r\n  Serial.println(WifiName);\r\n  Serial.println(WifiPw);\r\n  WiFi.begin(WifiName, WifiPw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("FlashConnetWifi->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("FlashConnetWifi 闪存配置连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("FlashConnetWifi->false");\r\n  return false;\r\n}\r\nvoid EspReboot() {\r\n  ESP.restart();\r\n}', '', 'webserver'),
(7933, 32, '电动车电瓶保养', '使用工具\r\n1.浓缩修复液  2 一字小螺丝刀 3 注射针管\r\n一 浓缩液用量 每个电瓶安数 / 2 \r\n比如12A的   12/2=6毫升  如果一个是电瓶有6个格，每个格要加6毫升,加完502胶水粘好盖子\r\n二 静放4小时,然后充电2小时,把点放完,然后一次性把点充满,再放电,做循环让修复液彻底循环\r\n', '', 'webserver');
INSERT INTO `WisdomPreview` (`id`, `tid`, `title`, `content`, `imgtext`, `user`) VALUES
(7936, 344, 'mqtt电脑限时上网', 'package main\r\n\r\nimport (\r\n	"encoding/json"\r\n	"errors"\r\n	"fmt"\r\n	"net"\r\n	"os/exec"\r\n	"strings"\r\n	"syscall"\r\n	"time"\r\n	"unsafe"\r\n\r\n	MQTT "github.com/eclipse/paho.mqtt.golang"\r\n)\r\n\r\nvar MqttXyz = MqttClient{}\r\n\r\n// 连接服务器地址\r\nvar Host = "192.168.0.254"\r\n\r\nvar username string\r\n\r\n// 接收服务器消息\r\nvar SubTopic = "home/system/pc"\r\n\r\n// 定时向服务器发送 空字符 判断有返回 来确定是否连接\r\nvar PubTopic = "home/system/pctosystem"\r\n\r\nfunc init() {\r\n	ip, errip := getIp()\r\n	if errip == nil {\r\n		last := strings.LastIndex(ip, ".")\r\n		Host = ip[0:last] + ".254"\r\n	}\r\n	username = GetMac()\r\n}\r\nfunc main() {\r\n	ConnetXyz(username)\r\n	for {\r\n		time.Sleep(time.Minute * 5) //5分钟\r\n		bl := MqttXyz.PublishXyz()\r\n		if !bl {\r\n			ConnetXyz(username)\r\n		}\r\n\r\n	}\r\n}\r\nfunc ConnetXyz(username string) {\r\n	MqttXyz.MqttClientInit(Host, username, "abcdefg", username).SubscribeXyz(SubTopic)\r\n}\r\n\r\ntype WindowsAlert struct {\r\n}\r\n\r\nfunc (class *WindowsAlert) StrPtr(s string) uintptr {\r\n	return uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(s)))\r\n}\r\nfunc (class *WindowsAlert) ShowMessage(title, text string) {\r\n	user32dll, _ := syscall.LoadLibrary("user32.dll")\r\n	user32 := syscall.NewLazyDLL("user32.dll")\r\n	MessageBoxW := user32.NewProc("MessageBoxW")\r\n	defer syscall.FreeLibrary(user32dll)\r\n	MessageBoxW.Call(uintptr(0), class.StrPtr(text), class.StrPtr(title), uintptr(0))\r\n	time.Sleep(time.Second * 3)\r\n}\r\n\r\ntype MqttClient struct {\r\n	Client MQTT.Client\r\n}\r\n\r\nfunc (class *MqttClient) MqttClientInit(host, username, passwd, clientId string) *MqttClient {\r\n	opts := MQTT.NewClientOptions().AddBroker("tcp://" + host + ":1883")\r\n	opts.SetUsername(username)\r\n	opts.SetPassword(passwd)\r\n	opts.SetClientID(clientId)\r\n	class.Client = MQTT.NewClient(opts)\r\n	return class\r\n}\r\n\r\n// 系统MQTT接收消息,邮件提示站长\r\nfunc (class *MqttClient) SubscribeXyz(topic string) {\r\n	//连接并等待连接成功\r\n	if token := class.Client.Connect(); token.Wait() && token.Error() != nil {\r\n		fmt.Println("conn")\r\n	}\r\n\r\n	class.Client.Subscribe(topic, byte(2), func(c MQTT.Client, m MQTT.Message) {\r\n		mm := make(map[string]string)\r\n		err := json.Unmarshal(m.Payload(), &mm)\r\n		if err == nil {\r\n\r\n			if mm["username"] == username {\r\n				switch mm["msg"] {\r\n				case "关机":\r\n					//fmt.Println("关机")\r\n					arg := []string{"-s", "-t", "0"}\r\n					cmd := exec.Command("shutdown", arg...)\r\n					cmd.CombinedOutput()\r\n				case "重启":\r\n					arg := []string{"-r", "-t", "0"}\r\n					cmd := exec.Command("shutdown", arg...)\r\n					cmd.CombinedOutput()\r\n				default:\r\n					x := WindowsAlert{}\r\n					x.ShowMessage("系统消息", mm["msg"])\r\n				}\r\n			}\r\n		}\r\n\r\n	})\r\n}\r\nfunc (class *MqttClient) PublishXyz() bool {\r\n	token := class.Client.Publish(PubTopic, byte(1), false, username)\r\n	if token.Error() != nil {\r\n		class.Client.Disconnect(1)\r\n		//fmt.Println("发布失败")\r\n		return false\r\n	}\r\n	if !token.WaitTimeout(3 * time.Second) {\r\n		//fmt.Println("发布失败Timeout")\r\n		class.Client.Disconnect(1)\r\n		return false\r\n	}\r\n	//fmt.Println("发布ok")\r\n	return true\r\n}\r\nfunc GetMac() string {\r\n	netInterfaces, err := net.Interfaces()\r\n	if err != nil {\r\n		return ""\r\n	}\r\n	for _, i2 := range netInterfaces {\r\n		//fmt.Println(i2.Name)\r\n		mac := i2.HardwareAddr\r\n		//fmt.Println(mac)\r\n		return mac.String()\r\n	}\r\n	return ""\r\n}\r\nfunc getIp() (string, error) {\r\n	addrs, err := net.InterfaceAddrs()\r\n	if err != nil {\r\n		fmt.Println(err)\r\n		return "", errors.New(err.Error())\r\n	}\r\n\r\n	for _, address := range addrs {\r\n		// 检查IP地址，其他类型的地址(如link-local或者loopback)忽略\r\n		if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && ipnet.IP.To4() != nil {\r\n			return ipnet.IP.String(), nil\r\n		}\r\n	}\r\n	return "", errors.New("失败")\r\n}\r\n', '', 'webserver'),
(7938, 160, '网络无法连接外网', 'vi /etc/systemd/resolved.conf\r\n[Resolve]\r\nDNS=8.8.8.8\r\n\r\n然后重启一下\r\nsystemctl restart systemd-resolved.service\r\n\r\n', '', 'webserver'),
(7939, 344, '继承', 'package main\r\n\r\nimport "fmt"\r\n\r\nfunc main() {\r\n	d := Def{}\r\n	d.Go()\r\n	d.come() //Def 继承 Abc 那么就可以使用Abc里的方法 首字母小写也能继承使用\r\n}\r\n\r\ntype Abc struct {\r\n}\r\n\r\nfunc (class *Abc) Go() {\r\n	fmt.Println("GO")\r\n}\r\nfunc (class *Abc) come() {\r\n	fmt.Println("come")\r\n}\r\n\r\ntype Def struct {\r\n	//Def 继承 Abc\r\n	Abc\r\n}\r\n', '', 'webserver'),
(7941, 20, 'esp32 https GET', 'String cat=String("")+"-----BEGIN CERTIFICATE-----\\r\\n"+\r\n"MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb\\r\\n"+\r\n"MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow\\r\\n"+\r\n"GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj\\r\\n"+\r\n"YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL\\r\\n"+\r\n"MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\\r\\n"+\r\n"BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM\\r\\n"+\r\n"GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP\\r\\n"+\r\n"ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua\\r\\n"+\r\n"BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe\\r\\n"+\r\n"3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4\\r\\n"+\r\n"YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR\\r\\n"+\r\n"rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm\\r\\n"+\r\n"ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU\\r\\n"+\r\n"oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF\\r\\n"+\r\n"MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v\\r\\n"+\r\n"QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t\\r\\n"+\r\n"b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF\\r\\n"+\r\n"AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q\\r\\n"+\r\n"GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz\\r\\n"+\r\n"Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2\\r\\n"+\r\n"G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi\\r\\n"+\r\n"l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3\\r\\n"+\r\n"smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==\\r\\n"+\r\n"-----END CERTIFICATE-----";\r\nString MyHttpsGet(String url){\r\n  HTTPClient http;\r\n  String result;\r\n  http.begin(url,cat.c_str());\r\n  int httpCode=http.GET();\r\n  if(httpCode>0){\r\n     result=http.getString();\r\n  }\r\n  http.end();\r\n  return result;\r\n}', '', 'webserver'),
(7942, 20, 'esp32舵机', '#include <ESP32Servo.h>\r\nServo servo1;\r\nint minUs = 500;   //0度是脉宽,单位us\r\nint maxUs = 2500;  //180度脉宽,单位us\r\nint servo1Pin = 15;\r\nvoid setup() {\r\n  // put your setup code here, to run once:\r\n  Serial.begin(115200);\r\n  ESP32PWM::allocateTimer(0);  //指定使用的硬件定时器 esp32有4个\r\n  servo1.setPeriodHertz(50);   //指定PWM频率\r\n  servo1.attach(servo1Pin, minUs, maxUs);\r\n  servo1.write(90);  //转到指定角度(0-180);\r\n  servo1.detach();   //不需要的时候将引脚和ledc分离\r\n}\r\n\r\nvoid loop() {\r\n  // put your main code here, to run repeatedly:\r\n}\r\n', '', 'webserver'),
(7943, 20, 'ESP32 WIFI 舵机', '#include <Arduino.h>\r\n#include <WiFi.h>\r\n#include <WiFiMulti.h>\r\n#include <WiFiClientSecure.h>\r\n#include <WebSocketsClient.h>\r\n#include <ESP32Servo.h>\r\n#include <WebServer.h>\r\n#include <HTTPClient.h>\r\n#include <FS.h>\r\n#include "SPIFFS.h"\r\n#include "ESPmDNS.h"\r\n#include <Ticker.h>\r\n#include <ArduinoJson.h>\r\nServo servo1;\r\nint minUs = 500;   //0度是脉宽,单位us\r\nint maxUs = 2500;  //180度脉宽,单位us\r\nint servo1Pin = 15;\r\nint thisOpt=0;//当前角度\r\n\r\nTicker myTicker;\r\nDynamicJsonDocument  jsonBuffer(100);\r\nJsonObject desJson;\r\n//被读取的文件位置和名称\r\nString flash_wifi = "/wifi.txt";\r\nWebServer webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString ssid = "";\r\nString passwd = "";\r\nString html;\r\n\r\nWiFiMulti WiFiMulti;\r\nWebSocketsClient webSocket;\r\n\r\n#define USE_SERIAL Serial1\r\n\r\nvoid hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {\r\n  const uint8_t* src = (const uint8_t*) mem;\r\n  USE_SERIAL.printf("\\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);\r\n  for (uint32_t i = 0; i < len; i++) {\r\n    if (i % cols == 0) {\r\n      USE_SERIAL.printf("\\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);\r\n    }\r\n    USE_SERIAL.printf("%02X ", *src);\r\n    src++;\r\n  }\r\n  USE_SERIAL.printf("\\n");\r\n}\r\n\r\nvoid webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {\r\n\r\n  switch (type) {\r\n    case WStype_DISCONNECTED:\r\n      USE_SERIAL.printf("[WSc] Disconnected!\\n");\r\n      break;\r\n    case WStype_CONNECTED:\r\n      USE_SERIAL.printf("[WSc] Connected to url: %s\\n", payload);\r\n\r\n      // send message to server when Connected\r\n      webSocket.sendTXT("Connected");\r\n      break;\r\n    case WStype_TEXT:\r\n      USE_SERIAL.printf("[WSc] get text: %s\\n", payload);\r\n      deserializeJson(jsonBuffer, payload);\r\n      desJson = jsonBuffer.as<JsonObject>();\r\n      if (desJson["message"] != "") {\r\n        String str = desJson["message"];\r\n        Serial.println(str);\r\n        if(str=="+"){\r\n          if(thisOpt <=175){\r\n             thisOpt=thisOpt+5;\r\n             servo1.write(thisOpt);\r\n          }\r\n        }\r\n        if(str=="-"){\r\n          if(thisOpt<=5){\r\n             thisOpt=thisOpt-5;\r\n             servo1.write(thisOpt);\r\n          }\r\n        }\r\n        str=String(thisOpt);\r\n        webSocket.sendTXT(str);\r\n      }\r\n      // send message to server\r\n\r\n      break;\r\n    case WStype_BIN:\r\n      USE_SERIAL.printf("[WSc] get binary length: %u\\n", length);\r\n      hexdump(payload, length);\r\n\r\n      // send data to server\r\n      // webSocket.sendBIN(payload, length);\r\n      break;\r\n    case WStype_PING:\r\n      // pong will be send automatically\r\n      Serial.printf("[WSc] get ping\\n");\r\n      break;\r\n    case WStype_PONG:\r\n      // answer to a ping we send\r\n      Serial.printf("[WSc] get pong\\n");\r\n      break;\r\n\r\n    case WStype_ERROR:\r\n    case WStype_FRAGMENT_TEXT_START:\r\n    case WStype_FRAGMENT_BIN_START:\r\n    case WStype_FRAGMENT:\r\n    case WStype_FRAGMENT_FIN:\r\n      break;\r\n  }\r\n\r\n}\r\n\r\nvoid setup() {\r\n  // USE_SERIAL.begin(921600);\r\n  USE_SERIAL.begin(115200);\r\n\r\n  //Serial.setDebugOutput(true);\r\n  USE_SERIAL.setDebugOutput(true);\r\n\r\n  USE_SERIAL.println();\r\n  USE_SERIAL.println();\r\n  USE_SERIAL.println();\r\n\r\n  for (uint8_t t = 4; t > 0; t--) {\r\n    USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\\n", t);\r\n    USE_SERIAL.flush();\r\n    delay(1000);\r\n  }\r\n\r\n  if (FlashConnetWifi() == false) {\r\n    HtmlSetWifi();\r\n  }\r\n  ESP32PWM::allocateTimer(0);  //指定使用的硬件定时器 esp32有4个\r\n  servo1.setPeriodHertz(50);   //指定PWM频率\r\n  servo1.attach(servo1Pin, minUs, maxUs);\r\n  //WiFi.disconnect();\r\n\r\n  // server address, port and URL\r\n  webSocket.begin("192.168.0.254", 80, "/service/wss");\r\n\r\n  // event handler\r\n  webSocket.onEvent(webSocketEvent);\r\n\r\n  // use HTTP Basic Authorization this is optional remove if not needed\r\n  webSocket.setAuthorization("user=mg996r&password=efghijk&room=root");\r\n\r\n  // try ever 5000 again if connection has failed\r\n  webSocket.setReconnectInterval(5000);\r\n\r\n}\r\n\r\nvoid loop() {\r\n  webSocket.loop();\r\n}\r\n\r\n\r\n\r\nvoid HtmlSetWifi() {\r\n  WifiScan();\r\n  ApOpen();\r\n  delay(1000);\r\n  Serial.println("启动网页");\r\n  //5分后重启 防止停电后复电，路由器连接WIFI速度慢于ESP导致ESP连接不到路由器进入无限AP模式，所以这里只让AP激活5分钟后就重启\r\n  myTicker.once(300, EspRestart);\r\n  delay(200);\r\n  WebServerOpen();\r\n  while (1) {\r\n    webServer.handleClient();   // 检查网络服务请求并处理\r\n  }\r\n}\r\nvoid EspRestart() {\r\n  ESP.restart();\r\n}\r\n//扫描附件WIFI\r\nvoid WifiScan() {\r\n  Serial.begin(115200);\r\n  WiFi.mode(WIFI_STA);\r\n  WiFi.disconnect();\r\n  delay(500);\r\n  int n = WiFi.scanNetworks();\r\n  if (n > 0) {\r\n    Serial.println(n);\r\n    String a =  "附近WiFi <select id=\\"ssid\\">";\r\n    for (int i = 0; i < n; i++) {\r\n      Serial.println(WiFi.SSID(i));\r\n      a = a +  "<option value=\\"" + WiFi.SSID(i) + "\\">" + WiFi.SSID(i) + "</option>";\r\n      delay(50);\r\n    }\r\n    String HtmlStart = String("") + "<!DOCTYPE html>" +\r\n                       "<html>" +\r\n                       "<head>" +\r\n                       "<meta charset=\\"utf-8\\">" +\r\n                       "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />" +\r\n                       "<title>设置WiFi</title>" +\r\n                       "<link rel=\\"stylesheet\\" href=\\"\\">" +\r\n                       "</head>" +\r\n                       "<script>" +\r\n                       "onload  = function() {" +\r\n                       "document.getElementById(\\"up\\").onclick = function(){" +\r\n                       "var ssida=document.getElementById(\\"ssid\\").value;" +\r\n                       "var ssid=ssida.replace(/\\\\s+/g, \\" \\");" +\r\n                       "var passwda=document.getElementsByTagName(''input'')[0].value;" +\r\n                       "var passwd=passwda.replace(/\\\\s+/g, \\" \\");" +\r\n                       "xhr = new XMLHttpRequest();" +\r\n                       "xhr.open(\\"POST\\",\\"./SetWifi\\",true);" +\r\n                       "var posts = (\\"ssid=\\"+ssid+\\"&passwd=\\"+ passwd);" +\r\n                       "xhr.setRequestHeader(\\"Content-Type\\",\\"application/x-www-form-urlencoded\\");" +\r\n                       "xhr.send(posts);" +\r\n                       "xhr.onreadystatechange = function(){" +\r\n                       "if(this.readyState == 4 && this.status == 200){" +\r\n                       "alert(this.responseText);" +\r\n                       "}" +\r\n                       "}" +\r\n                       "}" +\r\n                       "}" +\r\n                       "</script>" +\r\n                       "<body>";\r\n    String HtmlEnd = String("") + "<p>WiFi密码<input type=\\"text\\" id=\\"passwd\\"></p>" +\r\n                     "<input type=\\"submit\\" id=\\"up\\" value=\\"设 置\\">" +\r\n                     "<hr/>" +\r\n                     "<div>如果附近WiFi没有显示到自己的WIFI<div>" +\r\n                     "<div>请重启或离信号近点</div>" +\r\n                     "<div>连接成功AP热点退出转WIFI_STA</div>" +\r\n                     "</body>" +\r\n                     "</html>";\r\n    a = a +  "</select>";\r\n    html = HtmlStart + a + HtmlEnd;\r\n  } else {\r\n    html = "no wifis";\r\n    Serial.println("no wifis");\r\n  }\r\n}\r\nvoid SetWifi() {\r\n  ssid = webServer.arg(0);\r\n  passwd = webServer.arg(1);\r\n  const char* Ssid = ssid.c_str();\r\n  const char* Passwd = passwd.c_str();\r\n  String sp = ssid + "&" + passwd;\r\n\r\n  Serial.println(sp);\r\n  Serial.begin(115200);\r\n  delay(500);\r\n  WiFi.begin(Ssid, Passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      webServer.send(200, "text/plane", "Wifi密码正确，ESP准备重启");\r\n      webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flash_wifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML连接成功");\r\n      delay(1000);\r\n      ESP.restart();\r\n    }\r\n  }\r\n  webServer.send(200, "text/plane", "Wifi密码错误，请重新输入");\r\n  //HtmlSetWifi();\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  webServer.send(200, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\n\r\n\r\nvoid ApOpen() {\r\n  Serial.begin(115200);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet) ;\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid WebServerOpen() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  webServer.begin(); // 启用网络服务\r\n  webServer.on("/", handleRoot);   // / 在HTTP中，表示请求首页服务，\r\n  webServer.on("/SetWifi", SetWifi);\r\n  webServer.onNotFound(handleNotFound);    // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\n\r\nbool FlashConnetWifi() {\r\n  Serial.begin(115200);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flash_wifi) == false) {\r\n    Serial.print(flash_wifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flash_wifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  const char* WifiName = wifiname.c_str();\r\n  const char* WifiPw = wifipw.c_str();\r\n  Serial.println(WifiName);\r\n  Serial.println(WifiPw);\r\n  WiFi.begin(WifiName, WifiPw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("FlashConnetWifi->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("FlashConnetWifi 闪存配置连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("FlashConnetWifi->false");\r\n  return false;\r\n}', '', 'webserver'),
(7944, 555, '过敏性咳嗽，咳嗽频率搞', '富马酸酮替芬片', '', 'webserver'),
(7946, 344, '天气预报API', '城市代码获取方法：\r\n1 选择省份：http://weather.cma.cn/api/dict/province\r\n2 选择城市：  http://weather.cma.cn/api/dict/province/AHN\r\n', '', 'webserver'),
(7948, 20, 'nodeMCU32s和INMP441将声音通过websocket传输 ', '/*\r\n * WebSocketClient.ino\r\n *\r\n *  Created on: 24.05.2015\r\n *\r\n */\r\n\r\n#include <Arduino.h>\r\n\r\n#include <WiFi.h>\r\n#include <WiFiMulti.h>\r\n#include <WiFiClientSecure.h>\r\n\r\n#include <WebSocketsClient.h>\r\n#include <driver/i2s.h>\r\n#include <ArduinoJson.h>\r\n\r\n#define d17 17\r\n\r\nconst int headerSize = 44;  // wave header size\r\n\r\nWiFiMulti WiFiMulti;\r\nWebSocketsClient webSocket;\r\nDynamicJsonDocument jsonBuffer(1024);\r\nJsonObject jsonb;\r\nbool bl;\r\nvoid hexdump(const void* mem, uint32_t len, uint8_t cols = 16) {\r\n  const uint8_t* src = (const uint8_t*)mem;\r\n  Serial.printf("\\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);\r\n  for (uint32_t i = 0; i < len; i++) {\r\n    if (i % cols == 0) {\r\n      Serial.printf("\\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);\r\n    }\r\n    Serial.printf("%02X ", *src);\r\n    src++;\r\n  }\r\n  Serial.printf("\\n");\r\n}\r\n\r\nvoid webSocketEvent(WStype_t type, uint8_t* payload, size_t length) {\r\n\r\n  switch (type) {\r\n    case WStype_DISCONNECTED:\r\n      Serial.printf("[WSc] Disconnected!\\n");\r\n      break;\r\n    case WStype_CONNECTED:\r\n      Serial.printf("[WSc] Connected to url: %s\\n", payload);\r\n\r\n      // send message to server when Connected\r\n      //webSocket.sendTXT("Connected");\r\n      break;\r\n    case WStype_TEXT:\r\n      Serial.printf("[WSc] get text: %s\\n", payload);\r\n      deserializeJson(jsonBuffer, payload);\r\n      jsonb = jsonBuffer.as<JsonObject>();\r\n\r\n\r\n\r\n      break;\r\n    case WStype_BIN:\r\n      Serial.printf("[WSc] get binary length: %u\\n", length);\r\n      hexdump(payload, length);\r\n\r\n      // send data to server\r\n      // webSocket.sendBIN(payload, length);\r\n      break;\r\n    case WStype_ERROR:\r\n    case WStype_FRAGMENT_TEXT_START:\r\n    case WStype_FRAGMENT_BIN_START:\r\n    case WStype_FRAGMENT:\r\n    case WStype_FRAGMENT_FIN:\r\n      break;\r\n  }\r\n}\r\n\r\nvoid setup() {\r\n  // Serial.begin(921600);\r\n  Serial.begin(115200);\r\n  pinMode(d17, INPUT_PULLUP);\r\n  digitalWrite(d17, HIGH);\r\n\r\n\r\n  Serial.println();\r\n  Serial.println();\r\n  Serial.println();\r\n  //SPIFFSInit();\r\n  // 初始化I2S接口\r\n  i2s_config_t i2sConfig = {\r\n    .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),\r\n    .sample_rate = 16000,  // 采样率\r\n    .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,\r\n    .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,\r\n    .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),\r\n    .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,\r\n    .dma_buf_count = 4,\r\n    .dma_buf_len = 8\r\n  };\r\n\r\n  i2s_pin_config_t pinConfig = {\r\n    .bck_io_num = 2,     // BCK引脚\r\n    .ws_io_num = 15,     // WS引脚\r\n    .data_out_num = -1,  // 不输出音频数据\r\n    .data_in_num = 13    // DATA输入引脚\r\n  };\r\n\r\n  i2s_driver_install(I2S_NUM_0, &i2sConfig, 0, NULL);\r\n\r\n  i2s_set_pin(I2S_NUM_0, &pinConfig);\r\n\r\n\r\n  for (uint8_t t = 4; t > 0; t--) {\r\n    Serial.printf("[SETUP] BOOT WAIT %d...\\n", t);\r\n    Serial.flush();\r\n    delay(1000);\r\n  }\r\n\r\n  WiFiMulti.addAP("webserver", "www.360xyz.cn");\r\n\r\n  while (WiFiMulti.run() != WL_CONNECTED) {\r\n    delay(100);\r\n  }\r\n\r\n  webSocket.begin("192.168.0.3", 100, "/service/wss");\r\n  webSocket.onEvent(webSocketEvent);\r\n  webSocket.setAuthorization("user=client1&passwd=123456789");\r\n  webSocket.setReconnectInterval(5000);\r\n}\r\n\r\nvoid loop() {\r\n  webSocket.loop();\r\n  if (digitalRead(d17) == LOW) {\r\n    if (bl == false) {\r\n      //String str3 = "3";\r\n      bl = true;\r\n      webSocket.sendTXT("start");\r\n    } else {\r\n      Serial.println("audio add");\r\n      size_t bytesRead;\r\n      int16_t buffer[1024];\r\n      int8_t d_buff[1024];\r\n\r\n      // 从I2S接口读取音频数据\r\n      i2s_read(I2S_NUM_0, (void*)buffer, sizeof(buffer), &bytesRead, portMAX_DELAY);\r\n      webSocket.sendBIN((uint8_t*)buffer, sizeof(buffer));\r\n      delay(10);\r\n    }\r\n  } else if (bl == true) {\r\n    Serial.println("audio end");\r\n      bl = false;\r\n    //String str4 = "4";\r\n    webSocket.sendTXT("end");\r\n  }\r\n}\r\n', '', 'webserver'),
(7950, 20, 'esp32与MAX98357串口发送连接播放MP3', '// Welcome to www.LingShunLAB.com\r\n\r\n#include "Arduino.h"\r\n#include "WiFiMulti.h"\r\n#include "Audio.h"\r\n\r\n// Digital I/O used\r\n#define I2S_DOUT      25\r\n#define I2S_BCLK      27\r\n#define I2S_LRC       26\r\n\r\nAudio audio;\r\nWiFiMulti wifiMulti;\r\n\r\n// config your wifi\r\nString ssid =     "webserver";\r\nString password = "www.360xyz.cn";\r\n\r\nvoid setup() {\r\n\r\n    Serial.begin(115200);\r\n\r\n    WiFi.mode(WIFI_STA);\r\n    wifiMulti.addAP(ssid.c_str(), password.c_str());\r\n    wifiMulti.run();\r\n    if(WiFi.status() != WL_CONNECTED){\r\n        WiFi.disconnect(true);\r\n        wifiMulti.run();\r\n    }\r\n    audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);\r\n    audio.setVolume(12); // 0...21\r\n\r\n    audio.connecttohost("http://192.168.0.254/tool/music/l4vtr-t3c4b.mp3"); //  128k mp3\r\n}\r\n\r\nvoid loop()\r\n{\r\n    audio.loop();\r\n    if(Serial.available()){ // put streamURL in serial monitor\r\n        audio.stopSong();\r\n        String r=Serial.readString(); r.trim();\r\n        if(r.length()>5) audio.connecttohost(r.c_str());\r\n        log_i("free heap=%i", ESP.getFreeHeap());\r\n    }\r\n}\r\n\r\n// optional\r\nvoid audio_info(const char *info){\r\n    Serial.print("info        "); Serial.println(info);\r\n}\r\nvoid audio_id3data(const char *info){  //id3 metadata\r\n    Serial.print("id3data     ");Serial.println(info);\r\n}\r\nvoid audio_eof_mp3(const char *info){  //end of file\r\n    Serial.print("eof_mp3     ");Serial.println(info);\r\n}\r\nvoid audio_showstation(const char *info){\r\n    Serial.print("station     ");Serial.println(info);\r\n}\r\nvoid audio_showstreamtitle(const char *info){\r\n    Serial.print("streamtitle ");Serial.println(info);\r\n}\r\nvoid audio_bitrate(const char *info){\r\n    Serial.print("bitrate     ");Serial.println(info);\r\n}\r\nvoid audio_commercial(const char *info){  //duration in sec\r\n    Serial.print("commercial  ");Serial.println(info);\r\n}\r\nvoid audio_icyurl(const char *info){  //homepage\r\n    Serial.print("icyurl      ");Serial.println(info);\r\n}\r\nvoid audio_lasthost(const char *info){  //stream URL played\r\n    Serial.print("lasthost    ");Serial.println(info);\r\n}', '', 'webserver'),
(7952, 20, 'I2S协议驱动INMP441数字麦克风 实现语音采集 ', '/*\r\n * WebSocketClient.ino\r\n *\r\n *  Created on: 24.05.2015\r\n *\r\n */\r\n\r\n#include <Arduino.h>\r\n\r\n#include <WiFi.h>\r\n#include <WiFiMulti.h>\r\n#include <WiFiClientSecure.h>\r\n\r\n#include <WebSocketsClient.h>\r\n#include <driver/i2s.h>\r\n#include <SPIFFS.h>\r\n\r\n\r\n#define d17 17\r\nFile file;\r\nconst char filename[] = "/recording.wav";\r\nconst int headerSize = 44;  // wave header size\r\n\r\nWiFiMulti WiFiMulti;\r\nWebSocketsClient webSocket;\r\n\r\n#define USE_SERIAL Serial1\r\nbool bl;\r\nvoid hexdump(const void* mem, uint32_t len, uint8_t cols = 16) {\r\n  const uint8_t* src = (const uint8_t*)mem;\r\n  USE_SERIAL.printf("\\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);\r\n  for (uint32_t i = 0; i < len; i++) {\r\n    if (i % cols == 0) {\r\n      USE_SERIAL.printf("\\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);\r\n    }\r\n    USE_SERIAL.printf("%02X ", *src);\r\n    src++;\r\n  }\r\n  USE_SERIAL.printf("\\n");\r\n}\r\n\r\nvoid webSocketEvent(WStype_t type, uint8_t* payload, size_t length) {\r\n\r\n  switch (type) {\r\n    case WStype_DISCONNECTED:\r\n      USE_SERIAL.printf("[WSc] Disconnected!\\n");\r\n      break;\r\n    case WStype_CONNECTED:\r\n      USE_SERIAL.printf("[WSc] Connected to url: %s\\n", payload);\r\n\r\n      // send message to server when Connected\r\n      webSocket.sendTXT("Connected");\r\n      break;\r\n    case WStype_TEXT:\r\n      USE_SERIAL.printf("[WSc] get text: %s\\n", payload);\r\n\r\n      // send message to server\r\n      // webSocket.sendTXT("message here");\r\n      break;\r\n    case WStype_BIN:\r\n      USE_SERIAL.printf("[WSc] get binary length: %u\\n", length);\r\n      hexdump(payload, length);\r\n\r\n      // send data to server\r\n      // webSocket.sendBIN(payload, length);\r\n      break;\r\n    case WStype_ERROR:\r\n    case WStype_FRAGMENT_TEXT_START:\r\n    case WStype_FRAGMENT_BIN_START:\r\n    case WStype_FRAGMENT:\r\n    case WStype_FRAGMENT_FIN:\r\n      break;\r\n  }\r\n}\r\n\r\nvoid setup() {\r\n  // USE_SERIAL.begin(921600);\r\n  USE_SERIAL.begin(115200);\r\n  pinMode(d17, INPUT_PULLUP);\r\n  digitalWrite(d17, LOW);\r\n  //Serial.setDebugOutput(true);\r\n  USE_SERIAL.setDebugOutput(true);\r\n\r\n  USE_SERIAL.println();\r\n  USE_SERIAL.println();\r\n  USE_SERIAL.println();\r\n  //SPIFFSInit();\r\n  // 初始化I2S接口\r\n  i2s_config_t i2sConfig = {\r\n    .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),\r\n    .sample_rate = 16000,  // 采样率\r\n    .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,\r\n    .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,\r\n    .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),\r\n    .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,\r\n    .dma_buf_count = 4,\r\n    .dma_buf_len = 8\r\n  };\r\n\r\n  i2s_pin_config_t pinConfig = {\r\n    .bck_io_num = 2,    // BCK引脚\r\n    .ws_io_num = 15,     // WS引脚\r\n    .data_out_num = -1,  // 不输出音频数据\r\n    .data_in_num = 13    // DATA输入引脚\r\n  };\r\n\r\n  i2s_driver_install(I2S_NUM_0, &i2sConfig, 0, NULL);\r\n\r\n  i2s_set_pin(I2S_NUM_0, &pinConfig);\r\n\r\n\r\n  for (uint8_t t = 4; t > 0; t--) {\r\n    USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\\n", t);\r\n    USE_SERIAL.flush();\r\n    delay(1000);\r\n  }\r\n\r\n  WiFiMulti.addAP("webserver", "www.360xyz.cn");\r\n\r\n  //WiFi.disconnect();\r\n  while (WiFiMulti.run() != WL_CONNECTED) {\r\n    delay(100);\r\n  }\r\n\r\n  // server address, port and URL\r\n  webSocket.begin("192.168.0.3", 100, "/service/wss");\r\n\r\n  // event handler\r\n\r\n  webSocket.onEvent(webSocketEvent);\r\n\r\n  // use HTTP Basic Authorization this is optional remove if not needed\r\n  webSocket.setAuthorization("user=client1&passwd=123456789");\r\n\r\n\r\n  // try ever 5000 again if connection has failed\r\n  webSocket.setReconnectInterval(5000);\r\n}\r\n\r\nvoid loop() {\r\n  webSocket.loop();\r\n    if (digitalRead(d17) == LOW) {\r\n    if (bl == false) {\r\n      //String str3 = "3";\r\n      bl = true;\r\n      webSocket.sendTXT("start");\r\n    } else {\r\n      Serial.println("audio add");\r\n      size_t bytesRead;\r\n      int16_t buffer[1024];\r\n      int8_t d_buff[1024];\r\n\r\n      // 从I2S接口读取音频数据\r\n      i2s_read(I2S_NUM_0, (void *)buffer, sizeof(buffer), &bytesRead, portMAX_DELAY);\r\n      webSocket.sendBIN((uint8_t *)buffer, sizeof(buffer));\r\n      delay(10);\r\n    }\r\n  } else if (bl == true) {\r\n    Serial.println("audio end");\r\n    bl = false;\r\n    //String str4 = "4";\r\n    webSocket.sendTXT("end");\r\n  }\r\n\r\n}\r\n', '', 'webserver'),
(7957, 344, 'golang 直接播放wav', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"log"\r\n	"os"\r\n\r\n	"github.com/faiface/beep"\r\n	"github.com/faiface/beep/wav"\r\n)\r\n\r\nfunc main() {\r\n	f, err := os.Open("audio.wav")\r\n	if err != nil {\r\n		log.Fatal(err)\r\n	}\r\n\r\n	streamer, format, err := wav.Decode(f)\r\n	if err != nil {\r\n		log.Fatal(err)\r\n	}\r\n	defer streamer.Close()\r\n\r\n	speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))\r\n\r\n	done := make(chan bool)\r\n	speaker.Play(beep.Seq(streamer, beep.Callback(func() {\r\n		done <- true\r\n	})))\r\n\r\n	fmt.Println("Playing audio...")\r\n	<-done\r\n	fmt.Println("Audio playback complete.")\r\n}\r\n', '', 'webserver'),
(7958, 344, 'golang 直接播放mp3', 'package main\r\n\r\nimport (\r\n	"fmt"\r\n	"log"\r\n	"os"\r\n	"time"\r\n\r\n	"github.com/faiface/beep"\r\n	"github.com/faiface/beep/mp3"\r\n	"github.com/faiface/beep/speaker"\r\n)\r\n\r\nfunc main() {\r\n	f, err := os.Open("audio.mp3")\r\n	if err != nil {\r\n		log.Fatal(err)\r\n	}\r\n\r\n	streamer, format, err := mp3.Decode(f)\r\n	if err != nil {\r\n		log.Fatal(err)\r\n	}\r\n	defer streamer.Close()\r\n\r\n	speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))\r\n\r\n	done := make(chan bool)\r\n	speaker.Play(beep.Seq(streamer, beep.Callback(func() {\r\n		done <- true\r\n	})))\r\n\r\n	fmt.Println("Playing audio...")\r\n	<-done\r\n	fmt.Println("Audio playback complete.")\r\n}\r\n', '', 'webserver'),
(7959, 20, '校园智能防欺凌系统', '#include <Arduino.h>\r\n#include <WiFi.h>\r\n#include <WiFiMulti.h>\r\n#include <WiFiClientSecure.h>\r\n#include <WebSocketsClient.h>\r\n#include <driver/i2s.h>\r\n#include <ArduinoJson.h>\r\n#include <FS.h>\r\n#include "SPIFFS.h"\r\n#include "ESPmDNS.h"\r\n#include <Ticker.h>\r\n#include <WebServer.h>\r\n#include <HTTPClient.h>\r\n\r\n#define d17 17\r\nconst int headerSize = 44;  // wave header size\r\nWiFiMulti WiFiMulti;\r\nWebSocketsClient webSocket;\r\nDynamicJsonDocument jsonBuffer(1024);\r\nJsonObject jsonb;\r\nString EventStr;\r\nchar *result;\r\nbool bl;\r\n// Digital I/O used\r\n#define I2S_DOUT 25\r\n#define I2S_BCLK 27\r\n#define I2S_LRC 26\r\n\r\nTicker myTicker;\r\n//被读取的文件位置和名称\r\nString flashWifi = "/wifi.txt";\r\nWebServer webServer(80);  // 创建网络服务器对象，HTTP服务的标准端口为：80\r\nString ssid = "";\r\nString passwd = "";\r\nString html;\r\nint botelu = 115200;\r\nvoid HtmlSetWifi() {\r\n  WifiScan();\r\n  apStart();\r\n  delay(1000);\r\n  Serial.println("启动网页配置网络");\r\n  //5分后重启 防止停电后复电，路由器连接WIFI速度慢于ESP导致ESP连接不到路由器进入无限AP模式，所以这里只让AP激活5分钟后就重启\r\n  myTicker.once(300, EspStart);\r\n  delay(200);\r\n  webserverStart();\r\n  while (1) {\r\n    webServer.handleClient();  // 检查网络服务请求并处理\r\n  }\r\n}\r\n\r\n\r\nvoid EspStart() {\r\n  ESP.restart();\r\n}\r\n//扫描附件WIFI\r\nvoid WifiScan() {\r\n  Serial.begin(botelu);\r\n  WiFi.disconnect();\r\n  WiFi.mode(WIFI_STA);\r\n  delay(100);\r\n  int n = WiFi.scanNetworks();\r\n  if (n > 0) {\r\n    Serial.println(n);\r\n    String a = "附近WiFi <select id=\\"ssid\\">";\r\n    for (int i = 0; i < n; i++) {\r\n      Serial.println(WiFi.SSID(i));\r\n      a = a + "<option value=\\"" + WiFi.SSID(i) + "\\">" + WiFi.SSID(i) + "</option>";\r\n      delay(50);\r\n    }\r\n    String HtmlStart = String("") + "<!DOCTYPE html>" + "<html>" + "<head>" + "<meta charset=\\"utf-8\\">" + "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />" + "<title>设置WiFi</title>" + "<link rel=\\"stylesheet\\" href=\\"\\">" + "</head>" + "<script>" + "onload  = function() {" + "document.getElementById(\\"up\\").onclick = function(){" + "var ssida=document.getElementById(\\"ssid\\").value;" + "var ssid=ssida.replace(/\\\\s+/g, \\" \\");" + "var passwda=document.getElementsByTagName(''input'')[0].value;" + "var passwd=passwda.replace(/\\\\s+/g, \\" \\");" + "xhr = new XMLHttpRequest();" + "xhr.open(\\"POST\\",\\"./setWifi\\",true);" + "var posts = (\\"ssid=\\"+ssid+\\"&passwd=\\"+ passwd);" + "xhr.setRequestHeader(\\"Content-Type\\",\\"application/x-www-form-urlencoded\\");" + "xhr.send(posts);" + "xhr.onreadystatechange = function(){" + "if(this.readyState == 4 && this.status == 200){" + "alert(this.responseText);" + "}" + "}" + "}" + "}" + "</script>" + "<body>";\r\n    String HtmlEnd = String("") + "<p>WiFi密码<input type=\\"text\\" id=\\"passwd\\"></p>" + "<input type=\\"submit\\" id=\\"up\\" value=\\"设 置\\">" + "<hr/>" + "<div>如果附近WiFi没有显示到自己的WIFI<div>" + "<div>请重启或离信号近点</div>" + "<div>连接成功AP热点退出转WIFI_STA</div>" + "</body>" + "</html>";\r\n    a = a + "</select>";\r\n    html = HtmlStart + a + HtmlEnd;\r\n  } else {\r\n    html = "扫描不到网络";\r\n    Serial.println("扫描不到网络");\r\n  }\r\n}\r\nvoid setWifi() {\r\n  ssid = webServer.arg(0);\r\n  passwd = webServer.arg(1);\r\n  const char *Ssid = ssid.c_str();\r\n  const char *Passwd = passwd.c_str();\r\n  String sp = ssid + "&" + passwd;\r\n\r\n  Serial.println(sp);\r\n  Serial.begin(botelu);\r\n  delay(500);\r\n  WiFi.begin(Ssid, Passwd);\r\n  WiFi.mode(WIFI_STA);\r\n  delay(200);\r\n  Serial.println("wifi_connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(".");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      webServer.send(200, "text/plane", "Wifi密码正确,ESP准备重启");\r\n      webServer.close();\r\n      delay(500);\r\n      WiFi.disconnect();\r\n      delay(500);\r\n      //写入数据\r\n      SPIFFS.format();\r\n      delay(500);\r\n      SPIFFS.begin();\r\n      File dataFile = SPIFFS.open(flashWifi, "w");\r\n      dataFile.println(sp);\r\n      dataFile.close();\r\n      Serial.println("HTML设置网络连接成功");\r\n      delay(1000);\r\n      ESP.restart();\r\n    }\r\n  }\r\n  webServer.send(200, "text/plane", "Wifi密码错误,请重新输入");\r\n}\r\n//------- 展示页面-------\r\nvoid handleRoot() {\r\n  webServer.send(500, "text/html", html);\r\n}\r\nvoid handleNotFound(void) {\r\n  webServer.send(404, "text/plain", "404-The page is not Found!");\r\n}\r\n\r\n\r\nvoid apStart() {\r\n  Serial.begin(botelu);\r\n  WiFi.mode(WIFI_AP);\r\n  IPAddress local_IP(192, 168, 168, 2);\r\n  IPAddress gateway(192, 168, 168, 1);\r\n  IPAddress subnet(255, 255, 255, 0);\r\n  WiFi.softAPConfig(local_IP, gateway, subnet);\r\n\r\n  //启动AP模式，并设置账号和密码\r\n  boolean result = WiFi.softAP("192.168.168.2", "192.168.168.2");\r\n  if (result) {\r\n    //输出 soft-ap ip地址\r\n    //Serial.println(String("Soft-AP IP address = ") + WiFi.softAPIP());\r\n  }\r\n}\r\nvoid webserverStart() {\r\n  //-----------------启动webserver网络服务--------------------\r\n  webServer.begin();              // 启用网络服务\r\n  webServer.on("/", handleRoot);  // / 在HTTP中，表示请求首页服务，\r\n  webServer.on("/setWifi", setWifi);\r\n  webServer.onNotFound(handleNotFound);  // 当服务器没找到所需的服务，调用404函数\r\n  Serial.println("webserver started");\r\n}\r\n\r\nbool FlashConnetWifi() {\r\n  Serial.begin(botelu);\r\n  delay(500);\r\n  //是否存在数据\r\n  SPIFFS.begin();\r\n  if (SPIFFS.exists(flashWifi) == false) {\r\n    Serial.print(flashWifi);\r\n    Serial.println(" NOT FOUND");\r\n    return false;\r\n  }\r\n\r\n  File dateFile = SPIFFS.open(flashWifi, "r");\r\n  String result;\r\n  for (int i = 0; i < dateFile.size(); i++) {\r\n    //Serial.print((char)dateFile.read());\r\n    result += (char)dateFile.read();\r\n  }\r\n  //去除前后空格\r\n  result.trim();\r\n  Serial.println(result);\r\n  int i = result.indexOf("&");\r\n\r\n  String wifiname = result.substring(0, i);\r\n  String wifipw = result.substring(i + 1);\r\n  const char *WifiName = wifiname.c_str();\r\n  const char *WifiPw = wifipw.c_str();\r\n  Serial.println(WifiName);\r\n  Serial.println(WifiPw);\r\n  WiFi.begin(WifiName, WifiPw);\r\n  delay(500);\r\n  WiFi.mode(WIFI_STA);\r\n  Serial.println("FlashConnetWifi->connet");\r\n  int ii = 0;\r\n  for (ii; ii < 20; ii++) {\r\n    delay(500);\r\n    Serial.print(" . ");\r\n    if (WiFi.status() == WL_CONNECTED) {\r\n      Serial.println("闪存读取,连接成功");\r\n      return true;\r\n    }\r\n  }\r\n  Serial.println("闪存读取,连接失败");\r\n  return false;\r\n}\r\n\r\n#define FLASH_RECORD_SIZE (I2S_CHANNEL_NUM * I2S_SAMPLE_RATE * I2S_SAMPLE_BITS / 8 * RECORD_TIME)\r\nvoid hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {\r\n  const uint8_t *src = (const uint8_t *)mem;\r\n  Serial.printf("\\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);\r\n  for (uint32_t i = 0; i < len; i++) {\r\n    if (i % cols == 0) {\r\n      Serial.printf("\\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);\r\n    }\r\n    Serial.printf("%02X ", *src);\r\n    src++;\r\n  }\r\n  Serial.printf("\\n");\r\n}\r\n\r\nvoid webSocketEvent(WStype_t type, uint8_t *payload, size_t length) {\r\n\r\n  switch (type) {\r\n    case WStype_DISCONNECTED:\r\n      Serial.printf("[WSc] Disconnected!\\n");\r\n      break;\r\n    case WStype_CONNECTED:\r\n      Serial.printf("[WSc] Connected to url: %s\\n", payload);\r\n\r\n      // send message to server when Connected\r\n      //webSocket.sendTXT("Connected");\r\n      break;\r\n    case WStype_TEXT:\r\n      Serial.printf("[WSc] get text: %s\\n", payload);\r\n      result = "";\r\n      result = reinterpret_cast<char *>(payload);\r\n      EventStr = "";\r\n      EventStr = String(result);\r\n\r\n      if (EventStr == "monitor") {\r\n        byte data[]={0xAA,0x55,0x02,0x55,0xAA};\r\n        Serial.write(data,sizeof(data));\r\n        digitalWrite(d17, LOW);\r\n      }\r\n      if (EventStr == "unmonitor") {\r\n        byte data[]={0xAA,0x55,0x00,0x55,0xAA};\r\n        Serial.write(data,sizeof(data));\r\n       // digitalWrite(d17, HIGH);\r\n      }\r\n      break;\r\n    case WStype_BIN:\r\n      Serial.printf("[WSc] get binary length: %u\\n", length);\r\n      hexdump(payload, length);\r\n\r\n      // webSocket.sendBIN(payload, length);\r\n      break;\r\n    case WStype_ERROR:\r\n    case WStype_FRAGMENT_TEXT_START:\r\n    case WStype_FRAGMENT_BIN_START:\r\n    case WStype_FRAGMENT:\r\n    case WStype_FRAGMENT_FIN:\r\n      break;\r\n  }\r\n}\r\n\r\nvoid setup() {\r\n  // Serial.begin(921600);\r\n  Serial.begin(115200);\r\n  pinMode(d17, INPUT_PULLUP);\r\n  digitalWrite(d17, HIGH);\r\n  Serial.println();\r\n  Serial.println();\r\n  Serial.println();\r\n  //SPIFFSInit();\r\n  // 初始化I2S接口\r\n  i2s_config_t i2sConfig = {\r\n    .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),\r\n    .sample_rate = 16000,  // 采样率\r\n    .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,\r\n    .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,\r\n    .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),\r\n    .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,\r\n    .dma_buf_count = 4,\r\n    .dma_buf_len = 8\r\n  };\r\n\r\n  i2s_pin_config_t pinConfig = {\r\n    .bck_io_num = 2,     // BCK引脚\r\n    .ws_io_num = 15,     // WS引脚\r\n    .data_out_num = -1,  // 不输出音频数据\r\n    .data_in_num = 13    // DATA输入引脚\r\n  };\r\n\r\n  i2s_driver_install(I2S_NUM_0, &i2sConfig, 0, NULL);\r\n\r\n  i2s_set_pin(I2S_NUM_0, &pinConfig);\r\n\r\n\r\n  for (uint8_t t = 4; t > 0; t--) {\r\n    Serial.printf("[SETUP] BOOT WAIT %d...\\n", t);\r\n    Serial.flush();\r\n    delay(1000);\r\n  }\r\n\r\n  if (FlashConnetWifi() == false) {\r\n    HtmlSetWifi();\r\n  }\r\n\r\n  webSocket.begin("192.168.0.250", 100, "/service/wss");\r\n  webSocket.onEvent(webSocketEvent);\r\n  webSocket.setAuthorization("user=client1&passwd=123456789");\r\n  webSocket.setReconnectInterval(5000);\r\n\r\n}\r\n\r\nvoid loop() {\r\n  webSocket.loop();\r\n  if (digitalRead(d17) == LOW) {\r\n    if (bl == false) {\r\n      //String str3 = "3";\r\n      bl = true;\r\n      webSocket.sendTXT("start");\r\n    } else {\r\n      Serial.println("audio add");\r\n      size_t bytesRead;\r\n      int16_t buffer[1024];\r\n      int8_t d_buff[1024];\r\n\r\n      // 从I2S接口读取音频数据\r\n      i2s_read(I2S_NUM_0, (void *)buffer, sizeof(buffer), &bytesRead, portMAX_DELAY);\r\n      webSocket.sendBIN((uint8_t *)buffer, sizeof(buffer));\r\n      delay(10);\r\n    }\r\n  } else if (bl == true) {\r\n    Serial.println("audio end");\r\n    bl = false;\r\n    //String str4 = "4";\r\n    webSocket.sendTXT("end");\r\n  }\r\n}\r\n\r\n// 生成wav header，32bit 位深  byte header[headerSize]; wavHeader(header, FLASH_RECORD_SIZE); // 生成wave header\r\nvoid wavHeader(byte *header, int wavSize) {  // 数字小端格式，字符大端格式\r\n  header[0] = ''R'';\r\n  header[1] = ''I'';\r\n  header[2] = ''F'';\r\n  header[3] = ''F'';\r\n  unsigned int fileSize = wavSize + headerSize - 8;\r\n  header[4] = (byte)(fileSize & 0xFF);  // file size, 4byte integer\r\n  header[5] = (byte)((fileSize >> 8) & 0xFF);\r\n  header[6] = (byte)((fileSize >> 16) & 0xFF);\r\n  header[7] = (byte)((fileSize >> 24) & 0xFF);\r\n  header[8] = ''W'';\r\n  header[9] = ''A'';\r\n  header[10] = ''V'';\r\n  header[11] = ''E'';\r\n  header[12] = ''f'';\r\n  header[13] = ''m'';\r\n  header[14] = ''t'';\r\n  header[15] = '' '';\r\n  header[16] = 0x10;  // length of format data = 16, 4byte integer\r\n  header[17] = 0x00;\r\n  header[18] = 0x00;\r\n  header[19] = 0x00;\r\n  header[20] = 0x01;  // format type:1(PCM), 2byte integer\r\n  header[21] = 0x00;\r\n  header[22] = 0x01;  // channel number:1, 2byte integer\r\n  header[23] = 0x00;\r\n  header[24] = 0x80;  // sample rate:16000=0x00003E80, 4byte integer\r\n  header[25] = 0x3E;\r\n  header[26] = 0x00;\r\n  header[27] = 0x00;\r\n  header[28] = 0x00;  // SampleRate*BitPerSample*ChannelNum/8=16000*32*1/8=64000=0x0000FA00, 4byte integer\r\n  header[29] = 0xFA;\r\n  header[30] = 0x00;\r\n  header[31] = 0x00;\r\n  header[32] = 0x04;  // BitPerSample*ChannelNum/8 = 4, 2byte integer\r\n  header[33] = 0x00;\r\n  header[34] = 0x20;  // BitPerSample:32 = 0x0020, 2byte integer\r\n  header[35] = 0x00;\r\n  header[36] = ''d'';\r\n  header[37] = ''a'';\r\n  header[38] = ''t'';\r\n  header[39] = ''a'';\r\n  header[40] = (byte)(wavSize & 0xFF);\r\n  header[41] = (byte)((wavSize >> 8) & 0xFF);\r\n  header[42] = (byte)((wavSize >> 16) & 0xFF);\r\n  header[43] = (byte)((wavSize >> 24) & 0xFF);\r\n}\r\n// digital to analog：麦克风输入为digital code(binary)， 需要将编码转换成相应的电压值才能播放\r\n// 先转换成电压值\r\n//i2s_adc_data_scale(flash_write_buff, (uint8_t*)i2s_read_buff, i2s_read_len);\r\n// file.write((const byte*)  flash_write_buff, i2s_read_len);\r\nvoid i2s_adc_data_scale(uint8_t *d_buff, uint8_t *s_buff, uint32_t len) {\r\n  uint32_t j = 0;\r\n  uint32_t dac_value = 0;\r\n  // 一个采样点是4byte，每4个byte\r\n  for (int i = 0; i < len; i += 4) {\r\n    dac_value = ((((uint16_t)(s_buff[i + 3] & 0xf) << 8) | ((s_buff[i + 2]))));\r\n    d_buff[j++] = 0;\r\n    d_buff[j++] = 0;\r\n    d_buff[j++] = 0;\r\n    d_buff[j++] = dac_value * 128 / 2048;\r\n  }\r\n}\r\n', '', 'webserver'),
(7960, 321, 'mysql 复制数据库某表', 'mysql 复制数据库某表到另一个数据库\r\n//先复制数据结构\r\nCREATE TABLE English.English1000 LIKE xyz.English1000\r\nEnglish.English1000为目标    xyz.English1000为源\r\n//复制数据\r\nINSERT INTO English.English1000 SELECT * FROM xyz.English1000;', '', 'webserver'),
(7961, 344, '获取目录下创建修改的图片', '// 获取目录下创建修改的图片返回完整路径+图片名\r\ntype ImageLastName struct {\r\n}\r\n\r\nfunc (class *ImageLastName) GetName(dir string) (string, error) {\r\n	// 图片所在的目录路径\r\n	//dir := "./images"\r\n	// 获取目录下所有文件\r\n	files, err := os.ReadDir(dir)\r\n	if err != nil {\r\n		return "", errors.New("无法读取目录")\r\n	}\r\n	var imageFiles []string\r\n	// 筛选出图片文件\r\n	for _, file := range files {\r\n		if !file.IsDir() && class.isImage(file.Name()) {\r\n			imageFiles = append(imageFiles, filepath.Join(dir, file.Name()))\r\n		}\r\n	}\r\n\r\n	// 按照修改时间排序\r\n	sort.Slice(imageFiles, func(i, j int) bool {\r\n		fi, _ := os.Stat(imageFiles[i])\r\n		fj, _ := os.Stat(imageFiles[j])\r\n		return fj.ModTime().Before(fi.ModTime())\r\n	})\r\n\r\n	// 获取最新创建的图片\r\n	if len(imageFiles) > 0 {\r\n		newestImage := imageFiles[0]\r\n		return newestImage, nil\r\n		//fmt.Println("最新创建的图片：", newestImage)\r\n	} else {\r\n		return "", errors.New("目录下没有图片文件")\r\n	}\r\n}\r\n\r\n// 判断文件是否为图片\r\nfunc (class *ImageLastName) isImage(filename string) bool {\r\n	ext := filepath.Ext(filename)\r\n	switch ext {\r\n	case ".jpg", ".jpeg", ".png", ".gif":\r\n		return true\r\n	}\r\n	return false\r\n}', '', 'webserver'),
(7962, 344, '图片压缩类', '// a.FromPath("111.jpg").SetOutSize(800).Out(".")\r\ntype ImageSmall struct {\r\n	file *os.File\r\n	size uint\r\n}\r\n\r\n// 图片路径\r\nfunc (class *ImageSmall) FromPath(strPath string) *ImageSmall {\r\n	class.size = 800\r\n	// 打开图像文件\r\n	files, err := os.Open(strPath)\r\n	if err != nil {\r\n		log.Fatal(err)\r\n	}\r\n	class.file = files\r\n	return class\r\n}\r\n\r\n// 调整图像 大小为默认宽度800，高度按比例缩放 输出名为 路径+时间.jpg\r\nfunc (class *ImageSmall) SetOutSize(i uint) *ImageSmall {\r\n	class.size = i\r\n	return class\r\n}\r\n\r\n// 输出目录\r\nfunc (class *ImageSmall) Out(outPath string) (string, error) {\r\n	ou := outPath[len(outPath)-1:]\r\n	if ou != "/" {\r\n		outPath = outPath + "/"\r\n	}\r\n	defer class.file.Close()\r\n	// 解码图像文件\r\n	img, _, err := image.Decode(class.file)\r\n	if err != nil {\r\n		return "", errors.New(err.Error())\r\n	}\r\n\r\n	// 压缩图像并保存到新文件\r\n	resizedImg := resize.Resize(class.size, 0, img, resize.Lanczos3) // 调整图像大小为宽度800，高度按比例缩放\r\n	outAll := outPath + time.Now().Format("20060102150405") + ".jpg"\r\n	out, err1 := os.Create(outAll)\r\n	if err1 != nil {\r\n		return "", errors.New(err1.Error())\r\n	}\r\n	defer out.Close()\r\n	jpeg.Encode(out, resizedImg, nil)\r\n\r\n	//fmt.Println("图像压缩完成！")\r\n	return outAll, nil\r\n}\r\n', '', 'webserver');
