package org.linlinjava.jz.hm.web;

import java.util.List;

import org.linlinjava.jz.db.domain.HmNotice;
import org.linlinjava.jz.db.service.hm.HmNoticeService;
import org.linlinjava.jz.hm.util.HmResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(value = "小程序--老师服务记录", description = "小程序--老师服务记录")
@RestController
@RequestMapping("teachServiceLog")
public class TeachServiceLogController {

	@Autowired
	HmNoticeService hmNoticeService;

	@ApiOperation(value = "保姆获取老师服务记录", notes = "保姆获取老师服务记录")
	@GetMapping(value = "noticeByServant")
	public Object noticeByServant(Long employRelationId,String yearMonth) {
		if (employRelationId == null||yearMonth ==null) {
			HmResponseUtil.fail("employRelationId和yearMonth都不能为空");
		}
		// 查notice的类型3种（下班打卡又无法完成的任务，缺勤未打卡的，雇主质疑打卡）
		return hmNoticeService.getNoticeByServant(employRelationId,yearMonth,2);
	}
	
	@ApiOperation(value = "雇主获取老师服务记录", notes = "雇主获取老师服务记录")
	@GetMapping(value = "noticeByCustomer")
	public Object noticeByCustomer(Long employRelationId,String yearMonth) {
		if (employRelationId == null||yearMonth ==null) {
			HmResponseUtil.fail("employRelationId和yearMonth都不能为空");
		} 
		return hmNoticeService.getNoticeByServant(employRelationId,yearMonth,1);
	}
	 
}
