Commit 19f33e6c authored by 周健威's avatar 周健威

添加日志接口

parent d81b7f14
package com.upyuns.platform.rs.website.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 成果数据日志
*
* @author zjw
* @email jiaoruizhen@126.com
* @date 2024-09-14 13:29:08
*/
@Data
@Table(name = "gaindata_log")
public class GaindataLog implements Serializable {
private static final long serialVersionUID = 1L;
//1001--录入;2211--生产线镶嵌;2212--生产线温度反演;2213--生产线植被覆盖度;2214--生产线植被识别;2215--水体识别;2216--风险等级;2217--病虫害监测
public static final String TYPE_1001 = "1001";
public static final String TYPE_2211 = "2211";
public static final String TYPE_2212 = "2212";
public static final String TYPE_2213 = "2213";
public static final String TYPE_2214 = "2214";
public static final String TYPE_2215 = "2215";
public static final String TYPE_2216 = "2216";
public static final String TYPE_2217 = "2217";
/**
*
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("")
private Integer id;
/**
* 名称
*/
@Column(name = "name")
@ApiModelProperty(value = "名称")
private String name;
/**
* 操作类型 1001--录入;2211--生产线镶嵌;2212--生产线温度反演;2213--生产线植被覆盖度;2214--生产线植被识别;2215--生产线水体识别;2216--生产线风险等级;2217--生产线病虫害监测
*/
@Column(name = "type")
@ApiModelProperty(value = "操作类型 1001--录入;2211--生产线镶嵌;2212--生产线温度反演;2213--生产线植被覆盖度;2214--生产线植被识别;2215--生产线水体识别;2216--生产线风险等级;2217--生产线病虫害监测")
private String type;
/**
* 数据来源 1--门户;2--生产线;3--AI系统
*/
@Column(name = "source")
@ApiModelProperty(value = "数据来源 1--门户;2--生产线;3--AI系统")
private Integer source;
/**
* 功能模块 0--默认;
*/
@Column(name = "source_module")
@ApiModelProperty(value = "功能模块 0--默认;")
private String sourceModule;
/**
* 成果数据id 1--已删除;0--未删除
*/
@Column(name = "gain_id")
@ApiModelProperty(value = "成果数据id 1--已删除;0--未删除")
private Integer gainId;
/**
* 是否删除 1--已删除;0--未删除
*/
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除 1--已删除;0--未删除")
private Integer isDel;
/**
* 属性信息
*/
@Column(name = "detail_json")
@ApiModelProperty(value = "属性信息")
private String detailJson;
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime;
/**
* 创建人
*/
@Column(name = "crt_user")
@ApiModelProperty(value = "创建人")
private String crtUser;
/**
* 更新人
*/
@Column(name = "upd_user")
@ApiModelProperty(value = "更新人")
private String updUser;
/**
* 用户id
*/
@Column(name = "user_id")
@ApiModelProperty(value = "用户id")
private Integer userId;
/**
* 用户名称
*/
@Column(name = "username")
@ApiModelProperty(value = "用户名称")
private Integer username;
/**
* 1--已提交;
*/
@Column(name = "status")
@ApiModelProperty(value = "1--已提交;")
private Integer status;
/**
* 备注描述
*/
@Column(name = "remark")
@ApiModelProperty(value = "备注描述")
private String remark;
/**
* 内容
*/
@Column(name = "content")
@ApiModelProperty(value = "内容")
private String content;
}
package com.upyuns.platform.rs.website.biz;
import org.springframework.stereotype.Service;
import com.upyuns.platform.rs.website.entity.GaindataLog;
import com.upyuns.platform.rs.website.mapper.GaindataLogMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
/**
* 成果数据日志
*
* @author zjw
* @email jiaoruizhen@126.com
* @date 2024-09-14 13:29:08
*/
@Service
public class GaindataLogBiz extends BaseBiz<GaindataLogMapper,GaindataLog> {
}
\ No newline at end of file
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.upyuns.platform.rs.website.biz.GaindataLogBiz;
import com.upyuns.platform.rs.website.entity.GaindataLog;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("gaindataLog/web")
public class GaindataLogController extends BaseController<GaindataLogBiz,GaindataLog> {
//1001--录入;2211--生产线镶嵌;2212--生产线温度反演;2213--生产线植被覆盖度;2214--生产线植被识别;2215--生产线水体识别;2216--生产线风险等级;2217--生产线病虫害监测
// static Map<String, String>
//
// static {
//
// }
@RequestMapping(value = "/app/unauth/baseAdd",method = RequestMethod.POST)
@ResponseBody
public ObjectRestResponse<GaindataLog> appunauthBaseAdd(@RequestBody GaindataLog entity){
// if(GaindataLog.TYPE_1001.equals())
String content = "进行了一次{}操作";
if(GaindataLog.TYPE_2211.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线镶嵌"));
} else if(GaindataLog.TYPE_2212.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线温度反演"));
} else if(GaindataLog.TYPE_2213.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线植被覆盖度"));
} else if(GaindataLog.TYPE_2214.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线植被识别"));
} else if(GaindataLog.TYPE_2215.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线水体识别"));
} else if(GaindataLog.TYPE_2215.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线风险等级"));
} else if(GaindataLog.TYPE_2215.equals(entity.getType())) {
entity.setContent(StrUtil.format(content, "生产线病虫害监测"));
}
baseBiz.insertSelective(entity);
return ObjectRestResponse.succ();
}
}
\ No newline at end of file
package com.upyuns.platform.rs.website.mapper;
import com.upyuns.platform.rs.website.entity.GaindataLog;
import tk.mybatis.mapper.common.Mapper;
/**
* 成果数据日志
*
* @author zjw
* @email jiaoruizhen@126.com
* @date 2024-09-14 13:29:08
*/
public interface GaindataLogMapper extends Mapper<GaindataLog> {
}
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