package org.jeecg.modules.api.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.bean.UpdateTerProjectBean;
import org.jeecg.bean.UpdateTerTimeBean;
import org.jeecg.common.api.vo.Result;

import org.jeecg.modules.postBean.OrderPayBean;
import org.jeecg.modules.service.OrderCreateVipService;
import org.jeecg.modules.service.TerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="补充接口")
@RestController
@RequestMapping("/ter")
@Slf4j
public class TerController {


    //链接相关接口
    @Resource
    private TerService terService;
    //支付相关接口
    @Resource
    private OrderCreateVipService orderCreateVipService;

    //初始化技师上钟时间
    @PostMapping("/initTerTime")
    @ApiOperation(value = "初始化技师上钟时间",notes = "初始化技师上钟时间")
    public Result<?> initTerTime(@RequestHeader("X-Access-Token") String token){
        return terService.initTerTime(token);
    }


    //修改技师上钟时间
    @PostMapping("/updateTerTime")
    @ApiOperation(value = "修改技师上钟时间",notes = "修改技师上钟时间")
    public Result<?> updateTerTime(@RequestHeader("X-Access-Token") String token, UpdateTerTimeBean bean){
        return terService.updateTerTime(token,bean);
    }



    //初始化技师上钟项目
    @PostMapping("/initTerProject")
    @ApiOperation(value = "初始化技师上钟项目",notes = "初始化技师上钟项目")
    public Result<?> initTerProject(@RequestHeader("X-Access-Token") String token){
        return terService.initTerProject(token);
    }



    //查询技师上钟项目
    @PostMapping("/queryTerProject")
    @ApiOperation(value = "查询技师上钟项目",notes = "查询技师上钟项目")
    public Result<?> queryTerProject(@RequestHeader("X-Access-Token") String token){
        return terService.queryTerProject(token);
    }


    //修改技师上钟项目
    @PostMapping("/updateTerProject")
    @ApiOperation(value = "修改技师上钟项目",notes = "修改技师上钟项目")
    public Result<?> updateTerProject(@RequestHeader("X-Access-Token") String token, UpdateTerProjectBean bean){
        return terService.updateTerProject(token,bean);
    }


    //修改用户信息
    @PostMapping("/updateUser")
    @ApiOperation(value = "修改用户信息",notes = "修改用户信息")
    public Result<?> updateUser(
            @RequestHeader("X-Access-Token") String token,
            String nickName,
            String avatarUrl,
            String phone,
            String sex
    ){
        return terService.updateUser(token,nickName,avatarUrl,phone,sex);
    }




}
