Commit 32b9ad68 authored by 周健威's avatar 周健威

添加日志接口

parent 19f33e6c
......@@ -3,8 +3,11 @@ package com.upyuns.platform.rs.website.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
......@@ -149,5 +152,12 @@ public class GaindataLog implements Serializable {
@ApiModelProperty(value = "内容")
private String content;
/**
* 日志时间
*/
@Column(name = "log_time")
@ApiModelProperty(value = "日志时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date logTime;
}
......@@ -3,8 +3,12 @@ package com.upyuns.platform.rs.website.controller.web;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.upyuns.platform.rs.website.biz.GainDataBiz;
import com.upyuns.platform.rs.website.biz.GaindataLogBiz;
import com.upyuns.platform.rs.website.entity.GainData;
import com.upyuns.platform.rs.website.entity.GaindataLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
......@@ -13,6 +17,9 @@ import java.util.Map;
@RequestMapping("gaindataLog/web")
public class GaindataLogController extends BaseController<GaindataLogBiz,GaindataLog> {
@Autowired
GainDataBiz gainDataBiz;
//1001--录入;2211--生产线镶嵌;2212--生产线温度反演;2213--生产线植被覆盖度;2214--生产线植被识别;2215--生产线水体识别;2216--生产线风险等级;2217--生产线病虫害监测
// static Map<String, String>
//
......@@ -25,6 +32,9 @@ public class GaindataLogController extends BaseController<GaindataLogBiz,Gaindat
public ObjectRestResponse<GaindataLog> appunauthBaseAdd(@RequestBody GaindataLog entity){
// if(GaindataLog.TYPE_1001.equals())
String content = "进行了一次{}操作";
if(null != entity.getGainId()) {
GainData gainData = gainDataBiz.selectById(entity.getGainId());
if(null != gainData) {
if(GaindataLog.TYPE_2211.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线镶嵌"));
} else if(GaindataLog.TYPE_2212.equals(entity.getType())) {
......@@ -43,4 +53,7 @@ public class GaindataLogController extends BaseController<GaindataLogBiz,Gaindat
baseBiz.insertSelective(entity);
return ObjectRestResponse.succ();
}
}
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "参数错误");
}
}
\ No newline at end of file
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