34 lines
1.3 KiB
Java
34 lines
1.3 KiB
Java
package com.gunshi.project.hsz.controller;
|
|
|
|
import com.gunshi.core.result.R;
|
|
import com.gunshi.db.dao.BaseDao;
|
|
import com.gunshi.db.dao.IMapper;
|
|
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import java.io.Serializable;
|
|
|
|
/**
|
|
* 通用按id删除
|
|
*
|
|
* @author lyf
|
|
* @version 1.0.0
|
|
* @since 2024-01-31
|
|
*/
|
|
public interface ICommonDeleteByIdWithAttach<Model extends AbstractModelWithAttachService.GetFileIds, AutoMapper extends IMapper<Model>, AutoDao extends BaseDao<AutoMapper, Model>,
|
|
AttachModel, AttachModelAutoMapper extends IMapper<AttachModel>, AttachModelAutoDao extends BaseDao<AttachModelAutoMapper, AttachModel>> {
|
|
|
|
AbstractModelWithAttachService<Model,AutoMapper,AutoDao,AttachModel, AttachModelAutoMapper, AttachModelAutoDao> getModelService();
|
|
|
|
Serializable getId(Serializable id);
|
|
|
|
@Operation(summary = "按id删除")
|
|
@GetMapping("/deleteById/{id}")
|
|
default R<Boolean> commonDeleteById(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
|
return R.ok(getModelService().removeById(getId(id)));
|
|
}
|
|
}
|