package com.ruoyi.web.controller.bgt;

import com.ruoyi.bgt.domain.dto.UserRealNameAuthenticationDTO;
import com.ruoyi.bgt.service.IBgtUserService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 后台管理包工头Controller
 *
 * @author ruoyi
 * @date 2025-02-14
 */
@Api(value = "App包工头控制器", tags = {"APP包工头管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/app/bgt/user")
public class AppBgtUserController extends BaseController {

    private final IBgtUserService iBgtUserService;

	/**
	 * 实名认证
	 */
	@ApiOperation("实名认证")
	@Log(title = "App管理包工头", businessType = BusinessType.UPDATE)
	@RepeatSubmit
	@PutMapping
	public AjaxResult<Void> realNameAuthentication(@Validated @RequestBody UserRealNameAuthenticationDTO dto) {
		return toAjax(iBgtUserService.realNameAuthentication(dto));
	}


	@ApiOperation("个人信息")
	@RepeatSubmit
	@GetMapping("/{id}")
	public AjaxResult<Void> getInfo(@Validated @RequestBody UserRealNameAuthenticationDTO dto) {
		return toAjax(iBgtUserService.realNameAuthentication(dto));
	}

}
