package org.jeecg.modules.api.studytourController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.api.service.BindService;
import org.jeecg.modules.api.service.ExperienceService;
import org.jeecg.modules.studytourBindperson.entity.StudytourBindperson;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="学员管理-相关接口")
@RestController
@RequestMapping("/studytour/bind")
@Slf4j
public class BindController {

    /******************************************************************************************************************/
    //配置信息
    @Resource
    private BindService bindService;
    /******************************************************************************************************************/

    @ApiOperation(value="成员管理-查询绑定人信息", notes="成员管理-查询绑定人信息")
    @RequestMapping(value = "/queryBindUser", method = {RequestMethod.GET})
    public Result<?> queryBindUser(String bindUserId){
        return bindService.queryBindUser(bindUserId);
    }

    @ApiOperation(value="成员管理-查询绑定成员列表", notes="绑定状态(status)：0-确认中 1-已绑定 2-已拒绝")
    @RequestMapping(value = "/queryBindList", method = {RequestMethod.GET})
    public Result<?> queryBindList(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson, PageBean pageBean){
        return bindService.queryBindList(token, studytourBindperson, pageBean);
    }

    @ApiOperation(value="成员管理-绑定申请", notes="成长档案-绑定申请")
    @RequestMapping(value = "/addBind", method = {RequestMethod.POST})
    public Result<?> addBind(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson){
        return bindService.addBind(token, studytourBindperson);
    }

    @ApiOperation(value="成员管理-审批绑定申请", notes="成长档案-审批绑定申请")
    @RequestMapping(value = "/updateBind", method = {RequestMethod.POST})
    public Result<?> updateBind(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson){
        return bindService.updateBind(token, studytourBindperson);
    }

}
