게시판 관련 모델 추가.
parent
c261beaed7
commit
e71e57910a
|
|
@ -1,12 +1,17 @@
|
|||
package com.dbnt.kcgfilemanager.controller;
|
||||
|
||||
import com.dbnt.kcgfilemanager.model.UserInfo;
|
||||
import com.dbnt.kcgfilemanager.service.UserInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/board")
|
||||
|
|
@ -22,8 +27,12 @@ public class BoardController {
|
|||
|
||||
|
||||
@GetMapping("/contentWrite")
|
||||
public ModelAndView doDenied() {
|
||||
public ModelAndView contentWrite(Principal principal) {
|
||||
ModelAndView mav = new ModelAndView("board/contentWrite");
|
||||
UserInfo loginUser = ((UserInfo)((UsernamePasswordAuthenticationToken) principal).getPrincipal());
|
||||
mav.addObject("userId", loginUser.getUserId());
|
||||
mav.addObject("userName", loginUser.getName());
|
||||
mav.addObject("nowDate", LocalDateTime.now());
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.dbnt.kcgfilemanager.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "BOARD")
|
||||
public class Board extends BaseModel{
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "CONTENT_SEQ")
|
||||
private Integer contentSeq;
|
||||
@Column(name = "CATEGORY_SEQ")
|
||||
private Integer categorySeq;
|
||||
@Column(name = "TITLE")
|
||||
private String title;
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
@Column(name = "STATUS")
|
||||
private String status;
|
||||
@Column(name = "CREATE_ID")
|
||||
private String createId;
|
||||
@Column(name = "CREATE_DATE")
|
||||
private LocalDateTime createDate;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.dbnt.kcgfilemanager.model;
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "BOARD_LOG")
|
||||
@IdClass(BoardLog.BoardLogId.class)
|
||||
public class BoardLog {
|
||||
|
||||
@Id
|
||||
@Column(name = "CONTENT_SEQ", nullable = false)
|
||||
private Integer contentSeq;
|
||||
@Id
|
||||
@Column(name = "LOG_SEQ", nullable = false)
|
||||
private Integer logSeq;
|
||||
|
||||
@Column(name = "LOG_STATUS")
|
||||
private String logStatus;
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
@Column(name = "CREATE_ID")
|
||||
private String createId;
|
||||
@Column(name = "CREATE_DATE")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class BoardLogId implements Serializable {
|
||||
private Integer contentSeq;
|
||||
private Integer logSeq;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.dbnt.kcgfilemanager.model;
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "FILE_INFO")
|
||||
@IdClass(FileInfo.FileInfoId.class)
|
||||
public class FileInfo {
|
||||
|
||||
@Id
|
||||
@Column(name = "CONTENT_SEQ", nullable = false)
|
||||
private Integer contentSeq;
|
||||
@Id
|
||||
@Column(name = "FILE_SEQ", nullable = false)
|
||||
private Integer fileSeq;
|
||||
|
||||
@Column(name = "ORIGINAL_NAME")
|
||||
private String originalName;
|
||||
@Column(name = "CONVERSION_NAME")
|
||||
private String conversionName;
|
||||
@Column(name = "EXTENTION")
|
||||
private String extention;
|
||||
@Column(name = "SAVE_PATH")
|
||||
private String savePath;
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class FileInfoId implements Serializable {
|
||||
private Integer contentSeq;
|
||||
private Integer fileSeq;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.dbnt.kcgfilemanager.model;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "HASH_TAG")
|
||||
public class HashTag {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "TAG_SEQ")
|
||||
private Integer tagSeq;
|
||||
@Column(name = "TAG_NAME")
|
||||
private String tagName;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.dbnt.kcgfilemanager.model;
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "HASH_TAG_LINK")
|
||||
@IdClass(HashTagLink.HashTagLinkId.class)
|
||||
public class HashTagLink {
|
||||
|
||||
@Id
|
||||
@Column(name = "CONTENT_SEQ", nullable = false)
|
||||
private Integer contentSeq;
|
||||
@Id
|
||||
@Column(name = "TAG_SEQ", nullable = false)
|
||||
private Integer tagSeq;
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class HashTagLinkId implements Serializable {
|
||||
private Integer contentSeq;
|
||||
private Integer tagSeq;
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ function setCategorySelector(depth, categorySeq){
|
|||
if(parentSeq === categorySeq){
|
||||
option.removeAttr("style");
|
||||
}else{
|
||||
option.css("display", "none;");
|
||||
option.css("display", "none");
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -74,13 +74,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="createId" class="col-sm-2 col-form-label">작성자</label>
|
||||
<label for="createName" class="col-sm-2 col-form-label">작성자</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="createId" readonly>
|
||||
<input type="hidden" name="createId" th:value="${userId}">
|
||||
<input type="text" class="form-control" id="createName" th:value="${userName}" readonly>
|
||||
</div>
|
||||
<label for="createDate" class="col-sm-2 col-form-label">작성일</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="createDate" readonly>
|
||||
<input type="text" class="form-control" id="createDate" th:value="${#temporals.format(nowDate, 'yyyy-MM-dd')}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
|
|
|
|||
Loading…
Reference in New Issue