Skip to content

Commit

Permalink
Merge pull request #43 from lab-cherry/haeri
Browse files Browse the repository at this point in the history
Haeri
  • Loading branch information
taking authored Oct 26, 2023
2 parents 103da81 + 026e444 commit f6e085b
Show file tree
Hide file tree
Showing 39 changed files with 286 additions and 347 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
"/swagger-resources/**",
"/swagger-ui/**",
"/swagger-ui.html",
"/api/v1/file/download/**", // TODO: download/{orgId} 에 대해 각 orgId 소속만 접근 가능하는 기능 추가 필요
"/api/v1/file/test"
"/api/v1/mail/**"
)
.permitAll()
.requestMatchers("/api/v1/**").hasAnyRole("ADMIN", "USER") // spring boot 에서 ROLE_ 은 자동으로 붙음
Expand Down
172 changes: 0 additions & 172 deletions nw/src/main/java/lab/cherry/nw/controller/BoardController.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ public ResponseEntity<?> findByBookmarkId(@PathVariable("id") String id) {
// return new ResponseEntity<>(bookmarkService.findByUserId(objectId), new HttpHeaders(), HttpStatus.OK);
// }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/nw/api/v1/finaltempl")
@RequestMapping("/api/v1/finaltempl")
@Tag(name = "Finaltempl", description = "Finaltempl API Document")
public class FinalTemplController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/nw/api/v1/finaldocs")
@RequestMapping("/api/v1/finaldocs")
@Tag(name = "Finaldocs", description = "Finaldocs API Document")
public class FinaldocsController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ public ResponseEntity<?> downloadQsheetBySeq(@RequestBody QsheetEntity.QsheetDow

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/nw/api/v1/schedule")
@RequestMapping("/api/v1/schedule")
@Tag(name = "Schedule", description = "Schedule API Document")
public class ScheduleController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ public ResponseEntity<?> findByTagId(@PathVariable("name") String name) {
// return new ResponseEntity<>(tagService.findByUserId(objectId), new HttpHeaders(), HttpStatus.OK);
// }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import lab.cherry.nw.error.ResultResponse;
import lab.cherry.nw.error.enums.SuccessCode;
import lab.cherry.nw.model.UserCardEntity;
import lab.cherry.nw.model.UserEntity;
import lab.cherry.nw.service.UserCardService;
import lab.cherry.nw.util.Common;
import lombok.RequiredArgsConstructor;
Expand All @@ -46,7 +47,7 @@
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/nw/api/v1/usercard")
@RequestMapping("/api/v1/usercard")
@Tag(name = "Usercard", description = "Usercard API Document")
public class UserCardController {

Expand Down Expand Up @@ -134,6 +135,34 @@ public ResponseEntity<?> updateUserCardById(@PathVariable("id") String id, @Requ
return new ResponseEntity<>(userCardService.findById(id), new HttpHeaders(), HttpStatus.OK);
}

/**
* [UserCardController] 사용자 웨딩홀 업데이트 함수
*
* @param id 고객카드 고유번호를 입력합니다.
* @param usercardEntity 웨딩홀 정보를 업데이트하기 위한 고객카드 고유아이디를 갖고 있는 객체입니다.업데이트에 필요한 고객카드 정보를 담고 있는 객체입니다.
* @return
* <pre>
* true : 업데이트된 고객카드 정보를 반환합니다.
* false : 에러(400, 404)를 반환합니다.
* </pre>
*
* Author : hhhaeri(yhoo0020@gmail.com)
*/
@PatchMapping("{id}/weddinghall")
@Operation(summary = "고객카드 웨딩홀 정보 업데이트", description = "특정 고객카드의 웨딩홀 정보를 업데이트합니다.")
public ResponseEntity<?> updateUserWeddinghalls(
@PathVariable("id") String id,
@RequestBody UserCardEntity.UserCardUpdateDto usercardEntity) {

log.info("[UserController] updateUserCard Weddinghall...!");

userCardService.updateWeddinghallByName(id, usercardEntity.getWeddinghall());

final ResultResponse response = ResultResponse.of(SuccessCode.OK);
return new ResponseEntity<>(response, new HttpHeaders(), HttpStatus.OK);
}


/**
* [UserCardController] 특정 고객카드 조회 함수
*
Expand Down
2 changes: 1 addition & 1 deletion nw/src/main/java/lab/cherry/nw/model/BoardEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public static class BoardUpdateDto {
private List<String> tagList;
}

}
}
2 changes: 1 addition & 1 deletion nw/src/main/java/lab/cherry/nw/model/BookmarkEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ public void updateFromDto(BookmarkUpdateDto updateDto) {
}


}
}
6 changes: 0 additions & 6 deletions nw/src/main/java/lab/cherry/nw/model/CategoryEntity.java

This file was deleted.

39 changes: 21 additions & 18 deletions nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@Builder
@NoArgsConstructor @AllArgsConstructor
@Document(collection = "finaltempl")
@JsonPropertyOrder({ "id", "finaltemplName","content","userid","orgid","updated_at", "created_at"})
@JsonPropertyOrder({ "id", "finaltemplName","content","user","org","updated_at", "created_at"})
public class FinalTemplEntity implements Serializable {

@Id
Expand All @@ -41,15 +41,15 @@ public class FinalTemplEntity implements Serializable {

@NotNull
@DBRef
@JsonProperty("userid")
@Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de")
private UserEntity userid;
@JsonProperty("user")
@Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de")
private UserEntity user;

@NotNull
@DBRef
@JsonProperty("orgid")
@Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de")
private OrgEntity orgid;
@JsonProperty("org")
@Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de")
private OrgEntity org;

@NotNull
@JsonProperty("finaltemplName")
Expand All @@ -60,7 +60,8 @@ public class FinalTemplEntity implements Serializable {
@NotNull
@JsonProperty("content")
@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private Map content;
private Map<String,String> content;


@JsonProperty("updated_at")
@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss", locale = "ko_KR", timezone = "Asia/Seoul")
Expand All @@ -87,18 +88,19 @@ public static class FinalTemplCreateDto {

@NotBlank
@JsonProperty("userid")
@Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String userid;
@Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de")
private String user;

@NotBlank
@JsonProperty("orgid")
@Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String orgid;
@Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de")
private String org;

@NotBlank
@JsonProperty("content")
@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private Map content;
private Map<String,String> content;


}

Expand All @@ -108,18 +110,19 @@ public static class FinalTemplCreateDto {
@NoArgsConstructor @AllArgsConstructor
public static class FinalTemplUpdateDto {

@Schema(title = "사용자 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String userid;
@Schema(title = "사용자 정보", example = "64ed89aa9e813b5ab16da6de")
private String user;

@Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de")
private String orgid;
@Schema(title = "조직 정보", example = "64ed89aa9e813b5ab16da6de")
private String org;

@Schema(title = "최종확인서 템플릿 이름", example = "예식장 최종 확인서 양식")
@Size(min = 4, max = 255, message = "Minimum name length: 4 characters")
private String name;

@Schema(title = "최종확인서 템플릿 내용", example = "문서 내용")
private Map content;
private Map<String, String> content;


}

Expand Down
Loading

0 comments on commit f6e085b

Please sign in to comment.