文件状态名字分类修改方法添加
							parent
							
								
									134011bcaf
								
							
						
					
					
						commit
						c1d11bdc51
					
				| @ -0,0 +1,23 @@ | ||||
| package com.pjilisense.flxai.dao; | ||||
| 
 | ||||
| import com.pjilisense.flxai.base.dao.BaseDao; | ||||
| import com.pjilisense.flxai.entity.FilesEntity; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * ${comments} | ||||
|  * | ||||
|  * @author liushujing liushujing@philisense.com | ||||
|  * @since 1.0.0 2025-01-14 | ||||
|  */ | ||||
| @Mapper | ||||
| public interface FilesDao extends BaseDao<FilesEntity> { | ||||
| 
 | ||||
|     int modifyFileName(Map<String, Object> objectToMap); | ||||
| 
 | ||||
|     int modifyFileStatus(Map<String, Object> objectToMap); | ||||
| 
 | ||||
|     int modifyFileCategory(Map<String, Object> objectToMap); | ||||
| } | ||||
| @ -0,0 +1,79 @@ | ||||
| package com.pjilisense.flxai.dto; | ||||
| 
 | ||||
| import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||||
| import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.io.Serializable; | ||||
| import java.time.OffsetDateTime; | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  * ${comments} | ||||
|  * | ||||
|  * @author liushujing liushujing@philisense.com | ||||
|  * @since 1.0.0 2025-01-14 | ||||
|  */ | ||||
| @Data | ||||
| @ApiModel(value = "${comments}") | ||||
| public class FilesDTO implements Serializable { | ||||
|     private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private String id; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private String userId; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private String fileType; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private String name; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private Integer size; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private String url; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private Map<String,Object> metadata; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	@JsonSerialize(using = com.pjilisense.flxai.wrapper.OffsetDateTimeSerializer.class) | ||||
| 	@JsonDeserialize(using = com.pjilisense.flxai.wrapper.OffsetDateTimeDeserializer.class) | ||||
| 	private OffsetDateTime  createdAt; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	@JsonSerialize(using = com.pjilisense.flxai.wrapper.OffsetDateTimeSerializer.class) | ||||
| 	@JsonDeserialize(using = com.pjilisense.flxai.wrapper.OffsetDateTimeDeserializer.class) | ||||
| 	private OffsetDateTime  updatedAt; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private String fileHash; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private UUID chunkTaskId; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	private UUID embeddingTaskId; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "$column.comments") | ||||
| 	@JsonSerialize(using = com.pjilisense.flxai.wrapper.OffsetDateTimeSerializer.class) | ||||
| 	@JsonDeserialize(using = com.pjilisense.flxai.wrapper.OffsetDateTimeDeserializer.class) | ||||
| 	private OffsetDateTime accessedAt; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "文件分类1文档2问答") | ||||
| 	private String fileCategory; | ||||
| 
 | ||||
| 	@ApiModelProperty(value = "文件状态0删除1没有删除") | ||||
| 	private String fileStatus; | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,87 @@ | ||||
| package com.pjilisense.flxai.entity; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.pjilisense.flxai.handle.JsonbTypeHandler; | ||||
| import com.pjilisense.flxai.handle.UUIDTypeHandler; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.OffsetDateTime; | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
| 
 | ||||
