package com.ruoyi.web.app;

import com.alipay.api.domain.UserBaseInfo;
import com.ruoyi.bst.booth.domain.BoothVO;
import com.ruoyi.bst.booth.service.BoothService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.User;
import com.ruoyi.common.core.domain.vo.UserVO;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.LogBizType;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.system.user.service.UserConverter;
import com.ruoyi.system.user.service.UserService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/user")
@Slf4j
public class AppUserController extends BaseController {

    @Autowired
    private UserService userService;
    @Autowired
    private UserConverter userConverter;

    @ApiOperation("用户编辑基础信息")
    @PutMapping("/editInfo")
    public AjaxResult editInfo(@RequestBody User user) {
        UserVO vo = userConverter.toBasicInfoVOByUpdate(user);
        vo.setUserId(getUserId());
        return toAjax(userService.updateUserBasicInfo(vo));
    }


}
