| | |
| | | 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.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiOperation(value = "查询服务器时间戳") |
| | | @GetMapping("timestamp") |
| | | public Response<Long> getTimestamp(){ |
| | | return new Response<Long>().set(1,System.currentTimeMillis()); |
| | | 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); |
| | | String as = (String) ActionUtil.getSession().getAttribute("lang"); |
| | | return new Response().set(1, true, as); |
| | | } |
| | | } |