package edu.neusoft.project.controller;

import edu.neusoft.project.model.service.IndentService;
import edu.neusoft.project.model.service.PersonService;
import edu.neusoft.project.model.service.SongService;
import edu.neusoft.project.model.vo.Indent;
import edu.neusoft.project.model.vo.Person;
import edu.neusoft.project.model.vo.Song;
import edu.neusoft.project.util.MyMD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

//import java.util.ArrayList;


@Controller
public class PersonBasicAction {
    @Autowired
    private PersonService service;
    @Autowired
    private SongService songService;
    @Autowired
    private IndentService indentService;

    private MyMD5Util myMD5Util;

    private Person globalPerson = null;
//    HttpSession session;
    public String level = null;

    @ResponseBody
    @RequestMapping(value="selectUser.action", method=RequestMethod.POST,produces=MediaType.APPLICATION_JSON_VALUE)
    public boolean selectUser(String username,HttpServletRequest request){
        System.out.println("ajax yes");
        boolean flag=service.selUser(username);
        return flag;
    }
    @RequestMapping("delThisIndent.action")
    @ResponseBody
    public int delThisIndent(String adminListPersonCode,String id){
        int ret = indentService.delThisIndent(adminListPersonCode,id);
        return ret;
    }
//    @ResponseBody
//    @RequestMapping("mjson.asp")
//    public void mjson(String username){
//
//
//    }


//    @RequestMapping("indentInfoAct.action")
//    @ResponseBody
//    public String indentInfo(String Id){
//        System.out.println(Id);
//        String data= indentService.indentInfo(Id);
//
//        System.out.println(data);
//        return  data;
//    }

}
