|
@@ -1,25 +1,79 @@
|
|
|
package com.lemon.lifecenter.test;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Random;
|
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
+import com.lemon.lifecenter.common.LifeCenterConfigVO;
|
|
|
import com.lemon.lifecenter.common.LifeCenterController;
|
|
|
+import com.lemon.lifecenter.common.LifeCenterFunction;
|
|
|
import com.lemon.lifecenter.dto.PatientDTO;
|
|
|
+import com.lemon.lifecenter.dto.StaffDTO;
|
|
|
|
|
|
@Controller
|
|
|
|
|
|
public class TestContorller extends LifeCenterController {
|
|
|
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private LifeCenterConfigVO config;
|
|
|
+
|
|
|
@Autowired
|
|
|
- TestService s;
|
|
|
+ private TestService s;
|
|
|
+
|
|
|
+// @RequestMapping("/update/info")
|
|
|
+// public ModelAndView updatePassword() throws Exception {
|
|
|
+// ArrayList<StaffDTO> listDto = new ArrayList<>();
|
|
|
+// listDto = (ArrayList<StaffDTO>) s.selectMemberPassword();
|
|
|
+//
|
|
|
+// for (int i = 0; i < listDto.size(); i++) {
|
|
|
+// String id = listDto.get(i).getId();
|
|
|
+// String pw = LifeCenterFunction.aesDecrypt(config.aesKey, config.IV, listDto.get(i).getPassword());
|
|
|
+// logger.error("id -- > " + id + " :::: pw -- > " + pw);
|
|
|
+// pw = LifeCenterFunction.sha256Encrypt(pw);
|
|
|
+//
|
|
|
+// StaffDTO sdto = new StaffDTO();
|
|
|
+// sdto.setId(id);
|
|
|
+// sdto.setPassword(pw);
|
|
|
+// s.updateMemberPassword(sdto);
|
|
|
+// }
|
|
|
+//
|
|
|
+// ModelAndView mv = setMV("test");
|
|
|
+// return mv;
|
|
|
+// }
|
|
|
+//
|
|
|
+// @RequestMapping("/update/patient")
|
|
|
+// public ModelAndView updatePatientPassword() throws Exception {
|
|
|
+// ArrayList<PatientDTO> listDto = new ArrayList<>();
|
|
|
+// listDto = s.selectPatientPassword();
|
|
|
+//
|
|
|
+// for (int i = 0; i < listDto.size(); i++) {
|
|
|
+// String id = listDto.get(i).getId();
|
|
|
+// String pw = LifeCenterFunction.aesDecrypt(config.aesKey, config.IV, listDto.get(i).getPw());
|
|
|
+// pw = LifeCenterFunction.sha256Encrypt(pw);
|
|
|
+//
|
|
|
+//
|
|
|
+// PatientDTO dto = new PatientDTO();
|
|
|
+// dto.setId(id);
|
|
|
+// dto.setPw(pw);
|
|
|
+//
|
|
|
+// s.updatePatientPassword(dto);
|
|
|
+// }
|
|
|
+//
|
|
|
+// ModelAndView mv = setMV("test");
|
|
|
+// return mv;
|
|
|
+// }
|
|
|
|
|
|
@RequestMapping("/insert/{start}/{end}")
|
|
|
public ModelAndView insert(@PathVariable("start") int start, @PathVariable("end") int end) {
|