[UPDATE] SPEC 수정

main
bjkim 11 months ago
parent 9157033ef1
commit 4fd139ab38

@ -63,7 +63,7 @@ public class ProjectController {
@Operation(summary = "프로젝트 수정")
@PutMapping("/{id}")
public ResponseEntity<ProjectEntity> updateProject(
@Parameter(description = "수정할 프로젝트 ID", required = true, in = ParameterIn.PATH)
@Parameter(description = "수정할 프로젝트 ID", required = true, in = ParameterIn.PATH)
@PathVariable("id") Long id,
@RequestBody ProjectRequest dto) {

@ -8,6 +8,7 @@ import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Schema(description = "프로젝트")
@Comment("프로젝트")
@ -54,7 +55,7 @@ public class ProjectEntity {
@CreatedDate
@Schema(description = "등록 일자")
@Comment("등록 일자")
private String regDate;
private LocalDateTime regDate;
@Schema(description = "등록 유저 ID", example = "system")
@Comment("등록 유저 ID")
@ -67,7 +68,7 @@ public class ProjectEntity {
@LastModifiedDate
@Schema(description = "수정 일자")
@Comment("수정 일자")
private String modDate;
private LocalDateTime modDate;
@Schema(description = "수정 유저 ID", example = "system")
@Comment("수정 유저 ID")

@ -37,8 +37,10 @@ public class ProjectService {
}
public Page<ProjectEntity> search(BaseSearchRequest request) {
int pageIndex = request.getPage() > 0 ? request.getPage() - 1 : 0;
Pageable pageable = PageRequest.of(
request.getPage(),
pageIndex,
request.getSize(),
Sort.by(Sort.Direction.fromString(request.getSortDirection()), request.getSortField())
);

@ -50,7 +50,8 @@ public class ProjectSpecification {
Predicate predicate = cb.conjunction();
if (keyword != null && !keyword.isEmpty()) {
if ("전체".equalsIgnoreCase(searchType) || "all".equalsIgnoreCase(searchType)) {
if (searchType == null || searchType.isEmpty() ||
"전체".equalsIgnoreCase(searchType) || "all".equalsIgnoreCase(searchType)) {
Predicate orPredicate = cb.disjunction();
for (String field : stringFields) {
orPredicate = cb.or(orPredicate,

@ -3,7 +3,7 @@ spring.datasource.username=cuuva
spring.datasource.password=cuuva
spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect
spring.jpa.hibernate.ddl-auto=create-only
spring.jpa.hibernate.ddl-auto=create-drop
spring.sql.init.mode=always
@ -20,3 +20,16 @@ bezkoder.app.jwtSecret= 275511b31c520562d69802ce4a913773102563891563a24062f44b3f
## For test
bezkoder.app.jwtExpirationMs= 60000
bezkoder.app.jwtRefreshExpirationMs= 180000
# SQL ?? ??
spring.jpa.show-sql=true
# SQL ??? ????? ?? ?? ?? (??)
spring.jpa.properties.hibernate.format_sql=true
# ??? ? ???? ??? ??? ?? ??? ?? ?? ??
logging.level.org.hibernate.type.descriptor.sql=TRACE
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

@ -1,5 +1,6 @@
-- src/main/resources/data.sql
# INSERT INTO tb_role (id, name) VALUES (1, 'ROLE_USER');
# INSERT INTO tb_role (id, name) VALUES (2, 'ROLE_MODERATOR');
# INSERT INTO tb_role (id, name) VALUES (3, 'ROLE_ADMIN');
INSERT INTO tb_role (id, name) VALUES (1, 'ROLE_USER');
INSERT INTO tb_role (id, name) VALUES (2, 'ROLE_MODERATOR');
INSERT INTO tb_role (id, name) VALUES (3, 'ROLE_ADMIN');

Loading…
Cancel
Save