<commit_before>package spms.controls;

import java.io.File;
import java.io.IOException;

import javax.servlet.ServletContext;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import spms.dao.MemberDao;
import spms.vo.JsonResult;
import spms.vo.Member;
import spms.vo.Office;
import spms.dao.OfficeDao;

@Controller
@RequestMapping("/member")
public class MemberControl {
	Logger log = Logger.getLogger(MemberControl.class);
	
	@Autowired
	ServletContext servletContext;
	
	@Autowired(required=false)
	MemberDao memberDao;
	
	@Autowired(required=false)
	OfficeDao officeDao;
	
	
	@Autowired(required=false)
	ExcelControl excelControl;
	
	
	@RequestMapping(value="/add",method=RequestMethod.GET)
	public String form() {
		
		//return "member/addForm";
		return "member/add";
	}
	@RequestMapping(value="/addtest",method=RequestMethod.GET)
	public String formTest() {
		//return "member/addForm";
		return "member/addtest";
	}
	
//	@RequestMapping(value="/add",method=RequestMethod.POST)
//	public String add(
//			Member member, 
//			@RequestParam("photoFile") MultipartFile photoFile,
//			Model model) throws Exception {
//
//		member.setPhoto(saveFile(photoFile));
//		
//		int count = memberDao.insert(member);
//		if (count > 0) {
//			model.addAttribute("message", "등록 성공입니다!");
//		} else {
//			model.addAttribute("message", "등록 실패입니다!");
//		}
//		
//		return "member/add";
//	}
	
	@RequestMapping(value="/setPhoto",method=RequestMethod.POST)
	public String setPhoto(
			Member member, 
			@RequestParam("file1") MultipartFile photoFile,
			Model model) throws Exception {
		saveFile(photoFile);
		
		return "member/add";
	}
	@RequestMapping(value="/updatePhoto",method=RequestMethod.POST)
	public String updatePhoto(
			Member member, 
			@RequestParam("file1") MultipartFile photoFile,
			Model model) throws Exception {
		saveFile(photoFile);
		
		return "member/memberList";
	}
	
	@RequestMapping("/delete")
	public String delete(int no, Model model) throws Exception {
		memberDao.delete(no);
		return "redirect:list.do";
	}
	@RequestMapping("/addImage")
	public String addImage( ) throws Exception {
		
		return "member/add_image";
	}<commit_msg>점소 검색 팝업 <commit_after>package spms.controls;

import java.io.File;
import java.io.IOException;

import javax.servlet.ServletContext;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import spms.dao.MemberDao;
import spms.vo.JsonResult;
import spms.vo.Member;
import spms.vo.Office;
import spms.dao.OfficeDao;

@Controller
@RequestMapping("/member")
public class MemberControl {
	Logger log = Logger.getLogger(MemberControl.class);
	
	@Autowired
	ServletContext servletContext;
	
	@Autowired(required=false)
	MemberDao memberDao;
	
	@Autowired(required=false)
	OfficeDao officeDao;
	
	
	@Autowired(required=false)
	ExcelControl excelControl;
	
	
	@RequestMapping(value="/add",method=RequestMethod.GET)
	public String form() {
		
		//return "member/addForm";
		return "member/add";
	}
	@RequestMapping(value="/addtest",method=RequestMethod.GET)
	public String formTest() {
		//return "member/addForm";
		return "member/addtest";
	}
	
//	@RequestMapping(value="/add",method=RequestMethod.POST)
//	public String add(
//			Member member, 
//			@RequestParam("photoFile") MultipartFile photoFile,
//			Model model) throws Exception {
//
//		member.setPhoto(saveFile(photoFile));
//		
//		int count = memberDao.insert(member);
//		if (count > 0) {
//			model.addAttribute("message", "등록 성공입니다!");
//		} else {
//			model.addAttribute("message", "등록 실패입니다!");
//		}
//		
//		return "member/add";
//	}
	
	@RequestMapping(value="/setPhoto",method=RequestMethod.POST)
	public String setPhoto(
			Member member, 
			@RequestParam("file1") MultipartFile photoFile,
			Model model) throws Exception {
		saveFile(photoFile);
		
		return "member/add";
	}
	@RequestMapping(value="/updatePhoto",method=RequestMethod.POST)
	public String updatePhoto(
			Member member, 
			@RequestParam("file1") MultipartFile photoFile,
			Model model) throws Exception {
		saveFile(photoFile);
		
		return "member/memberList";
	}
	
	@RequestMapping("/delete")
	public String delete(int no, Model model) throws Exception {
		memberDao.delete(no);
		return "redirect:list.do";
	}
	@RequestMapping("/addImage")
	public String addImage( ) throws Exception {
		
		return "member/add_image";
	}
	@RequestMapping("/searchCompany")
	public String searchCompany( ) throws Exception {
		
		return "member/searchCompany";
	}
{'fraction_non_alphanumeric': 0.13210090506450992, 'fraction_numerical': 0.0015405353360292702, 'mean_word_length': 4.816349384098544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7056328', 'n_tokens_mistral': 1752, 'n_tokens_neox': 1679, 'n_words': 313}