package com.red.circle.other.adapter.app.activity.room;

import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.tool.core.date.TimestampUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务器时间.
 *
 * @author lisizhe on 2023/9/25
 * @eo.api-type http
 * @eo.groupName 活动服务.服务器时间
 * @eo.path /activity/server-date
 */
@RestController
@RequestMapping(value = "/activity/server-date", produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class ServerDateController extends BaseController {

  /**
   * 获取最新服务器时间.
   *
   * @eo.name 获取最新服务器时间
   * @eo.url /timestamp
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/timestamp")
  public Long getServerTimestamp() {
    return TimestampUtils.nowMinusHours(5).getTime();
  }

}
