package org.jeecg.modules.api.employController;

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.apiService.AuthenticationService;
import org.jeecg.modules.employAuthenticationCompany.entity.EmployAuthenticationCompany;
import org.jeecg.modules.employAuthenticationPerson.entity.EmployAuthenticationPerson;
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("/employ/authentication")
@Slf4j
public class AuthenticationController {

    /******************************************************************************************************************/
    //实名认证
    @Resource
    private AuthenticationService authenticationService;
    /******************************************************************************************************************/

    //实名认证-查询个人实名认证信息
    @ApiOperation(value="实名认证-查询个人实名认证信息", notes="实名认证-查询个人实名认证信息")
    @RequestMapping(value = "/getAuthenticationPerson", method = {RequestMethod.GET})
    public Result<?> getAuthenticationPerson(@RequestHeader("X-Access-Token") String token){
        //业务处理
        return authenticationService.getAuthenticationPerson(token);
    }

    //实名认证-个人实名认证
    @ApiOperation(value="实名认证-个人实名认证", notes="实名认证-个人实名认证")
    @RequestMapping(value = "/addAuthenticationPerson", method = {RequestMethod.POST})
    public Result<?> addAuthenticationPerson(@RequestHeader("X-Access-Token") String token, EmployAuthenticationPerson employAuthenticationPerson){
        //业务处理
        return authenticationService.addAuthenticationPerson(token, employAuthenticationPerson);
    }

    @ApiOperation(value="实名认证-查询企业实名认证信息", notes="实名认证-查询企业实名认证信息")
    @RequestMapping(value = "/getAuthenticationCompany", method = {RequestMethod.GET})
    public Result<?> getAuthenticationCompany(@RequestHeader("X-Access-Token") String token){
        //业务处理
        return authenticationService.getAuthenticationCompany(token);
    }

    //实名认证-企业实名认证
    @ApiOperation(value="实名认证-企业实名认证", notes="实名认证-企业实名认证")
    @RequestMapping(value = "/addAuthenticationCompany", method = {RequestMethod.POST})
    public Result<?> addAuthenticationCompany(@RequestHeader("X-Access-Token") String token, EmployAuthenticationCompany employAuthenticationCompany){
        //业务处理
        return authenticationService.addAuthenticationCompany(token, employAuthenticationCompany);
    }

}