| /** | ||||
|  * ${comments} | ||||
|  * | ||||
|  * @author liushujing liushujing@philisense.com | ||||
|  * @since 1.0.0 2025-01-14 | ||||
|  */ | ||||
| @Data | ||||
| @TableName(value = "files", autoResultMap = true) | ||||
| public class FilesEntity { | ||||
| 
 | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private String id; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private String userId; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private String fileType; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private String name; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private Integer size; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private String url; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
|     @TableField(value = "metadata", typeHandler = JsonbTypeHandler.class) | ||||
| 	private Map<String,Object> metadata; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private OffsetDateTime createdAt; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private OffsetDateTime  updatedAt; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private String fileHash; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
|     @TableField(typeHandler = UUIDTypeHandler.class) | ||||
| 	private UUID chunkTaskId; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
|     @TableField(typeHandler = UUIDTypeHandler.class) | ||||
| 	private UUID embeddingTaskId; | ||||
|     /** | ||||
|      * $column.comments | ||||
|      */ | ||||
| 	private OffsetDateTime  accessedAt; | ||||
|     /** | ||||
|      * 文件分类1文档2问答 | ||||
|      */ | ||||
| 	private String fileCategory; | ||||
|     /** | ||||
|      * 文件状态0删除1没有删除 | ||||
|      */ | ||||
| 	private String fileStatus; | ||||
| } | ||||
| @ -0,0 +1,46 @@ | ||||
| package com.pjilisense.flxai.handle; | ||||
| 
 | ||||
| import com.alibaba.fastjson.JSON; | ||||
| import org.apache.ibatis.type.BaseTypeHandler; | ||||
| import org.apache.ibatis.type.JdbcType; | ||||
| import org.apache.ibatis.type.MappedTypes; | ||||
| import org.postgresql.util.PGobject; | ||||
| 
 | ||||
| import java.sql.CallableStatement; | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| 
 | ||||
