package com.unis.auth.modular.login.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.unis.auth.core.enums.SaClientTypeEnum;
import com.unis.auth.modular.login.param.AuthAccountPasswordLoginParam;
import com.unis.auth.modular.login.param.UserCollectPasswordLoginParam;
import com.unis.auth.modular.login.service.AuthService;
import com.unis.common.pojo.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 移动端登录管理
 *
 * @author weiyinbin
 * @date 2024/04/02 15:40
 */
@Api(tags = "移动端登录管理")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@Validated
public class UserCollectLoginController {

    @Autowired
    private AuthService authService;

    @ApiOperationSupport(order = 1)
    @ApiOperation("移动端登录密码登录")
    @PostMapping("/auth/c/userCollect/login")
    public CommonResult<String> doLogin(@RequestBody @Valid UserCollectPasswordLoginParam userCollectPasswordLoginParam) {
        return CommonResult.data(authService.userLogin(userCollectPasswordLoginParam));
    }


}
