Contents API 추가
This commit is contained in:
parent
843db73d12
commit
77c0a7d43f
|
|
@ -0,0 +1,23 @@
|
|||
package com.leejk0523.javavue.admin.contents.controller;
|
||||
|
||||
import com.leejk0523.javavue.admin.contents.service.AdminContentsService;
|
||||
import com.leejk0523.javavue.model.AsaContent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class AdminContentsController {
|
||||
private final AdminContentsService adminContentsService;
|
||||
|
||||
@GetMapping("/api/admin/contents/contentsList")
|
||||
public ResponseEntity<List<AsaContent>> siteAllList() {
|
||||
final var results = adminContentsService.SiteAllList();
|
||||
return ResponseEntity.ok(results);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.leejk0523.javavue.admin.contents.dao;
|
||||
|
||||
import com.leejk0523.javavue.model.AsaContent;
|
||||
import com.leejk0523.javavue.model.QAsaContent;
|
||||
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class AdminContentsDao extends QuerydslRepositorySupport {
|
||||
public AdminContentsDao() {
|
||||
super(AsaContent.class);
|
||||
}
|
||||
|
||||
public List<AsaContent> SiteAllList() {
|
||||
QAsaContent asaContent = QAsaContent.asaContent;
|
||||
|
||||
return from(asaContent)
|
||||
.fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.leejk0523.javavue.admin.contents.service;
|
||||
|
||||
import com.leejk0523.javavue.model.AsaContent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AdminContentsService {
|
||||
List<AsaContent> SiteAllList();
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.leejk0523.javavue.admin.contents.service;
|
||||
|
||||
import com.leejk0523.javavue.admin.contents.dao.AdminContentsDao;
|
||||
import com.leejk0523.javavue.model.AsaContent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AdminContentsServiceImpl implements AdminContentsService {
|
||||
private final AdminContentsDao adminContentsDao;
|
||||
|
||||
@Override
|
||||
public List<AsaContent> SiteAllList() {
|
||||
return adminContentsDao.SiteAllList();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.leejk0523.javavue.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "asa_content")
|
||||
public class AsaContent {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "CONTENT_ID", nullable = false)
|
||||
private Integer contentId;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "SITE_ID", length = 20)
|
||||
private String siteId;
|
||||
|
||||
@Column(name = "ORG_ID", length = 36)
|
||||
private String orgId;
|
||||
|
||||
@Size(max = 500)
|
||||
@Column(name = "CONTENT_TITLE", length = 500)
|
||||
private String contentTitle;
|
||||
|
||||
@Lob
|
||||
@Column(name = "CONTENTS")
|
||||
private String contents;
|
||||
|
||||
@Size(max = 4000)
|
||||
@Column(name = "CONTENT_PLAIN", length = 4000)
|
||||
private String contentPlain;
|
||||
|
||||
@Column(name = "USE_YN", length = 1, nullable = false)
|
||||
private Boolean useYn;
|
||||
|
||||
@Column(name = "DEL_YN", length = 1, nullable = false)
|
||||
private Boolean delYn;
|
||||
|
||||
@Column(name = "FRST_RGTR_ID", length = 50, nullable = false)
|
||||
private String frstRgtrId;
|
||||
|
||||
@Column(name = "FRST_REG_DT", nullable = false)
|
||||
private LocalDateTime frstRegDt;
|
||||
|
||||
@Column(name = "LAST_MDFR_ID", length = 50)
|
||||
private String lastMdfrId;
|
||||
|
||||
@Column(name = "LAST_MDFCN_DT")
|
||||
private LocalDateTime lastMdfcnDt;
|
||||
}
|
||||
Loading…
Reference in New Issue