package com.fdkankan.platform.user.controller.api;

import com.fdkankan.platform.user.request.RequestUser;
import com.fdkankan.platform.user.service.sso.AppService;
import com.fdkankan.platform.user.vo.ResponseUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 个人中心-app模块
 */
@RestController
@RequestMapping("/service/platform/app/user/")
public class UserAppController {

    @Autowired
    private AppService appService;

    /**
     * app修改密码
     */
    @PostMapping(value = "/changePassword")
    public String changePassword(@RequestBody RequestUser user) throws Exception {
        return appService.resetPassword(user);
    }

    /**
     * app上传头像
     * head         用户头像
     * phoneNum     用户名（手机号）
     * @return
     */
    @PostMapping(value = "/uploadHead")
    public String uploadHead(@RequestBody RequestUser user) throws Exception {
        return appService.uploadHead(user);
    }
    /**
     * 获取账号点数
     * phoneNum     用户名（手机号）
     * @return
     */
    @PostMapping(value = "/getSubPointsFromUserName")
    public Long getSubPointsFromUserName(@RequestBody RequestUser user) throws Exception {
        return appService.getSubPointsFromUserName(user);
    }
    /**
     * 获取用户信息
     * phoneNum     用户名（手机号）
     * cameraType    相机类型，1双目，4八目  9:转台
     * @return
     */
    @PostMapping(value = "/getUserInfo")
    public ResponseUser getUserInfo(@RequestBody RequestUser user) throws Exception {
        return appService.getUserInfo(user);
    }
    /**
     * 更改昵称
     * nickName     昵称
     * phoneNum     用户名（手机号）
     */
    @PostMapping(value = "/updateNickName")
    public String updateNickName(@RequestBody RequestUser user) throws Exception {
        return appService.updateNickName(user);
    }
}
