package com.ningdatech.kqapi.open.controller;

import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ZPF
 * @since 2023-10-27
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/anonymous")
@RequiredArgsConstructor
public class HealthController {

    @GetMapping("/health")
    public JSONObject health() {
        JSONObject json = new JSONObject();
        json.put("code", "200");
        json.put("area", "柯桥区");
        json.put("chargePerson", "李*");
        json.put("appName", "企业线上平台");
        json.put("mobile", "156*****306");
        json.put("time", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        json.put("dept", "产业发展科");
        return json;
    }

}
