package com.ylx.web.controller.usercenter;

import com.ylx.common.core.controller.BaseController;
import com.ylx.common.core.domain.R;
import com.ylx.usercenter.domain.dto.UnifiedUserCenterDTO;
import com.ylx.usercenter.service.UnifiedUserCenterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/userCenter")
@Api(tags = {"一账通客户端"})
@Slf4j
public class UnifiedUserCenterController extends BaseController {

    @Resource
    private UnifiedUserCenterService unifiedUserCenterService;

    @ApiOperation("查询用户绑定")
    @PostMapping("/userApp/queryBind")
    public R<?> queryBind(@RequestBody UnifiedUserCenterDTO dto) {
        return this.unifiedUserCenterService.queryBind(dto);
    }

    @ApiOperation("添加用户绑定")
    @PostMapping("/userApp/bind")
    public R<?> bind(@RequestBody UnifiedUserCenterDTO dto) {
        return this.unifiedUserCenterService.bind(dto);
    }

    @ApiOperation("解除用户绑定")
    @PostMapping("/userApp/unbind")
    public R<?> unbind(@RequestBody UnifiedUserCenterDTO dto) {
        return this.unifiedUserCenterService.unbind(dto);
    }

}
