package com.bonus.canteen.core.android.controller;

import com.bonus.canteen.core.android.dto.AppDTO;
import com.bonus.canteen.core.android.service.UserService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "android-双屏消费机-用户信息")
@RestController
@RequestMapping("/api/android/user")
public class UserController {
    @Autowired
    private UserService userService;

    @ApiOperation("获取人员信息")
    @RequestMapping("/getUserInfo")
    public AjaxResult getUserInfo(@RequestBody AppDTO dto) {
        try {
            return userService.getUserInfo(dto);
        }catch (ServiceException e){
            return AjaxResult.error("获取人员信息失败！");
        }
    }

}
