SchedulePlanController.java 1.68 KB
package com.bsth.controller.schedule;

import com.bsth.controller.BaseController;
import com.bsth.entity.schedule.SchedulePlan;
import com.bsth.service.schedule.SchedulePlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by xu on 16/6/16.
 */
@RestController
@RequestMapping("spc")
public class SchedulePlanController extends BaseController<SchedulePlan, Long> {
    @Autowired
    private SchedulePlanService schedulePlanService;

    /**
     * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
     * @Title: save
     * @Description: TODO(持久化对象)
     * @param @param t
     * @param @return    设定文件
     * @return Map<String,Object>  {status: 1(成功),-1(失败)}
     * @throws
     */
    @RequestMapping(method = RequestMethod.POST)
    public Map<String, Object> save(@RequestBody SchedulePlan t){

        return baseService.save(t);
    }

    // TODO:
//    @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
//    public List<Map<String, Object>> findGroupInfo(
//            Integer xlid, Date scheduleDate) {
//
//    }

    @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
    public List<Map<String, Object>> findGroupInfo(
            @PathVariable(value = "xlid") Integer xlid,
            @PathVariable(value = "date") Date scheduleDate) {
        return schedulePlanService.findGroupInfo(xlid, scheduleDate);
    }

//    public int updateGroupInfo


}