gunshi-project-ss/src/main/java/com/gunshi/project/hsz/controller/ICommonDeleteByIdWithAttach...

34 lines
1.3 KiB
Java
Raw Normal View History

2025-07-17 15:26:39 +08:00
package com.gunshi.project.hsz.controller;
2024-07-08 10:05:02 +08:00
import com.gunshi.core.result.R;
import com.gunshi.db.dao.BaseDao;
import com.gunshi.db.dao.IMapper;
2025-07-17 15:26:39 +08:00
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
2024-07-08 10:05:02 +08:00
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)));
}
}