feat: 增加附件表结构与本地上传接口
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package com.bruce.common.attachment;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bruce.common.controller.SysAttachmentController;
|
||||
import com.bruce.common.entity.SysAttachment;
|
||||
import com.bruce.common.mapper.SysAttachmentMapper;
|
||||
import com.bruce.common.service.ISysAttachmentService;
|
||||
import com.bruce.common.service.impl.SysAttachmentServiceImpl;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class SysAttachmentComponentStructureTests {
|
||||
|
||||
@Test
|
||||
void sysAttachmentComponentsShouldReuseMybatisPlusBaseTypes() {
|
||||
assertTrue(BaseMapper.class.isAssignableFrom(SysAttachmentMapper.class));
|
||||
assertTrue(IService.class.isAssignableFrom(ISysAttachmentService.class));
|
||||
assertTrue(ServiceImpl.class.isAssignableFrom(SysAttachmentServiceImpl.class));
|
||||
assertTrue(ISysAttachmentService.class.isAssignableFrom(SysAttachmentServiceImpl.class));
|
||||
assertTrue(SysAttachment.class.isAssignableFrom(SysAttachment.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sysAttachmentShouldExposeUploadMethods() throws NoSuchMethodException {
|
||||
Method serviceMethod = ISysAttachmentService.class.getMethod(
|
||||
"upload",
|
||||
MultipartFile.class,
|
||||
String.class,
|
||||
Long.class
|
||||
);
|
||||
Method controllerMethod = SysAttachmentController.class.getMethod(
|
||||
"upload",
|
||||
MultipartFile.class,
|
||||
String.class,
|
||||
Long.class
|
||||
);
|
||||
|
||||
assertNotNull(serviceMethod);
|
||||
assertNotNull(controllerMethod);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user