| /** | ||||
|  * @author CSDN @一碗情深 | ||||
|  * @description PostgreSql jsonb 数据处理器 | ||||
|  **/ | ||||
| @MappedTypes({Object.class}) | ||||
| public class JsonbTypeHandler extends BaseTypeHandler<Object> { | ||||
|     private static final PGobject jsonObject = new PGobject(); | ||||
| 
 | ||||
|     @Override | ||||
|     public void setNonNullParameter(PreparedStatement preparedStatement, int i, Object o, JdbcType jdbcType) throws SQLException { | ||||
|         if (preparedStatement != null) { | ||||
|             jsonObject.setType("jsonb"); | ||||
|             jsonObject.setValue(JSON.toJSONString(o)); | ||||
|             preparedStatement.setObject(i, jsonObject); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Object getNullableResult(ResultSet resultSet, String s) throws SQLException { | ||||
|         return JSON.parse(resultSet.getString(s)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Object getNullableResult(ResultSet resultSet, int i) throws SQLException { | ||||
|         return JSON.parse(resultSet.getString(i)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Object getNullableResult(CallableStatement callableStatement, int i) throws SQLException { | ||||
|         return JSON.parse(callableStatement.getString(i)); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,97 @@ | ||||
| package com.pjilisense.flxai.handle; | ||||
| 
 | ||||
| import org.apache.ibatis.type.BaseTypeHandler; | ||||
| import org.apache.ibatis.type.JdbcType; | ||||
| 
 | ||||
| import java.sql.*; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.UUID; | ||||
| 
 | ||||
| /** | ||||
|  * UUID数组类型处理器 | ||||
|  */ | ||||
| public class UUIDArrTypeHandler extends BaseTypeHandler<List<UUID>> { | ||||
| 
 | ||||
|     /** | ||||
|      * 设置参数 | ||||
|      * | ||||
|      * @param ps        PreparedStatement 对象 | ||||
|      * @param i         参数索引 | ||||
|      * @param parameter UUID 列表 | ||||
|      * @param jdbcType  JDBC 类型 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public void setNonNullParameter(PreparedStatement ps, int i, List<UUID> parameter, JdbcType jdbcType) throws SQLException { | ||||
|         if (parameter != null) { | ||||
|             Array array = ps.getConnection().createArrayOf("uuid", parameter.toArray()); | ||||
|             ps.setArray(i, array); | ||||
|         } else { | ||||
|             ps.setNull(i, Types.ARRAY); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param resultSet 结果集 | ||||
|      * @param columnName 列名 | ||||
|      * @return UUID 列表 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<UUID> getNullableResult(ResultSet resultSet, String columnName) throws SQLException { | ||||
|         return getUUIDList(resultSet.getArray(columnName)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param rs          结果集 | ||||
|      * @param columnIndex 列索引 | ||||
|      * @return UUID 列表 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<UUID> getNullableResult(ResultSet rs, int columnIndex) throws SQLException { | ||||
|         return getUUIDList(rs.getArray(columnIndex)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param cs          CallableStatement 对象 | ||||
|      * @param columnIndex 列索引 | ||||
|      * @return UUID 列表 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<UUID> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { | ||||
|         return getUUIDList(cs.getArray(columnIndex)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 获取 UUID 列表 | ||||
|      * | ||||
|      * @param array SQL 数组对象 | ||||
|      * @return UUID 列表 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     private List<UUID> getUUIDList(Array array) throws SQLException { | ||||
|         if (array == null) { | ||||
|             return null; | ||||
|         } | ||||
|         Object[] uuidArray = (Object[]) array.getArray(); | ||||
|         List<UUID> result = new ArrayList<>(); | ||||
|         for (Object obj : uuidArray) { | ||||
|             result.add((UUID) obj); | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,97 @@ | ||||
| package com.pjilisense.flxai.handle; | ||||
| 
 | ||||
| import org.apache.ibatis.type.BaseTypeHandler; | ||||
| 
 | ||||
| import java.sql.CallableStatement; | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.UUID; | ||||
| 
 | ||||
| /** | ||||
|  * UUID类型处理器 | ||||
|  */ | ||||
| public class UUIDTypeHandler extends BaseTypeHandler<UUID> { | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param resultSet  resultSet | ||||
|      * @param columnName 列名 | ||||
|      * @return UUID结果 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public UUID getNullableResult(ResultSet resultSet, String columnName) | ||||
|             throws SQLException { | ||||
|         return getValue(resultSet.getString(columnName)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param rs          结果集 | ||||
|      * @param columnIndex 列下标 | ||||
|      * @return UUID结果 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public UUID getNullableResult(ResultSet rs, int columnIndex) throws SQLException { | ||||
|         return getValue(rs.getString(columnIndex)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param cs          cs | ||||
|      * @param columnIndex 列下标 | ||||
|      * @return 返回UUID结果 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public UUID getNullableResult(CallableStatement cs, int columnIndex) | ||||
|             throws SQLException { | ||||
|         return getValue(cs.getString(columnIndex)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 设置参数 | ||||
|      * | ||||
|      * @param ps        ps | ||||
|      * @param i         i | ||||
|      * @param parameter 参数 | ||||
|      * @param jdbcType  jdbc类型 | ||||
|      * @throws SQLException SQL异常 | ||||
|      */ | ||||
|     @Override | ||||
|     public void setNonNullParameter(PreparedStatement ps, int i, UUID parameter, org.apache.ibatis.type.JdbcType jdbcType) throws SQLException { | ||||
|         if (ps != null) { | ||||
|             ps.setObject(i, parameter); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 获取结果 | ||||
|      * | ||||
|      * @param str 传参字符串 | ||||
|      * @return 返回UUID结果 | ||||
|      */ | ||||
|     private UUID getValue(String str) { | ||||
|         return notNull(str) ? UUID.fromString(str) : null; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 非空判断 | ||||
|      * | ||||
|      * @param arg 参数 | ||||
|      * @return 判断是否不为空 | ||||
|      */ | ||||
|     private boolean notNull(String arg) { | ||||
|         return (null != arg && !arg.isEmpty()); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,19 @@ | ||||
| package com.pjilisense.flxai.service; | ||||
| 
 | ||||
| import com.pjilisense.flxai.base.service.CrudService; | ||||
| import com.pjilisense.flxai.dto.FilesDTO; | ||||
| import com.pjilisense.flxai.entity.FilesEntity; | ||||
| 
 | ||||
| /** | ||||
|  * ${comments} | ||||
|  * | ||||
|  * @author liushujing liushujing@philisense.com | ||||
|  * @since 1.0.0 2025-01-14 | ||||
|  */ | ||||
| public interface FilesService extends CrudService<FilesEntity, FilesDTO> { | ||||
|     boolean modifyFileName(FilesDTO dto); | ||||
| 
 | ||||
|     boolean modifyFileStatus(FilesDTO dto); | ||||
| 
 | ||||
|     boolean modifyFileCategory(FilesDTO dto); | ||||
| } | ||||
| @ -0,0 +1,65 @@ | ||||
| package com.pjilisense.flxai.service.impl; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.pjilisense.flxai.base.service.impl.CrudServiceImpl; | ||||
| import com.pjilisense.flxai.dao.FilesDao; | ||||
| import com.pjilisense.flxai.dto.FilesDTO; | ||||
| import com.pjilisense.flxai.entity.FilesEntity; | ||||
| import com.pjilisense.flxai.service.FilesService; | ||||
| import cn.hutool.core.util.StrUtil; | ||||
| import com.pjilisense.flxai.utils.MapUtils; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * ${comments} | ||||
|  * | ||||
|  * @author liushujing liushujing@philisense.com | ||||
|  * @since 1.0.0 2025-01-14 | ||||
|  */ | ||||
| @Service | ||||
| public class FilesServiceImpl extends CrudServiceImpl<FilesDao, FilesEntity, FilesDTO> implements FilesService { | ||||
| 
 | ||||
|     @Override | ||||
|     public QueryWrapper<FilesEntity> getWrapper(Map<String, Object> params){ | ||||
|         String id = (String)params.get("id"); | ||||
| 
 | ||||
|         QueryWrapper<FilesEntity> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.eq(StrUtil.isNotBlank(id), "id", id); | ||||
| 
 | ||||
|         return wrapper; | ||||
|     } | ||||
| //    public QueryWrapper<FilesEntity> getWrapperModifyName(FilesDTO dto){
 | ||||
| //        String id = (String)dto.getId();
 | ||||
| //
 | ||||
| //        QueryWrapper<FilesEntity> wrapper = new QueryWrapper<>();
 | ||||
| //        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
 | ||||
| //
 | ||||
| //        return wrapper;
 | ||||
| //    }
 | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean modifyFileName(FilesDTO dto) { | ||||
|         int cnt = baseDao.modifyFileName(MapUtils.objectToMap(dto)); | ||||
| //        FilesEntity entity = baseDao.selectOne(getWrapperModifyName(dto));
 | ||||
| //        entity.setName(dto.getName());
 | ||||
| //        int cnt = baseDao.updateById(entity);
 | ||||
|         return cnt>0; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean modifyFileStatus(FilesDTO dto) { | ||||
|         Map map = MapUtils.objectToMap(dto); | ||||
|         int cnt = baseDao.modifyFileStatus(map); | ||||
|         return cnt>0; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean modifyFileCategory(FilesDTO dto) { | ||||
|         Map map = MapUtils.objectToMap(dto); | ||||
|         int cnt = baseDao.modifyFileCategory(map); | ||||
|         return cnt>0; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,32 @@ | ||||
| package com.pjilisense.flxai.wrapper; | ||||
| 
 | ||||
| import com.fasterxml.jackson.core.JsonParser; | ||||
| import com.fasterxml.jackson.databind.DeserializationContext; | ||||
| import com.fasterxml.jackson.databind.JsonDeserializer; | ||||
| 
 | ||||
| import java.io.IOException; | ||||
| import java.time.*; | ||||
| import java.time.format.DateTimeFormatter; | ||||
| 
 | ||||
| public class OffsetDateTimeDeserializer extends JsonDeserializer<OffsetDateTime> { | ||||
|     @Override | ||||
|     public OffsetDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { | ||||
|         String dateTimeStr = p.getText(); | ||||
|         if(dateTimeStr==null || dateTimeStr.trim().length()==0){ | ||||
|             return null; | ||||
|         } | ||||
|         if(dateTimeStr.length()==19&& dateTimeStr.indexOf('T')==-1) { | ||||
|             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); | ||||
|             // 创建一个Joda DateTime实例
 | ||||
|             LocalDateTime localDateTime = LocalDateTime.parse(dateTimeStr, formatter); | ||||
|             // 转换为OffsetDateTime
 | ||||
|             OffsetDateTime offsetDateTimeUtc = localDateTime.atOffset(ZoneOffset.UTC); | ||||
|             return offsetDateTimeUtc; | ||||
|         } else if(dateTimeStr.length()>19) { | ||||
|             OffsetDateTime dateTime = OffsetDateTime.parse(dateTimeStr, DateTimeFormatter.ISO_OFFSET_DATE_TIME); | ||||
|             return dateTime; | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,21 @@ | ||||
| package com.pjilisense.flxai.wrapper; | ||||
| 
 | ||||
| import com.fasterxml.jackson.core.JsonGenerator; | ||||
| import com.fasterxml.jackson.databind.JsonSerializer; | ||||
| import com.fasterxml.jackson.databind.SerializerProvider; | ||||
| 
 | ||||
| import java.io.IOException; | ||||
| import java.time.OffsetDateTime; | ||||
| import java.time.format.DateTimeFormatter; | ||||
| 
 | ||||
| public class OffsetDateTimeSerializer extends JsonSerializer<OffsetDateTime> { | ||||
| //    @Override
 | ||||
| //    public void serialize(OffsetDateTimeWrapper value, SerializerProvider serializers, com.fasterxml.jackson.core.JsonGenerator gen) throws IOException {
 | ||||
| //        gen.writeString(value.getDateTime().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
 | ||||
| //    }
 | ||||
| 
 | ||||
|     @Override | ||||
|     public void serialize(OffsetDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException { | ||||
|         gen.writeString(value.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,35 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| 
 | ||||
| <mapper namespace="com.pjilisense.flxai.dao.FilesDao"> | ||||
| 
 | ||||
|     <resultMap type="com.pjilisense.flxai.entity.FilesEntity" id="filesMap" > | ||||
|         <result property="id" column="id"/> | ||||
|         <result property="userId" column="user_id"/> | ||||
|         <result property="fileType" column="file_type"/> | ||||
|         <result property="name" column="name"/> | ||||
|         <result property="size" column="size"/> | ||||
|         <result property="url" column="url"/> | ||||
|         <result property="metadata" column="metadata" typeHandler="com.pjilisense.flxai.handle.JsonbTypeHandler"/> | ||||
|         <result property="createdAt" column="created_at" jdbcType="TIMESTAMP_WITH_TIMEZONE" javaType="java.time.OffsetDateTime" /> | ||||
|         <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP_WITH_TIMEZONE" javaType="java.time.OffsetDateTime" /> | ||||
|         <result property="fileHash" column="file_hash"/> | ||||
|         <result property="chunkTaskId" column="chunk_task_id" typeHandler="com.pjilisense.flxai.handle.UUIDTypeHandler"/> | ||||
|         <result property="embeddingTaskId" column="embedding_task_id" typeHandler="com.pjilisense.flxai.handle.UUIDTypeHandler"/> | ||||
|         <result property="accessedAt" column="accessed_at" jdbcType="TIMESTAMP_WITH_TIMEZONE" javaType="java.time.OffsetDateTime" /> | ||||
|         <result property="fileCategory" column="file_category"/> | ||||
|         <result property="fileStatus" column="file_status"/> | ||||
|     </resultMap> | ||||
| 
 | ||||
|     <update id="modifyFileName" parameterType="java.util.Map"> | ||||
|         UPDATE files SET name = #{name,jdbcType=VARCHAR} WHERE id = #{id} | ||||
|     </update> | ||||
| 
 | ||||
|     <update id="modifyFileStatus" parameterType="java.util.Map"> | ||||
|         UPDATE files SET file_status = #{fileStatus,jdbcType=VARCHAR} WHERE id = #{id} | ||||
|     </update> | ||||
| 
 | ||||
|     <update id="modifyFileCategory" parameterType="java.util.Map"> | ||||
|         UPDATE files SET file_category = #{fileCategory,jdbcType=VARCHAR} WHERE id = #{id} | ||||
|     </update> | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue