Просмотр исходного кода

feat: 添加教师交流区基本框架

191250028 3 лет назад
Родитель
Сommit
0dedaf5072

+ 24 - 0
seecoder-portal-common/src/main/java/cn/seecoder/seecoderportalcommon/vo/CommunicationFileVO.java

@@ -0,0 +1,24 @@
+package cn.seecoder.seecoderportalcommon.vo;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:10
+ */
+
+public class CommunicationFileVO {
+
+    private Long id;
+
+    private String fileName;
+
+//    枚举形
+//    private String fileType;
+
+    private Integer fileSize;
+
+    private String fileUrl;
+
+    private String fileExtention;
+
+    private Integer fileOwnerId;
+}

+ 45 - 0
seecoder-portal-common/src/main/java/cn/seecoder/seecoderportalcommon/vo/CommunicationVO.java

@@ -0,0 +1,45 @@
+package cn.seecoder.seecoderportalcommon.vo;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:15
+ */
+public class CommunicationVO {
+
+    private Long id;
+
+    private Long publisherId;
+
+    private String title;
+
+//    private CommunicationTypeEnum type;
+
+    private String description;
+
+    private String organization;
+
+    private String phone;
+
+    private String wechat;
+
+    private String qq;
+
+    private String email;
+
+    private Date publishTime;
+
+    private Date deadline;
+
+    private List<CommunicationFileVO> photos;
+
+    private List<CommunicationFileVO> attachments;
+
+    private String publisherName;
+
+    //是否已经收藏
+    private Boolean starred;
+
+}

+ 49 - 0
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/domain/Communication.java

@@ -0,0 +1,49 @@
+package cn.seecoder.seecoderportalserver.domain;
+
+import cn.seecoder.seecoderportalcommon.vo.CommunicationFileVO;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:22
+ */
+@Entity
+@Table(name = "communication")
+public class Communication {
+    @Id
+    private Long id;
+
+    private Long publisherId;
+
+    private String title;
+
+//    private CommunicationTypeEnum type;
+
+    private String description;
+
+    private String organization;
+
+    private String phone;
+
+    private String wechat;
+
+    private String qq;
+
+    private String email;
+
+    private Date publishTime;
+
+    private Date deadline;
+
+    @OneToMany
+    private List<CommunicationFile> photos;
+
+    @OneToMany
+    private List<CommunicationFile> attachments;
+}

+ 30 - 0
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/domain/CommunicationFile.java

@@ -0,0 +1,30 @@
+package cn.seecoder.seecoderportalserver.domain;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:22
+ */
+@Entity
+@Table(name = "communication_file")
+public class CommunicationFile {
+
+    @Id
+    private Long id;
+
+    private String fileName;
+
+//    枚举形
+//    private String fileType;
+
+    private Integer fileSize;
+
+    private String fileUrl;
+
+    private String fileExtention;
+
+    private Integer fileOwnerId;
+}

+ 8 - 0
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/domain/CommunicationStar.java

@@ -0,0 +1,8 @@
+package cn.seecoder.seecoderportalserver.domain;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:30
+ */
+public class CommunicationStar {
+}

+ 8 - 0
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/service/CommunicationService.java

@@ -0,0 +1,8 @@
+package cn.seecoder.seecoderportalserver.service;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:21
+ */
+public interface CommunicationService {
+}

+ 10 - 0
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/serviceImpl/CommunicationServiceImpl.java

@@ -0,0 +1,10 @@
+package cn.seecoder.seecoderportalserver.serviceImpl;
+
+import cn.seecoder.seecoderportalserver.service.CommunicationService;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:21
+ */
+public class CommunicationServiceImpl implements CommunicationService {
+}

+ 21 - 0
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/web/rest/CommunicationController.java

@@ -0,0 +1,21 @@
+package cn.seecoder.seecoderportalserver.web.rest;
+
+import cn.seecoder.seecoderportalcommon.vo.UserVO;
+import cn.seecoder.seecoderportalserver.utility.OkResponse;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+
+/**
+ * @author fanyanpeng
+ * @date 2023/7/11 12:06
+ */
+@RestController
+@RequestMapping("/api/communication")
+public class CommunicationController {
+    @PostMapping("/upload")
+    public OkResponse<UserVO> uploadCommunicationFile(@RequestParam MultipartFile file) {
+        return null;
+    }
+}