Commit c7ae4bb8 authored by wlx@33.cn's avatar wlx@33.cn

增加服务器时间查询接口

parent 69fc0ffc
...@@ -3,17 +3,16 @@ package com.fzm.mall.server.front.system.controller; ...@@ -3,17 +3,16 @@ package com.fzm.mall.server.front.system.controller;
import com.fzm.mall.server.front.base.ResponseVO; import com.fzm.mall.server.front.base.ResponseVO;
import com.fzm.mall.server.front.constant.MallResponseEnum; import com.fzm.mall.server.front.constant.MallResponseEnum;
import com.fzm.mall.server.front.goods.model.Banner;
import com.fzm.mall.server.front.system.model.SysConfig; import com.fzm.mall.server.front.system.model.SysConfig;
import com.fzm.mall.server.front.system.service.ISysConfigService; import com.fzm.mall.server.front.system.service.ISysConfigService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.text.SimpleDateFormat;
import java.util.Calendar;
/** /**
* <p> * <p>
...@@ -32,12 +31,18 @@ public class SysConfigController { ...@@ -32,12 +31,18 @@ public class SysConfigController {
@ApiOperation(value = "获取logo") @ApiOperation(value = "获取logo")
@PostMapping("/without/getLogo") @PostMapping("/without/getLogo")
public ResponseVO<String> getLogo(){ public ResponseVO<String> getLogo() {
String key = "coin_logo"; String key = "coin_logo";
SysConfig sys = sysConfigService.getByKey(key); SysConfig sys = sysConfigService.getByKey(key);
if(sys==null){ if (sys == null) {
return new ResponseVO<>(MallResponseEnum.SUCCESS,""); return new ResponseVO<>(MallResponseEnum.SUCCESS, "");
} }
return new ResponseVO<>(MallResponseEnum.SUCCESS,sys.getDictValue()); return new ResponseVO<>(MallResponseEnum.SUCCESS, sys.getDictValue());
}
@ApiOperation(value = "获取服务器时间")
@PostMapping("/without/read/systemTime")
public ResponseVO<String> systemTime() {
return new ResponseVO<>(MallResponseEnum.SUCCESS, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime()));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment