import {
  CoolController,
  BaseController,
  CoolUrlTag,
  TagTypes,
  CoolTag,
} from '@cool-midway/core';
import { Body, Inject, Post } from '@midwayjs/core';
import { PushSorterAttendanceService } from '../../service/sorterattendance';

/**
 * 分拣员工作签到
 */
@CoolUrlTag()
@CoolController()
export class AppPushSorterattendanceController extends BaseController {
  @Inject()
  pushSorterAttendanceService: PushSorterAttendanceService;

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Post('/checkIn', { summary: '上班签到' })
  async checkIn(@Body() body) {
    return this.ok(await this.pushSorterAttendanceService.checkIn(body));
  }

  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Post('/checkOut', { summary: '下班签退' })
  async checkOut(@Body() body) {
    return this.ok(await this.pushSorterAttendanceService.checkOut(body));
  }
}
