lxw
2023-04-19 2f5540197f47dac55d7d5b50532a8816160d39e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 服务器相关
 */
@Api(tags = "服务器相关")
@RestController
@RequestMapping("server")
public class ServerController {
 
    @ApiOperation(value = "查询服务器时间戳")
    @GetMapping("timestamp")
    public Response<Long> getTimestamp() {
        return new Response<Long>().set(1, System.currentTimeMillis());
    }
 
    @ApiOperation(value = "session里面设置语言")
    @GetMapping("lang")
    public Response setlang(@RequestParam String lang) {
        ActionUtil.getSession().setAttribute("lang", lang);
        return new Response().set(1, true, "设置系统语言");
    }
}