package com.bonus.core.account.v4.app.controller;

import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.core.account.v4.app.dto.AppAccInfoV4DTO;
import com.bonus.core.account.v4.app.service.impl.AppAccV4Service;
import com.bonus.core.account.v4.app.vo.AppAccInfoV4VO;
import com.bonus.core.account.v4.app.vo.AppWalletBalanceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Map;

@RestController
@RequestMapping({"/api/v4/app/account"})
@Api(
        value = "账户管理/移动端/v4",
        tags = {"账户管理/移动端/v4"}
)
public class AppAccV4Controller extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(AppAccV4Controller.class);
    @Resource
    private AppAccV4Service appAccV4Service;

    @ApiOperation(
            value = "查询账户(仅返回钱包余额)",
            notes = "移动端查询账户(仅返回钱包余额)"
    )
    @PostMapping({"/wallet/balance"})
    public AjaxResult queryWalletBalance(@RequestBody AppAccInfoV4DTO o) {
        return success(this.appAccV4Service.queryWalletBalance(o));
    }

    @ApiOperation(
            value = "查询账户(基础信息+余额)",
            notes = "移动端查询账户(基础信息+余额)"
    )
    @PostMapping({"/info"})
    public AjaxResult queryAccInfoForApp(@RequestBody AppAccInfoV4DTO o) {
        return success(this.appAccV4Service.queryAccInfoForApp(o));
    }
}
