审核图片
This commit is contained in:
parent
817791b6e1
commit
469f9ebf47
|
@ -12,7 +12,6 @@ import lombok.EqualsAndHashCode;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
@ -117,4 +116,8 @@ public class ImageEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("image_path")
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty("是否已审核,0未审核,1已审核")
|
||||
@TableField("review_state")
|
||||
private Boolean reviewState;
|
||||
|
||||
}
|
||||
|
|
|
@ -30,4 +30,7 @@ public class ImageListReq implements Serializable {
|
|||
@ApiModelProperty("图像类型")
|
||||
private String[] imageTypes;
|
||||
|
||||
@ApiModelProperty("是否已审核,0未审核,1已审核")
|
||||
private Boolean reviewState;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.dite.znpt.domain.entity.AudioFileInfoEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -47,4 +43,7 @@ public class ImageResp implements Serializable {
|
|||
@ApiModelProperty("关联图像的音频列表")
|
||||
private List<AudioFileInfoResp> audioList;
|
||||
|
||||
@ApiModelProperty("是否已审核,0未审核,1已审核")
|
||||
private Boolean reviewState;
|
||||
|
||||
}
|
||||
|
|
|
@ -42,4 +42,13 @@ public interface ImageService extends IService<ImageEntity> {
|
|||
* @date 2025/06/06 09:44
|
||||
**/
|
||||
void linkAppImagesToPart(AppImageToPartReq partReq);
|
||||
|
||||
/**
|
||||
* 功能描述:审核图片
|
||||
*
|
||||
* @param imageIds 图片id列表
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/16 15:28
|
||||
**/
|
||||
void reviewImages(List<String> imageIds);
|
||||
}
|
||||
|
|
|
@ -441,4 +441,19 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
imageCollectService.save(BeanUtil.copyProperties(partReq, ImageCollectEntity.class));
|
||||
baseMapper.insert(newImageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:审核图片
|
||||
*
|
||||
* @param imageIds 图片id列表
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/16 15:28
|
||||
**/
|
||||
@Override
|
||||
public void reviewImages(List<String> imageIds) {
|
||||
if (CollUtil.isEmpty(imageIds)) {
|
||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
lambdaUpdate().in(ImageEntity::getImageId, imageIds).set(ImageEntity::getReviewState, "1").update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
SELECT
|
||||
i.image_id, i.image_name, i.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
||||
i.camera_model, i.GPS, ic.weather, ic.humidness, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature, ic.wind_level,
|
||||
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source
|
||||
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source, i.review_state
|
||||
FROM image i
|
||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||
LEFT JOIN part p ON i.part_id = p.part_id
|
||||
|
@ -22,6 +22,9 @@
|
|||
<if test="imageTypes != null and imageTypes.length > 0">
|
||||
AND i.image_type in <foreach collection="imageTypes" item="imageType" open="(" close=")" separator=",">#{imageType}</foreach>
|
||||
</if>
|
||||
<if test="reviewState != null">
|
||||
and i.review_state = #{reviewState}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -31,6 +34,7 @@
|
|||
<result property="imagePath" column="image_path"></result>
|
||||
<result property="imageSize" column="image_size"></result>
|
||||
<result property="imageResolution" column="image_resolution"></result>
|
||||
<result property="reviewState" column="review_state"></result>
|
||||
<association property="imageExifInfo">
|
||||
<result property="imageWidth" column="image_width"></result>
|
||||
<result property="imageHeight" column="image_height"></result>
|
||||
|
@ -64,7 +68,7 @@
|
|||
SELECT i.image_id, i.image_name, i.image_path, i.image_height, i.image_resolution, i.image_width, i.image_height, i.focal_distance,
|
||||
i.focal_distance35, i.x_resolution, i.y_resolution, i.resolution_units, i.shooting_time, i.camera_manufacturer, i.camera_model,
|
||||
i.latitude, i.latitude, i.altitude, ic.collect_id, ic.weather, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature,
|
||||
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source
|
||||
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source, i.review_state
|
||||
FROM image i
|
||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||
WHERE i.image_id = #{imageId}
|
||||
|
|
|
@ -88,4 +88,11 @@ public class ImageController {
|
|||
imageService.linkAppImagesToPart(partReq);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审核图片", httpMethod = "POST")
|
||||
@PostMapping("/reviewImages")
|
||||
public Result<?> reviewImages(@RequestBody List<String> imageIds) {
|
||||
imageService.reviewImages(imageIds);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue