package com.yc.ship.module.otc.controller.admin.agencyLoginLog;

import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.module.otc.controller.admin.agencyLoginLog.vo.AgencyLoginLogSaveReqVO;
import com.yc.ship.module.otc.service.auth.AgencyLoginLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static com.yc.ship.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 旅行社信息登录记录")
@RestController
@RequestMapping("/agency/login-log")
@Validated
public class AgencyLoginLogController {

    @Resource
    private AgencyLoginLogService agencyLoginLogService;

    @PostMapping("/record")
    @Operation(summary = "创建旅行社信息登录记录")
    public CommonResult<Long> createAgencyLoginLog(@Valid @RequestBody AgencyLoginLogSaveReqVO createReqVO) {
        return success(agencyLoginLogService.recordLog(createReqVO));
    }

}