forked from dyf/fys-Multi-tenant
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.common.core.domain.R;
|
||||
import com.fuyuanshen.common.web.core.BaseController;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -44,8 +45,8 @@ public class AppFileController extends BaseController {
|
||||
/**
|
||||
* 文件删除
|
||||
*/
|
||||
@DeleteMapping("/delete")
|
||||
public R<Void> delete(Long[] ids) {
|
||||
@DeleteMapping("/delete/{ids}")
|
||||
public R<Void> delete(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
if(ids == null || ids.length == 0){
|
||||
return R.fail("请选择要删除的文件");
|
||||
}
|
||||
|
@ -6,6 +6,11 @@ import lombok.Data;
|
||||
public class AppFileVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
private String businessId;
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<mapper namespace="com.fuyuanshen.app.mapper.AppBusinessFileMapper">
|
||||
|
||||
<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
|
||||
<if test="businessId != null">
|
||||
and a.business_id = #{businessId}
|
||||
|
Reference in New Issue
Block a user