Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 스프링
- java
- webpack
- git
- snowpack
- java#왕초보
- SQL
- 시큐어코딩
- Spring
- Spinner
- 쿠키
- sub query
- React
- 상속
- 미니게임
- 숫자
- 버전일치
- 스타일보험
- 게시판
- 코틀린
- FIle
- degit
- 왕초보
- 안드로이드
- parcel
- 함수
- Android
- kotlin
- 오버라이드
- 답글
Archives
- Today
- Total
YSHUSH
게시판1. 기본 빌드 본문
1. 테이블 작성 (sqldevelper)
CREATE TABLE BBS(
SEQ NUMBER(8) PRIMARY KEY,
ID VARCHAR2(50) NOT NULL,
REF NUMBER(8) NOT NULL,
STEP NUMBER(8) NOT NULL,
DEPTH NUMBER(8) NOT NULL,
TITLE VARCHAR2(200) NOT NULL,
CONTENT VARCHAR2(4000) NOT NULL,
WDATE DATE NOT NULL,
DEL NUMBER(1) NOT NULL,
READCOUNT NUMBER(8) NOT NULL
);
CREATE SEQUENCE SEQ_BBS
START WITH 1 INCREMENT BY 1;
ALTER TABLE BBS
ADD CONSTRAINT FK_BBS_ID FOREIGN KEY(ID)
REFERENCES MEMBER(ID);
COMMIT;
2. Bbs.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="Bbs">
</mapper>
3. BbsDto 만들기
BBS = Bulletin Board System 전자 게시판
public class BbsDto implements Serializable{
private int seq; // 글의 번호 -> sequence
private String id; // 작성자
private int ref; // 그룹번호 -> 댓글용
private int step; // 행번호
private int depth; // 깊이
private String title; // 제목
private String content; // 내용
private String wdate; // 작성일
private int del; // 삭제
private int readcount; // 조회수
public BbsDto() {
}
public BbsDto(int seq, String id, int ref, int step, int depth, String title, String content, String wdate, int del,
int readcount) {
super();
this.seq = seq;
this.id = id;
this.ref = ref;
this.step = step;
this.depth = depth;
this.title = title;
this.content = content;
this.wdate = wdate;
this.del = del;
this.readcount = readcount;
}
public BbsDto(String id, String title, String content) {
super();
this.id = id;
this.title = title;
this.content = content;
}
public int getSeq() {
return seq;
}
public void setSeq(int seq) {
this.seq = seq;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getRef() {
return ref;
}
public void setRef(int ref) {
this.ref = ref;
}
public int getStep() {
return step;
}
public void setStep(int step) {
this.step = step;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getWdate() {
return wdate;
}
public void setWdate(String wdate) {
this.wdate = wdate;
}
public int getDel() {
return del;
}
public void setDel(int del) {
this.del = del;
}
public int getReadcount() {
return readcount;
}
public void setReadcount(int readcount) {
this.readcount = readcount;
}
@Override
public String toString() {
return "BbsDto [seq=" + seq + ", id=" + id + ", ref=" + ref + ", step=" + step + ", depth=" + depth + ", title="
+ title + ", content=" + content + ", wdate=" + wdate + ", del=" + del + ", readcount=" + readcount
+ "]";
}
}
4. BbsDao, BbsDaoImpl
BbsDao
public interface BbsDao {
}
BbsDaoImpl
@Repository
public class BbsDaoImpl implements BbsDao{
@Autowired
SqlSession session;
String ns = "Bbs.";
}
5. BbsService, BbsServiceImpl
BbsService
public interface BbsService {
}
BbsServiceImpl
@Service
public class BbsServiceImpl implements BbsService{
@Autowired
BbsDao dao;
}
6. BbsController
@Controller
public class BbsController {
private static Logger logger = LoggerFactory.getLogger(BbsController.class);
@Autowired
BbsService service;
}
'Coding > SpringFramework' 카테고리의 다른 글
| 게시판3. 상세 글 보기 + 최신글 역순 정렬 (0) | 2022.01.28 |
|---|---|
| 게시판2. 게시판 목록 & 글쓰기 (0) | 2022.01.25 |
| 로그인 (0) | 2022.01.24 |
| 회원가입시 아이디 확인, 빈칸 허용하지 않기 (0) | 2022.01.24 |
| 회원가입 (0) | 2022.01.24 |