package com.sqx.modules.artificer.controller.app;


import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.artificer.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/artificerTime")
@Api(value = "师傅时间管理", tags = {"师傅时间管理"})
public class AppArtificerTimeController {

    @Autowired
    private ArtificerTimeService artificerTimeService;

    @PostMapping("/updateArtificerTime")
    @ApiOperation("修改时间管理")
    @Login
    public Result updateArtificerTime(String artificerDate,String times,@RequestAttribute("userId") Long userId){
        return artificerTimeService.updateArtificerTime( artificerDate, times, userId);
    }

    @GetMapping("/selectArtificerTimeByArtificerId")
    @ApiOperation("查看时间")
    public Result selectArtificerTimeByArtificerId(Long artificerId,String artificerDate){
        return artificerTimeService.selectArtificerTimeByArtificerId(artificerId,artificerDate);
    }


    @GetMapping("/selectArtificerTimeListByArtificerId")
    @ApiOperation("查看时间(连续查最近五天）")
    public Result selectArtificerTimeListByArtificerId(Long artificerId,String artificerDate){
        return artificerTimeService.selectArtificerTimeListByArtificerId(artificerId,artificerDate);
    }




}
