7 changed files with 193 additions and 13 deletions
@ -0,0 +1,112 @@ |
|||
package com.qs.serve.modules.sys.entity; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 同步日志 实体类 |
|||
* @author YenHex |
|||
* @since 2023-03-15 |
|||
*/ |
|||
@Data |
|||
@TableName("sys_sync_log") |
|||
public class SysSyncLog implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 来自系统 */ |
|||
@Length(max = 255,message = "来自系统长度不能超过255字") |
|||
private String from; |
|||
|
|||
/** 请求地址 */ |
|||
@Length(max = 255,message = "请求地址长度不能超过255字") |
|||
private String url; |
|||
|
|||
/** 请求类 */ |
|||
@Length(max = 255,message = "请求类长度不能超过255字") |
|||
private String entityClass; |
|||
|
|||
/** 请求json */ |
|||
@Length(max = 255,message = "请求json长度不能超过255字") |
|||
private String requestJson; |
|||
|
|||
/** 失败原因 */ |
|||
@Length(max = 255,message = "失败原因长度不能超过255字") |
|||
private String failReason; |
|||
|
|||
/** 成功标识 */ |
|||
private Integer successStatus; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 租户id */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 删除标识 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private Boolean delFlag; |
|||
|
|||
|
|||
public static SysSyncLog toNewObject(SysSyncLog source){ |
|||
SysSyncLog syncLog = new SysSyncLog(); |
|||
syncLog.setId(source.getId()); |
|||
syncLog.setFrom(source.getFrom()); |
|||
syncLog.setUrl(source.getUrl()); |
|||
syncLog.setEntityClass(source.getEntityClass()); |
|||
syncLog.setRequestJson(source.getRequestJson()); |
|||
syncLog.setFailReason(source.getFailReason()); |
|||
syncLog.setSuccessStatus(source.getSuccessStatus()); |
|||
syncLog.setRemark(source.getRemark()); |
|||
syncLog.setCreateTime(source.getCreateTime()); |
|||
syncLog.setCreateBy(source.getCreateBy()); |
|||
syncLog.setUpdateTime(source.getUpdateTime()); |
|||
syncLog.setUpdateBy(source.getUpdateBy()); |
|||
syncLog.setTenantId(source.getTenantId()); |
|||
syncLog.setDelFlag(source.getDelFlag()); |
|||
return syncLog; |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.sys.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.sys.entity.SysSyncLog; |
|||
|
|||
/** |
|||
* 同步日志 Mapper |
|||
* @author YenHex |
|||
* @date 2023-03-15 |
|||
*/ |
|||
public interface SysSyncLogMapper extends BaseMapper<SysSyncLog> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.sys.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.sys.entity.SysSyncLog; |
|||
|
|||
/** |
|||
* 同步日志 服务接口 |
|||
* @author YenHex |
|||
* @date 2023-03-15 |
|||
*/ |
|||
public interface SysSyncLogService extends IService<SysSyncLog> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.sys.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.sys.entity.SysSyncLog; |
|||
import com.qs.serve.modules.sys.service.SysSyncLogService; |
|||
import com.qs.serve.modules.sys.mapper.SysSyncLogMapper; |
|||
|
|||
/** |
|||
* 同步日志 服务实现类 |
|||
* @author YenHex |
|||
* @since 2023-03-15 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SysSyncLogServiceImpl extends ServiceImpl<SysSyncLogMapper,SysSyncLog> implements SysSyncLogService { |
|||
|
|||
} |
|||
|
Loading…
Reference in new issue