package com.ssyf.common.security.domain;

import lombok.Getter;
import lombok.experimental.Accessors;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;

/**
 * 业务上下文
 *
 * @author huwei
 * @date 2022/7/15 15:48
 */
@Getter
@Accessors(chain = true)
public class ClientContext {

    /**
     * 请求对象
     */
    private HttpServletRequest request;

    /**
     * 请求响应对象
     */
    private HttpServletResponse response;

    /**
     * 进入业务时间
     */
    private LocalDateTime enterTime;

    public ClientContext(HttpServletRequest request, HttpServletResponse response) {
        this.request = request;
        this.response = response;
        this.enterTime = LocalDateTime.now();
    }
}
