app删除文件
This commit is contained in:
@ -6,6 +6,7 @@ import com.fuyuanshen.app.domain.vo.AppFileVo;
|
|||||||
import com.fuyuanshen.app.service.AppFileService;
|
import com.fuyuanshen.app.service.AppFileService;
|
||||||
import com.fuyuanshen.common.core.domain.R;
|
import com.fuyuanshen.common.core.domain.R;
|
||||||
import com.fuyuanshen.common.web.core.BaseController;
|
import com.fuyuanshen.common.web.core.BaseController;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -44,8 +45,8 @@ public class AppFileController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 文件删除
|
* 文件删除
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete/{ids}")
|
||||||
public R<Void> delete(Long[] ids) {
|
public R<Void> delete(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||||
if(ids == null || ids.length == 0){
|
if(ids == null || ids.length == 0){
|
||||||
return R.fail("请选择要删除的文件");
|
return R.fail("请选择要删除的文件");
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,11 @@ import lombok.Data;
|
|||||||
public class AppFileVo {
|
public class AppFileVo {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
/**
|
/**
|
||||||
* 文件id
|
* 文件id
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<mapper namespace="com.fuyuanshen.app.mapper.AppBusinessFileMapper">
|
<mapper namespace="com.fuyuanshen.app.mapper.AppBusinessFileMapper">
|
||||||
|
|
||||||
<select id="queryAppFileList" resultType="com.fuyuanshen.app.domain.vo.AppFileVo">
|
<select id="queryAppFileList" resultType="com.fuyuanshen.app.domain.vo.AppFileVo">
|
||||||
select a.business_id id,a.file_id,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
select a.id,a.business_id,a.file_id,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
||||||
where
|
where
|
||||||
<if test="businessId != null">
|
<if test="businessId != null">
|
||||||
and a.business_id = #{businessId}
|
and a.business_id = #{businessId}
|
||||||
|
Reference in New Issue
Block a user