diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..bd5659b --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,21 @@ +name: Build Test + +on: + pull_request: + branches: [ "develop", "stage", "main" ] + +jobs: + build-test: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'temurin' + + - name: Build with Gradle + run: chmod +x gradlew && ./gradlew build -x test \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..4b3dfff --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,87 @@ +name: Deploy + +on: + push: + branches: [ "develop", "main" ] + +permissions: + contents: read + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: true + token: ${{ secrets.GH_PAT }} + + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'temurin' + + - name: Gradle Caching + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build with Gradle + run: chmod +x gradlew && ./gradlew build -x test + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Login to Amazon ECR + run: aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REGISTRY_URI }} + + - name: Docker build & push to ECR (develop) + if: github.ref == 'refs/heads/develop' + run: docker build -t ${{ secrets.ECR_REGISTRY_URI }}:dev -f Dockerfile-dev --push . + + - name: Docker build & push to ECR (production) + if: github.ref == 'refs/heads/main' + run: docker build -t ${{ secrets.ECR_REGISTRY_URI }}:prod -f Dockerfile-prod --push . + + - name: Server Deploy (develop) + if: github.ref == 'refs/heads/develop' + run: | + aws ssm send-command \ + --document-name "AWS-RunShellScript" \ + --instance-ids "${{ secrets.EC2_INSTANCE_ID }}" \ + --parameters commands='[ + "aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REGISTRY_URI }}", + "cd /root", + "[ $(docker ps --filter 'publish=443' -q | wc -l) -gt 0 ] && docker stop $(docker ps --filter 'publish=443' -q)", + "[ $(docker images -q ${{ secrets.ECR_REGISTRY_URI }}:dev | wc -l) -gt 0 ] && docker rmi ${{ secrets.ECR_REGISTRY_URI }}:dev", + "docker pull ${{ secrets.ECR_REGISTRY_URI }}:dev", + "docker run --rm -d -p 443:443 --name writely-api -v /writely/logs:/writely/logs -v /etc/letsencrypt/live/dev-api.writeon.ai.kr:/writely/cert ${{ secrets.ECR_REGISTRY_URI }}:dev" + ]' \ + --comment "Deploying Docker container (develop)" + + - name: Server Deploy (production) + if: github.ref == 'refs/heads/main' + run: | + aws ssm send-command \ + --document-name "AWS-RunShellScript" \ + --instance-ids "${{ secrets.EC2_INSTANCE_ID_PROD }}" \ + --parameters commands='[ + "aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REGISTRY_URI }}", + "cd /root", + "[ $(docker ps --filter 'publish=443' -q | wc -l) -gt 0 ] && docker stop $(docker ps --filter 'publish=443' -q)", + "[ $(docker images -q ${{ secrets.ECR_REGISTRY_URI }}:prod | wc -l) -gt 0 ] && docker rmi ${{ secrets.ECR_REGISTRY_URI }}:prod", + "docker pull ${{ secrets.ECR_REGISTRY_URI }}:prod", + "docker run --rm -d -p 443:443 --name writely-api -v /writely/logs:/writely/logs -v /etc/letsencrypt/live/api.writeon.ai.kr:/writely/cert ${{ secrets.ECR_REGISTRY_URI }}:prod" + ]' \ + --comment "Deploying Docker container (production)" \ No newline at end of file diff --git a/.github/workflows/schedule-for-refresh-certification.yml b/.github/workflows/schedule-for-refresh-certification.yml new file mode 100644 index 0000000..df51bfd --- /dev/null +++ b/.github/workflows/schedule-for-refresh-certification.yml @@ -0,0 +1,66 @@ +name: Schedule for refresh certification + +on: + schedule: + - cron: "0 15 1 * *" + workflow_dispatch: + +jobs: + run-script: + runs-on: ubuntu-latest + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Login to Amazon ECR + run: aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REGISTRY_URI }} + + - name: Refresh let's encrypt certification (develop) + run: | + aws ssm send-command \ + --document-name "AWS-RunShellScript" \ + --instance-ids "${{ secrets.EC2_INSTANCE_ID }}" \ + --parameters commands='[ + "docker run --rm --name writeon-certbot -p 80:80 -v \"/etc/letsencrypt:/etc/letsencrypt\" -v \"/var/lib/letsencrypt:/var/lib/letsencrypt\" certbot/certbot certonly --standalone --force-renewal -d dev-api.writeon.ai.kr", + "cd /etc/letsencrypt/live/dev-api.writeon.ai.kr", + "openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -CAfile chain.pem -caname root -password pass:${{ secrets.TLS_KEYSTORE_PASSWORD }}" + ]' \ + --comment "Refresh let's encrypt certification" + + - name: Restart API Server (develop) + run: | + aws ssm send-command \ + --document-name "AWS-RunShellScript" \ + --instance-ids "${{ secrets.EC2_INSTANCE_ID }}" \ + --parameters commands='[ + "[ $(docker ps --filter 'publish=443' -q | wc -l) -gt 0 ] && docker stop $(docker ps --filter 'publish=443' -q)", + "docker run --rm -d -p 443:443 --name writely-api -v /writely/logs:/writely/logs -v /etc/letsencrypt/live/dev-api.writeon.ai.kr:/writely/cert ${{ secrets.ECR_REGISTRY_URI }}:dev" + ]' \ + --comment "Restart API Server for apply new certification" + + - name: Refresh let's encrypt certification (production) + run: | + aws ssm send-command \ + --document-name "AWS-RunShellScript" \ + --instance-ids "${{ secrets.EC2_INSTANCE_ID_PROD }}" \ + --parameters commands='[ + "docker run --rm --name writeon-certbot -p 80:80 -v \"/etc/letsencrypt:/etc/letsencrypt\" -v \"/var/lib/letsencrypt:/var/lib/letsencrypt\" certbot/certbot certonly --standalone --force-renewal -d api.writeon.ai.kr", + "cd /etc/letsencrypt/live/api.writeon.ai.kr", + "openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -CAfile chain.pem -caname root -password pass:${{ secrets.TLS_KEYSTORE_PASSWORD }}" + ]' \ + --comment "Refresh let's encrypt certification" + + - name: Restart API Server (production) + run: | + aws ssm send-command \ + --document-name "AWS-RunShellScript" \ + --instance-ids "${{ secrets.EC2_INSTANCE_ID_PROD }}" \ + --parameters commands='[ + "[ $(docker ps --filter 'publish=443' -q | wc -l) -gt 0 ] && docker stop $(docker ps --filter 'publish=443' -q)", + "docker run --rm -d -p 443:443 --name writely-api -v /writely/logs:/writely/logs -v /etc/letsencrypt/live/api.writeon.ai.kr:/writely/cert ${{ secrets.ECR_REGISTRY_URI }}:prod" + ]' \ + --comment "Restart API Server for apply new certification" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 41719c5..e468764 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ HELP.md .gradle build/ +db/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ @@ -37,3 +38,6 @@ out/ .vscode/ *.log *.pid + +### secrets ### +application*.yml \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..52e35c6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "BE-secret"] + path = BE-secret + url = https://github.com/WritelyForWriters/BE-secret.git diff --git a/BE-secret b/BE-secret new file mode 160000 index 0000000..73f1191 --- /dev/null +++ b/BE-secret @@ -0,0 +1 @@ +Subproject commit 73f11914444b4f55419d542628f5f4e0c76b5b7e diff --git a/Dockerfile-dev b/Dockerfile-dev new file mode 100644 index 0000000..bb42586 --- /dev/null +++ b/Dockerfile-dev @@ -0,0 +1,10 @@ +FROM openjdk:21-jdk-slim + +WORKDIR /writeon + +ENV TZ=Asia/Seoul +RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime + +COPY api/build/libs/*.jar writeon.jar + +ENTRYPOINT ["java", "-Dspring.profiles.active=dev", "-jar", "writeon.jar"] \ No newline at end of file diff --git a/Dockerfile-prod b/Dockerfile-prod new file mode 100644 index 0000000..3bf0bd3 --- /dev/null +++ b/Dockerfile-prod @@ -0,0 +1,10 @@ +FROM openjdk:21-jdk-slim + +WORKDIR /writeon + +ENV TZ=Asia/Seoul +RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime + +COPY api/build/libs/*.jar writeon.jar + +ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "writeon.jar"] \ No newline at end of file diff --git a/api/build.gradle b/api/build.gradle new file mode 100644 index 0000000..6e4a76d --- /dev/null +++ b/api/build.gradle @@ -0,0 +1,42 @@ +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + + /* Mail */ + implementation 'org.springframework.boot:spring-boot-starter-mail' + + /* Template engine */ + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' + implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' + + /* AWS SDK */ + implementation 'software.amazon.awssdk:s3:2.30.31' + implementation("software.amazon.awssdk:netty-nio-client:2.30.31") + + /* amplitude (tracking tool) */ + implementation 'org.json:json:20201115' + implementation 'com.amplitude:java-sdk:1.+' + + /* Swagger */ + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' + + implementation 'io.netty:netty-resolver-dns-native-macos:4.1.68.Final:osx-aarch_64' + + implementation project(':assistant-api-client') + implementation project(':domain') +} + +jar { + enabled = false +} + +task copySecret(type: Copy) { + copy { + from '../BE-secret/api' + include "*.yml" + into 'src/main/resources' + } +} + +tasks.named('bootJar') { + mainClass = 'writeon.api.ApiApplication' +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/ApiApplication.java b/api/src/main/java/writeon/api/ApiApplication.java new file mode 100644 index 0000000..5f72d6a --- /dev/null +++ b/api/src/main/java/writeon/api/ApiApplication.java @@ -0,0 +1,28 @@ +package writeon.api; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; + +@SpringBootApplication +@ComponentScan(basePackages = {"writeon.api", "writeon.assistantapiclient"}) +@EntityScan(basePackages = "writeon.domain") +@EnableJpaRepositories( + basePackages = "writeon.domain", + includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*JpaRepository") +) +@EnableRedisRepositories( + basePackages = "writeon.domain", + includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*RedisRepository") +) +public class ApiApplication { + + public static void main(String[] args) { + SpringApplication.run(ApiApplication.class, args); + } + +} diff --git a/api/src/main/java/writeon/api/HealthCheckController.java b/api/src/main/java/writeon/api/HealthCheckController.java new file mode 100644 index 0000000..66992e3 --- /dev/null +++ b/api/src/main/java/writeon/api/HealthCheckController.java @@ -0,0 +1,24 @@ +package writeon.api; + +import writeon.api.common.enums.exception.ParameterException; +import writeon.api.common.exception.BaseException; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/health-check") +@Tag(name = "health-check") +public class HealthCheckController { + + @GetMapping + public void healthCheck() { + } + + @GetMapping("/error") + public void error(@RequestParam String id) { + throw new BaseException(ParameterException.PARAMETER_INVALID); + } +} diff --git a/api/src/main/java/writeon/api/assistant/controller/AssistantController.java b/api/src/main/java/writeon/api/assistant/controller/AssistantController.java new file mode 100644 index 0000000..3ba5037 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/controller/AssistantController.java @@ -0,0 +1,192 @@ +package writeon.api.assistant.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springdoc.core.annotations.ParameterObject; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import writeon.api.assistant.request.*; +import writeon.api.assistant.response.AssistantHistoryResponse; +import writeon.api.assistant.response.AssistantResponse; +import writeon.api.assistant.response.MessageCreateResponse; +import writeon.api.assistant.service.*; +import writeon.api.common.response.CursorResponse; + +import java.util.UUID; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/assistant") +@Tag(name = "AI 어시스턴트") +public class AssistantController { + + private final AssistantService assistantService; + private final AssistantEvaluationService assistantEvaluationService; + private final AutoModifyService autoModifyService; + private final ChatService chatService; + private final FeedbackService feedbackService; + private final UserModifyService userModifyService; + private final PlannerService plannerService; + + @Operation(summary = "어시스턴트 답변 적용") + @PostMapping("/{assistantId}/apply") + public void apply(@PathVariable UUID assistantId) { + assistantService.apply(assistantId); + } + + @Operation(summary = "자동 수정") + @PostMapping("/auto-modify") + public AssistantResponse autoModify(@RequestBody AssistantAutoModifyRequest request) { + return autoModifyService.autoModify(request); + } + + @Operation(summary = "자동 수정 메세지 저장") + @PostMapping("/auto-modify/messages") + public MessageCreateResponse createAutoModifyMessage(@RequestBody AssistantAutoModifyRequest request) { + return autoModifyService.createMessage(request); + } + + @Operation(summary = "자유 대화") + @PostMapping("/chat") + public AssistantResponse chat(@RequestBody AssistantChatRequest request) { + return chatService.chat(request); + } + + @Operation(summary = "자유 대화 메세지 저장") + @PostMapping("/chat/messages") + public MessageCreateResponse createChatMessage(@RequestBody AssistantChatRequest request) { + return chatService.createMessage(request); + } + + @Operation(summary = "어시스턴트 답변 평가") + @PostMapping("/{assistantId}/evaluate") + public void evaluate( + @PathVariable UUID assistantId, + @RequestBody AssistantEvaluateRequest request) { + assistantEvaluationService.evaluate(assistantId, request); + } + + @Operation(summary = "구간 피드백") + @PostMapping("/feedback") + public AssistantResponse feedback(@RequestBody AssistantFeedbackRequest request) { + return feedbackService.feedback(request); + } + + @Operation(summary = "구간 피드백 메세지 저장") + @PostMapping("/feedback/messages") + public MessageCreateResponse createFeedbackMessage(@RequestBody AssistantFeedbackRequest request) { + return feedbackService.createMessage(request); + } + + @Operation(summary = "플래너 AI 완성") + @PostMapping("/planner") + public AssistantResponse planner(@RequestBody AssistantPlannerRequest request) { + return plannerService.planner(request); + } + + @Operation(summary = "플래너 AI 완성 메세지 저장") + @PostMapping("/planner/messages") + public MessageCreateResponse createPlannerMessage(@RequestBody AssistantPlannerRequest request) { + return plannerService.createMessage(request); + } + + @Operation(summary = "수동 수정") + @PostMapping("/user-modify") + public AssistantResponse userModify(@RequestBody AssistantUserModifyRequest request) { + return userModifyService.userModify(request); + } + + @Operation(summary = "수동 수정 메세지 저장") + @PostMapping("/user-modify/messages") + public MessageCreateResponse createUserModifyMessage(@RequestBody AssistantUserModifyRequest request) { + return userModifyService.createMessage(request); + } + + @Operation(summary = "자유 대화 - 웹 검색 모드") + @PostMapping("/chat/research") + public AssistantResponse research(@RequestBody AssistantResearchRequest request) { + return chatService.research(request); + } + + @Operation(summary = "자동 수정 스트리밍") + @GetMapping("/auto-modify/stream") + public SseEmitter streamAutoModify( + @RequestParam UUID assistantId, + @RequestParam(required = false, defaultValue = "true") Boolean shouldApplySetting + ) { + SseEmitter emitter = autoModifyService.streamAutoModify(assistantId, shouldApplySetting); + setResponseHeaderForSSE(); + return emitter; + } + + @Operation(summary = "자유 대화 스트리밍") + @GetMapping("/chat/stream") + public SseEmitter streamChat( + @RequestParam UUID assistantId, + @RequestParam String sessionId, + @RequestParam(required = false, defaultValue = "true") Boolean shouldApplySetting + ) { + SseEmitter emitter = chatService.streamChat(assistantId, sessionId, shouldApplySetting); + setResponseHeaderForSSE(); + return emitter; + } + + @Operation(summary = "구간 피드백 스트리밍") + @GetMapping("/feedback/stream") + public SseEmitter streamFeedback( + @RequestParam UUID assistantId, + @RequestParam(required = false, defaultValue = "true") Boolean shouldApplySetting + ) { + SseEmitter emitter = feedbackService.streamFeedback(assistantId, shouldApplySetting); + setResponseHeaderForSSE(); + return emitter; + } + + @Operation(summary = "플래너 AI 완성 스트리밍") + @GetMapping("/planner/stream") + public SseEmitter streamPlanner(@RequestParam UUID assistantId) { + SseEmitter emitter = plannerService.streamPlanner(assistantId); + setResponseHeaderForSSE(); + return emitter; + } + + @Operation(summary = "수동 수정 스트리밍") + @GetMapping("/user-modify/stream") + public SseEmitter streamUserModify( + @RequestParam UUID assistantId, + @RequestParam(required = false, defaultValue = "true") Boolean shouldApplySetting + ) { + SseEmitter emitter = userModifyService.streamUserModify(assistantId, shouldApplySetting); + setResponseHeaderForSSE(); + return emitter; + } + + @Operation(summary = "어시스턴트 사용 내역 조회") + @GetMapping("/histories") + public CursorResponse getHistories(@ParameterObject AssistantHistoryListRequest request) { + return assistantService.getHistories(request); + } + + @Operation(summary = "어시스턴트 답변 영구 보관") + @PutMapping("/{assistantId}/archive") + public void archive(@PathVariable UUID assistantId) { + assistantService.archive(assistantId); + } + + @Operation(summary = "어시스턴트 기능 완료 처리") + @PutMapping("/{assistantId}/completed") + public void completed(@PathVariable UUID assistantId) { + assistantService.completed(assistantId); + } + + private void setResponseHeaderForSSE() { + HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getResponse(); + if (response != null) { + response.setContentType("text/event-stream; charset=UTF-8"); + } + } +} diff --git a/api/src/main/java/writeon/api/assistant/repository/AssistantDao.java b/api/src/main/java/writeon/api/assistant/repository/AssistantDao.java new file mode 100644 index 0000000..90a9154 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/repository/AssistantDao.java @@ -0,0 +1,85 @@ +package writeon.api.assistant.repository; + +import org.jooq.Condition; +import org.jooq.DSLContext; +import org.jooq.impl.DSL; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import lombok.RequiredArgsConstructor; +import writeon.api.assistant.response.AssistantHistoryResponse; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; +import writeon.tables.AssistantMessage; + +import static writeon.Tables.ASSISTANT; +import static writeon.Tables.ASSISTANT_EVALUATION; +import static writeon.Tables.ASSISTANT_MESSAGE; +import static writeon.Tables.PRODUCT_FAVORITE_PROMPT; + +@Repository +@RequiredArgsConstructor +public class AssistantDao { + + private final DSLContext dsl; + + public List selectHistories(UUID productId, UUID assistantId, int size) { + AssistantMessage memberMessage = ASSISTANT_MESSAGE.as("member_message"); + AssistantMessage assistantMessage = ASSISTANT_MESSAGE.as("assistant_message"); + + List conditions = getConditions(productId); + if (assistantId != null) { + conditions.add(ASSISTANT.ID.lessOrEqual(assistantId)); + } + + return dsl + .select(ASSISTANT, memberMessage, PRODUCT_FAVORITE_PROMPT.MESSAGE_ID.isNotNull(), assistantMessage, + DSL.when(ASSISTANT_EVALUATION.ASSISTANT_ID.isNull(), false).otherwise(ASSISTANT_EVALUATION.IS_GOOD)) + .from(ASSISTANT) + .join(memberMessage) + .on(ASSISTANT.ID.eq(memberMessage.ASSISTANT_ID) + .and(memberMessage.ROLE.eq(MessageSenderRole.MEMBER.getCode()))) + .leftJoin(PRODUCT_FAVORITE_PROMPT) + .on(memberMessage.ID.eq(PRODUCT_FAVORITE_PROMPT.MESSAGE_ID)) + .join(assistantMessage) + .on(ASSISTANT.ID.eq(assistantMessage.ASSISTANT_ID) + .and(assistantMessage.ROLE.eq(MessageSenderRole.ASSISTANT.getCode()))) + .leftJoin(ASSISTANT_EVALUATION) + .on(ASSISTANT.ID.eq(ASSISTANT_EVALUATION.ASSISTANT_ID)) + .where(conditions) + .orderBy(ASSISTANT.ID.desc()) + .limit(size) + .fetchInto(AssistantHistoryResponse.class); + } + + public Long countHistories(UUID productId) { + return dsl + .selectCount() + .from(ASSISTANT) + .where(getConditions(productId)) + .fetchOneInto(Long.class); + } + + private List getConditions(UUID productId) { + LocalDateTime now = LocalDateTime.now(); + + return new ArrayList<>(List.of( + ASSISTANT.PRODUCT_ID.eq(productId), + ASSISTANT.STATUS.ne(AssistantStatus.DRAFT.getCode()), + ASSISTANT.CREATED_AT.between(now.minusMonths(6), now), + ASSISTANT.TYPE.in( + List.of( + AssistantType.AUTO_MODIFY.getCode(), + AssistantType.USER_MODIFY.getCode(), + AssistantType.FEEDBACK.getCode(), + AssistantType.CHAT.getCode() + ) + ) + )); + } +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantAutoModifyRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantAutoModifyRequest.java new file mode 100644 index 0000000..6d7d996 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantAutoModifyRequest.java @@ -0,0 +1,19 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class AssistantAutoModifyRequest { + + @Schema(title = "작품 ID") + private UUID productId; + @Schema(title = "선택 구간") + private String content; + @Schema(title = "설정 반영 여부", nullable = true) + private Boolean shouldApplySetting = true; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantChatRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantChatRequest.java new file mode 100644 index 0000000..d005dd8 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantChatRequest.java @@ -0,0 +1,23 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class AssistantChatRequest { + + @Schema(title = "작품 ID") + private UUID productId; + @Schema(title = "선택 구간", nullable = true) + private String content; + @Schema(title = "프롬프트") + private String prompt; + @Schema(title = "세션 ID", nullable = true) + private String sessionId; + @Schema(title = "설정 반영 여부", nullable = true) + private Boolean shouldApplySetting = true; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantEvaluateRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantEvaluateRequest.java new file mode 100644 index 0000000..696fccc --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantEvaluateRequest.java @@ -0,0 +1,18 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.assistant.enums.FeedbackType; + +@Getter +@Setter +public class AssistantEvaluateRequest { + + @Schema(title = "만족 여부") + private Boolean isGood; + @Schema(title = "피드백 타입", nullable = true) + private FeedbackType feedbackType; + @Schema(title = "피드백", nullable = true) + private String feedback; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantFeedbackRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantFeedbackRequest.java new file mode 100644 index 0000000..21058c3 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantFeedbackRequest.java @@ -0,0 +1,19 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class AssistantFeedbackRequest { + + @Schema(title = "작품 ID") + private UUID productId; + @Schema(title = "선택 구간") + private String content; + @Schema(title = "설정 반영 여부", nullable = true) + private Boolean shouldApplySetting = true; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantHistoryListRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantHistoryListRequest.java new file mode 100644 index 0000000..3ce0dd7 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantHistoryListRequest.java @@ -0,0 +1,22 @@ +package writeon.api.assistant.request; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.Positive; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class AssistantHistoryListRequest { + + @Parameter(required = true) + private UUID productId; + + @Parameter(description = "cursor pagination 기준값") + private UUID assistantId; + + @Positive(message = "한 페이지에 조회 할 데이터 수는 양수여야 합니다.") + private int size = 10; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantPlannerRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantPlannerRequest.java new file mode 100644 index 0000000..f47cb02 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantPlannerRequest.java @@ -0,0 +1,33 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class AssistantPlannerRequest { + + @Schema(title = "작품 ID") + private UUID productId; + @Schema(title = "장르") + private String genre; + @Schema(title = "로그라인") + private String logline; + @Schema( + title = "생성할 섹션", + description = """ + 생성 가능한 섹션: + - example: 예시문장 + - geography, history, politics, society, religion: 세계관(지리/역사/정치/사회/종교) + - economy, technology, lifestyle, language, culture: 세계관(경제/기술/생활/언어/문화) + - species, occupation, conflict, custom_field: 세계관(종족/직업/갈등/커스텀필드) + - introduction, development, crisis, conclusion: 줄거리(발단/전개/위기/결말) + """ + ) + private String section; + @Schema(title = "프롬프트") + private String prompt; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantResearchRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantResearchRequest.java new file mode 100644 index 0000000..8da4f97 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantResearchRequest.java @@ -0,0 +1,23 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class AssistantResearchRequest { + + @Schema(title = "작품 ID") + private UUID productId; + @Schema(title = "세션 ID") + private String sessionId; + @Schema(title = "선택 구간", nullable = true) + private String content; + @Schema(title = "프롬프트") + private String prompt; + @Schema(title = "설정 반영 여부", nullable = true) + private Boolean shouldApplySetting = true; +} diff --git a/api/src/main/java/writeon/api/assistant/request/AssistantUserModifyRequest.java b/api/src/main/java/writeon/api/assistant/request/AssistantUserModifyRequest.java new file mode 100644 index 0000000..ad2e100 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/request/AssistantUserModifyRequest.java @@ -0,0 +1,21 @@ +package writeon.api.assistant.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class AssistantUserModifyRequest { + + @Schema(title = "작품 ID") + private UUID productId; + @Schema(title = "선택 구간") + private String content; + @Schema(title = "프롬프트", nullable = true) + private String prompt; + @Schema(title = "설정 반영 여부", nullable = true) + private Boolean shouldApplySetting = true; +} diff --git a/api/src/main/java/writeon/api/assistant/response/AssistantHistoryResponse.java b/api/src/main/java/writeon/api/assistant/response/AssistantHistoryResponse.java new file mode 100644 index 0000000..5b02e21 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/response/AssistantHistoryResponse.java @@ -0,0 +1,72 @@ +package writeon.api.assistant.response; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.time.LocalDateTime; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import writeon.tables.records.AssistantMessageRecord; +import writeon.tables.records.AssistantRecord; + +@Getter +public class AssistantHistoryResponse { + + private final UUID id; + @Schema(title = "어시스턴트 타입", description = "auto modify, feedback, chat, user modify") + private final String type; + private final MemberMessage memberMessage; + private final AssistantMessage assistantMessage; + private final LocalDateTime createdAt; + + public AssistantHistoryResponse(AssistantRecord assistant, AssistantMessageRecord memberMessage, + Boolean isFavoritedPrompt, AssistantMessageRecord assistantMessage, Boolean isGood) { + this.id = assistant.getId(); + this.type = assistant.getType(); + this.memberMessage = new MemberMessage(memberMessage, isFavoritedPrompt); + this.assistantMessage = new AssistantMessage(assistantMessage, assistant.getIsApplied(), isGood); + this.createdAt = assistant.getCreatedAt(); + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class MemberMessage { + + @Schema(title = "메세지 ID") + private final UUID id; + @Schema(title = "사용자가 선택한 구간") + private final String content; + @Schema(title = "사용자가 입력한 프롬프트") + private final String prompt; + @Schema(title = "즐겨찾기 적용 여부") + private final Boolean isFavoritedPrompt; + + public MemberMessage(AssistantMessageRecord message, Boolean isFavoritedPrompt) { + this.id = message.getId(); + this.content = message.getContent(); + this.prompt = message.getPrompt(); + this.isFavoritedPrompt = isFavoritedPrompt; + } + } + + @Getter + public static class AssistantMessage { + + @Schema(title = "메세지 ID") + private final UUID id; + @Schema(title = "Assistant 답변") + private final String content; + @Schema(title = "답변 적용 여부") + private final Boolean isApplied; + @Schema(title = "답변 평가") + private final Boolean isGood; + + public AssistantMessage(AssistantMessageRecord message, Boolean isApplied, Boolean isGood) { + this.id = message.getId(); + this.content = message.getContent(); + this.isApplied = isApplied; + this.isGood = isGood; + } + } +} diff --git a/api/src/main/java/writeon/api/assistant/response/AssistantResponse.java b/api/src/main/java/writeon/api/assistant/response/AssistantResponse.java new file mode 100644 index 0000000..22fa216 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/response/AssistantResponse.java @@ -0,0 +1,19 @@ +package writeon.api.assistant.response; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +@Getter +public class AssistantResponse { + + private final UUID id; + @Schema(title = "답변 내용") + private final String answer; + + public AssistantResponse(UUID id, String answer) { + this.id = id; + this.answer = answer; + } +} diff --git a/api/src/main/java/writeon/api/assistant/response/MessageCreateResponse.java b/api/src/main/java/writeon/api/assistant/response/MessageCreateResponse.java new file mode 100644 index 0000000..90d9f74 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/response/MessageCreateResponse.java @@ -0,0 +1,17 @@ +package writeon.api.assistant.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +import java.util.UUID; + +@Getter +public class MessageCreateResponse { + + @Schema(title = "어시스턴트 ID") + private final UUID assistantId; + + public MessageCreateResponse(UUID assistantId) { + this.assistantId = assistantId; + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/AssistantEvaluationService.java b/api/src/main/java/writeon/api/assistant/service/AssistantEvaluationService.java new file mode 100644 index 0000000..36b94cb --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/AssistantEvaluationService.java @@ -0,0 +1,65 @@ +package writeon.api.assistant.service; + +import com.amplitude.Amplitude; +import com.amplitude.Event; +import lombok.RequiredArgsConstructor; +import org.json.JSONObject; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import writeon.api.assistant.request.AssistantEvaluateRequest; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.MemberUtil; +import writeon.domain.assistant.AssistantEvaluation; +import writeon.domain.assistant.AssistantEvaluationJpaRepository; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.FeedbackType; + +import java.util.List; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class AssistantEvaluationService { + + private final AssistantEvaluationJpaRepository assistantEvaluationRepository; + private final AssistantService assistantService; + private final Amplitude amplitude = Amplitude.getInstance(); + + @Transactional + public void evaluate(UUID assistantId, AssistantEvaluateRequest request) { + assistantService.verifyExist(assistantId); + verifyEvaluated(assistantId); + + String feedback = null; + + if (!request.getIsGood()) { + feedback = request.getFeedbackType() == FeedbackType.ETC + ? request.getFeedback() : null; + } + + AssistantEvaluation assistantEvaluation = AssistantEvaluation.builder() + .assistantId(assistantId) + .isGood(request.getIsGood()) + .feedbackType(request.getFeedbackType()) + .feedback(feedback) + .build(); + + assistantEvaluationRepository.save(assistantEvaluation); + + final UUID memberId = MemberUtil.getMemberId(); + final List evaluations = assistantEvaluationRepository.getByCreatedBy(memberId); + final float totalCount = evaluations.size(); + final float goodCount = evaluations.stream().filter(AssistantEvaluation::getIsGood).toList().size(); + final float percentage = Math.round(goodCount / totalCount * 100 * 10) / 10f; + // amplitude 이벤트 송신 + Event event = new Event("$identify", memberId.toString()); + event.userProperties = new JSONObject().put("ai_feedback_satisfaction", percentage); + amplitude.logEvent(event); + } + + private void verifyEvaluated(UUID assistantId) { + if (assistantEvaluationRepository.existsById(assistantId)) { + throw new BaseException(AssistantException.ALREADY_EVALUATED); + } + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/AssistantService.java b/api/src/main/java/writeon/api/assistant/service/AssistantService.java new file mode 100644 index 0000000..b4e8d18 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/AssistantService.java @@ -0,0 +1,122 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import writeon.api.assistant.repository.AssistantDao; +import writeon.api.assistant.request.AssistantHistoryListRequest; +import writeon.api.assistant.response.AssistantHistoryResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.response.CursorResponse; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.service.ProductQueryService; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantJpaRepository; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.AssistantMessageJpaRepository; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class AssistantService { + + private final AssistantJpaRepository assistantRepository; + private final AssistantMessageJpaRepository assistantMessageRepository; + private final AssistantDao assistantDao; + + private final ProductQueryService productQueryService; + + @Transactional + public void archive(UUID assistantId) { + Assistant assistant = getById(assistantId, MemberUtil.getMemberId()); + if (assistant.getStatus() == AssistantStatus.DRAFT) { + throw new BaseException(AssistantException.CANNOT_BE_COMPLETED); + } + + assistant.archive(); + } + + @Transactional + public void apply(UUID assistantId) { + Assistant assistant = getById(assistantId, MemberUtil.getMemberId()); + if (assistant.getStatus() == AssistantStatus.DRAFT || assistant.getIsApplied()) { + throw new BaseException(AssistantException.CANNOT_BE_APPLIED); + } + + assistant.apply(); + } + + @Transactional + public UUID create(UUID productId, AssistantType type) { + Assistant assistant = new Assistant(productId, type, MemberUtil.getMemberId()); + return assistantRepository.save(assistant).getId(); + } + + @Transactional + public UUID createMessage(AssistantMessage message) { + return assistantMessageRepository.save(message).getId(); + } + + @Transactional + public void completed(UUID assistantId) { + Assistant assistant = getById(assistantId, MemberUtil.getMemberId()); + if (assistant.getStatus() != AssistantStatus.IN_PROGRESS) { + throw new BaseException(AssistantException.CANNOT_BE_COMPLETED); + } + + assistant.updateStatus(AssistantStatus.COMPLETED); + } + + @Transactional + public void modifyStatus(UUID assistantId, AssistantStatus status) { + assistantRepository.updateStatus(assistantId, status); + } + + @Transactional(readOnly = true) + public Assistant getById(UUID assistantId) { + return assistantRepository.findById(assistantId) + .orElseThrow(() -> new BaseException(AssistantException.NOT_EXIST)); + } + + @Transactional(readOnly = true) + public Assistant getById(UUID assistantId, UUID memberId) { + return assistantRepository.findByIdAndCreatedBy(assistantId, memberId) + .orElseThrow(() -> new BaseException(AssistantException.NOT_EXIST)); + } + + @Transactional(readOnly = true) + public CursorResponse getHistories(AssistantHistoryListRequest request) { + productQueryService.verifyExist(request.getProductId()); + + long count = assistantDao.countHistories(request.getProductId()); + return CursorResponse.of( + assistantDao.selectHistories(request.getProductId(), request.getAssistantId(), request.getSize()), + count + ); + } + + @Transactional(readOnly = true) + public AssistantMessage getMessageByAssistantId(UUID assistantId, MessageSenderRole role) { + return assistantMessageRepository.findByAssistantIdAndMessageContent_Role(assistantId, role) + .orElseThrow(() -> new BaseException(AssistantException.NOT_EXIST_MESSAGE)); + } + + @Transactional(readOnly = true) + public void verifyAnswered(UUID assistantId) { + if (assistantMessageRepository.existsByAssistantIdAndMessageContent_Role(assistantId, MessageSenderRole.ASSISTANT)) { + throw new BaseException(AssistantException.ALREADY_ANSWERED); + } + } + + @Transactional(readOnly = true) + public void verifyExist(UUID assistantId) { + if (!assistantRepository.existsByIdAndCreatedBy(assistantId, MemberUtil.getMemberId())) { + throw new BaseException(AssistantException.NOT_EXIST); + } + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/AutoModifyService.java b/api/src/main/java/writeon/api/assistant/service/AutoModifyService.java new file mode 100644 index 0000000..efcf0c9 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/AutoModifyService.java @@ -0,0 +1,151 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import writeon.api.assistant.request.AssistantAutoModifyRequest; +import writeon.api.assistant.response.AssistantResponse; +import writeon.api.assistant.response.MessageCreateResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.LogUtil; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.service.ProductQueryService; +import writeon.assistantapiclient.AssistantApiClient; +import writeon.assistantapiclient.request.AutoModifyRequest; +import writeon.assistantapiclient.request.UserSetting; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.io.IOException; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class AutoModifyService { + + private final long TIMEOUT = 180_000L; + + private final AssistantApiClient assistantApiClient; + private final AssistantService assistantService; + private final ProductQueryService productQueryService; + + @Transactional + public AssistantResponse autoModify(AssistantAutoModifyRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.AUTO_MODIFY); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + UserSetting userSetting; + if (request.getShouldApplySetting()) { + userSetting = new UserSetting(productQueryService.getById(request.getProductId())); + } else { + userSetting = new UserSetting(); + } + + AutoModifyRequest autoModifyRequest = new AutoModifyRequest( + "t" + request.getProductId().toString().replaceAll("-", ""), + userSetting, + memberMessage.getContent() + ); + + String answer = assistantApiClient.autoModify(autoModifyRequest).block(); + + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + + return new AssistantResponse(assistantId, answer); + } + + @Transactional + public MessageCreateResponse createMessage(AssistantAutoModifyRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.AUTO_MODIFY); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + return new MessageCreateResponse(assistantId); + } + + public SseEmitter streamAutoModify(UUID assistantId, Boolean shouldApplySetting) { + Assistant assistant = assistantService.getById(assistantId, MemberUtil.getMemberId()); + + assistantService.verifyAnswered(assistantId); + productQueryService.verifyExist(assistant.getProductId()); + + AssistantMessage memberMessage = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.MEMBER); + + UserSetting userSetting; + if (shouldApplySetting) { + userSetting = new UserSetting(productQueryService.getById(assistant.getProductId())); + } else { + userSetting = new UserSetting(); + } + + AutoModifyRequest request = new AutoModifyRequest( + "t" + assistant.getProductId().toString().replaceAll("-", ""), + userSetting, + memberMessage.getContent() + ); + + SseEmitter emitter = new SseEmitter(TIMEOUT); + StringBuilder responseBuilder = new StringBuilder(); + + assistantApiClient.streamAutoModify(request) + .subscribe( + data -> { + try { + emitter.send(SseEmitter.event().data(data)); + responseBuilder.append(data); + } catch (IOException e) { + emitter.completeWithError(new BaseException(AssistantException.SSE_SEND_ERROR)); + } + }, + error -> { + LogUtil.error(error); + emitter.completeWithError(new BaseException(AssistantException.WEBCLIENT_REQUEST_ERROR)); + }, + () -> { + String answer = responseBuilder.toString().replace("[DONE]", "").trim(); + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(assistant.getCreatedBy()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + emitter.complete(); + } + ); + + return emitter; + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/ChatService.java b/api/src/main/java/writeon/api/assistant/service/ChatService.java new file mode 100644 index 0000000..f573336 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/ChatService.java @@ -0,0 +1,197 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import writeon.api.assistant.request.AssistantChatRequest; +import writeon.api.assistant.request.AssistantResearchRequest; +import writeon.api.assistant.response.AssistantResponse; +import writeon.api.assistant.response.MessageCreateResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.LogUtil; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.service.ProductQueryService; +import writeon.assistantapiclient.AssistantApiClient; +import writeon.assistantapiclient.request.ChatRequest; +import writeon.assistantapiclient.request.ResearchRequest; +import writeon.assistantapiclient.request.UserSetting; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.io.IOException; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class ChatService { + + private final long TIMEOUT = 180_000L; + + private final AssistantApiClient assistantApiClient; + private final AssistantService assistantService; + private final ProductQueryService productQueryService; + + @Transactional + public AssistantResponse chat(AssistantChatRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.CHAT); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .prompt(request.getPrompt()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + UserSetting userSetting; + if (request.getShouldApplySetting()) { + userSetting = new UserSetting(productQueryService.getById(request.getProductId())); + } else { + userSetting = new UserSetting(); + } + + ChatRequest chatRequest = new ChatRequest( + userSetting, + memberMessage.getContent(), + memberMessage.getPrompt(), + request.getSessionId() + ); + + String answer = assistantApiClient.chat(chatRequest).block(); + + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + + return new AssistantResponse(assistantId, answer); + } + + @Transactional + public MessageCreateResponse createMessage(AssistantChatRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.CHAT); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .prompt(request.getPrompt()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + return new MessageCreateResponse(assistantId); + } + + public SseEmitter streamChat(UUID assistantId, String sessionId, Boolean shouldApplySetting) { + Assistant assistant = assistantService.getById(assistantId, MemberUtil.getMemberId()); + + assistantService.verifyAnswered(assistantId); + productQueryService.verifyExist(assistant.getProductId()); + + AssistantMessage memberMessage = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.MEMBER); + + UserSetting userSetting; + if (shouldApplySetting) { + userSetting = new UserSetting(productQueryService.getById(assistant.getProductId())); + } else { + userSetting = new UserSetting(); + } + + ChatRequest request = new ChatRequest( + userSetting, + memberMessage.getContent(), + memberMessage.getPrompt(), + sessionId + ); + + SseEmitter emitter = new SseEmitter(TIMEOUT); + StringBuilder responseBuilder = new StringBuilder(); + + assistantApiClient.streamChat(request) + .subscribe( + data -> { + try { + emitter.send(SseEmitter.event().data(data)); + responseBuilder.append(data); + } catch (IOException e) { + emitter.completeWithError(new BaseException(AssistantException.SSE_SEND_ERROR)); + } + }, + error -> { + LogUtil.error(error.getMessage()); + emitter.completeWithError(new BaseException(AssistantException.WEBCLIENT_REQUEST_ERROR)); + }, + () -> { + String answer = responseBuilder.toString().replace("[DONE]", "").trim(); + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(memberMessage.getCreatedBy()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + emitter.complete(); + } + ); + + return emitter; + } + + @Transactional + public AssistantResponse research(AssistantResearchRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.CHAT); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .prompt(request.getPrompt()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + UserSetting userSetting; + if (request.getShouldApplySetting()) { + userSetting = new UserSetting(productQueryService.getById(request.getProductId())); + } else { + userSetting = new UserSetting(); + } + + ResearchRequest researchRequest = new ResearchRequest(userSetting, request.getContent(), request.getPrompt(), request.getSessionId()); + + // 웹 검색 요청 + String answer = assistantApiClient.research(researchRequest).block(); + + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + + return new AssistantResponse(assistantId, answer); + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/DocumentUploadService.java b/api/src/main/java/writeon/api/assistant/service/DocumentUploadService.java new file mode 100644 index 0000000..bdbddc0 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/DocumentUploadService.java @@ -0,0 +1,24 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import writeon.assistantapiclient.AssistantApiClient; +import writeon.assistantapiclient.request.DocumentUploadRequest; + +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class DocumentUploadService { + + private final AssistantApiClient assistantApiClient; + + public void documentUpload(UUID productId, String content) { + DocumentUploadRequest request = new DocumentUploadRequest( + "t" + productId.toString().replaceAll("-", ""), + content + ); + assistantApiClient.documentUpload(request) + .subscribe(); + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/FeedbackService.java b/api/src/main/java/writeon/api/assistant/service/FeedbackService.java new file mode 100644 index 0000000..1b070e6 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/FeedbackService.java @@ -0,0 +1,151 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import writeon.api.assistant.request.AssistantFeedbackRequest; +import writeon.api.assistant.response.AssistantResponse; +import writeon.api.assistant.response.MessageCreateResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.LogUtil; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.service.ProductQueryService; +import writeon.assistantapiclient.AssistantApiClient; +import writeon.assistantapiclient.request.FeedbackRequest; +import writeon.assistantapiclient.request.UserSetting; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.io.IOException; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class FeedbackService { + + private final long TIMEOUT = 180_000L; + + private final AssistantApiClient assistantApiClient; + private final AssistantService assistantService; + private final ProductQueryService productQueryService; + + @Transactional + public AssistantResponse feedback(AssistantFeedbackRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.FEEDBACK); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + UserSetting userSetting; + if (request.getShouldApplySetting()) { + userSetting = new UserSetting(productQueryService.getById(request.getProductId())); + } else { + userSetting = new UserSetting(); + } + + FeedbackRequest feedbackRequest = new FeedbackRequest( + "t" + request.getProductId().toString().replaceAll("-", ""), + userSetting, + memberMessage.getContent() + ); + + String answer = assistantApiClient.feedback(feedbackRequest).block(); + + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + + return new AssistantResponse(assistantId, answer); + } + + @Transactional + public MessageCreateResponse createMessage(AssistantFeedbackRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.FEEDBACK); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + return new MessageCreateResponse(assistantId); + } + + public SseEmitter streamFeedback(UUID assistantId, Boolean shouldApplySetting) { + Assistant assistant = assistantService.getById(assistantId, MemberUtil.getMemberId()); + + assistantService.verifyAnswered(assistantId); + productQueryService.verifyExist(assistant.getProductId()); + + AssistantMessage memberMessage = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.MEMBER); + + UserSetting userSetting; + if (shouldApplySetting) { + userSetting = new UserSetting(productQueryService.getById(assistant.getProductId())); + } else { + userSetting = new UserSetting(); + } + + FeedbackRequest request = new FeedbackRequest( + "t" + assistant.getProductId().toString().replaceAll("-", ""), + userSetting, + memberMessage.getContent() + ); + + SseEmitter emitter = new SseEmitter(TIMEOUT); + StringBuilder responseBuilder = new StringBuilder(); + + assistantApiClient.streamFeedback(request) + .subscribe( + data -> { + try { + emitter.send(SseEmitter.event().data(data)); + responseBuilder.append(data); + } catch (IOException e) { + emitter.completeWithError(new BaseException(AssistantException.SSE_SEND_ERROR)); + } + }, + error -> { + LogUtil.error(error); + emitter.completeWithError(new BaseException(AssistantException.WEBCLIENT_REQUEST_ERROR)); + }, + () -> { + String answer = responseBuilder.toString().replace("[DONE]", "").trim(); + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(memberMessage.getCreatedBy()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + emitter.complete(); + } + ); + + return emitter; + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/PlannerService.java b/api/src/main/java/writeon/api/assistant/service/PlannerService.java new file mode 100644 index 0000000..cafebe5 --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/PlannerService.java @@ -0,0 +1,163 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import writeon.api.assistant.request.AssistantPlannerRequest; +import writeon.api.assistant.response.AssistantResponse; +import writeon.api.assistant.response.MessageCreateResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.LogUtil; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.service.ProductQueryService; +import writeon.assistantapiclient.AssistantApiClient; +import writeon.assistantapiclient.request.PlannerGenerateRequest; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.AssistantPlannerMessage; +import writeon.domain.assistant.AssistantPlannerMessageJpaRepository; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.io.IOException; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class PlannerService { + + private final long TIMEOUT = 180_000L; + + private final AssistantApiClient assistantApiClient; + private final AssistantService assistantService; + private final ProductQueryService productQueryService; + private final AssistantPlannerMessageJpaRepository assistantPlannerMessageRepository; + + @Transactional + public AssistantResponse planner(AssistantPlannerRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.PLANNER); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .prompt(request.getPrompt()) + .role(MessageSenderRole.MEMBER) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + AssistantPlannerMessage plannerMessage = AssistantPlannerMessage.builder() + .assistantId(assistantId) + .genre(request.getGenre()) + .logline(request.getLogline()) + .section(request.getSection()) + .build(); + assistantPlannerMessageRepository.save(plannerMessage); + + PlannerGenerateRequest plannerGenerateRequest = PlannerGenerateRequest.builder() + .tenantId("t" + request.getProductId().toString().replaceAll("-", "")) + .genre(plannerMessage.getGenre()) + .logline(plannerMessage.getLogline()) + .section(plannerMessage.getSection()) + .prompt(memberMessage.getPrompt()) + .build(); + + String answer = assistantApiClient.plannerGenerate(plannerGenerateRequest).block(); + + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + + return new AssistantResponse(assistantId, answer); + } + + @Transactional + public MessageCreateResponse createMessage(AssistantPlannerRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.PLANNER); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .prompt(request.getPrompt()) + .role(MessageSenderRole.MEMBER) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + AssistantPlannerMessage plannerMessage = AssistantPlannerMessage.builder() + .assistantId(assistantId) + .genre(request.getGenre()) + .logline(request.getLogline()) + .section(request.getSection()) + .build(); + assistantPlannerMessageRepository.save(plannerMessage); + + return new MessageCreateResponse(assistantId); + } + + public SseEmitter streamPlanner(UUID assistantId) { + Assistant assistant = assistantService.getById(assistantId, MemberUtil.getMemberId()); + + if (assistant.getStatus() != AssistantStatus.DRAFT) { + throw new BaseException(AssistantException.ALREADY_ANSWERED); + } + productQueryService.verifyExist(assistant.getProductId()); + + AssistantMessage memberMessage = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.MEMBER); + + AssistantPlannerMessage plannerMessage = assistantPlannerMessageRepository.findById(assistantId) + .orElseThrow(() -> new BaseException(AssistantException.NOT_EXIST_MESSAGE)); + + PlannerGenerateRequest request = PlannerGenerateRequest.builder() + .tenantId("t" + assistant.getProductId().toString().replaceAll("-", "")) + .genre(plannerMessage.getGenre()) + .logline(plannerMessage.getLogline()) + .section(plannerMessage.getSection()) + .prompt(memberMessage.getPrompt()) + .build(); + + SseEmitter emitter = new SseEmitter(TIMEOUT); + StringBuilder responseBuilder = new StringBuilder(); + + assistantApiClient.streamPlannerGenerate(request) + .subscribe( + data -> { + try { + emitter.send(SseEmitter.event().data(data)); + responseBuilder.append(data); + } catch (IOException e) { + emitter.completeWithError(new BaseException(AssistantException.SSE_SEND_ERROR)); + } + }, + error -> { + LogUtil.error(error); + emitter.completeWithError(new BaseException(AssistantException.WEBCLIENT_REQUEST_ERROR)); + }, + () -> { + String answer = responseBuilder.toString().replace("[DONE]", "").trim(); + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + emitter.complete(); + } + ); + + return emitter; + } +} diff --git a/api/src/main/java/writeon/api/assistant/service/UserModifyService.java b/api/src/main/java/writeon/api/assistant/service/UserModifyService.java new file mode 100644 index 0000000..5e47fda --- /dev/null +++ b/api/src/main/java/writeon/api/assistant/service/UserModifyService.java @@ -0,0 +1,153 @@ +package writeon.api.assistant.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import writeon.api.assistant.request.AssistantUserModifyRequest; +import writeon.api.assistant.response.AssistantResponse; +import writeon.api.assistant.response.MessageCreateResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.LogUtil; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.service.ProductQueryService; +import writeon.assistantapiclient.AssistantApiClient; +import writeon.assistantapiclient.request.UserModifyRequest; +import writeon.assistantapiclient.request.UserSetting; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.io.IOException; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class UserModifyService { + + private final long TIMEOUT = 180_000L; + + private final AssistantApiClient assistantApiClient; + private final AssistantService assistantService; + private final ProductQueryService productQueryService; + + @Transactional + public AssistantResponse userModify(AssistantUserModifyRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.USER_MODIFY); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .prompt(request.getPrompt()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + UserSetting userSetting; + if (request.getShouldApplySetting()) { + userSetting = new UserSetting(productQueryService.getById(request.getProductId())); + } else { + userSetting = new UserSetting(); + } + + UserModifyRequest userModifyRequest = new UserModifyRequest( + "t" + request.getProductId().toString().replaceAll("-", ""), + userSetting, memberMessage.getContent(), + memberMessage.getPrompt() + ); + + String answer = assistantApiClient.userModify(userModifyRequest).block(); + + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + + return new AssistantResponse(assistantId, answer); + } + + @Transactional + public MessageCreateResponse createMessage(AssistantUserModifyRequest request) { + productQueryService.verifyExist(request.getProductId()); + + UUID assistantId = assistantService.create(request.getProductId(), AssistantType.USER_MODIFY); + + AssistantMessage memberMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.MEMBER) + .content(request.getContent()) + .prompt(request.getPrompt()) + .createdBy(MemberUtil.getMemberId()) + .build(); + assistantService.createMessage(memberMessage); + + return new MessageCreateResponse(assistantId); + } + + public SseEmitter streamUserModify(UUID assistantId, Boolean shouldApplySetting) { + Assistant assistant = assistantService.getById(assistantId, MemberUtil.getMemberId()); + + assistantService.verifyAnswered(assistantId); + productQueryService.verifyExist(assistant.getProductId()); + + AssistantMessage memberMessage = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.MEMBER); + + UserSetting userSetting; + if (shouldApplySetting) { + userSetting = new UserSetting(productQueryService.getById(assistant.getProductId())); + } else { + userSetting = new UserSetting(); + } + + UserModifyRequest request = new UserModifyRequest( + "t" + assistant.getProductId().toString().replaceAll("-", ""), + userSetting, memberMessage.getContent(), + memberMessage.getPrompt() + ); + + SseEmitter emitter = new SseEmitter(TIMEOUT); + StringBuilder responseBuilder = new StringBuilder(); + + assistantApiClient.streamUserModify(request) + .subscribe( + data -> { + try { + emitter.send(SseEmitter.event().data(data)); + responseBuilder.append(data); + } catch (IOException e) { + emitter.completeWithError(new BaseException(AssistantException.SSE_SEND_ERROR)); + } + }, + error -> { + LogUtil.error(error); + emitter.completeWithError(new BaseException(AssistantException.WEBCLIENT_REQUEST_ERROR)); + }, + () -> { + String answer = responseBuilder.toString().replace("[DONE]", "").trim(); + AssistantMessage assistantMessage = AssistantMessage.builder() + .assistantId(assistantId) + .role(MessageSenderRole.ASSISTANT) + .content(answer) + .createdBy(memberMessage.getCreatedBy()) + .build(); + assistantService.createMessage(assistantMessage); + + assistantService.modifyStatus(assistantId, AssistantStatus.IN_PROGRESS); + emitter.complete(); + } + ); + + return emitter; + } +} diff --git a/api/src/main/java/writeon/api/auth/controller/AuthController.java b/api/src/main/java/writeon/api/auth/controller/AuthController.java new file mode 100644 index 0000000..4452498 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/controller/AuthController.java @@ -0,0 +1,115 @@ +package writeon.api.auth.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import writeon.api.auth.helper.AuthCookieHelper; +import writeon.api.auth.request.*; +import writeon.api.auth.response.CheckEmailResponse; +import writeon.api.auth.response.TokenReissueResponse; +import writeon.api.auth.service.AuthCommandService; +import writeon.api.auth.service.AuthQueryService; +import writeon.api.common.response.BaseResponse; +import writeon.api.common.util.LogUtil; +import writeon.domain.auth.dto.AuthTokenDto; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/auth") +@Tag(name = "인증") +public class AuthController { + private final AuthQueryService authQueryService; + private final AuthCommandService authCommandService; + private final AuthCookieHelper authCookieHelper; + + @Operation(summary = "토큰 재발급") + @PostMapping("/token/reissue") + public ResponseEntity> reissueToken(@CookieValue(value = "refreshToken", defaultValue="") String tokenString) { + LogUtil.info("token" + tokenString); + AuthTokenDto tokens = authCommandService.reissueToken(tokenString); + TokenReissueResponse response = new TokenReissueResponse(tokens.getAccessToken()); + + String cookieString = authCookieHelper.createNewCookie(tokens.getRefreshToken()); + HttpHeaders headers = new HttpHeaders(); + headers.add(HttpHeaders.SET_COOKIE, cookieString); + + return ResponseEntity.ok() + .headers(headers) + .body(BaseResponse.success(response)); + } + + @Operation(summary = "로그인") + @PostMapping("/login") + public ResponseEntity> login(@Valid @RequestBody LoginRequest request) { + AuthTokenDto tokens = authCommandService.login(request); + TokenReissueResponse response = new TokenReissueResponse(tokens.getAccessToken()); + + String cookieString = authCookieHelper.createNewCookie(tokens.getRefreshToken()); + HttpHeaders headers = new HttpHeaders(); + headers.add(HttpHeaders.SET_COOKIE, cookieString); + + return ResponseEntity.ok() + .headers(headers) + .body(BaseResponse.success(response)); + } + + @Operation(summary = "로그아웃") + @PostMapping("/logout") + public ResponseEntity> logout() { + authCommandService.logout(); + + HttpHeaders headers = new HttpHeaders(); + headers.add(HttpHeaders.SET_COOKIE, authCookieHelper.createExpiredCookie()); + + return ResponseEntity.ok() + .headers(headers) + .body(null); + } + + @Operation(summary = "회원가입") + @PostMapping("/join") + public void join(@Valid @RequestBody JoinRequest request) { + + authCommandService.join(request); + } + + @Operation(summary = "회원가입 완료") + @PostMapping("/join/complete") + public void completeJoin(@Valid @RequestBody JoinCompletionRequest request) { + + authCommandService.completeJoin(request); + } + + @Operation(summary = "비밀번호 변경") + @PostMapping("/change-password") + public void changePassword(@Valid @RequestBody ChangePasswordRequest request) { + + authCommandService.changePassword(request); + } + + @Operation(summary = "비밀번호 변경 완료") + @PostMapping("/change-password/complete") + public void completeChangePassword(@Valid @RequestBody ChangePasswordCompletionRequest request) { + + authCommandService.completeChangePassword(request); + } + + @Operation(summary = "이메일 중복 조회") + @GetMapping("/check-email") + public CheckEmailResponse checkEmail(@Valid CheckEmailRequest request) { + + return authQueryService.checkEmail(request); + } + + @Operation(summary = "닉네임 중복 조회") + @GetMapping("/check-nickname") + public CheckEmailResponse checkNickname(@Valid CheckNicknameRequest request) { + + return authQueryService.checkNickname(request); + } + +} diff --git a/api/src/main/java/writeon/api/auth/helper/AuthCookieHelper.java b/api/src/main/java/writeon/api/auth/helper/AuthCookieHelper.java new file mode 100644 index 0000000..d423ba2 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/helper/AuthCookieHelper.java @@ -0,0 +1,37 @@ +package writeon.api.auth.helper; + +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseCookie; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class AuthCookieHelper { + public final JwtHelper jwtHelper; + + @Value("${spring.profiles.active}") + private String profile; // todo: 프로필에 따른 쿠키 설정 분기, 운영기는 (secure: true && samesite: strict) + + public String createNewCookie(String refreshToken) { + return ResponseCookie + .from("refreshToken", refreshToken) + .httpOnly(true) + .path("/") + .maxAge(jwtHelper.getRefreshTokenExpirationPeriod()) + .sameSite("None") + .secure(true) + .build().toString(); + } + + public String createExpiredCookie() { + return ResponseCookie + .from("refreshToken", "") + .httpOnly(true) + .path("/") + .maxAge(0L) + .sameSite("None") + .secure(true) + .build().toString(); + } +} diff --git a/api/src/main/java/writeon/api/auth/helper/JwtHelper.java b/api/src/main/java/writeon/api/auth/helper/JwtHelper.java new file mode 100644 index 0000000..a8ed9b7 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/helper/JwtHelper.java @@ -0,0 +1,100 @@ +package writeon.api.auth.helper; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTVerificationException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.Getter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import writeon.api.common.util.CryptoUtil; +import writeon.domain.auth.JwtPayload; + +import java.io.IOException; +import java.time.Instant; + +@Component +@Getter +public class JwtHelper { + private final Algorithm algorithm; + private final Long accessTokenExpirationPeriod; + private final Long refreshTokenExpirationPeriod; + private final Long joinTokenExpirationPeriod; + private final Long changePasswordTokenExpirationPeriod; + private final CryptoUtil cryptoUtil; + + public JwtHelper ( + @Value("${jwt.secret}") String secret, + @Value("${jwt.access-token-expiration-period}") Long accessTokenExpirationPeriod, + @Value("${jwt.refresh-token-expiration-period}") Long refreshTokenExpirationPeriod, + @Value("${jwt.join-token-expiration-period}") Long joinTokenExpirationPeriod, + @Value("${jwt.change-password-token-expiration-period}") Long changePasswordTokenExpirationPeriod, + @Autowired CryptoUtil cryptoUtil + ) { + this.algorithm = Algorithm.HMAC256(secret); + this.accessTokenExpirationPeriod = accessTokenExpirationPeriod; + this.refreshTokenExpirationPeriod = refreshTokenExpirationPeriod; + this.joinTokenExpirationPeriod = joinTokenExpirationPeriod; + this.changePasswordTokenExpirationPeriod = changePasswordTokenExpirationPeriod; + this.cryptoUtil = cryptoUtil; + } + + public String generateAccessToken(JwtPayload payload) { + return generateJwt(this.accessTokenExpirationPeriod, payload); + } + + public String generateRefreshToken(JwtPayload payload) { + + return generateJwt(this.refreshTokenExpirationPeriod, payload); + } + + public String generateJoinToken(JwtPayload payload) { + + return generateJwt(this.joinTokenExpirationPeriod, payload); + } + + public String generateChangePasswordToken(JwtPayload payload) { + + return generateJwt(this.changePasswordTokenExpirationPeriod, payload); + } + + public JwtPayload getPayload(String token) throws JWTVerificationException { + try { + JWTVerifier verifier = JWT.require(algorithm).build(); + String payloadEncoded = verifier.verify(token).getPayload(); + byte[] payloadDecoded = cryptoUtil.decodeBase64(payloadEncoded); + + return new ObjectMapper().readValue(payloadDecoded, JwtPayload.class); + } catch (IOException ex) { + throw new JWTVerificationException("JwtPayload object mapping has failed."); + } + } + + public boolean isTokenValid(String token) { + try { + JWTVerifier verifier = JWT.require(algorithm).build(); + verifier.verify(token); + + return true; + } catch (JWTVerificationException ex) { + + return false; + } + } + + private String generateJwt(Long expPeriod, JwtPayload payload) { + try { + String jsonPayload = new ObjectMapper().writeValueAsString(payload); + + return JWT.create() + .withPayload(jsonPayload) + .withExpiresAt(Instant.ofEpochSecond(Instant.now().getEpochSecond() + expPeriod)) + .withIssuedAt(Instant.now()) + .sign(algorithm); + } catch (Exception ex) { + throw new RuntimeException(); + } + } +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/auth/helper/MailHelper.java b/api/src/main/java/writeon/api/auth/helper/MailHelper.java new file mode 100644 index 0000000..087798c --- /dev/null +++ b/api/src/main/java/writeon/api/auth/helper/MailHelper.java @@ -0,0 +1,55 @@ +package writeon.api.auth.helper; + +import jakarta.mail.MessagingException; +import jakarta.mail.internet.MimeMessage; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; +import org.thymeleaf.context.Context; +import org.thymeleaf.spring6.SpringTemplateEngine; + +@Component +@RequiredArgsConstructor +public class MailHelper { + private final JavaMailSender javaMailSender; + private final SpringTemplateEngine templateEngine; + + @Async("threadPoolExecutor") + public void send ( + MailType mailType, String mailTo, MailData data + ) throws MessagingException { + MimeMessage mimeMessage = javaMailSender.createMimeMessage(); + MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, false, "UTF-8"); + mimeMessageHelper.setTo(mailTo); + mimeMessageHelper.setSubject(mailType.getSubject()); + + Context variables = new Context(); + variables.setVariable("data", data); + mimeMessageHelper.setText(templateEngine.process(mailType.getTemplatePath(), variables), true); + + javaMailSender.send(mimeMessage); + } + + @Getter + @RequiredArgsConstructor + public enum MailType { + JOIN("[라이트온] 계정을 인증해주세요!", "mail/join"), + CHANGE_PASSWORD("[라이트온] 비밀번호 재설정 안내", "mail/change-password"); + + private final String subject; + private final String templatePath; + } + + @Getter + @AllArgsConstructor + @Builder + public static class MailData { + private String linkUrl; + private String nickname; + } +} diff --git a/api/src/main/java/writeon/api/auth/helper/MemberHelper.java b/api/src/main/java/writeon/api/auth/helper/MemberHelper.java new file mode 100644 index 0000000..25daa50 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/helper/MemberHelper.java @@ -0,0 +1,19 @@ +package writeon.api.auth.helper; + +import lombok.experimental.UtilityClass; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import writeon.domain.common.MemberSession; + +@UtilityClass +public class MemberHelper { + + public MemberSession getMemberSession() { + SecurityContext context = SecurityContextHolder.getContext(); + if (context.getAuthentication().getPrincipal() instanceof MemberSession memberSession) { + return memberSession; + } + return null; + } + +} diff --git a/api/src/main/java/writeon/api/auth/request/ChangePasswordCompletionRequest.java b/api/src/main/java/writeon/api/auth/request/ChangePasswordCompletionRequest.java new file mode 100644 index 0000000..6f2f561 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/ChangePasswordCompletionRequest.java @@ -0,0 +1,22 @@ +package writeon.api.auth.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import writeon.api.common.validation.IsPassword; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class ChangePasswordCompletionRequest { + @NotBlank + @Schema(title = "비밀번호 변경 토큰", requiredMode = Schema.RequiredMode.REQUIRED, example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3Mzc4Nzc1MDUsImV4cCI6MTc0NTY1MzUwNSwibWVtYmVySWQiOiJlZGMxNDJmNi1hODI4LTQ4MTQtODllOC1jZGM2NmU2ZTExMzMifQ.dEr2bidlj9lPe3ozoHFDc8e9IPxKaDdGiFQOl0HgiUM") + private String changePasswordToken; + + @NotBlank + @Schema(title = "변경할 비밀번호", requiredMode = Schema.RequiredMode.REQUIRED, example = "Writely4Writers!@") + private String password; +} diff --git a/api/src/main/java/writeon/api/auth/request/ChangePasswordRequest.java b/api/src/main/java/writeon/api/auth/request/ChangePasswordRequest.java new file mode 100644 index 0000000..1511808 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/ChangePasswordRequest.java @@ -0,0 +1,19 @@ +package writeon.api.auth.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import writeon.api.common.validation.IsPassword; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class ChangePasswordRequest { + @NotBlank + @IsPassword + @Schema(title = "이메일", requiredMode = Schema.RequiredMode.REQUIRED, example = "example@domain.com") + private String email; +} diff --git a/api/src/main/java/writeon/api/auth/request/CheckEmailRequest.java b/api/src/main/java/writeon/api/auth/request/CheckEmailRequest.java new file mode 100644 index 0000000..1b48760 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/CheckEmailRequest.java @@ -0,0 +1,16 @@ +package writeon.api.auth.request; + +import writeon.api.common.validation.IsEmail; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class CheckEmailRequest { + @NotBlank + @IsEmail + @Schema(title = "이메일", requiredMode = Schema.RequiredMode.REQUIRED, example = "example@domain.com") + private String email; +} diff --git a/api/src/main/java/writeon/api/auth/request/CheckNicknameRequest.java b/api/src/main/java/writeon/api/auth/request/CheckNicknameRequest.java new file mode 100644 index 0000000..e7d2376 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/CheckNicknameRequest.java @@ -0,0 +1,16 @@ +package writeon.api.auth.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; +import writeon.api.common.validation.IsNickname; + +@Getter +@Setter +public class CheckNicknameRequest { + @NotBlank + @IsNickname + @Schema(title = "닉네임", requiredMode = Schema.RequiredMode.REQUIRED, example = "노래하는뱁새") + private String nickname; +} diff --git a/api/src/main/java/writeon/api/auth/request/JoinCompletionRequest.java b/api/src/main/java/writeon/api/auth/request/JoinCompletionRequest.java new file mode 100644 index 0000000..6327a1a --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/JoinCompletionRequest.java @@ -0,0 +1,15 @@ +package writeon.api.auth.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.*; + +@Getter +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Builder +public class JoinCompletionRequest { + @NotBlank + @Schema(title = "회원가입 토큰", requiredMode = Schema.RequiredMode.REQUIRED, example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3Mzc4Nzc1MDUsImV4cCI6MTc0NTY1MzUwNSwibWVtYmVySWQiOiJlZGMxNDJmNi1hODI4LTQ4MTQtODllOC1jZGM2NmU2ZTExMzMifQ.dEr2bidlj9lPe3ozoHFDc8e9IPxKaDdGiFQOl0HgiUM") + private String joinToken; +} diff --git a/api/src/main/java/writeon/api/auth/request/JoinRequest.java b/api/src/main/java/writeon/api/auth/request/JoinRequest.java new file mode 100644 index 0000000..3664d1d --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/JoinRequest.java @@ -0,0 +1,40 @@ +package writeon.api.auth.request; + +import io.swagger.v3.oas.annotations.media.ArraySchema; +import writeon.api.common.validation.IsEmail; +import writeon.api.common.validation.IsNickname; +import writeon.api.common.validation.IsPassword; +import writeon.api.terms.request.TermsAgreeRequest; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class JoinRequest { + @NotBlank + @IsEmail + @Schema(title = "이메일", requiredMode = Schema.RequiredMode.REQUIRED, example = "example@domain.com") + private String email; + + @NotBlank + @IsPassword + @Schema(title = "비밀번호", requiredMode = Schema.RequiredMode.REQUIRED, example = "Writely4Writers!@") + private String password; + + @NotBlank + @Size(min = 2, max = 20) + @IsNickname + @Schema(title = "닉네임", requiredMode = Schema.RequiredMode.REQUIRED, example = "노래하는뱁새") + private String nickname; + + @NotNull + @ArraySchema(schema = @Schema(implementation = TermsAgreeRequest.class)) + private List termsList; + +} diff --git a/api/src/main/java/writeon/api/auth/request/LoginRequest.java b/api/src/main/java/writeon/api/auth/request/LoginRequest.java new file mode 100644 index 0000000..35f9058 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/request/LoginRequest.java @@ -0,0 +1,21 @@ +package writeon.api.auth.request; + +import writeon.api.common.validation.IsEmail; +import writeon.api.common.validation.IsPassword; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class LoginRequest { + @NotBlank + @IsEmail + @Schema(title = "이메일", requiredMode = Schema.RequiredMode.REQUIRED, example = "example@domain.com") + private String email; + + @NotBlank + @Schema(title = "비밀번호", requiredMode = Schema.RequiredMode.REQUIRED, example = "Writely4Writers!@") + private String password; +} diff --git a/api/src/main/java/writeon/api/auth/response/CheckEmailResponse.java b/api/src/main/java/writeon/api/auth/response/CheckEmailResponse.java new file mode 100644 index 0000000..f56fabb --- /dev/null +++ b/api/src/main/java/writeon/api/auth/response/CheckEmailResponse.java @@ -0,0 +1,16 @@ +package writeon.api.auth.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class CheckEmailResponse { + @Schema(title = "이메일", requiredMode = Schema.RequiredMode.REQUIRED, example = "example@domain.com") + private String email; + @Schema(title = "존재 여부", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") + private boolean exists; +} diff --git a/api/src/main/java/writeon/api/auth/response/CheckNicknameResponse.java b/api/src/main/java/writeon/api/auth/response/CheckNicknameResponse.java new file mode 100644 index 0000000..d5f6737 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/response/CheckNicknameResponse.java @@ -0,0 +1,16 @@ +package writeon.api.auth.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class CheckNicknameResponse { + @Schema(title = "닉네임", requiredMode = Schema.RequiredMode.REQUIRED, example = "노래하는뱁새") + private String email; + @Schema(title = "존재 여부", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") + private boolean exists; +} diff --git a/api/src/main/java/writeon/api/auth/response/LoginFailResponse.java b/api/src/main/java/writeon/api/auth/response/LoginFailResponse.java new file mode 100644 index 0000000..5be6422 --- /dev/null +++ b/api/src/main/java/writeon/api/auth/response/LoginFailResponse.java @@ -0,0 +1,19 @@ +package writeon.api.auth.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Getter +@Setter +@AllArgsConstructor +public class LoginFailResponse { + @Schema(title = "남은 로그인 시도 횟수", requiredMode = Schema.RequiredMode.REQUIRED, example = "4") + private int remainingAttempts; + + @Schema(title = "로그인 가능 시각", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2025-04-05T14:41:10.626943") + private LocalDateTime loginAvailableAt; +} diff --git a/api/src/main/java/writeon/api/auth/response/TokenReissueResponse.java b/api/src/main/java/writeon/api/auth/response/TokenReissueResponse.java new file mode 100644 index 0000000..c51137b --- /dev/null +++ b/api/src/main/java/writeon/api/auth/response/TokenReissueResponse.java @@ -0,0 +1,16 @@ +package writeon.api.auth.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + + +@Getter +@Setter +@RequiredArgsConstructor +public class TokenReissueResponse { + @Schema(title = "액세스 토큰", requiredMode = Schema.RequiredMode.REQUIRED, example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3Mzc4Nzc1MDUsImV4cCI6MTc0NTY1MzUwNSwibWVtYmVySWQiOiJlZGMxNDJmNi1hODI4LTQ4MTQtODllOC1jZGM2NmU2ZTExMzMifQ.dEr2bidlj9lPe3ozoHFDc8e9IPxKaDdGiFQOl0HgiUM") + private final String accessToken; + +} diff --git a/api/src/main/java/writeon/api/auth/service/AuthCommandService.java b/api/src/main/java/writeon/api/auth/service/AuthCommandService.java new file mode 100644 index 0000000..f25ba6c --- /dev/null +++ b/api/src/main/java/writeon/api/auth/service/AuthCommandService.java @@ -0,0 +1,362 @@ +package writeon.api.auth.service; + +import com.amplitude.Amplitude; +import com.amplitude.Event; +import jakarta.mail.MessagingException; +import jakarta.transaction.Transactional; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.crypto.bcrypt.BCrypt; +import org.springframework.stereotype.Service; +import writeon.api.auth.helper.JwtHelper; +import writeon.api.auth.helper.MailHelper; +import writeon.api.auth.helper.MemberHelper; +import writeon.api.auth.request.*; +import writeon.api.auth.response.LoginFailResponse; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.DateTimeUtil; +import writeon.api.common.util.LogUtil; +import writeon.api.terms.request.TermsAgreeRequest; +import writeon.api.terms.service.TermsQueryService; +import writeon.domain.auth.*; +import writeon.domain.auth.dto.AuthTokenDto; +import writeon.domain.auth.enums.AuthException; +import writeon.domain.auth.enums.LoginAttemptResultType; +import writeon.domain.auth.repository.ChangePasswordTokenRedisRepository; +import writeon.domain.auth.repository.JoinTokenRedisRepository; +import writeon.domain.auth.repository.LoginAttemptJpaRepository; +import writeon.domain.auth.repository.RefreshTokenRedisRepository; +import writeon.domain.common.MemberSession; +import writeon.domain.member.Member; +import writeon.domain.member.MemberPassword; +import writeon.domain.member.repository.MemberJpaRepository; +import writeon.domain.member.repository.MemberPasswordJpaRepository; +import writeon.domain.terms.TermsAgreement; +import writeon.domain.terms.enums.TermsCode; +import writeon.domain.terms.repository.TermsAgreeJpaRepository; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +@Slf4j +public class AuthCommandService { + private final AuthQueryService authQueryService; + private final TermsQueryService termsQueryService; + private final MemberJpaRepository memberJpaRepository; + private final MemberPasswordJpaRepository memberPasswordJpaRepository; + private final RefreshTokenRedisRepository refreshTokenRedisRepository; + private final JoinTokenRedisRepository joinTokenRedisRepository; + private final ChangePasswordTokenRedisRepository changePasswordTokenRedisRepository; + private final TermsAgreeJpaRepository termsAgreeJpaRepository; + private final LoginAttemptJpaRepository loginAttemptJpaRepository; + private final JwtHelper jwtHelper; + private final MailHelper mailHelper; + private final Amplitude amplitude = Amplitude.getInstance(); + + @Value("${service.web.url}") + private String WEB_URL; + + /** + * 토큰 재발급 + */ + @Transactional + public AuthTokenDto reissueToken(String tokenString) { + // 리프래시 토큰이 비유효하면 + if (!jwtHelper.isTokenValid(tokenString)) { + throw new BaseException(AuthException.REFRESH_TOKEN_NOT_VALID); + } + + // 레디스 검사 + RefreshToken oldRefreshToken = refreshTokenRedisRepository.findById(tokenString) + .orElseThrow(() -> new BaseException(AuthException.REFRESH_TOKEN_NOT_VALID)); + LogUtil.info("invalidate refresh token by reissue: " + tokenString); + this.invalidateToken(oldRefreshToken); + + JwtPayload payload = jwtHelper.getPayload(tokenString); + return generateAuthTokens(payload.getMemberId()); + } + + /** + * 로그인 + */ + public AuthTokenDto login(LoginRequest request) { + Member member = memberJpaRepository.findByEmail(request.getEmail()) + .orElseThrow(() -> new BaseException(AuthException.LOGIN_FAILED)); + MemberPassword memberPassword = memberPasswordJpaRepository.findById(member.getId()) + .orElseThrow(() -> new BaseException(AuthException.AUTH_FAILED_BY_UNKNOWN_ERROR)); + + List lastFiveAttempts = loginAttemptJpaRepository.findTop5ByEmailOrderByCreatedAtDesc(request.getEmail()); + if (!lastFiveAttempts.isEmpty()) { + LoginAttempt lastAttempt = lastFiveAttempts.getFirst(); + // 로그인 시도가 블락 상태이고, 블락 시간으로부터 1시간이 지나지 않은 경우 + if (lastAttempt.getResult() == LoginAttemptResultType.BLOCKED && lastAttempt.getCreatedAt().isAfter(LocalDateTime.now().minusHours(1)) + ) { + LocalDateTime loginAvailableAt = lastAttempt.getCreatedAt().plusHours(1); + throw new BaseException( + AuthException.LOGIN_BLOCKED, + new LoginFailResponse(0, loginAvailableAt), + String.format("로그인 5회 실패로 [%s]까지 접속이 제한됩니다.", loginAvailableAt.format(DateTimeFormatter.ofPattern(DateTimeUtil.DATETIME_HOUR_ONLY_KR_PATTERN))) + ); + } + } + + + LoginAttempt newLoginAttempt = new LoginAttempt(); + newLoginAttempt.setEmail(request.getEmail()); + + final boolean isPasswordCorrect = BCrypt.checkpw(request.getPassword(), memberPassword.getPassword()); + if (!isPasswordCorrect) { + int attemptsRemaining = 5 - 1; + // 남은 시도 횟수 계산 + for (LoginAttempt attempt : lastFiveAttempts) { + if (attempt.getResult() != LoginAttemptResultType.FAILED) break; + attemptsRemaining -= 1; + } + + newLoginAttempt.setResult( + attemptsRemaining == 0 + ? LoginAttemptResultType.BLOCKED + : LoginAttemptResultType.FAILED + ); + loginAttemptJpaRepository.save(newLoginAttempt); + if (attemptsRemaining == 0) { + LocalDateTime now = LocalDateTime.now(); + throw new BaseException( + AuthException.LOGIN_BLOCKED, + new LoginFailResponse(0, now), + String.format("로그인 5회 실패로 [%s]까지 접속이 제한됩니다.", now.format(DateTimeFormatter.ofPattern(DateTimeUtil.DATETIME_HOUR_ONLY_KR_PATTERN))) + ); + } else if (attemptsRemaining > 2) { + throw new BaseException(AuthException.LOGIN_FAILED, new LoginFailResponse(attemptsRemaining, null)); + } else { + throw new BaseException(AuthException.LOGIN_FAILED_WITH_WARNING, new LoginFailResponse(attemptsRemaining, null)); + } + } + + newLoginAttempt.setResult(LoginAttemptResultType.SUCCEED); + loginAttemptJpaRepository.save(newLoginAttempt); + return generateAuthTokens(memberPassword.getMemberId()); + } + + /** + * 로그아웃 + */ + @Transactional + public void logout() { + MemberSession memberSession = MemberHelper.getMemberSession(); + + refreshTokenRedisRepository.findByMemberId(memberSession.getMemberId()).ifPresent((refreshToken) -> { + LogUtil.info("invalidate refresh token by logout: " + refreshToken.getTokenString()); + invalidateToken(refreshToken); + }); + } + + /** + * 회원 가입 + */ + @Transactional + public void join(JoinRequest request) { + // 필수 약관이 모두 포함되어있는지 검사 + List agreedTermsList = request.getTermsList() + .stream() + .filter(TermsAgreeRequest::getIsAgreed) + .map(TermsAgreeRequest::getTermsCd) + .toList(); + + // 필수 약관 검사 + if (!termsQueryService.isContainingAllRequiredTerms(agreedTermsList)) { + throw new BaseException(AuthException.TERMS_AGREE_REQUIRED); + } + // 이메일 중복 검사 + if (memberJpaRepository.findByEmail(request.getEmail()).isPresent()) { + throw new BaseException(AuthException.JOIN_ALREADY_EXIST_MEMBER); + } + // 닉네임 중복 검사 + if (memberJpaRepository.findByNickname(request.getNickname()).isPresent()) { + throw new BaseException(AuthException.NICKNAME_ALREADY_EXIST); + } + + // 회원 정보 설정 + String passwordHash = BCrypt.hashpw(request.getPassword(), BCrypt.gensalt()); + + Member member = Member.builder() + .email(request.getEmail()) + .nickname(request.getNickname()) + .build(); + MemberPassword memberPassword = MemberPassword.builder() + .memberId(member.getId()) + .password(passwordHash) + .build(); + List termsAgreementList = agreedTermsList.stream() + .map(t -> TermsAgreement.builder() + .termsCd(t) + .memberId(member.getId()) + .build() + ).toList(); + String jwtString = jwtHelper.generateJoinToken( + JwtPayload.builder().memberId(member.getId()).build() + ); + + // joinToken redis 저장 + JoinToken joinToken = new JoinToken(jwtString, member, memberPassword, termsAgreementList); + joinTokenRedisRepository.save(joinToken); + + try { + // 이메일 전송 + mailHelper.send( + MailHelper.MailType.JOIN, + request.getEmail(), + MailHelper.MailData.builder() + .nickname(request.getNickname()) + .linkUrl( WEB_URL + "/join/complete?joinToken=" + joinToken.getTokenString() ) + .build() + ); + } catch (MessagingException e) { + throw new BaseException(AuthException.MAIL_SEND_FAILED); + } + + // Amplitude 이벤트 전송 + Event event = new Event("$identify", joinToken.getMember().getId().toString()); + event.userProperties = new JSONObject() + .put("signup_date", DateTimeUtil.convertToString(LocalDate.now())) + .put("account_activation", false); + amplitude.logEvent(event); + } + + /** + * 회원가입 완료 + */ + @Transactional + public void completeJoin(JoinCompletionRequest request) { + final String joinTokenString = request.getJoinToken(); + + // 토큰이 비유효한 경우 + if (!jwtHelper.isTokenValid(joinTokenString)) { + throw new BaseException(AuthException.JOIN_TOKEN_NOT_VALID); + } + + // 토큰 조회 + JoinToken joinToken = joinTokenRedisRepository.findById(joinTokenString) + .orElseThrow(() -> new BaseException(AuthException.JOIN_TOKEN_NOT_VALID)); + + // 가입 완료 처리 + memberJpaRepository.save(joinToken.getMember()); + memberPasswordJpaRepository.save(joinToken.getMemberPassword()); + joinToken.getTermsAgreementList().forEach(termsAgreeJpaRepository::save); + + // 토큰 무효화 + this.invalidateToken(joinToken); + + // Amplitude 이벤트 전송 + final String userId = joinToken.getMember().getId().toString(); + Event userPropEvent = new Event("$identify", userId); + userPropEvent.userProperties = new JSONObject() + .put("account_activation", true); + Event signUpEvent = new Event("signup_complete", userId); + userPropEvent.eventProperties = new JSONObject() + .put("user_id", userId); + + amplitude.logEvent(userPropEvent); + amplitude.logEvent(signUpEvent); + } + + /** + * 비밀번호 변경 + */ + @Transactional + public void changePassword(ChangePasswordRequest request) { + Member member = memberJpaRepository.findByEmail(request.getEmail()) + .orElseThrow(() -> new BaseException(AuthException.CHANGE_PASSWORD_EMAIL_NOT_FOUND)); + + // 비밀번호 변경 토큰 생성 & 저장 + JwtPayload payload = JwtPayload.builder() + .memberId(member.getId()) + .build(); + ChangePasswordToken changePasswordToken = new ChangePasswordToken(jwtHelper.generateChangePasswordToken(payload)); + changePasswordTokenRedisRepository.save(changePasswordToken); + + // 이메일 전송 + try { + mailHelper.send( + MailHelper.MailType.CHANGE_PASSWORD, + member.getEmail(), + MailHelper.MailData.builder() + .nickname(member.getNickname()) + .linkUrl(WEB_URL + "/change-password/complete?changePasswordToken=" + changePasswordToken.getTokenString()) + .build() + ); + } catch (MessagingException e) { + throw new BaseException(AuthException.CHANGE_PASSWORD_EMAIL_NOT_FOUND); + } + + } + + /** + * 비밀번호 변경 완료 + */ + @Transactional + public void completeChangePassword(ChangePasswordCompletionRequest request) { + // 토큰이 비유효한 경우 + if (!jwtHelper.isTokenValid(request.getChangePasswordToken())) { + throw new BaseException(AuthException.CHANGE_PASSWORD_TOKEN_NOT_VALID); + } + + // 토큰 레디스 조회 + ChangePasswordToken changePasswordToken = changePasswordTokenRedisRepository.findById(request.getChangePasswordToken()) + .orElseThrow(() -> new BaseException(AuthException.CHANGE_PASSWORD_TOKEN_NOT_VALID)); + JwtPayload payload = jwtHelper.getPayload(changePasswordToken.getTokenString()); + + // 비밀번호 조회 + MemberPassword memberPassword = memberPasswordJpaRepository.findById(payload.getMemberId()) + .orElseThrow(() -> new BaseException(AuthException.AUTH_FAILED_BY_UNKNOWN_ERROR)); + + final boolean isPasswordUsedBefore = BCrypt.checkpw(request.getPassword(), memberPassword.getPassword()); + if (isPasswordUsedBefore) { + throw new BaseException(AuthException.CHANGE_PASSWORD_USED_PASSWORD_BEFORE); + } + + // 비밀번호 변경 + final String passwordHash = BCrypt.hashpw(request.getPassword(), BCrypt.gensalt()); + memberPassword.setPassword(passwordHash); + + // 토큰 무효화 + this.invalidateToken(changePasswordToken); + } + + /** + * 인증 토큰 발급 (액세스 + 리프래시) + */ + private AuthTokenDto generateAuthTokens(UUID memberId) { + JwtPayload jwtPayload = JwtPayload.builder() + .memberId(memberId) + .build(); + String accessToken = jwtHelper.generateAccessToken(jwtPayload); + String refreshToken = jwtHelper.generateRefreshToken(jwtPayload); + refreshTokenRedisRepository.save(new RefreshToken(refreshToken, memberId)); + LogUtil.info("issue refresh token: " + refreshToken); + + return new AuthTokenDto(accessToken, refreshToken); + } + + /** + * 토큰 무효화 (Redis에서 관리하는 토큰의 경우) + */ + private void invalidateToken(BaseToken token) { + if (token instanceof RefreshToken refreshToken) { + refreshTokenRedisRepository.delete(refreshToken); + } + else if (token instanceof JoinToken joinToken) { + joinTokenRedisRepository.delete(joinToken); + } + else if (token instanceof ChangePasswordToken changePasswordToken) { + changePasswordTokenRedisRepository.delete(changePasswordToken); + } + } +} diff --git a/api/src/main/java/writeon/api/auth/service/AuthQueryService.java b/api/src/main/java/writeon/api/auth/service/AuthQueryService.java new file mode 100644 index 0000000..740d0dd --- /dev/null +++ b/api/src/main/java/writeon/api/auth/service/AuthQueryService.java @@ -0,0 +1,29 @@ +package writeon.api.auth.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import writeon.api.auth.request.CheckEmailRequest; +import writeon.api.auth.request.CheckNicknameRequest; +import writeon.api.auth.response.CheckEmailResponse; +import writeon.domain.member.repository.MemberJpaRepository; + +@RequiredArgsConstructor +@Transactional(readOnly = true) +@Service +public class AuthQueryService { + private final MemberJpaRepository memberJpaRepository; + + public CheckEmailResponse checkEmail(CheckEmailRequest request) { + boolean exists = memberJpaRepository.findByEmail(request.getEmail()).isPresent(); + + return new CheckEmailResponse(request.getEmail(), exists); + } + + public CheckEmailResponse checkNickname(CheckNicknameRequest request) { + boolean exists = memberJpaRepository.findByNickname(request.getNickname()).isPresent(); + + return new CheckEmailResponse(request.getNickname(), exists); + } + +} diff --git a/api/src/main/java/writeon/api/common/audit/CustomAuditorAware.java b/api/src/main/java/writeon/api/common/audit/CustomAuditorAware.java new file mode 100644 index 0000000..832fcfe --- /dev/null +++ b/api/src/main/java/writeon/api/common/audit/CustomAuditorAware.java @@ -0,0 +1,16 @@ +package writeon.api.common.audit; + +import org.springframework.data.domain.AuditorAware; +import writeon.api.common.util.MemberUtil; + +import java.util.Optional; +import java.util.UUID; + +public class CustomAuditorAware implements AuditorAware { + + @Override + public Optional getCurrentAuditor() { + UUID memberId = MemberUtil.getMemberId(); + return memberId != null ? Optional.of(memberId) : Optional.empty(); + } +} diff --git a/api/src/main/java/writeon/api/common/config/AmplitudeConfig.java b/api/src/main/java/writeon/api/common/config/AmplitudeConfig.java new file mode 100644 index 0000000..d54f356 --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/AmplitudeConfig.java @@ -0,0 +1,20 @@ +package writeon.api.common.config; + +import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import com.amplitude.Amplitude; + + +@Configuration +public class AmplitudeConfig { + @Value("${service.tracking.amplitude.api-key}") + private String apiKey; + + @PostConstruct + public void init() { + Amplitude amplitude = Amplitude.getInstance(); + amplitude.init(apiKey); + } + +} diff --git a/api/src/main/java/writeon/api/common/config/AsyncConfig.java b/api/src/main/java/writeon/api/common/config/AsyncConfig.java new file mode 100644 index 0000000..a5b335c --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/AsyncConfig.java @@ -0,0 +1,25 @@ +package writeon.api.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; + +@Configuration +@EnableAsync +public class AsyncConfig { + + @Bean(name = "threadPoolExecutor") + public Executor threadPoolExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(4); + executor.setMaxPoolSize(8); + executor.setQueueCapacity(50); + executor.setThreadNamePrefix("executor-threadpool-"); + executor.initialize(); + return executor; + } + +} diff --git a/api/src/main/java/writeon/api/common/config/AuditConfig.java b/api/src/main/java/writeon/api/common/config/AuditConfig.java new file mode 100644 index 0000000..b08654f --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/AuditConfig.java @@ -0,0 +1,19 @@ +package writeon.api.common.config; + +import writeon.api.common.audit.CustomAuditorAware; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.domain.AuditorAware; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; + +import java.util.UUID; + +@Configuration +@EnableJpaAuditing(auditorAwareRef = "auditorProvider") +public class AuditConfig { + + @Bean + public AuditorAware auditorProvider() { + return new CustomAuditorAware(); + } +} diff --git a/api/src/main/java/writeon/api/common/config/S3ClientConfig.java b/api/src/main/java/writeon/api/common/config/S3ClientConfig.java new file mode 100644 index 0000000..746fdc9 --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/S3ClientConfig.java @@ -0,0 +1,36 @@ +package writeon.api.common.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.s3.S3Client; +import software.amazon.awssdk.services.s3.presigner.S3Presigner; + +@Configuration +public class S3ClientConfig { + @Value("${cloud.aws.credentials.access-key}") + private String accessKey; + @Value("${cloud.aws.credentials.secret-key}") + private String secretKey; + @Value("${cloud.aws.region.static}") + private String region; + + @Bean + public S3Client s3Client() { + return S3Client.builder() + .region(Region.of(region)) + .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey))) + .build(); + } + + @Bean + public S3Presigner s3Presigner() { + return S3Presigner.builder() + .region(Region.of(region)) + .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey))) + .build(); + } +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/config/SecurityConfig.java b/api/src/main/java/writeon/api/common/config/SecurityConfig.java new file mode 100644 index 0000000..15736dc --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/SecurityConfig.java @@ -0,0 +1,80 @@ +package writeon.api.common.config; + +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.AuthenticationServiceException; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import writeon.api.common.exception.handler.CustomAuthenticationEntryPoint; +import writeon.api.common.filter.CustomAuthenticationFilter; + +import java.util.List; + +@Configuration +@EnableWebSecurity +@RequiredArgsConstructor +public class SecurityConfig { + private final CustomAuthenticationFilter customAuthenticationFilter; + private final CustomAuthenticationEntryPoint customAuthenticationEntryPoint; + + @Value("${service.cors.origins}") + private List origins; + + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + return http + .cors(Customizer.withDefaults()) + .csrf(AbstractHttpConfigurer::disable) + .formLogin(AbstractHttpConfigurer::disable) + .httpBasic(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(auth -> auth + .requestMatchers("/swagger-ui/**", "/doc/**", "/v3/api-docs/**").permitAll() + .requestMatchers("/health-check/**").permitAll() + .requestMatchers("/auth/logout").authenticated() + .requestMatchers("/auth/**").permitAll() + .requestMatchers("/terms/**").permitAll() + .requestMatchers(AntPathRequestMatcher.antMatcher("/assistant/**/stream")).permitAll() + .anyRequest().authenticated() + ) + .addFilterBefore(customAuthenticationFilter, UsernamePasswordAuthenticationFilter.class) + .exceptionHandling(configurer -> { + configurer.authenticationEntryPoint(customAuthenticationEntryPoint); + } + ) + .build(); + } + + @Bean + public CorsConfigurationSource corsConfigurationSource() { + CorsConfiguration configuration = new CorsConfiguration(); + configuration.setAllowedOrigins(origins); + configuration.setAllowedMethods(List.of("*")); + configuration.setAllowedHeaders(List.of("*")); + configuration.setAllowCredentials(true); + + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", configuration); + return source; + } + + @Bean + public AuthenticationManager noopAuthenticationManager() { + return authentication -> { + throw new AuthenticationServiceException("Authentication is disabled"); + }; + } + +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/config/SwaggerConfig.java b/api/src/main/java/writeon/api/common/config/SwaggerConfig.java new file mode 100644 index 0000000..14d8c1f --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/SwaggerConfig.java @@ -0,0 +1,28 @@ +package writeon.api.common.config; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Arrays; +import java.util.Collections; + +@Configuration +public class SwaggerConfig { + + @Bean + public OpenAPI openAPI(){ + SecurityScheme securityScheme = new SecurityScheme() + .type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT") + .in(SecurityScheme.In.HEADER).name("Authorization"); + SecurityRequirement securityRequirement = new SecurityRequirement().addList("bearer token"); + + return new OpenAPI() + .components(new Components().addSecuritySchemes("bearer token", securityScheme)) + .security(Collections.singletonList(securityRequirement)); + } + +} diff --git a/api/src/main/java/writeon/api/common/config/WebConfig.java b/api/src/main/java/writeon/api/common/config/WebConfig.java new file mode 100644 index 0000000..3901e89 --- /dev/null +++ b/api/src/main/java/writeon/api/common/config/WebConfig.java @@ -0,0 +1,18 @@ +package writeon.api.common.config; + +import lombok.RequiredArgsConstructor; +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import writeon.domain.terms.enums.TermsCode; + +@Configuration +@RequiredArgsConstructor +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addFormatters(FormatterRegistry registry) { + registry.addConverter(new TermsCode.SpringConverter()); + } + +} diff --git a/api/src/main/java/writeon/api/common/discord/DiscordLogAppender.java b/api/src/main/java/writeon/api/common/discord/DiscordLogAppender.java new file mode 100644 index 0000000..1e124ee --- /dev/null +++ b/api/src/main/java/writeon/api/common/discord/DiscordLogAppender.java @@ -0,0 +1,119 @@ +package writeon.api.common.discord; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.UnsynchronizedAppenderBase; +import writeon.api.common.discord.model.EmbedObject; +import writeon.api.common.enums.exception.InternalServerException; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.MDCUtil; +import lombok.Setter; +import org.springframework.context.annotation.Profile; + +import java.awt.*; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.regex.Pattern; + +@Setter +@Profile("!local") +public class DiscordLogAppender extends UnsynchronizedAppenderBase { + + private String webhookUrl; + + @Override + protected void append(ILoggingEvent event) { + if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { + sendErrorLog(event); + } + } + + public void sendErrorLog(ILoggingEvent event) { + DiscordWebHook discordWebhook = new DiscordWebHook(webhookUrl); + Map mdcPropertyMap = event.getMDCPropertyMap(); + + String requestUri = mdcPropertyMap.get(MDCUtil.REQUEST_URI_MDC); + if (!Pattern.matches("/products/.*|/auth/.*|/health-check/.*", requestUri)) { + return; + } + + Color messageColor = Color.red; + String message = event.getMessage(); + + int newlineIndex = message.indexOf("\n"); + if (newlineIndex != -1) { + message = message.substring(0, newlineIndex).trim(); + } else { + message = "EXCEPTION 정보가 남지 않았습니다."; + } + + discordWebhook.addEmbed(new EmbedObject() + .setTitle("[에러 내용]") + .setColor(messageColor) + .setDescription(message) + .addField(MDCUtil.REQUEST_URI_MDC, mdcPropertyMap.get(MDCUtil.REQUEST_METHOD_MDC) + " " + mdcPropertyMap.get(MDCUtil.REQUEST_URI_MDC), true) + .addField("[오류 발생 시간]", LocalDateTime.now().toString(), true) + .addField(MDCUtil.REQUEST_IP_MDC, mdcPropertyMap.get(MDCUtil.REQUEST_IP_MDC), false) + .addField(MDCUtil.HEADER_MAP_MDC, + escapeJsonInternal(mdcPropertyMap.get(MDCUtil.HEADER_MAP_MDC)), + false) + .addField(MDCUtil.PARAMETER_MAP_MDC, + escapeJsonInternal(mdcPropertyMap.get(MDCUtil.PARAMETER_MAP_MDC)), + false)); + + discordWebhook.addEmbed(new EmbedObject() + .setTitle("[Exception 상세 내용]") + .setColor(messageColor) + .setDescription(escapeJsonInternal(event.getMessage().substring(0, 2000))) + ); + + try { + discordWebhook.execute(); + } catch (Exception e) { + throw new BaseException(InternalServerException.DISCORD_APPENDER_FAIL); + } + } + + private String escapeJsonInternal(final String input) { + // 입력이 null이거나 빈 문자열인 경우 그대로 반환 + if (input == null || input.trim().isEmpty()) { + return ""; + } + + final StringBuilder builder = new StringBuilder(input.length() * 2); + for (int i = 0; i < input.length(); i++) { + final char ch = input.charAt(i); + switch (ch) { + case '"': + builder.append("\\\""); + break; + case '\\': + builder.append("\\\\"); + break; + case '\b': + builder.append("\\b"); + break; + case '\f': + builder.append("\\f"); + break; + case '\n': + builder.append("\\n"); + break; + case '\r': + builder.append("\\r"); + break; + case '\t': + builder.append("\\t"); + break; + default: + if (ch < ' ' || (ch >= '\u0080' && ch < '\u00a0') + || (ch >= '\u2000' && ch < '\u2100')) { + builder.append("\\u").append(Integer.toHexString(ch | 0x10000).substring(1)); + } else { + builder.append(ch); + } + } + } + return builder.toString(); + } +} diff --git a/api/src/main/java/writeon/api/common/discord/DiscordWebHook.java b/api/src/main/java/writeon/api/common/discord/DiscordWebHook.java new file mode 100644 index 0000000..4f35354 --- /dev/null +++ b/api/src/main/java/writeon/api/common/discord/DiscordWebHook.java @@ -0,0 +1,120 @@ +package writeon.api.common.discord; + +import writeon.api.common.discord.model.EmbedObject; +import writeon.api.common.discord.model.Field; +import writeon.api.common.discord.model.JsonObject; +import writeon.api.common.enums.exception.InternalServerException; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.LogUtil; +import org.springframework.web.reactive.function.client.WebClient; + +import java.awt.*; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + +public class DiscordWebHook { + + private final String urlString; + private final List embeds = new ArrayList<>(); + private String username; + private String avatarUrl; + private boolean tts; + + public DiscordWebHook(String webhookUrl) { + this.urlString = webhookUrl; + } + + public void addEmbed(EmbedObject embed) { + this.embeds.add(embed); + } + + /** + * Discrod LogBack 메세지 전송 + */ + public void execute() { + if (this.embeds.isEmpty()) { + throw new BaseException(InternalServerException.DISCORD_APPENDER_FAIL); + } + + try { + WebClient.create(urlString) + .post() + .header("Content-Type", "application/json") + .header("User-Agent", "Java-DiscordWebhook-BY-Gelox_") + .bodyValue(createDiscordEmbedObject(this.embeds, initializerDiscordSendForJsonObject(new JsonObject())).toString().getBytes( + StandardCharsets.UTF_8)) + .retrieve() + .toBodilessEntity() + .subscribe((e) -> { + }, (error) -> { + LogUtil.info("Discord Appender Fail: " + error.getLocalizedMessage()); + }); + } catch (Exception e) { + LogUtil.info("Discord Appender Fail: " + e.getLocalizedMessage()); + } + } + + private JsonObject initializerDiscordSendForJsonObject(JsonObject json) { + json.put("username", this.username); + json.put("avatar_url", this.avatarUrl); + json.put("tts", this.tts); + return json; + } + + private JsonObject createDiscordEmbedObject(List embeds, JsonObject json) { + if (embeds.isEmpty()) { + throw new BaseException(InternalServerException.DISCORD_APPENDER_FAIL); + } + + List embedObjects = new ArrayList<>(); + + for (EmbedObject embed : embeds) { + JsonObject jsonEmbed = new JsonObject(); + + jsonEmbed.put("title", embed.getTitle()); + jsonEmbed.put("description", embed.getDescription()); + jsonEmbed.put("url", embed.getUrl()); + + setEmbedColor(embed, jsonEmbed); + setEmbedMessageFields(embed.getFields(), jsonEmbed); + + embedObjects.add(jsonEmbed); + } + json.put("embeds", embedObjects.toArray()); + return json; + } + + /** + * Embed 메세지 테두리 색상 설정 + */ + private void setEmbedColor(EmbedObject embed, JsonObject jsonEmbed) { + if (embed.getColor() != null) { + Color color = embed.getColor(); + int rgb = color.getRed(); + rgb = (rgb << 8) + color.getGreen(); + rgb = (rgb << 8) + color.getBlue(); + + jsonEmbed.put("color", rgb); + } + } + + /** + * 텍스트 필드 목록 설정 + */ + private void setEmbedMessageFields(List fields, JsonObject jsonEmbed) { + List jsonFields = new ArrayList<>(); + + for (Field field : fields) { + JsonObject jsonField = new JsonObject(); + + jsonField.put("name", field.getName()); + jsonField.put("value", field.getValue()); + jsonField.put("inline", field.isInline()); + + jsonFields.add(jsonField); + } + + jsonEmbed.put("fields", jsonFields.toArray()); + } +} diff --git a/api/src/main/java/writeon/api/common/discord/model/EmbedObject.java b/api/src/main/java/writeon/api/common/discord/model/EmbedObject.java new file mode 100644 index 0000000..73f39a0 --- /dev/null +++ b/api/src/main/java/writeon/api/common/discord/model/EmbedObject.java @@ -0,0 +1,42 @@ +package writeon.api.common.discord.model; + +import lombok.Getter; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +@Getter +public class EmbedObject { + + private final List fields = new ArrayList<>(); + private String title; + private String description; + private String url; + private Color color; + + public EmbedObject setTitle(String title) { + this.title = title; + return this; + } + + public EmbedObject setDescription(String description) { + this.description = description; + return this; + } + + public EmbedObject setUrl(String url) { + this.url = url; + return this; + } + + public EmbedObject setColor(Color color) { + this.color = color; + return this; + } + + public EmbedObject addField(String name, String value, boolean inline) { + this.fields.add(new Field(name, value, inline)); + return this; + } +} diff --git a/api/src/main/java/writeon/api/common/discord/model/Field.java b/api/src/main/java/writeon/api/common/discord/model/Field.java new file mode 100644 index 0000000..25d3782 --- /dev/null +++ b/api/src/main/java/writeon/api/common/discord/model/Field.java @@ -0,0 +1,17 @@ +package writeon.api.common.discord.model; + +import lombok.Getter; + +@Getter +public class Field { + + private final String name; + private final String value; + private final boolean inline; + + public Field(String name, String value, boolean inline) { + this.name = name; + this.value = value; + this.inline = inline; + } +} diff --git a/api/src/main/java/writeon/api/common/discord/model/JsonObject.java b/api/src/main/java/writeon/api/common/discord/model/JsonObject.java new file mode 100644 index 0000000..91a7531 --- /dev/null +++ b/api/src/main/java/writeon/api/common/discord/model/JsonObject.java @@ -0,0 +1,55 @@ +package writeon.api.common.discord.model; + +import java.lang.reflect.Array; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class JsonObject { + + private final HashMap discordMessageMap = new HashMap<>(); + + public void put(String key, Object value) { + if (value != null) { + discordMessageMap.put(key, value); + } + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + Set> entrySet = discordMessageMap.entrySet(); + builder.append("{"); + + int iter = 0; + for (Map.Entry entry : entrySet) { + Object val = entry.getValue(); + builder.append(quote(entry.getKey())).append(":"); + + if (val instanceof String) { + builder.append(quote(String.valueOf(val))); + } else if (val instanceof Integer) { + builder.append(Integer.valueOf(String.valueOf(val))); + } else if (val instanceof Boolean) { + builder.append(val); + } else if (val instanceof JsonObject) { + builder.append(val); + } else if (val.getClass().isArray()) { + builder.append("["); + int len = Array.getLength(val); + for (int j = 0; j < len; j++) { + builder.append(Array.get(val, j).toString()).append(j != len - 1 ? "," : ""); + } + builder.append("]"); + } + + builder.append(++iter == entrySet.size() ? "}" : ","); + } + + return builder.toString(); + } + + private String quote(String string) { + return "\"" + string + "\""; + } +} diff --git a/api/src/main/java/writeon/api/common/enums/code/ResultCodeInfo.java b/api/src/main/java/writeon/api/common/enums/code/ResultCodeInfo.java new file mode 100644 index 0000000..fd5b228 --- /dev/null +++ b/api/src/main/java/writeon/api/common/enums/code/ResultCodeInfo.java @@ -0,0 +1,19 @@ +package writeon.api.common.enums.code; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum ResultCodeInfo implements CodeInfo { + + SUCCESS(HttpStatus.OK, "RESULT-001", "성공적으로 수행하였습니다."), + FAILURE(HttpStatus.INTERNAL_SERVER_ERROR, "RESULT-002", "알 수 없는 오류가 발생했습니다."), + BAD_REQUEST(HttpStatus.BAD_REQUEST, "RESULT-003", "잘못된 요청입니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/api/src/main/java/writeon/api/common/enums/exception/InternalServerException.java b/api/src/main/java/writeon/api/common/enums/exception/InternalServerException.java new file mode 100644 index 0000000..9b1ed1f --- /dev/null +++ b/api/src/main/java/writeon/api/common/enums/exception/InternalServerException.java @@ -0,0 +1,17 @@ +package writeon.api.common.enums.exception; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum InternalServerException implements CodeInfo { + + DISCORD_APPENDER_FAIL(HttpStatus.INTERNAL_SERVER_ERROR, "SERVER-001", "Discord WebHook에 실패했습니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/api/src/main/java/writeon/api/common/enums/exception/ParameterException.java b/api/src/main/java/writeon/api/common/enums/exception/ParameterException.java new file mode 100644 index 0000000..63cde84 --- /dev/null +++ b/api/src/main/java/writeon/api/common/enums/exception/ParameterException.java @@ -0,0 +1,18 @@ +package writeon.api.common.enums.exception; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum ParameterException implements CodeInfo { + + PARAMETER_NOT_EXIST(HttpStatus.BAD_REQUEST, "PARAM-001", "파라미터가 존재하지 않습니다."), + PARAMETER_INVALID(HttpStatus.BAD_REQUEST, "PARAM-002", "유효하지 않은 파라미터입니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/api/src/main/java/writeon/api/common/exception/BaseException.java b/api/src/main/java/writeon/api/common/exception/BaseException.java new file mode 100644 index 0000000..909a28a --- /dev/null +++ b/api/src/main/java/writeon/api/common/exception/BaseException.java @@ -0,0 +1,35 @@ +package writeon.api.common.exception; + +import lombok.Getter; +import writeon.domain.common.enums.CodeInfo; + +@Getter +public class BaseException extends RuntimeException { + + private CodeInfo codeInfo; + private Object extraParams; + private String customMessage; + + public BaseException() { + } + + public BaseException(CodeInfo codeInfo) { + this.codeInfo = codeInfo; + } + + public BaseException(CodeInfo codeInfo, Object extraParams) { + this.codeInfo = codeInfo; + this.extraParams = extraParams; + } + + public BaseException(CodeInfo codeInfo, Object extraParams, String customMessage) { + this.codeInfo = codeInfo; + this.extraParams = extraParams; + this.customMessage = customMessage; + } + + @Override + public String toString() { + return "BaseException [status=" + codeInfo.getStatus().value() + ", code=" + codeInfo.getCode() + ", message=" + codeInfo.getMessage() + "]"; + } +} diff --git a/api/src/main/java/writeon/api/common/exception/handler/CustomAuthenticationEntryPoint.java b/api/src/main/java/writeon/api/common/exception/handler/CustomAuthenticationEntryPoint.java new file mode 100644 index 0000000..25122a7 --- /dev/null +++ b/api/src/main/java/writeon/api/common/exception/handler/CustomAuthenticationEntryPoint.java @@ -0,0 +1,38 @@ +package writeon.api.common.exception.handler; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; +import writeon.api.common.response.BaseResponse; +import writeon.api.common.util.LogUtil; +import writeon.domain.auth.enums.AuthException; + +import java.io.IOException; + +@RequiredArgsConstructor +@Component +public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint { + private final ObjectMapper objectMapper; + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { + response.setContentType("application/json"); + response.setCharacterEncoding("UTF-8"); + response.setStatus(AuthException.ACCESS_TOKEN_NOT_VALID.getStatus().value()); + + try { + String jsonResponse = objectMapper.writeValueAsString( + BaseResponse.failure(AuthException.ACCESS_TOKEN_NOT_VALID) + ); + response.getWriter().write(jsonResponse); + response.getWriter().flush(); + } catch (Exception exception) { + LogUtil.error(exception); + } + } +} diff --git a/api/src/main/java/writeon/api/common/exception/handler/GlobalExceptionHandler.java b/api/src/main/java/writeon/api/common/exception/handler/GlobalExceptionHandler.java new file mode 100644 index 0000000..2cb280c --- /dev/null +++ b/api/src/main/java/writeon/api/common/exception/handler/GlobalExceptionHandler.java @@ -0,0 +1,58 @@ +package writeon.api.common.exception.handler; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import writeon.api.common.enums.code.ResultCodeInfo; +import writeon.api.common.exception.BaseException; +import writeon.api.common.response.BaseResponse; +import writeon.api.common.util.LogUtil; +import writeon.domain.common.enums.CodeInfo; + +import java.util.stream.Collectors; + +@RestControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler({Exception.class}) + public ResponseEntity> handle(Exception e) { + LogUtil.error(e); + + HttpStatus status = null; + BaseResponse response = null; + + switch (e) { + case BaseException ex -> { + status = ex.getCodeInfo().getStatus(); + response = BaseResponse.failure(ex.getCodeInfo(), ex.getExtraParams()); + if (ex.getCustomMessage() != null) { + response.setMessage(ex.getCustomMessage()); + } + } + + case MethodArgumentNotValidException ex -> { + CodeInfo codeInfo = ResultCodeInfo.BAD_REQUEST; + status = codeInfo.getStatus(); + response = BaseResponse.failure(codeInfo); + String responseMessage = codeInfo.getMessage() + + " " + + ex.getBindingResult() + .getFieldErrors() + .stream() + .map(error -> error.getField() + " 이(가)" + error.getDefaultMessage()) + .collect(Collectors.joining(" ")); + response.setMessage(responseMessage); + } + + default -> { + status = ResultCodeInfo.FAILURE.getStatus(); + response = BaseResponse.failure(ResultCodeInfo.FAILURE); + } + } + + return new ResponseEntity<>(response, status); + } + +} diff --git a/api/src/main/java/writeon/api/common/filter/CustomAuthenticationFilter.java b/api/src/main/java/writeon/api/common/filter/CustomAuthenticationFilter.java new file mode 100644 index 0000000..e6fb7ad --- /dev/null +++ b/api/src/main/java/writeon/api/common/filter/CustomAuthenticationFilter.java @@ -0,0 +1,60 @@ +package writeon.api.common.filter; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; +import writeon.api.auth.helper.JwtHelper; +import writeon.api.common.exception.BaseException; +import writeon.domain.auth.JwtPayload; +import writeon.domain.auth.enums.AuthException; +import writeon.domain.common.MemberSession; + +import java.io.IOException; + +@RequiredArgsConstructor +@Component +public class CustomAuthenticationFilter extends OncePerRequestFilter { + private final JwtHelper jwtHelper; + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + String authorization = request.getHeader("Authorization"); + String path = request.getRequestURI(); + + if (authorization == null) { + if (path.matches("/assistant/.*/stream")) { + throw new BaseException(AuthException.ACCESS_TOKEN_NOT_VALID); + } + + filterChain.doFilter(request, response); + return; + } + + String[] parts = authorization.split(" "); + if (parts.length != 2) { + filterChain.doFilter(request, response); + return; + } + + String accessToken = parts[1]; + if (!jwtHelper.isTokenValid(accessToken)) { + filterChain.doFilter(request, response); + return; + } + + JwtPayload payload = jwtHelper.getPayload(accessToken); + MemberSession memberSession = new MemberSession(payload.getMemberId()); + Authentication authentication = new UsernamePasswordAuthenticationToken(memberSession, accessToken, memberSession.getAuthorities()); + SecurityContextHolder.getContext().setAuthentication(authentication); + + filterChain.doFilter(request, response); + } + +} diff --git a/api/src/main/java/writeon/api/common/filter/MDCFilter.java b/api/src/main/java/writeon/api/common/filter/MDCFilter.java new file mode 100644 index 0000000..8c522e8 --- /dev/null +++ b/api/src/main/java/writeon/api/common/filter/MDCFilter.java @@ -0,0 +1,30 @@ +package writeon.api.common.filter; + +import writeon.api.common.util.HttpRequestUtil; +import writeon.api.common.util.MDCUtil; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import java.io.IOException; +import java.util.Objects; + +@Profile("!local") +@Component +public class MDCFilter extends OncePerRequestFilter { + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { + MDCUtil.set(MDCUtil.REQUEST_METHOD_MDC, HttpRequestUtil.getRequestMethod(request)); + MDCUtil.set(MDCUtil.REQUEST_URI_MDC, HttpRequestUtil.getRequestUri(request)); + MDCUtil.set(MDCUtil.REQUEST_IP_MDC, HttpRequestUtil.getUserIP(Objects.requireNonNull(request))); + MDCUtil.setJsonValue(MDCUtil.HEADER_MAP_MDC, HttpRequestUtil.getHeaderMap(request)); + MDCUtil.setJsonValue(MDCUtil.PARAMETER_MAP_MDC, HttpRequestUtil.getParamMap(request)); + + chain.doFilter(request, response); + } +} diff --git a/api/src/main/java/writeon/api/common/response/BaseResponse.java b/api/src/main/java/writeon/api/common/response/BaseResponse.java new file mode 100644 index 0000000..86439f7 --- /dev/null +++ b/api/src/main/java/writeon/api/common/response/BaseResponse.java @@ -0,0 +1,66 @@ +package writeon.api.common.response; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import writeon.api.common.enums.code.ResultCodeInfo; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@ToString +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BaseResponse { + + @Schema(title = "코드", description = "API 처리 결과 코드", requiredMode = Schema.RequiredMode.REQUIRED, example = "RESULT-001") + private String code; + + @Schema(title = "결과 데이터", description = "API 처리 결과 데이터", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private T result; + + @Setter + @Schema(title = "메시지", description = "API 처리 결과 메시지", requiredMode = Schema.RequiredMode.REQUIRED, example = "성공적으로 수행하였습니다.") + private String message; + + protected BaseResponse() {} + + public static BaseResponse success() { + BaseResponse res = new BaseResponse<>(); + res.code = ResultCodeInfo.SUCCESS.getCode(); + res.message = ResultCodeInfo.SUCCESS.getMessage(); + return res; + } + + public static BaseResponse success(T data) { + BaseResponse res = new BaseResponse<>(); + res.code = ResultCodeInfo.SUCCESS.getCode(); + res.result = data; + res.message = ResultCodeInfo.SUCCESS.getMessage(); + return res; + } + + public static BaseResponse failure(CodeInfo codeInfo) { + BaseResponse res = new BaseResponse<>(); + res.code = codeInfo.getCode(); + res.message = codeInfo.getMessage(); + return res; + } + + public static BaseResponse failure(CodeInfo codeInfo, T extraParams) { + BaseResponse res = new BaseResponse<>(); + res.code = codeInfo.getCode(); + res.message = codeInfo.getMessage(); + res.result = extraParams; + return res; + } + + public static BaseResponse failure(CodeInfo codeInfo, T extraParams, String customMessage) { + BaseResponse res = new BaseResponse<>(); + res.code = codeInfo.getCode(); + res.message = customMessage; + res.result = extraParams; + return res; + } + +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/response/CursorResponse.java b/api/src/main/java/writeon/api/common/response/CursorResponse.java new file mode 100644 index 0000000..0e9ef10 --- /dev/null +++ b/api/src/main/java/writeon/api/common/response/CursorResponse.java @@ -0,0 +1,21 @@ +package writeon.api.common.response; + +import java.util.List; + +import lombok.Getter; + +@Getter +public class CursorResponse { + + private final List contents; + private final long totalElements; + + private CursorResponse(List contents, long totalElements) { + this.contents = contents; + this.totalElements = totalElements; + } + + public static CursorResponse of(List contents, long totalElements) { + return new CursorResponse<>(contents, totalElements); + } +} diff --git a/api/src/main/java/writeon/api/common/response/GlobalResponseBodyHandler.java b/api/src/main/java/writeon/api/common/response/GlobalResponseBodyHandler.java new file mode 100644 index 0000000..86df071 --- /dev/null +++ b/api/src/main/java/writeon/api/common/response/GlobalResponseBodyHandler.java @@ -0,0 +1,38 @@ +package writeon.api.common.response; + +import org.springframework.core.MethodParameter; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.server.ServerHttpRequest; +import org.springframework.http.server.ServerHttpResponse; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; + +@RestControllerAdvice(basePackages = "writeon.api") +public class GlobalResponseBodyHandler implements ResponseBodyAdvice { + + @Override + public boolean supports( + MethodParameter returnType, + Class> converterType + ) { + return true; + } + + @Override + public Object beforeBodyWrite( + Object body, + MethodParameter returnType, + MediaType selectedContentType, + Class> selectedConverterType, + ServerHttpRequest request, + ServerHttpResponse response + ) { + if (body instanceof BaseResponse || body instanceof ResponseEntity) { + return body; + } + + return BaseResponse.success(body); + } +} diff --git a/api/src/main/java/writeon/api/common/util/CryptoUtil.java b/api/src/main/java/writeon/api/common/util/CryptoUtil.java new file mode 100644 index 0000000..5f2e8e2 --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/CryptoUtil.java @@ -0,0 +1,100 @@ +package writeon.api.common.util; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.security.MessageDigest; +import java.util.Base64; + +@Component +public class CryptoUtil { + /** + * Encrypt / Decrypt + */ + private static final String CRYPT_ALGO = "AES"; + private static final String CRYPT_MODE = "CBC"; + private static final String CRYPT_PADDING = "PKCS5Padding"; + + @Value("${crypto.secret}") + private String SECRET; + @Value("${crypto.iv}") + private String IV; + + public String encrypt(String plainText) { + SecretKeySpec secretKeySpec = new SecretKeySpec(SECRET.getBytes(), CRYPT_ALGO); + IvParameterSpec ivSpec = new IvParameterSpec(IV.getBytes()); + + try { + Cipher cipher = Cipher.getInstance(CRYPT_ALGO + "/" + CRYPT_MODE + "/" + CRYPT_PADDING); + cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivSpec); + + byte[] cipherText = cipher.doFinal(plainText.getBytes()); + + return encodeBase64(cipherText); + } catch (Exception ex) { + throw new RuntimeException(); + } + } + + public String decrypt(String cipherText) { + SecretKeySpec secretKeySpec = new SecretKeySpec(SECRET.getBytes(), CRYPT_ALGO); + IvParameterSpec ivSpec = new IvParameterSpec(IV.getBytes()); + + try { + Cipher cipher = Cipher.getInstance(CRYPT_ALGO + "/" + CRYPT_MODE + "/" + CRYPT_PADDING); + cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivSpec); + + byte[] decoded = decodeBase64(cipherText); + byte[] plainText = cipher.doFinal(decoded); + + return new String(plainText); + } catch (Exception ex) { + throw new RuntimeException(); + } + } + + /** + * Hashing + */ + private static final String HASH_ALGO = "SHA-256"; + private static final Integer HASH_ROUND = 3; + + public String hash(String plainText) { + return hash(plainText + SECRET, HASH_ROUND); + } + + private String hash(String hashText, Integer rounds) { + if (rounds == 0) return hashText; + + try { + MessageDigest md = MessageDigest.getInstance(HASH_ALGO); + md.update((hashText).getBytes()); + + return hash(bytesToHex(md.digest()), --rounds); + } catch (Exception ex) { + throw new RuntimeException(); + } + } + + private String bytesToHex(byte[] bytes) { + StringBuilder builder = new StringBuilder(); + for (byte b : bytes) { + builder.append(String.format("%02x", b)); + } + return builder.toString(); + } + + /** + * encode / decode + */ + public String encodeBase64(byte[] bytes) { + return Base64.getEncoder().encodeToString(bytes); + } + + public byte[] decodeBase64(String encodedStr) { + return Base64.getDecoder().decode(encodedStr.getBytes()); + } +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/util/DateTimeUtil.java b/api/src/main/java/writeon/api/common/util/DateTimeUtil.java new file mode 100644 index 0000000..a413f93 --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/DateTimeUtil.java @@ -0,0 +1,93 @@ +package writeon.api.common.util; + +import writeon.api.common.enums.exception.ParameterException; +import writeon.api.common.exception.BaseException; +import lombok.experimental.UtilityClass; +import org.apache.commons.lang3.StringUtils; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Locale; +import java.util.TimeZone; + +@UtilityClass +public class DateTimeUtil { + + public final String DATE_DEFAULT_PATTERN = "yyyy-MM-dd"; + public final String DATE_NORMAL_PATTERN = "yyyyMMdd"; + public final String DATE_DOT_PATTERN = "yyyy.MM.dd"; + + public final String DATETIME_DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss"; + public final String DATETIME_HOUR_ONLY_KR_PATTERN = "yyyy년 MM월 dd일 HH시"; + + public final TimeZone KOREA_TIME_ZONE = TimeZone.getTimeZone(ZoneId.of("Asia/Seoul")); + + public LocalDateTime convertToDateTime(String dateString, String pattern) { + verifyValidPattern(dateString, pattern); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); + return LocalDateTime.parse(dateString, formatter); + } + + public LocalDateTime convertToDateTime(String dateString) { + return convertToDateTime(dateString, DATETIME_DEFAULT_PATTERN); + } + + public LocalDate convertToDate(String dateString, String pattern) { + verifyValidPattern(dateString, DATE_DEFAULT_PATTERN); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); + return LocalDate.parse(dateString, formatter); + } + + public LocalDate convertToDate(String dateString) { + return convertToDate(dateString, DATE_DEFAULT_PATTERN); + } + + public String convertToString(LocalDateTime dateTime, String pattern) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern, Locale.KOREA); + return dateTime.format(formatter); + } + + public String convertToString(LocalDateTime dateTime) { + return convertToString(dateTime, DATETIME_DEFAULT_PATTERN); + } + + public String convertToString(LocalDate date, String pattern) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern, Locale.KOREA); + return date.format(formatter); + } + + public String convertToString(LocalDate date) { + return convertToString(date, DATE_DEFAULT_PATTERN); + } + + public LocalDate getDate() { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_DEFAULT_PATTERN); + return LocalDate.parse(LocalDate.now().format(formatter), formatter); + } + + public LocalDateTime getDateTime() { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATETIME_DEFAULT_PATTERN); + return LocalDateTime.parse(LocalDateTime.now().format(formatter), formatter); + } + + private void verifyValidPattern(String dateString, String pattern) { + if (StringUtils.isBlank(dateString)) { + throw new BaseException(ParameterException.PARAMETER_INVALID); + } + + final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); + try { + if (StringUtils.containsAny(pattern, "H", "m", "s")) { + LocalDateTime.parse(dateString, formatter); + } else { + LocalDate.parse(dateString, formatter); + } + } catch (Exception e) { + throw new BaseException(ParameterException.PARAMETER_INVALID); + } + } +} diff --git a/api/src/main/java/writeon/api/common/util/FileUtil.java b/api/src/main/java/writeon/api/common/util/FileUtil.java new file mode 100644 index 0000000..d78047e --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/FileUtil.java @@ -0,0 +1,21 @@ +package writeon.api.common.util; + +import lombok.experimental.UtilityClass; + +@UtilityClass +public class FileUtil { + public String getFileExtension(String fileName) { + if (fileName == null || fileName.trim().isEmpty()) { + return ""; + } + + int lastDotIndex = fileName.lastIndexOf('.'); + + // 확장자가 없는 경우 + if (lastDotIndex == -1 || lastDotIndex == 0 || lastDotIndex == fileName.length() - 1) { + return ""; + } + + return fileName.substring(lastDotIndex + 1); + } +} diff --git a/api/src/main/java/writeon/api/common/util/HttpRequestUtil.java b/api/src/main/java/writeon/api/common/util/HttpRequestUtil.java new file mode 100644 index 0000000..40eea7a --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/HttpRequestUtil.java @@ -0,0 +1,61 @@ +package writeon.api.common.util; + +import jakarta.servlet.http.HttpServletRequest; +import lombok.experimental.UtilityClass; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +@UtilityClass +public class HttpRequestUtil { + + public String getRequestUri(HttpServletRequest request) { + return request.getRequestURI(); + } + + public String getRequestMethod(HttpServletRequest request) { + return request.getMethod(); + } + + public static Map getParamMap(HttpServletRequest request) { + Map paramMap = new HashMap<>(); + request.getParameterNames().asIterator() + .forEachRemaining(name -> paramMap.put(name, request.getParameter(name))); + return paramMap; + } + + public static Map getHeaderMap(HttpServletRequest request) { + Map headerMap = new HashMap<>(); + request.getHeaderNames().asIterator() + .forEachRemaining(name -> { + if (!name.equals("user-agent")) { + headerMap.put(name, request.getHeader(name)); + } + }); + return headerMap; + } + + public static String getUserIP(HttpServletRequest httpReq) { + String clientIp = httpReq.getHeader("X-Forwarded-For"); + if (!StringUtils.hasText(clientIp) || "unknown".equalsIgnoreCase(clientIp)) { + // Proxy 서버인 경우 + clientIp = httpReq.getHeader("Proxy-Client-IP"); + } + if (!StringUtils.hasText(clientIp) || "unknown".equalsIgnoreCase(clientIp)) { + // WebLogic 서버인 경우 + clientIp = httpReq.getHeader("WL-Proxy-Client-IP"); + } + if (!StringUtils.hasText(clientIp) || "unknown".equalsIgnoreCase(clientIp)) { + clientIp = httpReq.getHeader("HTTP_CLIENT_IP"); + } + if (!StringUtils.hasText(clientIp) || "unknown".equalsIgnoreCase(clientIp)) { + clientIp = httpReq.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (!StringUtils.hasText(clientIp) || "unknown".equalsIgnoreCase(clientIp)) { + clientIp = httpReq.getRemoteAddr(); + } + String[] clientIpList = clientIp.split(","); + return clientIpList[0]; + } +} diff --git a/api/src/main/java/writeon/api/common/util/LogUtil.java b/api/src/main/java/writeon/api/common/util/LogUtil.java new file mode 100644 index 0000000..6dea2ae --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/LogUtil.java @@ -0,0 +1,62 @@ +package writeon.api.common.util; + +import lombok.experimental.UtilityClass; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.PrintWriter; +import java.io.StringWriter; + +@Slf4j +@UtilityClass +public class LogUtil { + + private static final Logger LOG = LoggerFactory.getLogger(LogUtil.class); + + public void debug(String msg) { + LOG.info(msg); + } + public void debug(Throwable throwable) { + LOG.info(getStackTrace(throwable)); + } + + public void trace(String msg) { + LOG.trace(msg); + } + public void trace(Throwable throwable) { + LOG.trace(getStackTrace(throwable)); + } + + public void info(String msg) { + LOG.info(msg); + } + public void info(Throwable throwable) { + LOG.info(getStackTrace(throwable)); + } + + public void warn(String msg) { + LOG.warn(msg); + } + public void warn(Throwable throwable) { + LOG.warn(getStackTrace(throwable)); + } + + public void error(String msg) { + LOG.error(msg); + } + public void error(Throwable throwable) { + LOG.error(getStackTrace(throwable)); + } + + private String getStackTrace(Throwable throwable) { + if (throwable == null) { + return "No exception provided."; + } + StringWriter stringWriter = new StringWriter(); + PrintWriter printWriter = new PrintWriter(stringWriter); + throwable.printStackTrace(printWriter); + return stringWriter.toString(); + } + +} diff --git a/api/src/main/java/writeon/api/common/util/MDCUtil.java b/api/src/main/java/writeon/api/common/util/MDCUtil.java new file mode 100644 index 0000000..40f014f --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/MDCUtil.java @@ -0,0 +1,44 @@ +package writeon.api.common.util; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.experimental.UtilityClass; +import org.slf4j.MDC; +import org.slf4j.spi.MDCAdapter; + +@UtilityClass +public class MDCUtil { + + public static final String REQUEST_METHOD_MDC = "[요청 Method]"; + public static final String REQUEST_URI_MDC = "[요청 URI]"; + public static final String REQUEST_IP_MDC = "[요청 IP]"; + public static final String HEADER_MAP_MDC = "[Http Header 정보]"; + public static final String PARAMETER_MAP_MDC = "[Parameter 정보]"; + public static final String BODY_MDC = "[Http Body 정보]"; + + private static final ObjectMapper objectMapper = new ObjectMapper(); + private static final MDCAdapter mdc = MDC.getMDCAdapter(); + + public String get(String key) { + return mdc.get(key); + } + + public void set(String key, String value) { + mdc.put(key, value); + } + + public static void setJsonValue(String key, Object value) { + try { + if (value != null) { + String json = objectMapper.writerWithDefaultPrettyPrinter() + .writeValueAsString(value); + mdc.put(key, json); + + } else { + mdc.put(key, "내용 없음"); + } + + } catch (Exception e) { +// + } + } +} diff --git a/api/src/main/java/writeon/api/common/util/MemberUtil.java b/api/src/main/java/writeon/api/common/util/MemberUtil.java new file mode 100644 index 0000000..06541e6 --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/MemberUtil.java @@ -0,0 +1,25 @@ +package writeon.api.common.util; + +import lombok.experimental.UtilityClass; +import org.springframework.security.core.context.SecurityContextHolder; +import writeon.domain.common.MemberSession; + +import java.util.UUID; + +@UtilityClass +public class MemberUtil { + + public MemberSession getMember() { + if (SecurityContextHolder.getContext().getAuthentication().getPrincipal() instanceof MemberSession member) { + return member; + } + return null; + } + + public UUID getMemberId() { + if (SecurityContextHolder.getContext().getAuthentication().getPrincipal() instanceof MemberSession member) { + return member.getMemberId(); + } + return null; + } +} diff --git a/api/src/main/java/writeon/api/common/util/StringUtil.java b/api/src/main/java/writeon/api/common/util/StringUtil.java new file mode 100644 index 0000000..0dbcb45 --- /dev/null +++ b/api/src/main/java/writeon/api/common/util/StringUtil.java @@ -0,0 +1,84 @@ +package writeon.api.common.util; + +import lombok.experimental.UtilityClass; + +@UtilityClass +public class StringUtil { + + public String translateEscapes(String str) { + if (str.isEmpty()) { + return ""; + } + char[] chars = str.toCharArray(); + int length = chars.length; + int from = 0; + int to = 0; + while (from < length) { + char ch = chars[from++]; + if (ch == '\\') { + ch = from < length ? chars[from++] : '\0'; + switch (ch) { + case 'b': + ch = '\b'; + break; + case 'f': + ch = '\f'; + break; + case 'n': + ch = '\n'; + break; + case 'r': + ch = '\r'; + break; + case 's': + ch = ' '; + break; + case 't': + ch = '\t'; + break; + case '\'': + case '\"': + case '\\': + // as is + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + int limit = Integer.min(from + (ch <= '3' ? 2 : 1), length); + int code = ch - '0'; + while (from < limit) { + ch = chars[from]; + if (ch < '0' || '7' < ch) { + break; + } + from++; + code = (code << 3) | (ch - '0'); + } + ch = (char)code; + break; + case '\n': + continue; + case '\r': + if (from < length && chars[from] == '\n') { + from++; + } + continue; + default: { + String msg = String.format( + "Invalid escape sequence: \\%c \\\\u%04X", + ch, (int)ch); + throw new IllegalArgumentException(msg); + } + } + } + + chars[to++] = ch; + } + return new String(chars, 0, to); + } +} diff --git a/api/src/main/java/writeon/api/common/validation/IsEmail.java b/api/src/main/java/writeon/api/common/validation/IsEmail.java new file mode 100644 index 0000000..bd582fa --- /dev/null +++ b/api/src/main/java/writeon/api/common/validation/IsEmail.java @@ -0,0 +1,20 @@ +package writeon.api.common.validation; + +import jakarta.validation.Constraint; +import jakarta.validation.constraints.Size; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) +@Retention(RUNTIME) +@Constraint(validatedBy = IsEmailValidator.class) +@Size(max = 255) +public @interface IsEmail { + String message() default "이메일 형식이어야 합니다."; + Class[] groups() default {}; + Class[] payload() default {}; +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/validation/IsEmailValidator.java b/api/src/main/java/writeon/api/common/validation/IsEmailValidator.java new file mode 100644 index 0000000..ac0555a --- /dev/null +++ b/api/src/main/java/writeon/api/common/validation/IsEmailValidator.java @@ -0,0 +1,15 @@ +package writeon.api.common.validation; + +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; + + +public class IsEmailValidator implements ConstraintValidator { + @Override + public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { + if (s == null) + return true; + + return s.matches("^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"); + } +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/validation/IsNickname.java b/api/src/main/java/writeon/api/common/validation/IsNickname.java new file mode 100644 index 0000000..f9dc2d5 --- /dev/null +++ b/api/src/main/java/writeon/api/common/validation/IsNickname.java @@ -0,0 +1,20 @@ +package writeon.api.common.validation; + +import jakarta.validation.Constraint; +import jakarta.validation.constraints.Size; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) +@Retention(RUNTIME) +@Constraint(validatedBy = IsNicknameValidator.class) +@Size(min = 2, max = 20) +public @interface IsNickname { + String message() default "한글, 영문(대소문자), 숫자, 일부 특수문자(_ , .)로 이루어진 2자 이상 20자 이하의 문자여야 합니다."; + Class[] groups() default {}; + Class[] payload() default {}; +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/validation/IsNicknameValidator.java b/api/src/main/java/writeon/api/common/validation/IsNicknameValidator.java new file mode 100644 index 0000000..a55106e --- /dev/null +++ b/api/src/main/java/writeon/api/common/validation/IsNicknameValidator.java @@ -0,0 +1,40 @@ +package writeon.api.common.validation; + +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; + +public class IsNicknameValidator implements ConstraintValidator { + + final String digit = "0-9"; + final String english = "a-zA-Z"; + final String korean = "가-힣"; + final String specialCharacters = "_,."; + + @Override + public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { + if (s == null) + return true; + + final String otherCharacterMatcher = String.format(".*[^%s%s%s%s].*", digit, english, korean, specialCharacters); + if (s.matches(otherCharacterMatcher)) + return false; + + final String digitOnlyMatcher = String.format("[%s]*", digit); + if (s.matches(digitOnlyMatcher)) + return false; + + final String startsWithSpecialCharacterMatcher = String.format("^[%s].*", specialCharacters); + if (s.matches(startsWithSpecialCharacterMatcher)) + return false; + + final String endsWithSpecialCharacterMatcher = String.format("[%s].*$", specialCharacters); + if (s.matches(endsWithSpecialCharacterMatcher)) + return false; + + final String sequentialSpecialCharacterMatcher = String.format(".*[%s]{2,}.*", specialCharacters); + if (s.matches(sequentialSpecialCharacterMatcher)) + return false; + + return true; + } +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/validation/IsPassword.java b/api/src/main/java/writeon/api/common/validation/IsPassword.java new file mode 100644 index 0000000..1f986f2 --- /dev/null +++ b/api/src/main/java/writeon/api/common/validation/IsPassword.java @@ -0,0 +1,20 @@ +package writeon.api.common.validation; + +import jakarta.validation.Constraint; +import jakarta.validation.constraints.Size; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) +@Retention(RUNTIME) +@Constraint(validatedBy = IsPasswordValidator.class) +@Size(min = 8, max = 255) +public @interface IsPassword { + String message() default "최소 8자 이상이며, 대문자, 소문자, 숫자, 특수문자(@$!%*?&) 중 3가지를 포함해야 합니다."; + Class[] groups() default {}; + Class[] payload() default {}; +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/common/validation/IsPasswordValidator.java b/api/src/main/java/writeon/api/common/validation/IsPasswordValidator.java new file mode 100644 index 0000000..c41bdb5 --- /dev/null +++ b/api/src/main/java/writeon/api/common/validation/IsPasswordValidator.java @@ -0,0 +1,18 @@ +package writeon.api.common.validation; + +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; + +public class IsPasswordValidator implements ConstraintValidator { + + final String regexp + = "(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*\\d))(?=(.*[\\W_])).{8,}$|^(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*\\d)).{8,}$|^(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*[\\W_])).{8,}$|^(?=(.*[A-Z]))(?=(.*\\d))(?=(.*[\\W_])).{8,}$|^(?=(.*[a-z]))(?=(.*\\d))(?=(.*[\\W_])).{8,}"; + + @Override + public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { + if (s == null) + return true; + + return s.matches(regexp); + } +} \ No newline at end of file diff --git a/api/src/main/java/writeon/api/file/controller/FileController.java b/api/src/main/java/writeon/api/file/controller/FileController.java new file mode 100644 index 0000000..f2fe49f --- /dev/null +++ b/api/src/main/java/writeon/api/file/controller/FileController.java @@ -0,0 +1,27 @@ +package writeon.api.file.controller; + +import writeon.api.file.request.PresignedUrlIssueRequest; +import writeon.api.file.response.PresignedUrlIssueResponse; +import writeon.api.file.service.FileService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/files") +@Tag(name = "파일") +public class FileController { + private final FileService fileService; + + @Operation(summary = "presigned url 발급") + @PostMapping("/presigned-url") + public PresignedUrlIssueResponse issuePresignedUrl(@RequestBody PresignedUrlIssueRequest params) { + return fileService.issuePresignedUrl(params); + } + +} diff --git a/api/src/main/java/writeon/api/file/request/PresignedUrlIssueRequest.java b/api/src/main/java/writeon/api/file/request/PresignedUrlIssueRequest.java new file mode 100644 index 0000000..de85f69 --- /dev/null +++ b/api/src/main/java/writeon/api/file/request/PresignedUrlIssueRequest.java @@ -0,0 +1,24 @@ +package writeon.api.file.request; + +import writeon.domain.file.enums.FileUploadType; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +public class PresignedUrlIssueRequest { + @Schema(title = "업로드 타입", requiredMode = Schema.RequiredMode.REQUIRED, example = "idea-note") + private FileUploadType fileUploadType; + + @Schema(title = "원본 파일 이름", requiredMode = Schema.RequiredMode.REQUIRED, example = "download.png") + private String originalFileName; + + @Schema(title = "Content-Type", requiredMode = Schema.RequiredMode.REQUIRED, example = "image/png") + private String contentType; + + @Schema(title = "Content-Length", description = "Byte", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457280") + private Long contentLength; +} diff --git a/api/src/main/java/writeon/api/file/response/PresignedUrlIssueResponse.java b/api/src/main/java/writeon/api/file/response/PresignedUrlIssueResponse.java new file mode 100644 index 0000000..cf6e739 --- /dev/null +++ b/api/src/main/java/writeon/api/file/response/PresignedUrlIssueResponse.java @@ -0,0 +1,17 @@ +package writeon.api.file.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@AllArgsConstructor +public class PresignedUrlIssueResponse { + @Schema(title = "파일 업로드 url (presigned)", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://writely-bucket.s3.ap-northeast-2.amazonaws.com/idea-note/...") + private String filePutUrl; + + @Schema(title = "파일 조회 url", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://writely-bucket.s3.ap-northeast-2.amazonaws.com/idea-note/...") + private String fileGetUrl; +} diff --git a/api/src/main/java/writeon/api/file/service/FileService.java b/api/src/main/java/writeon/api/file/service/FileService.java new file mode 100644 index 0000000..d0e3d89 --- /dev/null +++ b/api/src/main/java/writeon/api/file/service/FileService.java @@ -0,0 +1,73 @@ +package writeon.api.file.service; + +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.FileUtil; +import writeon.api.file.request.PresignedUrlIssueRequest; +import writeon.api.file.response.PresignedUrlIssueResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import software.amazon.awssdk.services.s3.model.PutObjectRequest; +import software.amazon.awssdk.services.s3.presigner.S3Presigner; +import software.amazon.awssdk.services.s3.presigner.model.PresignedPutObjectRequest; +import software.amazon.awssdk.services.s3.presigner.model.PutObjectPresignRequest; +import writeon.domain.file.enums.FileException; +import writeon.domain.file.enums.FileUploadType; + +import java.time.Duration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +@Slf4j +public class FileService { + private final S3Presigner s3Presigner; + + @Value("${cloud.aws.s3.bucket}") + private String bucketName; + + @Value("${cloud.aws.s3.host}") + private String hostUrl; + + @Value("${cloud.aws.s3.presigned-url.expiration-seconds}") + private Long expirationSeconds; + + public PresignedUrlIssueResponse issuePresignedUrl(PresignedUrlIssueRequest params) { + final FileUploadType uploadType = params.getFileUploadType(); + + final String fileOriginalName = params.getOriginalFileName(); + final String fileExtension = FileUtil.getFileExtension(fileOriginalName); + final String fileGetPath = uploadType.getPath() + "/" + UUID.randomUUID() + "." + fileExtension; + final String fileGetUrl = hostUrl + "/" + fileGetPath; + + // 컨텐츠타입 허용 여부 검사 + if (!uploadType.getAllowedContentType().contains(params.getContentType())) { + throw new BaseException(FileException.UNSUPPORTED_CONTENT_TYPE); + } + // 파일 사이즈 검사 + if (uploadType.getMaxFileSize() < params.getContentLength()) { + throw new BaseException(FileException.MAX_FILE_SIZE_EXCEEDED); + } + + PutObjectRequest objectRequest = PutObjectRequest.builder() + .bucket(bucketName) + .key(fileGetPath) + .contentType(params.getContentType()) + .contentLength(params.getContentLength()) + .build(); + + PutObjectPresignRequest presignRequest = PutObjectPresignRequest.builder() + .signatureDuration(Duration.ofSeconds(expirationSeconds)) + .putObjectRequest(objectRequest) + .build(); + + PresignedPutObjectRequest presignedRequest = s3Presigner.presignPutObject(presignRequest); + + return new PresignedUrlIssueResponse(presignedRequest.url().toExternalForm(), fileGetUrl); + } + +} diff --git a/api/src/main/java/writeon/api/member/controller/MemberController.java b/api/src/main/java/writeon/api/member/controller/MemberController.java new file mode 100644 index 0000000..7aed325 --- /dev/null +++ b/api/src/main/java/writeon/api/member/controller/MemberController.java @@ -0,0 +1,25 @@ +package writeon.api.member.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import writeon.api.member.response.MyProfileResponse; +import writeon.api.member.service.MemberQueryService; +import writeon.domain.common.MemberSession; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/members") +@Tag(name = "회원") +public class MemberController { + private final MemberQueryService memberQueryService; + + @GetMapping("/me/profile") + public MyProfileResponse getMyProfile() { + return memberQueryService.getMyProfile(); + } + +} diff --git a/api/src/main/java/writeon/api/member/response/MyProfileResponse.java b/api/src/main/java/writeon/api/member/response/MyProfileResponse.java new file mode 100644 index 0000000..bc8d495 --- /dev/null +++ b/api/src/main/java/writeon/api/member/response/MyProfileResponse.java @@ -0,0 +1,26 @@ +package writeon.api.member.response; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.member.Member; + +@Getter +@Setter +public class MyProfileResponse { + @Schema(title = "이메일", requiredMode = Schema.RequiredMode.REQUIRED) + private final String email; + + @Schema(title = "닉네임", requiredMode = Schema.RequiredMode.REQUIRED) + private final String nickname; + + @Schema(title = "프로필 이미지 경로", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private final String profileImage; + + public MyProfileResponse(Member member) { + this.email = member.getEmail(); + this.nickname = member.getNickname(); + this.profileImage = member.getProfileImage(); + } +} diff --git a/api/src/main/java/writeon/api/member/service/MemberCommandService.java b/api/src/main/java/writeon/api/member/service/MemberCommandService.java new file mode 100644 index 0000000..85c5e77 --- /dev/null +++ b/api/src/main/java/writeon/api/member/service/MemberCommandService.java @@ -0,0 +1,4 @@ +package writeon.api.member.service; + +public class MemberCommandService { +} diff --git a/api/src/main/java/writeon/api/member/service/MemberQueryService.java b/api/src/main/java/writeon/api/member/service/MemberQueryService.java new file mode 100644 index 0000000..a36135e --- /dev/null +++ b/api/src/main/java/writeon/api/member/service/MemberQueryService.java @@ -0,0 +1,28 @@ +package writeon.api.member.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import writeon.api.auth.helper.MemberHelper; +import writeon.api.common.exception.BaseException; +import writeon.api.member.response.MyProfileResponse; +import writeon.domain.common.MemberSession; +import writeon.domain.member.Member; +import writeon.domain.member.enums.MemberException; +import writeon.domain.member.repository.MemberJpaRepository; + +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class MemberQueryService { + private final MemberJpaRepository memberJpaRepository; + + public MyProfileResponse getMyProfile() { + MemberSession memberSession = MemberHelper.getMemberSession(); + + Member member = memberJpaRepository.findById(memberSession.getMemberId()) + .orElseThrow(() -> new BaseException(MemberException.NOT_EXIST)); + + return new MyProfileResponse(member); + } +} diff --git a/api/src/main/java/writeon/api/product/controller/ProductController.java b/api/src/main/java/writeon/api/product/controller/ProductController.java new file mode 100644 index 0000000..8ddfc49 --- /dev/null +++ b/api/src/main/java/writeon/api/product/controller/ProductController.java @@ -0,0 +1,161 @@ +package writeon.api.product.controller; + +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import writeon.api.product.request.ProductMemoCompletedRequest; +import writeon.api.product.request.ProductMemoSaveRequest; +import writeon.api.product.request.ProductSaveRequest; +import writeon.api.product.request.ProductTemplateSaveRequest; +import writeon.api.product.response.ProductDetailResponse; +import writeon.api.product.response.ProductFavoritePromptResponse; +import writeon.api.product.response.ProductFixedMessageResponse; +import writeon.api.product.response.ProductMemoResponse; +import writeon.api.product.response.ProductResponse; +import writeon.api.product.response.ProductTemplateResponse; +import writeon.api.product.service.ProductCommandService; +import writeon.api.product.service.ProductQueryService; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/products") +@Tag(name = "작품") +public class ProductController { + + private final ProductCommandService productCommandService; + private final ProductQueryService productQueryService; + + @Operation(summary = "작품 생성") + @PostMapping + public UUID create() { + return productCommandService.create(); + } + + @Operation(summary = "작품 저장") + @PostMapping("/{productId}") + public UUID modify( + @PathVariable UUID productId, + @RequestBody ProductSaveRequest request) { + return productCommandService.save(productId, request); + } + + @Operation(summary = "프롬프트 즐겨찾기 설정") + @PostMapping("/{productId}/favorite-prompts/{assistantId}") + public void createFavoritePrompt( + @PathVariable UUID productId, + @PathVariable UUID assistantId) { + productCommandService.createFavoritePrompt(productId, assistantId); + } + + @Operation(summary = "고정 메세지 설정") + @PostMapping("/{productId}/fixed-messages/{assistantId}") + public void createFixedMessage( + @PathVariable UUID productId, + @PathVariable UUID assistantId) { + productCommandService.createFixedMessage(productId, assistantId); + } + + @Operation(summary = "템플릿 저장") + @PostMapping("/{productId}/templates") + public void createTemplate( + @PathVariable UUID productId, + @RequestBody ProductTemplateSaveRequest request) { + productCommandService.saveTemplate(productId, request); + } + + @Operation(summary = "메모 생성") + @PostMapping("/{productId}/memos") + public UUID createMemo( + @PathVariable UUID productId, + @RequestBody ProductMemoSaveRequest request) { + return productCommandService.createMemo(productId, request); + } + + @Operation(summary = "작품 목록 조회") + @GetMapping + public List getList() { + return productQueryService.getList(); + } + + @Operation(summary = "작품 상세 조회") + @GetMapping("/{productId}") + public ProductDetailResponse getDetail(@PathVariable UUID productId) { + return productQueryService.getDetail(productId); + } + + @Operation(summary = "즐겨찾는 프롬프트 목록 조회") + @GetMapping("/{productId}/favorite-prompts") + public List getFavoritePrompts(@PathVariable UUID productId) { + return productQueryService.getFavoritePrompts(productId); + } + + @Operation(summary = "고정 메세지 조회") + @GetMapping("/{productId}/fixed-messages") + public ProductFixedMessageResponse getFixedMessage(@PathVariable UUID productId) { + return productQueryService.getFixedMessage(productId); + } + + @Operation(summary = "템플릿 조회") + @GetMapping("/{productId}/templates") + public ProductTemplateResponse getTemplate(@PathVariable UUID productId) { + return productQueryService.getTemplate(productId); + } + + @Operation(summary = "메모 목록 조회") + @GetMapping("/{productId}/memos") + public List getMemos(@PathVariable UUID productId) { + return productQueryService.getMemos(productId); + } + + @Operation(summary = "메모 수정") + @PutMapping("/{productId}/memos/{memoId}") + public void modifyMemo( + @PathVariable UUID productId, + @PathVariable UUID memoId, + @RequestBody ProductMemoSaveRequest request) { + productCommandService.modifyMemo(productId, memoId, request); + } + + @Operation(summary = "메모 완료 여부 수정") + @PutMapping("/{productId}/memos/{memoId}/completed") + public void modifyMemoCompleted( + @PathVariable UUID productId, + @PathVariable UUID memoId, + @RequestBody ProductMemoCompletedRequest request) { + productCommandService.modifyMemoCompleted(productId, memoId, request.getIsCompleted()); + } + + @Operation(summary = "메모 삭제") + @DeleteMapping("/{productId}/memos/{memoId}") + public void deleteMemo( + @PathVariable UUID productId, + @PathVariable UUID memoId) { + productCommandService.deleteMemo(productId, memoId); + } + + @Operation(summary = "프롬프트 즐겨찾기 해제") + @DeleteMapping("/{productId}/favorite-prompts/{messageId}") + public void deleteFavoritePrompt( + @PathVariable UUID productId, + @PathVariable UUID messageId) { + productCommandService.deleteFavoritePrompt(productId, messageId); + } + + @Operation(summary = "고정 메세지 해제") + @DeleteMapping("/{productId}/fixed-messages") + public void deleteFixedMessage(@PathVariable UUID productId) { + productCommandService.deleteFixedMessage(productId); + } +} diff --git a/api/src/main/java/writeon/api/product/repository/ProductDao.java b/api/src/main/java/writeon/api/product/repository/ProductDao.java new file mode 100644 index 0000000..bbbed68 --- /dev/null +++ b/api/src/main/java/writeon/api/product/repository/ProductDao.java @@ -0,0 +1,48 @@ +package writeon.api.product.repository; + +import lombok.RequiredArgsConstructor; +import org.jooq.DSLContext; +import org.springframework.stereotype.Repository; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.response.ProductFavoritePromptResponse; +import writeon.api.product.response.ProductResponse; + +import java.util.List; +import java.util.UUID; + +import static writeon.tables.AssistantMessage.ASSISTANT_MESSAGE; +import static writeon.tables.Product.PRODUCT; +import static writeon.tables.ProductSynopsis.PRODUCT_SYNOPSIS; +import static writeon.tables.ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT; + + +@Repository +@RequiredArgsConstructor +public class ProductDao { + + private final DSLContext dsl; + + public List select() { + return dsl + .select(PRODUCT, PRODUCT_SYNOPSIS.GENRE) + .from(PRODUCT) + .leftJoin(PRODUCT_SYNOPSIS) + .on(PRODUCT.ID.eq(PRODUCT_SYNOPSIS.ID)) + .where(PRODUCT.CREATED_BY.eq(MemberUtil.getMemberId())) + .orderBy(PRODUCT.UPDATED_AT.desc()) + .fetchInto(ProductResponse.class); + } + + public List selectFavoritePrompts(UUID productId) { + return dsl + .select(PRODUCT_FAVORITE_PROMPT.MESSAGE_ID, ASSISTANT_MESSAGE.PROMPT, PRODUCT_FAVORITE_PROMPT.CREATED_AT) + .from(PRODUCT) + .join(PRODUCT_FAVORITE_PROMPT) + .on(PRODUCT.ID.eq(PRODUCT_FAVORITE_PROMPT.PRODUCT_ID)) + .join(ASSISTANT_MESSAGE) + .on(PRODUCT_FAVORITE_PROMPT.MESSAGE_ID.eq(ASSISTANT_MESSAGE.ID)) + .where(PRODUCT.ID.eq(productId)) + .orderBy(PRODUCT_FAVORITE_PROMPT.CREATED_AT.desc()) + .fetchInto(ProductFavoritePromptResponse.class); + } +} diff --git a/api/src/main/java/writeon/api/product/request/ProductFavoritePromptCreateRequest.java b/api/src/main/java/writeon/api/product/request/ProductFavoritePromptCreateRequest.java new file mode 100644 index 0000000..04d44ff --- /dev/null +++ b/api/src/main/java/writeon/api/product/request/ProductFavoritePromptCreateRequest.java @@ -0,0 +1,15 @@ +package writeon.api.product.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +public class ProductFavoritePromptCreateRequest { + + @Schema(title = "어시스턴트 ID") + private UUID assistantId; +} diff --git a/api/src/main/java/writeon/api/product/request/ProductMemoCompletedRequest.java b/api/src/main/java/writeon/api/product/request/ProductMemoCompletedRequest.java new file mode 100644 index 0000000..6feb416 --- /dev/null +++ b/api/src/main/java/writeon/api/product/request/ProductMemoCompletedRequest.java @@ -0,0 +1,13 @@ +package writeon.api.product.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ProductMemoCompletedRequest { + + @Schema(title = "완료 여부") + private Boolean isCompleted; +} diff --git a/api/src/main/java/writeon/api/product/request/ProductMemoSaveRequest.java b/api/src/main/java/writeon/api/product/request/ProductMemoSaveRequest.java new file mode 100644 index 0000000..d573b92 --- /dev/null +++ b/api/src/main/java/writeon/api/product/request/ProductMemoSaveRequest.java @@ -0,0 +1,18 @@ +package writeon.api.product.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ProductMemoSaveRequest { + + @Schema(title = "제목", nullable = true) + private String title; + @Schema(title = "내용") + private String content; + private String selectedText; + private Integer startIndex; + private Integer endIndex; +} diff --git a/api/src/main/java/writeon/api/product/request/ProductSaveRequest.java b/api/src/main/java/writeon/api/product/request/ProductSaveRequest.java new file mode 100644 index 0000000..8ba2cbe --- /dev/null +++ b/api/src/main/java/writeon/api/product/request/ProductSaveRequest.java @@ -0,0 +1,17 @@ +package writeon.api.product.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ProductSaveRequest { + + @Schema(title = "제목") + private String title; + @Schema(title = "내용") + private String content; + @Schema(title = "자동저장 여부") + private Boolean isAutoSave; +} diff --git a/api/src/main/java/writeon/api/product/request/ProductTemplateSaveRequest.java b/api/src/main/java/writeon/api/product/request/ProductTemplateSaveRequest.java new file mode 100644 index 0000000..dfa75e5 --- /dev/null +++ b/api/src/main/java/writeon/api/product/request/ProductTemplateSaveRequest.java @@ -0,0 +1,191 @@ +package writeon.api.product.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.product.*; +import writeon.domain.product.enums.ProductSectionType; + +import java.util.List; +import java.util.UUID; + +@Getter +@Setter +public class ProductTemplateSaveRequest { + + private List characters; + private IdeaNote ideaNote; + private Plot plot; + private Synopsis synopsis; + private Worldview worldview; + + @Getter + @Setter + public static class Character { + + @Schema(nullable = true) + private UUID id; + @Schema(title = "소개", nullable = true, example = "미국 최고의 기업가") + private String intro; + @Schema(title = "이름", nullable = true, example = "CEO") + private String name; + @Schema(title = "나이", nullable = true, example = "40") + private Short age; + @Schema(title = "성별", nullable = true, example = "남성") + private String gender; + @Schema(title = "직업", nullable = true, example = "CEO") + private String occupation; + @Schema(title = "외모", nullable = true, example = "평범") + private String appearance; + @Schema(title = "성격", nullable = true, example = "다정함") + private String personality; + @Schema(title = "특징", nullable = true) + private String characteristic; + @Schema(title = "주요관계", nullable = true) + private String relationship; + @Schema(title = "커스텀 필드", nullable = true) + private List customFields; + + public ProductCharacter toEntity(UUID productId) { + return ProductCharacter.builder() + .productId(productId) + .intro(intro) + .name(name) + .age(age) + .gender(gender) + .occupation(occupation) + .appearance(appearance) + .personality(personality) + .relationship(relationship) + .build(); + } + } + + @Getter + @Setter + public static class CustomField { + + @Schema(nullable = true) + private UUID id; + @Schema(title = "필드 이름") + private String name; + @Schema(title = "필드 내용") + private String content; + + public ProductCustomField toEntity(UUID productId, UUID sectionId, ProductSectionType sectionType) { + return ProductCustomField.builder() + .productId(productId) + .sectionId(sectionId) + .sectionType(sectionType) + .name(name) + .content(content) + .seq((short) 1) + .build(); + } + } + + @Getter + @Setter + public static class IdeaNote { + + @Schema(title = "제목") + private String title; + @Schema(title = "내용", nullable = true) + private String content; + } + + @Getter + @Setter + public static class Plot { + + @Schema(title = "내용", nullable = true) + private String content; + + public ProductPlot toEntity(UUID productId) { + return ProductPlot.builder() + .id(productId) + .content(content) + .build(); + } + } + + @Getter + @Setter + public static class Synopsis { + + @Schema(title = "장르", example = "SF, 로맨스") + private String genre; + @Schema(title = "분량", nullable = true) + private String length; + @Schema(title = "기획 의도", nullable = true) + private String purpose; + @Schema(title = "로그라인") + private String logline; + @Schema(title = "예시 문장", nullable = true) + private String example; + + public ProductSynopsis toEntity(UUID productId) { + return ProductSynopsis.builder() + .id(productId) + .genre(genre) + .length(length) + .purpose(purpose) + .logline(logline) + .example(example) + .build(); + } + } + + @Getter + @Setter + public static class Worldview { + + @Schema(title = "지리", nullable = true) + private String geography; + @Schema(title = "역사", nullable = true) + private String history; + @Schema(title = "정치", nullable = true) + private String politics; + @Schema(title = "사회", nullable = true) + private String society; + @Schema(title = "종교", nullable = true) + private String religion; + @Schema(title = "경제", nullable = true) + private String economy; + @Schema(title = "기술", nullable = true) + private String technology; + @Schema(title = "생활", nullable = true) + private String lifestyle; + @Schema(title = "언어", nullable = true) + private String language; + @Schema(title = "문화", nullable = true) + private String culture; + @Schema(title = "종족", nullable = true) + private String species; + @Schema(title = "직업", nullable = true) + private String occupation; + @Schema(title = "갈등 관계", nullable = true) + private String conflict; + @Schema(title = "커스텀 필드", nullable = true) + private List customFields; + + public ProductWorldview toEntity(UUID productId) { + return ProductWorldview.builder() + .id(productId) + .geography(geography) + .history(history) + .politics(politics) + .society(society) + .religion(religion) + .economy(economy) + .technology(technology) + .lifestyle(lifestyle) + .language(language) + .culture(culture) + .species(species) + .occupation(occupation) + .conflict(conflict) + .build(); + } + } +} diff --git a/api/src/main/java/writeon/api/product/response/ProductDetailResponse.java b/api/src/main/java/writeon/api/product/response/ProductDetailResponse.java new file mode 100644 index 0000000..3b1c9d7 --- /dev/null +++ b/api/src/main/java/writeon/api/product/response/ProductDetailResponse.java @@ -0,0 +1,35 @@ +package writeon.api.product.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.product.Product; +import writeon.domain.product.ProductMemo; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; + +@Getter +@Setter +public class ProductDetailResponse { + + private final UUID id; + @Schema(title = "제목") + private final String title; + @Schema(title = "내용") + private final String content; + @Schema(title = "수정일시") + private final LocalDateTime updatedAt; + private final List memos; + + public ProductDetailResponse(Product product) { + this.id = product.getId(); + this.title = product.getTitle(); + this.content = product.getContent(); + this.updatedAt = product.getUpdatedAt(); + this.memos = product.getMemos().stream() + .map(ProductMemoResponse::new) + .toList(); + } +} diff --git a/api/src/main/java/writeon/api/product/response/ProductFavoritePromptResponse.java b/api/src/main/java/writeon/api/product/response/ProductFavoritePromptResponse.java new file mode 100644 index 0000000..9f09934 --- /dev/null +++ b/api/src/main/java/writeon/api/product/response/ProductFavoritePromptResponse.java @@ -0,0 +1,22 @@ +package writeon.api.product.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Getter +public class ProductFavoritePromptResponse { + + @Schema(title = "메세지 ID") + private final UUID messageId; + private final String prompt; + private final LocalDateTime createdAt; + + public ProductFavoritePromptResponse(UUID messageId, String prompt, LocalDateTime createdAt) { + this.messageId = messageId; + this.prompt = prompt; + this.createdAt = createdAt; + } +} diff --git a/api/src/main/java/writeon/api/product/response/ProductFixedMessageResponse.java b/api/src/main/java/writeon/api/product/response/ProductFixedMessageResponse.java new file mode 100644 index 0000000..fb78fa6 --- /dev/null +++ b/api/src/main/java/writeon/api/product/response/ProductFixedMessageResponse.java @@ -0,0 +1,19 @@ +package writeon.api.product.response; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +@Getter +public class ProductFixedMessageResponse { + + @Schema(title = "메세지 ID") + private final UUID messageId; + private final String content; + + public ProductFixedMessageResponse(UUID messageId, String content) { + this.messageId = messageId; + this.content = content; + } +} diff --git a/api/src/main/java/writeon/api/product/response/ProductMemoResponse.java b/api/src/main/java/writeon/api/product/response/ProductMemoResponse.java new file mode 100644 index 0000000..8418b7d --- /dev/null +++ b/api/src/main/java/writeon/api/product/response/ProductMemoResponse.java @@ -0,0 +1,31 @@ +package writeon.api.product.response; + +import java.time.LocalDateTime; +import java.util.UUID; + +import lombok.Getter; +import writeon.domain.product.ProductMemo; + +@Getter +public class ProductMemoResponse { + + private final UUID id; + private final String title; + private final String content; + private final String selectedText; + private final Integer startIndex; + private final Integer endIndex; + private final Boolean isCompleted; + private final LocalDateTime updatedAt; + + public ProductMemoResponse(ProductMemo memo) { + this.id = memo.getId(); + this.title = memo.getTitle(); + this.content = memo.getContent(); + this.selectedText = memo.getSelectedText(); + this.startIndex = memo.getStartIndex(); + this.endIndex = memo.getEndIndex(); + this.isCompleted = memo.getIsCompleted(); + this.updatedAt = memo.getUpdatedAt(); + } +} diff --git a/api/src/main/java/writeon/api/product/response/ProductResponse.java b/api/src/main/java/writeon/api/product/response/ProductResponse.java new file mode 100644 index 0000000..b163957 --- /dev/null +++ b/api/src/main/java/writeon/api/product/response/ProductResponse.java @@ -0,0 +1,32 @@ +package writeon.api.product.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.tables.records.ProductRecord; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Getter +@Setter +public class ProductResponse { + + private final UUID id; + @Schema(title = "제목", nullable = true) + private final String title; + @Schema(title = "장르", nullable = true) + private final String genre; + @Schema(title = "생성일시") + private final LocalDateTime createdAt; + @Schema(title = "수정일시") + private final LocalDateTime updatedAt; + + public ProductResponse(ProductRecord product, String genre) { + this.id = product.getId(); + this.title = product.getTitle(); + this.genre = genre; + this.createdAt = product.getCreatedAt(); + this.updatedAt = product.getUpdatedAt(); + } +} diff --git a/api/src/main/java/writeon/api/product/response/ProductTemplateResponse.java b/api/src/main/java/writeon/api/product/response/ProductTemplateResponse.java new file mode 100644 index 0000000..77ffff7 --- /dev/null +++ b/api/src/main/java/writeon/api/product/response/ProductTemplateResponse.java @@ -0,0 +1,205 @@ +package writeon.api.product.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.product.*; + +import java.util.Comparator; +import java.util.List; +import java.util.UUID; + +@Getter +public class ProductTemplateResponse { + + private final UUID id; + private final List characters; + private final IdeaNote ideaNote; + private final Plot plot; + private final Synopsis synopsis; + private final Worldview worldview; + + public ProductTemplateResponse(Product product) { + this.id = product.getId(); + this.characters = product.getCharacters().stream() + .sorted(Comparator.comparing(ProductCharacter::getSeq)) + .map(Character::new) + .toList(); + this.ideaNote = product.getIdeaNote() != null ? new IdeaNote(product.getIdeaNote()) : null; + this.plot = product.getPlot() != null ? new Plot(product.getPlot()) : null; + this.synopsis = product.getSynopsis() != null ? new Synopsis(product.getSynopsis()) : null; + this.worldview = product.getWorldview() != null ? new Worldview(product.getWorldview()) : null; + } + + @Getter + @Setter + public static class Character { + + private final UUID id; + @Schema(title = "소개", nullable = true) + private final String intro; + @Schema(name = "이름", nullable = true) + private final String name; + @Schema(name = "나이", nullable = true) + private final Short age; + @Schema(name = "성별", nullable = true) + private final String gender; + @Schema(name = "직업", nullable = true) + private final String occupation; + @Schema(name = "외모", nullable = true) + private final String appearance; + @Schema(name = "성격/특징", nullable = true) + private final String personality; + @Schema(name = "주요관계", nullable = true) + private final String relationship; + @Schema(name = "커스텀 필드 목록", nullable = true) + private final List customFields; + + public Character(ProductCharacter character) { + this.id = character.getId(); + this.intro = character.getIntro(); + this.name = character.getName(); + this.age = character.getAge(); + this.gender = character.getGender(); + this.occupation = character.getOccupation(); + this.appearance = character.getAppearance(); + this.personality = character.getPersonality(); + this.relationship = character.getRelationship(); + this.customFields = character.getCustomFields().stream() + .map(CustomField::new) + .toList(); + } + } + + @Getter + @Setter + public static class CustomField { + + private final UUID id; + @Schema(title = "필드 이름") + private final String name; + @Schema(title = "필드 내용") + private final String content; + @Schema(title = "필드 순서") + private final Short seq; + + public CustomField(ProductCustomField customField) { + this.id = customField.getId(); + this.name = customField.getName(); + this.content = customField.getContent(); + this.seq = customField.getSeq(); + } + } + + @Getter + @Setter + public static class IdeaNote { + + private final UUID id; + @Schema(title = "제목", nullable = true) + private final String title; + @Schema(title = "내용", nullable = true) + private final String content; + + public IdeaNote(ProductIdeaNote ideaNote) { + this.id = ideaNote.getId(); + this.title = ideaNote.getTitle(); + this.content = ideaNote.getContent(); + } + } + + @Getter + @Setter + public static class Plot { + + private final UUID id; + @Schema(title = "내용", nullable = true) + private final String content; + + public Plot(ProductPlot plot) { + this.id = plot.getId(); + this.content = plot.getContent(); + } + } + + @Getter + @Setter + public static class Synopsis { + + private final UUID id; + @Schema(title = "장르") + private final String genre; + @Schema(title = "분량", nullable = true) + private final String length; + @Schema(title = "기획 의도", nullable = true) + private final String purpose; + @Schema(title = "로그라인", nullable = true) + private final String logline; + @Schema(title = "예시 문장", nullable = true) + private final String example; + + public Synopsis(ProductSynopsis synopsis) { + this.id = synopsis.getId(); + this.genre = synopsis.getGenre(); + this.length = synopsis.getLength(); + this.purpose = synopsis.getPurpose(); + this.logline = synopsis.getLogline(); + this.example = synopsis.getExample(); + } + } + + @Getter + @Setter + public static class Worldview { + + private final UUID id; + @Schema(title = "지리", nullable = true) + private final String geography; + @Schema(title = "역사", nullable = true) + private final String history; + @Schema(title = "정치", nullable = true) + private final String politics; + @Schema(title = "사회", nullable = true) + private final String society; + @Schema(title = "종교", nullable = true) + private final String religion; + @Schema(title = "경제", nullable = true) + private final String economy; + @Schema(title = "기술", nullable = true) + private final String technology; + @Schema(title = "생활", nullable = true) + private final String lifestyle; + @Schema(title = "언어", nullable = true) + private final String language; + @Schema(title = "문화", nullable = true) + private final String culture; + @Schema(title = "종족", nullable = true) + private final String species; + @Schema(title = "직업", nullable = true) + private final String occupation; + @Schema(title = "갈등 관계", nullable = true) + private final String conflict; + @Schema(name = "커스텀 필드 목록", nullable = true) + private final List customFields; + + public Worldview(ProductWorldview worldview) { + this.id = worldview.getId(); + this.geography = worldview.getGeography(); + this.history = worldview.getHistory(); + this.politics = worldview.getPolitics(); + this.society = worldview.getSociety(); + this.religion = worldview.getReligion(); + this.economy = worldview.getEconomy(); + this.technology = worldview.getTechnology(); + this.lifestyle = worldview.getLifestyle(); + this.language = worldview.getLanguage(); + this.culture = worldview.getCulture(); + this.species = worldview.getSpecies(); + this.occupation = worldview.getOccupation(); + this.conflict = worldview.getConflict(); + this.customFields = worldview.getCustomFields().stream() + .map(CustomField::new) + .toList(); + } + } +} diff --git a/api/src/main/java/writeon/api/product/service/ProductCommandService.java b/api/src/main/java/writeon/api/product/service/ProductCommandService.java new file mode 100644 index 0000000..827d690 --- /dev/null +++ b/api/src/main/java/writeon/api/product/service/ProductCommandService.java @@ -0,0 +1,382 @@ +package writeon.api.product.service; + +import com.amplitude.Amplitude; +import com.amplitude.Event; +import org.json.JSONObject; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; + +import lombok.RequiredArgsConstructor; +import writeon.api.assistant.service.AssistantService; +import writeon.api.assistant.service.DocumentUploadService; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.request.ProductMemoSaveRequest; +import writeon.api.product.request.ProductSaveRequest; +import writeon.api.product.request.ProductTemplateSaveRequest; +import writeon.domain.assistant.Assistant; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.assistant.enums.AssistantException; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.assistant.enums.MessageSenderRole; +import writeon.domain.product.Product; +import writeon.domain.product.ProductCharacter; +import writeon.domain.product.ProductCustomField; +import writeon.domain.product.ProductFavoritePrompt; +import writeon.domain.product.ProductFixedMessage; +import writeon.domain.product.ProductIdeaNote; +import writeon.domain.product.ProductMemo; +import writeon.domain.product.ProductPlot; +import writeon.domain.product.ProductSynopsis; +import writeon.domain.product.ProductWorldview; +import writeon.domain.product.enums.ProductException; +import writeon.domain.product.enums.ProductSectionType; +import writeon.domain.product.repository.ProductCharacterJpaRepository; +import writeon.domain.product.repository.ProductCustomFieldJpaRepository; +import writeon.domain.product.repository.ProductFavoritePromptJpaRepository; +import writeon.domain.product.repository.ProductIdeaNoteJpaRepository; +import writeon.domain.product.repository.ProductJpaRepository; +import writeon.domain.product.repository.ProductMemoJpaRepository; +import writeon.domain.product.repository.ProductPlotJpaRepository; +import writeon.domain.product.repository.ProductSynopsisJpaRepository; +import writeon.domain.product.repository.ProductWorldviewJpaRepository; + +@Service +@RequiredArgsConstructor +public class ProductCommandService { + + private final ProductQueryService productQueryService; + private final ProductJpaRepository productRepository; + private final ProductCharacterJpaRepository productCharacterJpaRepository; + private final ProductCustomFieldJpaRepository productCustomFieldJpaRepository; + private final ProductIdeaNoteJpaRepository productIdeaNoteRepository; + private final ProductMemoJpaRepository productMemoRepository; + private final ProductPlotJpaRepository productPlotRepository; + private final ProductSynopsisJpaRepository productSynopsisRepository; + private final ProductWorldviewJpaRepository productWorldviewRepository; + private final ProductFavoritePromptJpaRepository productFavoritePromptRepository; + private final Amplitude amplitude = Amplitude.getInstance(); + + private final AssistantService assistantService; + private final DocumentUploadService documentUploadService; + + @Transactional + public UUID create() { + return productRepository.save(new Product()).getId(); + } + + @Transactional + public UUID createMemo(UUID productId, ProductMemoSaveRequest request) { + productQueryService.verifyExist(productId); + + ProductMemo newMemo = new ProductMemo(productId, request.getTitle(), request.getContent(), + request.getSelectedText(), request.getStartIndex(), request.getEndIndex()); + productMemoRepository.save(newMemo); + + return newMemo.getId(); + } + + @Transactional + public void createFavoritePrompt(UUID productId, UUID assistantId) { + Product product = productQueryService.getById(productId); + Assistant assistant = assistantService.getById(assistantId); + + if (!assistant.getProductId().equals(productId)) { + throw new BaseException(AssistantException.NOT_EXIST); + } + + // 자유 대화 기능에서만 프롬프트 즐겨찾기 등록 가능 + if (!assistant.getType().equals(AssistantType.CHAT)) { + throw new BaseException(ProductException.INVALID_FAVORITE_PROMPT_TYPE); + } + AssistantMessage message = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.MEMBER); + + // 이미 즐겨찾기 등록된 프롬프트인지 검증 + if (productFavoritePromptRepository.existsByProduct_IdAndMessageId(productId, message.getId())) { + throw new BaseException(ProductException.ALREADY_EXIST_FAVORITE_PROMPT); + } + + product.getFavoritePrompts().add(new ProductFavoritePrompt(product, message.getId())); + } + + @Transactional + public void createFixedMessage(UUID productId, UUID assistantId) { + Product product = productQueryService.getById(productId); + Assistant assistant = assistantService.getById(assistantId); + + if (!assistant.getProductId().equals(productId)) { + throw new BaseException(AssistantException.NOT_EXIST); + } + + AssistantMessage message = assistantService.getMessageByAssistantId(assistantId, MessageSenderRole.ASSISTANT); + + product.setFixedMessage(new ProductFixedMessage(message)); + } + + @Transactional + public void saveTemplate(UUID productId, ProductTemplateSaveRequest request) { + Product product = productQueryService.getById(productId); + + modifyCharacters(product, request.getCharacters()); + modifyIdeaNote(product, request.getIdeaNote()); + modifyPlot(product, request.getPlot()); + modifySynopsis(product, request.getSynopsis()); + modifyWorldview(product, request.getWorldview()); + } + + @Transactional + public UUID save(UUID productId, ProductSaveRequest request) { + Product product = productQueryService.getById(productId); + + product.update(request.getTitle(), request.getContent()); + + // 수동 저장 시 작품 내용 임베딩 + if (!request.getIsAutoSave()) { + documentUploadService.documentUpload(productId, product.getContent()); + } + + return product.getId(); + } + + @Transactional + public void modifyMemo(UUID productId, UUID memoId, ProductMemoSaveRequest request) { + productQueryService.verifyExist(productId); + + ProductMemo memo = getMemoById(memoId); + + memo.update(request.getTitle(), request.getContent(), request.getSelectedText(), + request.getStartIndex(), request.getEndIndex()); + } + + @Transactional + public void modifyMemoCompleted(UUID productId, UUID memoId, Boolean isCompleted) { + productQueryService.verifyExist(productId); + + ProductMemo memo = getMemoById(memoId); + + memo.setIsCompleted(isCompleted); + } + + @Transactional + public void deleteMemo(UUID productId, UUID memoId) { + productQueryService.verifyExist(productId); + + ProductMemo memo = getMemoById(memoId); + + productMemoRepository.delete(memo); + } + + @Transactional + public void deleteFavoritePrompt(UUID productId, UUID messageId) { + Product product = productQueryService.getById(productId); + + ProductFavoritePrompt favoritePrompt = product.getFavoritePrompts().stream() + .filter(prompt -> prompt.getMessageId().equals(messageId)) + .findFirst() + .orElseThrow(() -> new BaseException(ProductException.NOT_EXIST_FAVORITE_PROMPT)); + + product.deleteFavoritePrompt(favoritePrompt); + productFavoritePromptRepository.delete(favoritePrompt); + } + + @Transactional + public void deleteFixedMessage(UUID productId) { + Product product = productQueryService.getById(productId); + product.deleteFixedMessage(); + } + + private ProductMemo getMemoById(UUID memoId) { + return productMemoRepository.findByIdAndCreatedBy(memoId, MemberUtil.getMemberId()) + .orElseThrow(() -> new BaseException(ProductException.NOT_EXIST_MEMO)); + } + + private void modifyCharacters(Product product, List requestInfos) { + Map savedCharacterMap = product.getCharacters().stream() + .collect(Collectors.toMap(ProductCharacter::getId, Function.identity())); + if (requestInfos == null || requestInfos.isEmpty()) { + productCustomFieldJpaRepository.deleteAllByProductIdAndSectionType(product.getId(), ProductSectionType.CHARACTER.getCode()); + productCharacterJpaRepository.deleteAll(savedCharacterMap.values()); + return; + } + + Set modifyIds = requestInfos.stream() + .map(ProductTemplateSaveRequest.Character::getId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + List deleteCharacters = savedCharacterMap.values().stream() + .filter(e -> !modifyIds.contains(e.getId())) + .toList(); + + productCharacterJpaRepository.deleteAll(deleteCharacters); + + List addCharacters = new ArrayList<>(); + for (int i = 0; i < requestInfos.size(); i++) { + var request = requestInfos.get(i); + + if (request.getId() == null) { + ProductCharacter newCharacter = request.toEntity(product.getId()); + newCharacter.setSeq(i); + addCharacters.add(newCharacter); + + modifyCustomFields(product.getId(), newCharacter.getId(), ProductSectionType.CHARACTER, + request.getCustomFields(), List.of()); + } else { + ProductCharacter savedCharacter = savedCharacterMap.get(request.getId()); + if (savedCharacter == null) { + throw new BaseException(ProductException.NOT_EXIST_CHARACTER); + } + + savedCharacter.update(request.getIntro(), request.getName(), request.getAge(), request.getGender(), request.getOccupation(), + request.getAppearance(), request.getPersonality(), request.getRelationship(), i); + + modifyCustomFields(product.getId(), savedCharacter.getId(), ProductSectionType.CHARACTER, + request.getCustomFields(), savedCharacter.getCustomFields()); + } + } + + productCharacterJpaRepository.saveAll(addCharacters); + } + + private void modifyCustomFields(UUID productId, UUID sectionId, ProductSectionType sectionType, + List requestInfos, + List savedCustomFields) { + Map savedCustomFieldMap = savedCustomFields.stream() + .collect(Collectors.toMap(ProductCustomField::getId, Function.identity())); + + if (requestInfos == null || requestInfos.isEmpty()) { + productCustomFieldJpaRepository.deleteAll(savedCustomFields); + return; + } + + Set modifyIds = requestInfos.stream() + .map(ProductTemplateSaveRequest.CustomField::getId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + List deleteCustomFields = savedCustomFields.stream() + .filter(cf -> !modifyIds.contains(cf.getId())) + .toList(); + + productCustomFieldJpaRepository.deleteAll(deleteCustomFields); + + List addCustomFields = new ArrayList<>(); + + for (ProductTemplateSaveRequest.CustomField request : requestInfos) { + if (request.getId() == null) { + addCustomFields.add(request.toEntity(productId, sectionId, sectionType)); + } else { + ProductCustomField savedField = savedCustomFieldMap.get(request.getId()); + if (savedField == null) { + throw new BaseException(ProductException.NOT_EXIST_CUSTOM_FIELD); + } + savedField.update(request.getName(), request.getContent()); + } + } + + productCustomFieldJpaRepository.saveAll(addCustomFields); + } + + private void modifyIdeaNote(Product product, ProductTemplateSaveRequest.IdeaNote requestInfo) { + ProductIdeaNote savedIdeaNote = product.getIdeaNote(); + + if (requestInfo == null) { + if (savedIdeaNote != null) { + productIdeaNoteRepository.delete(savedIdeaNote); + } + return; + } + + if (savedIdeaNote == null) { + ProductIdeaNote newIdeaNote = new ProductIdeaNote(product.getId(), requestInfo.getTitle(), requestInfo.getContent()); + productIdeaNoteRepository.save(newIdeaNote); + // amplitude 이벤트 전송 + final String memberId = MemberUtil.getMemberId().toString(); + Event event = new Event("$identify", memberId); + event.userProperties = new JSONObject() + .put("$add", new JSONObject() + .put("total_idea_notes_written", 1) + ); + amplitude.logEvent(event); + } else { + savedIdeaNote.update(requestInfo.getTitle(), requestInfo.getContent()); + } + } + + private void modifyPlot(Product product, ProductTemplateSaveRequest.Plot requestInfo) { + ProductPlot savedPlot = product.getPlot(); + + if (requestInfo == null) { + if (savedPlot != null) { + productPlotRepository.delete(savedPlot); + } + return; + } + + if (savedPlot == null) { + productPlotRepository.save(requestInfo.toEntity(product.getId())); + } else { + savedPlot.update(requestInfo.getContent()); + } + } + + private void modifySynopsis(Product product, ProductTemplateSaveRequest.Synopsis requestInfo) { + ProductSynopsis savedSynopsis = product.getSynopsis(); + + if (requestInfo == null) { + if (savedSynopsis != null) { + productSynopsisRepository.delete(savedSynopsis); + } + return; + } + + if (savedSynopsis == null) { + productSynopsisRepository.save(requestInfo.toEntity(product.getId())); + // amplitude 이벤트 전송 + final String memberId = MemberUtil.getMemberId().toString(); + Event event = new Event("$identify", memberId); + event.userProperties = new JSONObject() + .put("$add", new JSONObject() + .put("total_synopsis_written", 1) + ); + amplitude.logEvent(event); + } else { + savedSynopsis.update(requestInfo.getGenre(), requestInfo.getLength(), requestInfo.getPurpose(), requestInfo.getLogline(), requestInfo.getExample()); + } + } + + private void modifyWorldview(Product product, ProductTemplateSaveRequest.Worldview requestInfo) { + ProductWorldview savedWorldview = product.getWorldview(); + + if (requestInfo == null) { + if (savedWorldview != null) { + productCustomFieldJpaRepository.deleteAllByProductIdAndSectionType(product.getId(), ProductSectionType.WORLDVIEW.getCode()); + productWorldviewRepository.delete(savedWorldview); + } + return; + } + + if (savedWorldview == null) { + ProductWorldview newWorldview = productWorldviewRepository.save(requestInfo.toEntity(product.getId())); + + modifyCustomFields(product.getId(), newWorldview.getId(), ProductSectionType.WORLDVIEW, + requestInfo.getCustomFields(), List.of()); + } else { + savedWorldview.update(requestInfo.getGeography(), requestInfo.getHistory(), requestInfo.getPolitics(), + requestInfo.getSociety(), requestInfo.getReligion(), requestInfo.getEconomy(), requestInfo.getTechnology(), requestInfo.getLifestyle(), + requestInfo.getLanguage(), requestInfo.getCulture(), requestInfo.getSpecies(), requestInfo.getOccupation(), requestInfo.getConflict()); + + modifyCustomFields(product.getId(), savedWorldview.getId(), ProductSectionType.WORLDVIEW, + requestInfo.getCustomFields(), savedWorldview.getCustomFields()); + } + } +} diff --git a/api/src/main/java/writeon/api/product/service/ProductQueryService.java b/api/src/main/java/writeon/api/product/service/ProductQueryService.java new file mode 100644 index 0000000..cf7d017 --- /dev/null +++ b/api/src/main/java/writeon/api/product/service/ProductQueryService.java @@ -0,0 +1,84 @@ +package writeon.api.product.service; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Comparator; +import java.util.List; +import java.util.UUID; + +import lombok.RequiredArgsConstructor; +import writeon.api.common.exception.BaseException; +import writeon.api.common.util.MemberUtil; +import writeon.api.product.repository.ProductDao; +import writeon.api.product.response.ProductDetailResponse; +import writeon.api.product.response.ProductFavoritePromptResponse; +import writeon.api.product.response.ProductFixedMessageResponse; +import writeon.api.product.response.ProductMemoResponse; +import writeon.api.product.response.ProductResponse; +import writeon.api.product.response.ProductTemplateResponse; +import writeon.domain.assistant.AssistantMessage; +import writeon.domain.product.Product; +import writeon.domain.product.ProductFixedMessage; +import writeon.domain.product.ProductMemo; +import writeon.domain.product.enums.ProductException; +import writeon.domain.product.repository.ProductJpaRepository; + +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class ProductQueryService { + + private final ProductDao productDao; + private final ProductJpaRepository productRepository; + + public ProductDetailResponse getDetail(UUID productId) { + return new ProductDetailResponse(getById(productId)); + } + + public List getList() { + return productDao.select(); + } + + public Product getById(UUID productId) { + return productRepository.findByIdAndCreatedBy(productId, MemberUtil.getMemberId()) + .orElseThrow(() -> new BaseException(ProductException.NOT_EXIST)); + } + + public List getFavoritePrompts(UUID productId) { + verifyExist(productId); + + return productDao.selectFavoritePrompts(productId); + } + + public ProductFixedMessageResponse getFixedMessage(UUID productId) { + ProductFixedMessage fixedMessage = getById(productId).getFixedMessage(); + + if (fixedMessage == null) { + return null; + } + + AssistantMessage message = fixedMessage.getMessage(); + return new ProductFixedMessageResponse(message.getId(), message.getContent()); + } + + public ProductTemplateResponse getTemplate(UUID productId) { + return new ProductTemplateResponse(getById(productId)); + } + + public List getMemos(UUID productId) { + Product product = getById(productId); + + return product.getMemos() + .stream() + .sorted(Comparator.comparing(ProductMemo::getUpdatedAt).reversed()) + .map(ProductMemoResponse::new) + .toList(); + } + + public void verifyExist(UUID productId) { + if (!productRepository.existsByIdAndCreatedBy(productId, MemberUtil.getMemberId())) { + throw new BaseException(ProductException.NOT_EXIST); + } + } +} diff --git a/api/src/main/java/writeon/api/terms/controller/TermsController.java b/api/src/main/java/writeon/api/terms/controller/TermsController.java new file mode 100644 index 0000000..25e905d --- /dev/null +++ b/api/src/main/java/writeon/api/terms/controller/TermsController.java @@ -0,0 +1,38 @@ +//package writeon.api.terms.controller; +// +//import io.swagger.v3.oas.annotations.Operation; +//import io.swagger.v3.oas.annotations.tags.Tag; +//import lombok.RequiredArgsConstructor; +//import org.springframework.web.bind.annotation.GetMapping; +//import org.springframework.web.bind.annotation.PathVariable; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RestController; +//import writeon.api.terms.response.TermsDetailResponse; +//import writeon.api.terms.response.TermsSummaryResponse; +//import writeon.api.terms.service.TermsQueryService; +//import writeon.domain.terms.enums.TermsCode; +// +//import java.util.List; +// +//@RestController +//@RequiredArgsConstructor +//@RequestMapping("/terms") +//@Tag(name = "약관") +//public class TermsController { +// private final TermsQueryService termsQueryService; +// +// @Operation(summary = "약관 상세 조회") +// @GetMapping("/{termsCd}") +// public TermsDetailResponse getTermsByTermsCd(@PathVariable TermsCode termsCd) { +// +// return termsQueryService.getTermsByTermsCd(termsCd); +// } +// +// @Operation(summary = "약관 목록 조회") +// @GetMapping("/") +// public List getTermsList() { +// +// return termsQueryService.getAllTermsList(); +// } +// +//} diff --git a/api/src/main/java/writeon/api/terms/repository/TermsDao.java b/api/src/main/java/writeon/api/terms/repository/TermsDao.java new file mode 100644 index 0000000..faf0a56 --- /dev/null +++ b/api/src/main/java/writeon/api/terms/repository/TermsDao.java @@ -0,0 +1,50 @@ +package writeon.api.terms.repository; + +import org.jooq.DSLContext; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +import lombok.RequiredArgsConstructor; +import writeon.domain.terms.enums.TermsCode; +import writeon.tables.records.TermsRecord; + +import static org.jooq.impl.DSL.count; +import static writeon.tables.Terms.TERMS; + +@Repository +@RequiredArgsConstructor +public class TermsDao { + private final DSLContext dsl; + + public Optional selectLatestTermsByTermsCd(TermsCode termsCode) { + return Optional.ofNullable( + dsl.select() + .from(TERMS) + .where(TERMS.CD.eq(termsCode.getCode())) + .orderBy(TERMS.VERSION.desc()) + .fetchAnyInto(TermsRecord.class) + ); + } + + public List selectAllLatestTermsList() { + return dsl.select() + .distinctOn(TERMS.CD) + .from(TERMS) + .orderBy(TERMS.CD.asc(), TERMS.VERSION.desc()) + .fetchInto(TermsRecord.class); + } + + public boolean isContainingAllRequiredTerms(List termsCodeList) { + int notAgreedTermsCount = dsl.selectCount() + .from(TERMS) + .where( + TERMS.IS_REQUIRED.eq(true) + ).and( + TERMS.CD.notIn(termsCodeList.stream().map(TermsCode::getCode).toList()) + ).fetchOne(count()); + + return notAgreedTermsCount == 0; + } +} diff --git a/api/src/main/java/writeon/api/terms/request/TermsAgreeRequest.java b/api/src/main/java/writeon/api/terms/request/TermsAgreeRequest.java new file mode 100644 index 0000000..f16bb5c --- /dev/null +++ b/api/src/main/java/writeon/api/terms/request/TermsAgreeRequest.java @@ -0,0 +1,16 @@ +package writeon.api.terms.request; + +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Getter; +import writeon.domain.terms.enums.TermsCode; + +@AllArgsConstructor +@Getter +public class TermsAgreeRequest { + @NotNull + private TermsCode termsCd; + + @NotNull + private Boolean isAgreed; +} diff --git a/api/src/main/java/writeon/api/terms/response/TermsDetailResponse.java b/api/src/main/java/writeon/api/terms/response/TermsDetailResponse.java new file mode 100644 index 0000000..44d6c1f --- /dev/null +++ b/api/src/main/java/writeon/api/terms/response/TermsDetailResponse.java @@ -0,0 +1,42 @@ +package writeon.api.terms.response; + +import java.time.LocalDateTime; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.terms.enums.TermsCode; +import writeon.tables.records.TermsRecord; + +@Getter +@Setter +public class TermsDetailResponse { + @Schema(title = "약관 아이디", requiredMode = Schema.RequiredMode.REQUIRED) + private UUID id; + @Schema(title = "약관 코드", requiredMode = Schema.RequiredMode.REQUIRED) + private TermsCode cd; + @Schema(title = "약관 제목", requiredMode = Schema.RequiredMode.REQUIRED) + private String title; + @Schema(title = "약관 내용", requiredMode = Schema.RequiredMode.REQUIRED) + private String content; + @Schema(title = "약관 버전", requiredMode = Schema.RequiredMode.REQUIRED) + private int version; + @Schema(title = "약관 동의 필수 여부", requiredMode = Schema.RequiredMode.REQUIRED) + private boolean isRequired; + @Schema(title = "생성일", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime createdAt; + @Schema(title = "수정일", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime updatedAt; + + public TermsDetailResponse(TermsRecord terms) { + this.id = terms.getId(); + this.cd = TermsCode.fromCode(terms.getCd()); + this.title = terms.getTitle(); + this.content = terms.getContent(); + this.version = terms.getVersion(); + this.isRequired = terms.getIsRequired(); + this.createdAt = terms.getCreatedAt().toLocalDateTime(); + this.updatedAt = terms.getUpdatedAt().toLocalDateTime(); + } +} diff --git a/api/src/main/java/writeon/api/terms/response/TermsSummaryResponse.java b/api/src/main/java/writeon/api/terms/response/TermsSummaryResponse.java new file mode 100644 index 0000000..da20429 --- /dev/null +++ b/api/src/main/java/writeon/api/terms/response/TermsSummaryResponse.java @@ -0,0 +1,26 @@ +package writeon.api.terms.response; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import writeon.domain.terms.enums.TermsCode; +import writeon.tables.records.TermsRecord; + +@Getter +@Setter +public class TermsSummaryResponse { + @Schema(title = "약관 아이디", requiredMode = Schema.RequiredMode.REQUIRED) + private UUID id; + @Schema(title = "약관 코드", requiredMode = Schema.RequiredMode.REQUIRED) + private TermsCode cd; + @Schema(title = "약관 제목", requiredMode = Schema.RequiredMode.REQUIRED) + private String title; + + public TermsSummaryResponse(TermsRecord terms) { + this.id = terms.getId(); + this.cd = TermsCode.fromCode(terms.getCd()); + this.title = terms.getTitle(); + } +} diff --git a/api/src/main/java/writeon/api/terms/service/TermsCommandService.java b/api/src/main/java/writeon/api/terms/service/TermsCommandService.java new file mode 100644 index 0000000..955eb54 --- /dev/null +++ b/api/src/main/java/writeon/api/terms/service/TermsCommandService.java @@ -0,0 +1,10 @@ +package writeon.api.terms.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class TermsCommandService { + +} diff --git a/api/src/main/java/writeon/api/terms/service/TermsQueryService.java b/api/src/main/java/writeon/api/terms/service/TermsQueryService.java new file mode 100644 index 0000000..53abc92 --- /dev/null +++ b/api/src/main/java/writeon/api/terms/service/TermsQueryService.java @@ -0,0 +1,41 @@ +package writeon.api.terms.service; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import writeon.tables.records.TermsRecord; +import writeon.api.common.exception.BaseException; +import writeon.api.terms.repository.TermsDao; +import writeon.api.terms.response.TermsDetailResponse; +import writeon.api.terms.response.TermsSummaryResponse; +import writeon.domain.terms.enums.TermsCode; +import writeon.domain.terms.enums.TermsException; + +import java.util.List; + +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class TermsQueryService { + private final TermsDao termsDao; + + public TermsDetailResponse getTermsByTermsCd(TermsCode termsCd) { + TermsRecord terms = termsDao.selectLatestTermsByTermsCd(termsCd) + .orElseThrow(() -> new BaseException(TermsException.TERMS_NOT_FOUND)); + + return new TermsDetailResponse(terms); + } + + public boolean isContainingAllRequiredTerms(List termsCodeList) { + + return termsDao.isContainingAllRequiredTerms(termsCodeList); + } + + public List getAllTermsList() { + + return termsDao.selectAllLatestTermsList() + .stream() + .map(TermsSummaryResponse::new) + .toList(); + } +} diff --git a/api/src/main/resources/logback-spring.xml b/api/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..dff7ca8 --- /dev/null +++ b/api/src/main/resources/logback-spring.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + ${LOG_PATTERN} + + + + + + + + + + + + + + + + + + + + + ${INFO_PATH}/info.log + + ${INFO_PATH}/info_%d{yyyy-MM-dd}_%i.log + + 10MB + + 30 + + + + INFO + ACCEPT + DENY + + + ${LOG_PATTERN} + + + + + + ${ERR_PATH}/err.log + + ${ERR_PATH}/err_%d{yyyy-MM-dd}_%i.log + + 10MB + + 30 + + + + ERROR + ACCEPT + DENY + + + ${LOG_PATTERN} + + + + + + ${DISCORD_WEBHOOK_URL} + + + + + + + + + + + diff --git a/api/src/main/resources/templates/mail/change-password.html b/api/src/main/resources/templates/mail/change-password.html new file mode 100644 index 0000000..5ac8c1c --- /dev/null +++ b/api/src/main/resources/templates/mail/change-password.html @@ -0,0 +1,32 @@ + + + + + + +
+

+ 안녕하세요, 님.
+

+

+ 비밀번호 재설정을 요청하셨나요? 아래 링크를 클릭하여 새 비밀번호를 설정해 주세요.
+ 비밀번호 재설정하기 +

+

+ ⚠️보안 주의사항 +

    +
  • 이 링크는 일정 시간 후(예: 24시간) 만료됩니다.
  • +
  • 본인이 요청하지 않았다면 이 이메일을 무시하셔도 됩니다.
  • +
  • 계정 보안을 위해 비밀번호를 다른 서비스와 다르게 설정하는 것을 추천드립니다.
  • +
+

+

+ 궁금한 점이 있다면 언제든지 writeonforwriters@gmail.com을 통해 문의해 주세요. +

+

+ 감사합니다!
+ 라이트온 팀 드림 +

+
+ + \ No newline at end of file diff --git a/api/src/main/resources/templates/mail/join.html b/api/src/main/resources/templates/mail/join.html new file mode 100644 index 0000000..01387dc --- /dev/null +++ b/api/src/main/resources/templates/mail/join.html @@ -0,0 +1,30 @@ + + + + + + +
+

+ 안녕하세요, 님!
+ 라이트온에 가입해 주셔서 감사합니다. +

+

+ 계정을 활성화하려면 아래 링크를 클릭하여 이메일 주소를 인증해 주세요.
+ 이메일 인증하기 +

+

+ 위 버튼이 작동하지 않는다면 아래 링크를 복사하여 브라우저 주소창에 붙여넣어 주세요.
+ +

+

+ 이메일 인증은 보안을 위해 필수 절차이며, 일정 시간 내에 완료되지 않으면 계정이 비활성화될 수 있습니다.
+ 궁금한 점이 있다면 언제든지 writeonforwriters@gmail.com을 통해 문의해 주세요. +

+

+ 감사합니다!
+ 라이트온 팀 드림 +

+
+ + \ No newline at end of file diff --git a/assistant-api-client/build.gradle b/assistant-api-client/build.gradle new file mode 100644 index 0000000..856259e --- /dev/null +++ b/assistant-api-client/build.gradle @@ -0,0 +1,18 @@ +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation 'com.jayway.jsonpath:json-path:2.9.0' + + implementation project(':domain') +} + +bootJar { + enabled = false +} + +task copySecret(type: Copy) { + copy { + from '../BE-secret/assistant' + include "*.yml" + into 'src/main/resources' + } +} \ No newline at end of file diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/AssistantApiClient.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/AssistantApiClient.java new file mode 100644 index 0000000..affbf27 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/AssistantApiClient.java @@ -0,0 +1,213 @@ +package writeon.assistantapiclient; + +import com.jayway.jsonpath.JsonPath; +import org.springframework.http.HttpStatusCode; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import writeon.assistantapiclient.request.*; + +public class AssistantApiClient extends WebApiClient{ + + public AssistantApiClient(String baseUrl, int connectionTimeoutMs, int readTimeoutMs) { + super(baseUrl, connectionTimeoutMs, readTimeoutMs); + } + + public Mono documentUpload(DocumentUploadRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/document/upload") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .then(); + } + + public Mono research(ResearchRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/research") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .map(responseBody -> JsonPath.read(responseBody, "$.result")); + } + + public Mono autoModify(AutoModifyRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/auto-modify") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .map(responseBody -> JsonPath.read(responseBody, "$.result.content")); + } + + public Flux streamAutoModify(AutoModifyRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/auto-modify/stream") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToFlux(String.class); + } + + public Mono chat(ChatRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/chat") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .map(responseBody -> JsonPath.read(responseBody, "$.result.content")); + } + + public Flux streamChat(ChatRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/chat/stream") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToFlux(String.class); + } + + public Mono feedback(FeedbackRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/feedback") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .map(responseBody -> JsonPath.read(responseBody, "$.result.content")); + } + + public Flux streamFeedback(FeedbackRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/feedback/stream") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToFlux(String.class); + } + + public Mono plannerGenerate(PlannerGenerateRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/planner/generate") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .map(responseBody -> JsonPath.read(responseBody, "$.result.content")); + } + + public Flux streamPlannerGenerate(PlannerGenerateRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/planner/generate/stream") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToFlux(String.class); + } + + public Mono userModify(UserModifyRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/user-modify") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToMono(String.class) + .map(responseBody -> JsonPath.read(responseBody, "$.result.content")); + } + + public Flux streamUserModify(UserModifyRequest request) { + return webClient.post() + .uri(uriBuilder -> uriBuilder + .path("/v1/assistant/user-modify/stream") + .build() + ) + .bodyValue(request) + .retrieve() + .onStatus(HttpStatusCode::isError, response -> + response.bodyToMono(String.class) + .doOnNext(errorBody -> System.out.println("Error response: " + errorBody)) + .flatMap(errorBody -> Mono.error(new RuntimeException(errorBody))) + ) + .bodyToFlux(String.class); + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/WebApiClient.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/WebApiClient.java new file mode 100644 index 0000000..3938665 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/WebApiClient.java @@ -0,0 +1,42 @@ +package writeon.assistantapiclient; + +import io.netty.channel.ChannelOption; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.handler.timeout.WriteTimeoutHandler; +import org.springframework.http.client.reactive.ReactorClientHttpConnector; +import org.springframework.web.reactive.function.client.ExchangeStrategies; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.netty.http.client.HttpClient; + +import java.util.concurrent.TimeUnit; + +public class WebApiClient { + protected final WebClient webClient; + + public WebApiClient( + String baseUrl, + int connectionTimeoutMs, + int readTimeoutMs + ) { + HttpClient httpClient = HttpClient.create() + .keepAlive(true) + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectionTimeoutMs) + .doOnConnected(conn -> { + conn.addHandlerLast(new ReadTimeoutHandler(readTimeoutMs, TimeUnit.MILLISECONDS)); + conn.addHandlerLast(new WriteTimeoutHandler(readTimeoutMs, TimeUnit.MILLISECONDS)); + }); + + webClient = WebClient.builder() + .clientConnector(new ReactorClientHttpConnector(httpClient)) + .exchangeStrategies(getExchangeStrategies()) + .baseUrl(baseUrl) + .build(); + } + + // 응답 데이터 크기 조정, 기본 256KB + private ExchangeStrategies getExchangeStrategies() { + return ExchangeStrategies.builder() + .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(1024 * 1024 * 10)) // 10MB + .build(); + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/config/AssistantApiClientConfig.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/config/AssistantApiClientConfig.java new file mode 100644 index 0000000..18e5d02 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/config/AssistantApiClientConfig.java @@ -0,0 +1,20 @@ +package writeon.assistantapiclient.config; + +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import writeon.assistantapiclient.AssistantApiClient; + +@Configuration +@EnableConfigurationProperties({AssistantConfigurationProperties.class}) +public class AssistantApiClientConfig { + + @Bean + public AssistantApiClient assistantApiClient(AssistantConfigurationProperties configurationProperties) { + return new AssistantApiClient( + "http://" + configurationProperties.getIp() + ":" + configurationProperties.getPort(), + configurationProperties.getConnectionTimeoutMs(), + configurationProperties.getReadTimeoutMs() + ); + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/config/AssistantConfigurationProperties.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/config/AssistantConfigurationProperties.java new file mode 100644 index 0000000..bb996b1 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/config/AssistantConfigurationProperties.java @@ -0,0 +1,15 @@ +package writeon.assistantapiclient.config; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@Getter +@Setter +@ConfigurationProperties(prefix = "assistant.server") +public class AssistantConfigurationProperties { + private String ip; + private int port; + private int connectionTimeoutMs; + private int readTimeoutMs; +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/AutoModifyRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/AutoModifyRequest.java new file mode 100644 index 0000000..c40774d --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/AutoModifyRequest.java @@ -0,0 +1,20 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class AutoModifyRequest { + + private final String tenantId; + private final UserSetting userSetting; + private final String query; + + public AutoModifyRequest(String tenantId, UserSetting userSetting, String query) { + this.tenantId = tenantId; + this.userSetting = userSetting; + this.query = query; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/ChatRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/ChatRequest.java new file mode 100644 index 0000000..a261fd5 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/ChatRequest.java @@ -0,0 +1,22 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class ChatRequest { + + private final UserSetting userSetting; + private final String query; + private final String userInput; + private final String sessionId; + + public ChatRequest(UserSetting userSetting, String query, String userInput, String sessionId) { + this.userSetting = userSetting; + this.query = query; + this.userInput = userInput; + this.sessionId = sessionId; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/DocumentUploadRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/DocumentUploadRequest.java new file mode 100644 index 0000000..2c9ddf9 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/DocumentUploadRequest.java @@ -0,0 +1,18 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class DocumentUploadRequest { + + private final String tenantId; + private final String content; + + public DocumentUploadRequest(String tenantId, String content) { + this.tenantId = tenantId; + this.content = content; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/FeedbackRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/FeedbackRequest.java new file mode 100644 index 0000000..92b3551 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/FeedbackRequest.java @@ -0,0 +1,20 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class FeedbackRequest { + + private final String tenantId; + private final UserSetting userSetting; + private final String query; + + public FeedbackRequest(String tenantId, UserSetting userSetting, String query) { + this.tenantId = tenantId; + this.userSetting = userSetting; + this.query = query; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/PlannerGenerateRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/PlannerGenerateRequest.java new file mode 100644 index 0000000..3b354b8 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/PlannerGenerateRequest.java @@ -0,0 +1,26 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Builder; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class PlannerGenerateRequest { + + private final String tenantId; + private final String genre; + private final String logline; + private final String section; + private final String prompt; + + @Builder + public PlannerGenerateRequest(String tenantId, String genre, String logline, String section, String prompt) { + this.tenantId = tenantId; + this.genre = genre; + this.logline = logline; + this.section = section; + this.prompt = prompt; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/ResearchRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/ResearchRequest.java new file mode 100644 index 0000000..2c5c6a9 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/ResearchRequest.java @@ -0,0 +1,22 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class ResearchRequest { + + private final UserSetting userSetting; + private final String query; + private final String userInput; + private final String sessionId; + + public ResearchRequest(UserSetting userSetting, String query, String userInput, String sessionId) { + this.userSetting = userSetting; + this.query = query; + this.userInput = userInput; + this.sessionId = sessionId; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/UserModifyRequest.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/UserModifyRequest.java new file mode 100644 index 0000000..067a33d --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/UserModifyRequest.java @@ -0,0 +1,22 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.Getter; + +@Getter +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +public class UserModifyRequest { + + private final String tenantId; + private final UserSetting userSetting; + private final String query; + private final String howPolish; + + public UserModifyRequest(String tenantId, UserSetting userSetting, String query, String howPolish) { + this.tenantId = tenantId; + this.userSetting = userSetting; + this.query = query; + this.howPolish = howPolish; + } +} diff --git a/assistant-api-client/src/main/java/writeon/assistantapiclient/request/UserSetting.java b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/UserSetting.java new file mode 100644 index 0000000..62b1ac4 --- /dev/null +++ b/assistant-api-client/src/main/java/writeon/assistantapiclient/request/UserSetting.java @@ -0,0 +1,157 @@ +package writeon.assistantapiclient.request; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Getter; +import writeon.domain.product.*; + +import java.util.List; + +@Getter +@JsonInclude(JsonInclude.Include.NON_NULL) +public class UserSetting { + + private Synopsis synopsis; + private Worldview worldview; + private List characters; + private Plot plot; + private IdeaNote ideaNote; + + public UserSetting() { + } + + public UserSetting(Product product) { + this.characters = product.getCharacters().stream() + .map(Character::new) + .toList(); + this.ideaNote = product.getIdeaNote() != null ? new IdeaNote(product.getIdeaNote()) : null; + this.plot = product.getPlot() != null ? new Plot(product.getPlot()) : null; + this.synopsis = product.getSynopsis() != null ? new Synopsis(product.getSynopsis()) : null; + this.worldview = product.getWorldview() != null ? new Worldview(product.getWorldview()) : null; + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Character { + + private final String intro; + private final String character_name; + private final String age; + private final String gender; + private final String character_occupation; + private final String appearance; + private final String personality; + private final String characteristic; + private final String relationship; + private final List custom_fields; + + public Character(ProductCharacter character) { + this.intro = character.getIntro(); + this.character_name = character.getName(); + this.age = String.valueOf(character.getAge()); + this.gender = character.getGender(); + this.character_occupation = character.getOccupation(); + this.appearance = character.getAppearance(); + this.personality = character.getPersonality(); + this.characteristic = ""; + this.relationship = character.getRelationship(); + this.custom_fields = character.getCustomFields().stream() + .map(CustomField::new) + .toList(); + } + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class CustomField { + + private final String custom_field_name; + private final String custom_field_content; + + public CustomField(ProductCustomField customField) { + this.custom_field_name = customField.getName(); + this.custom_field_content = customField.getContent(); + } + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class IdeaNote { + + private final String idea_title; + private final String idea_content; + + public IdeaNote(ProductIdeaNote ideaNote) { + this.idea_title = ideaNote.getTitle(); + this.idea_content = ideaNote.getContent(); + } + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Plot { + + private final String content; + + public Plot(ProductPlot plot) { + this.content = plot.getContent(); + } + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Synopsis { + + private final String genre; + private final String length; + private final String purpose; + private final String logline; + private final String example; + + public Synopsis(ProductSynopsis synopsis) { + this.genre = synopsis.getGenre(); + this.length = synopsis.getLength(); + this.purpose = synopsis.getPurpose(); + this.logline = synopsis.getLogline(); + this.example = synopsis.getExample(); + } + } + + @Getter + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Worldview { + + private final String geography; + private final String history; + private final String politics; + private final String society; + private final String religion; + private final String economy; + private final String technology; + private final String lifestyle; + private final String language; + private final String culture; + private final String species; + private final String occupation; + private final String conflict; + private final List custom_fields; + + public Worldview(ProductWorldview worldview) { + this.geography = worldview.getGeography(); + this.history = worldview.getHistory(); + this.politics = worldview.getPolitics(); + this.society = worldview.getSociety(); + this.religion = worldview.getReligion(); + this.economy = worldview.getEconomy(); + this.technology = worldview.getTechnology(); + this.lifestyle = worldview.getLifestyle(); + this.language = worldview.getLanguage(); + this.culture = worldview.getCulture(); + this.species = worldview.getSpecies(); + this.occupation = worldview.getOccupation(); + this.conflict = worldview.getConflict(); + this.custom_fields = worldview.getCustomFields().stream() + .map(CustomField::new) + .toList(); + } + } +} diff --git a/build.gradle b/build.gradle index 0877da2..1980beb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,38 +1,51 @@ plugins { id 'java' + id 'java-library' id 'org.springframework.boot' version '3.3.7' id 'io.spring.dependency-management' version '1.1.7' } -group = 'com' -version = '0.0.1-SNAPSHOT' +bootJar { + enabled = false +} + +allprojects { + group = 'writeon' + version = '0.0.1-SNAPSHOT' + + apply plugin: 'java' + apply plugin: 'java-library' + apply plugin: 'org.springframework.boot' + apply plugin: 'io.spring.dependency-management' -java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) + java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } } -} -configurations { - compileOnly { - extendsFrom annotationProcessor + configurations { + compileOnly { + extendsFrom annotationProcessor + } } -} -repositories { - mavenCentral() -} + repositories { + mavenCentral() + } -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web' - compileOnly 'org.projectlombok:lombok' - runtimeOnly 'org.postgresql:postgresql' - annotationProcessor 'org.projectlombok:lombok' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' -} + dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-security' -tasks.named('test') { - useJUnitPlatform() -} + /* Lombok */ + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' + + /* Common Util */ + implementation 'org.apache.commons:commons-lang3:3.12.0' + implementation 'commons-io:commons-io:2.13.0' + implementation 'com.auth0:java-jwt:4.4.0' + } +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..05bec5b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.8' + +services: + postgres: + image: postgres + container_name: postgres + restart: always + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 1234 + POSTGRES_DB: service + ports: + - "5432:5432" + volumes: + - ./db:/var/lib/postgresql/data + - ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql + + redis: + image: redis:7.2.4-alpine3.19 + container_name: redis + restart: always + ports: + - "6379:6379" \ No newline at end of file diff --git a/domain/build.gradle b/domain/build.gradle new file mode 100644 index 0000000..eafac58 --- /dev/null +++ b/domain/build.gradle @@ -0,0 +1,78 @@ +plugins { + id 'nu.studer.jooq' version '9.0' +} + +dependencies { + api 'org.springframework.boot:spring-boot-starter-data-jpa' + + /* DB */ + runtimeOnly 'org.postgresql:postgresql' + api 'org.springframework.boot:spring-boot-starter-data-redis' + + /* jooq */ + api 'org.springframework.boot:spring-boot-starter-jooq' + jooqGenerator 'org.postgresql:postgresql' + + api 'com.fasterxml.uuid:java-uuid-generator:5.1.0' +} + +bootJar { + enabled = false +} + +task copySecret(type: Copy) { + copy { + from '../BE-secret/domain' + include "*.yml" + into 'src/main/resources' + } +} + +def jooqDir = "src/main/generated" + +sourceSets { + main.java.srcDirs += [ jooqDir ] +} + +tasks.withType(JavaCompile).configureEach { + options.getGeneratedSourceOutputDirectory().set(file(jooqDir)) +} + +jooq { + version = dependencyManagement.importedProperties['jooq.version'] + edition = nu.studer.gradle.jooq.JooqEdition.OSS + + configurations { + main { + generateSchemaSourceOnCompilation = false + + generationTool { + logging = org.jooq.meta.jaxb.Logging.DEBUG + jdbc { + driver = 'org.postgresql.Driver' + url = 'jdbc:postgresql://db-instance-postgres.cv2280c0874d.ap-northeast-2.rds.amazonaws.com:5432/service' + user = 'postgres' + password = 'Writely0101%' + } + generator { + name = 'org.jooq.codegen.DefaultGenerator' + database { + name = 'org.jooq.meta.postgres.PostgresDatabase' + inputSchema = 'public' + } + generate { + deprecated = false + records = true + immutablePojos = true + fluentSetters = true + } + target { + packageName = 'writeon' + directory = 'src/main/generated' + } + strategy.name = 'org.jooq.codegen.DefaultGeneratorStrategy' + } + } + } + } +} diff --git a/domain/src/main/generated/writeon/DefaultCatalog.java b/domain/src/main/generated/writeon/DefaultCatalog.java new file mode 100644 index 0000000..1ce0d58 --- /dev/null +++ b/domain/src/main/generated/writeon/DefaultCatalog.java @@ -0,0 +1,54 @@ +/* + * This file is generated by jOOQ. + */ +package writeon; + + +import java.util.Arrays; +import java.util.List; + +import org.jooq.Constants; +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class DefaultCatalog extends CatalogImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of DEFAULT_CATALOG + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema public. + */ + public final Public PUBLIC = Public.PUBLIC; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + return Arrays.asList( + Public.PUBLIC + ); + } + + /** + * A reference to the 3.19 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.19. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19; +} diff --git a/domain/src/main/generated/writeon/Indexes.java b/domain/src/main/generated/writeon/Indexes.java new file mode 100644 index 0000000..d5045fb --- /dev/null +++ b/domain/src/main/generated/writeon/Indexes.java @@ -0,0 +1,26 @@ +/* + * This file is generated by jOOQ. + */ +package writeon; + + +import org.jooq.Index; +import org.jooq.OrderField; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +import writeon.tables.ProductFavoritePrompt; + + +/** + * A class modelling indexes of tables in public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Indexes { + + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index IDX_PROMPT_PRODUCT_ID = Internal.createIndex(DSL.name("idx_prompt_product_id"), ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT, new OrderField[] { ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT.PRODUCT_ID }, false); +} diff --git a/domain/src/main/generated/writeon/Keys.java b/domain/src/main/generated/writeon/Keys.java new file mode 100644 index 0000000..8a5b132 --- /dev/null +++ b/domain/src/main/generated/writeon/Keys.java @@ -0,0 +1,91 @@ +/* + * This file is generated by jOOQ. + */ +package writeon; + + +import org.jooq.ForeignKey; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +import writeon.tables.Assistant; +import writeon.tables.AssistantEvaluation; +import writeon.tables.AssistantMessage; +import writeon.tables.AssistantPlannerMessage; +import writeon.tables.LoginAttempt; +import writeon.tables.Member; +import writeon.tables.MemberPassword; +import writeon.tables.Product; +import writeon.tables.ProductCharacter; +import writeon.tables.ProductCustomField; +import writeon.tables.ProductFavoritePrompt; +import writeon.tables.ProductFixedMessage; +import writeon.tables.ProductIdeanote; +import writeon.tables.ProductMemo; +import writeon.tables.ProductPlot; +import writeon.tables.ProductSynopsis; +import writeon.tables.ProductWorldview; +import writeon.tables.Terms; +import writeon.tables.TermsAgreement; +import writeon.tables.records.AssistantEvaluationRecord; +import writeon.tables.records.AssistantMessageRecord; +import writeon.tables.records.AssistantPlannerMessageRecord; +import writeon.tables.records.AssistantRecord; +import writeon.tables.records.LoginAttemptRecord; +import writeon.tables.records.MemberPasswordRecord; +import writeon.tables.records.MemberRecord; +import writeon.tables.records.ProductCharacterRecord; +import writeon.tables.records.ProductCustomFieldRecord; +import writeon.tables.records.ProductFavoritePromptRecord; +import writeon.tables.records.ProductFixedMessageRecord; +import writeon.tables.records.ProductIdeanoteRecord; +import writeon.tables.records.ProductMemoRecord; +import writeon.tables.records.ProductPlotRecord; +import writeon.tables.records.ProductRecord; +import writeon.tables.records.ProductSynopsisRecord; +import writeon.tables.records.ProductWorldviewRecord; +import writeon.tables.records.TermsAgreementRecord; +import writeon.tables.records.TermsRecord; + + +/** + * A class modelling foreign key relationships and constraints of tables in + * public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Keys { + + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- + + public static final UniqueKey ASSISTANT_PK = Internal.createUniqueKey(Assistant.ASSISTANT, DSL.name("assistant_pk"), new TableField[] { Assistant.ASSISTANT.ID }, true); + public static final UniqueKey ASSISTANT_EVALUATION_PK = Internal.createUniqueKey(AssistantEvaluation.ASSISTANT_EVALUATION, DSL.name("assistant_evaluation_pk"), new TableField[] { AssistantEvaluation.ASSISTANT_EVALUATION.ASSISTANT_ID }, true); + public static final UniqueKey ASSISTANT_MESSAGE_PK = Internal.createUniqueKey(AssistantMessage.ASSISTANT_MESSAGE, DSL.name("assistant_message_pk"), new TableField[] { AssistantMessage.ASSISTANT_MESSAGE.ID }, true); + public static final UniqueKey ASSISTANT_PLANNER_MESSAGE_PK = Internal.createUniqueKey(AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE, DSL.name("assistant_planner_message_pk"), new TableField[] { AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE.ASSISTANT_ID }, true); + public static final UniqueKey LOGIN_ATTEMPT_PK = Internal.createUniqueKey(LoginAttempt.LOGIN_ATTEMPT, DSL.name("login_attempt_pk"), new TableField[] { LoginAttempt.LOGIN_ATTEMPT.ID }, true); + public static final UniqueKey EMAIL_UK = Internal.createUniqueKey(Member.MEMBER, DSL.name("email_uk"), new TableField[] { Member.MEMBER.EMAIL }, true); + public static final UniqueKey MEMBER_PK = Internal.createUniqueKey(Member.MEMBER, DSL.name("member_pk"), new TableField[] { Member.MEMBER.ID }, true); + public static final UniqueKey NICKNAME_UK = Internal.createUniqueKey(Member.MEMBER, DSL.name("nickname_uk"), new TableField[] { Member.MEMBER.NICKNAME }, true); + public static final UniqueKey MEMBER_PASSWORD_PK = Internal.createUniqueKey(MemberPassword.MEMBER_PASSWORD, DSL.name("member_password_pk"), new TableField[] { MemberPassword.MEMBER_PASSWORD.MEMBER_ID }, true); + public static final UniqueKey PRODUCT_PK = Internal.createUniqueKey(Product.PRODUCT, DSL.name("product_pk"), new TableField[] { Product.PRODUCT.ID }, true); + public static final UniqueKey PRODUCT_CHARACTER_PK = Internal.createUniqueKey(ProductCharacter.PRODUCT_CHARACTER, DSL.name("product_character_pk"), new TableField[] { ProductCharacter.PRODUCT_CHARACTER.ID }, true); + public static final UniqueKey PRODUCT_CUSTOM_FIELD_PK = Internal.createUniqueKey(ProductCustomField.PRODUCT_CUSTOM_FIELD, DSL.name("product_custom_field_pk"), new TableField[] { ProductCustomField.PRODUCT_CUSTOM_FIELD.ID }, true); + public static final UniqueKey PRODUCT_FAVORITE_PROMPT_PK = Internal.createUniqueKey(ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT, DSL.name("product_favorite_prompt_pk"), new TableField[] { ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT.ID }, true); + public static final UniqueKey PRODUCT_FIXED_MESSAGE_PKEY = Internal.createUniqueKey(ProductFixedMessage.PRODUCT_FIXED_MESSAGE, DSL.name("product_fixed_message_pkey"), new TableField[] { ProductFixedMessage.PRODUCT_FIXED_MESSAGE.PRODUCT_ID }, true); + public static final UniqueKey PRODUCT_IDEANOTE_PK = Internal.createUniqueKey(ProductIdeanote.PRODUCT_IDEANOTE, DSL.name("product_ideanote_pk"), new TableField[] { ProductIdeanote.PRODUCT_IDEANOTE.ID }, true); + public static final UniqueKey PRODUCT_MEMO_PK = Internal.createUniqueKey(ProductMemo.PRODUCT_MEMO, DSL.name("product_memo_pk"), new TableField[] { ProductMemo.PRODUCT_MEMO.ID }, true); + public static final UniqueKey PRODUCT_PLOT_PK = Internal.createUniqueKey(ProductPlot.PRODUCT_PLOT, DSL.name("product_plot_pk"), new TableField[] { ProductPlot.PRODUCT_PLOT.ID }, true); + public static final UniqueKey PRODUCT_SYNOPSIS_PK = Internal.createUniqueKey(ProductSynopsis.PRODUCT_SYNOPSIS, DSL.name("product_synopsis_pk"), new TableField[] { ProductSynopsis.PRODUCT_SYNOPSIS.ID }, true); + public static final UniqueKey PRODUCT_WORLDVIEW_PK = Internal.createUniqueKey(ProductWorldview.PRODUCT_WORLDVIEW, DSL.name("product_worldview_pk"), new TableField[] { ProductWorldview.PRODUCT_WORLDVIEW.ID }, true); + public static final UniqueKey TERMS_PK = Internal.createUniqueKey(Terms.TERMS, DSL.name("terms_pk"), new TableField[] { Terms.TERMS.ID }, true); + public static final UniqueKey TERMS_AGREEMENT_PK = Internal.createUniqueKey(TermsAgreement.TERMS_AGREEMENT, DSL.name("terms_agreement_pk"), new TableField[] { TermsAgreement.TERMS_AGREEMENT.TERMS_CD, TermsAgreement.TERMS_AGREEMENT.MEMBER_ID }, true); + + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- + + public static final ForeignKey PRODUCT_FIXED_MESSAGE__FK_PRODUCT = Internal.createForeignKey(ProductFixedMessage.PRODUCT_FIXED_MESSAGE, DSL.name("fk_product"), new TableField[] { ProductFixedMessage.PRODUCT_FIXED_MESSAGE.PRODUCT_ID }, Keys.PRODUCT_PK, new TableField[] { Product.PRODUCT.ID }, true); +} diff --git a/domain/src/main/generated/writeon/Public.java b/domain/src/main/generated/writeon/Public.java new file mode 100644 index 0000000..7a4b7bd --- /dev/null +++ b/domain/src/main/generated/writeon/Public.java @@ -0,0 +1,225 @@ +/* + * This file is generated by jOOQ. + */ +package writeon; + + +import java.util.Arrays; +import java.util.List; + +import org.jooq.Catalog; +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.Result; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +import writeon.tables.Assistant; +import writeon.tables.AssistantEvaluation; +import writeon.tables.AssistantMessage; +import writeon.tables.AssistantPlannerMessage; +import writeon.tables.LoginAttempt; +import writeon.tables.Member; +import writeon.tables.MemberPassword; +import writeon.tables.PgpArmorHeaders; +import writeon.tables.Product; +import writeon.tables.ProductCharacter; +import writeon.tables.ProductCustomField; +import writeon.tables.ProductFavoritePrompt; +import writeon.tables.ProductFixedMessage; +import writeon.tables.ProductIdeanote; +import writeon.tables.ProductMemo; +import writeon.tables.ProductPlot; +import writeon.tables.ProductSynopsis; +import writeon.tables.ProductWorldview; +import writeon.tables.Terms; +import writeon.tables.TermsAgreement; +import writeon.tables.records.PgpArmorHeadersRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Public extends SchemaImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public + */ + public static final Public PUBLIC = new Public(); + + /** + * 어시스턴트 + */ + public final Assistant ASSISTANT = Assistant.ASSISTANT; + + /** + * 어시스턴트 평가 + */ + public final AssistantEvaluation ASSISTANT_EVALUATION = AssistantEvaluation.ASSISTANT_EVALUATION; + + /** + * The table public.assistant_message. + */ + public final AssistantMessage ASSISTANT_MESSAGE = AssistantMessage.ASSISTANT_MESSAGE; + + /** + * The table public.assistant_planner_message. + */ + public final AssistantPlannerMessage ASSISTANT_PLANNER_MESSAGE = AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE; + + /** + * 로그인_시도 + */ + public final LoginAttempt LOGIN_ATTEMPT = LoginAttempt.LOGIN_ATTEMPT; + + /** + * 회원 + */ + public final Member MEMBER = Member.MEMBER; + + /** + * 회원_비밀번호 + */ + public final MemberPassword MEMBER_PASSWORD = MemberPassword.MEMBER_PASSWORD; + + /** + * The table public.pgp_armor_headers. + */ + public final PgpArmorHeaders PGP_ARMOR_HEADERS = PgpArmorHeaders.PGP_ARMOR_HEADERS; + + /** + * Call public.pgp_armor_headers. + */ + public static Result PGP_ARMOR_HEADERS( + Configuration configuration + , String __1 + ) { + return configuration.dsl().selectFrom(writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + )).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static PgpArmorHeaders PGP_ARMOR_HEADERS( + String __1 + ) { + return writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + ); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static PgpArmorHeaders PGP_ARMOR_HEADERS( + Field __1 + ) { + return writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + ); + } + + /** + * 작품 + */ + public final Product PRODUCT = Product.PRODUCT; + + /** + * 작품 등장인물 + */ + public final ProductCharacter PRODUCT_CHARACTER = ProductCharacter.PRODUCT_CHARACTER; + + /** + * The table public.product_custom_field. + */ + public final ProductCustomField PRODUCT_CUSTOM_FIELD = ProductCustomField.PRODUCT_CUSTOM_FIELD; + + /** + * The table public.product_favorite_prompt. + */ + public final ProductFavoritePrompt PRODUCT_FAVORITE_PROMPT = ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT; + + /** + * The table public.product_fixed_message. + */ + public final ProductFixedMessage PRODUCT_FIXED_MESSAGE = ProductFixedMessage.PRODUCT_FIXED_MESSAGE; + + /** + * 작품 아이디어 노트 + */ + public final ProductIdeanote PRODUCT_IDEANOTE = ProductIdeanote.PRODUCT_IDEANOTE; + + /** + * 작품 메모 + */ + public final ProductMemo PRODUCT_MEMO = ProductMemo.PRODUCT_MEMO; + + /** + * 작품 줄거리 + */ + public final ProductPlot PRODUCT_PLOT = ProductPlot.PRODUCT_PLOT; + + /** + * 작품 시놉시스 + */ + public final ProductSynopsis PRODUCT_SYNOPSIS = ProductSynopsis.PRODUCT_SYNOPSIS; + + /** + * 작품 세계관 + */ + public final ProductWorldview PRODUCT_WORLDVIEW = ProductWorldview.PRODUCT_WORLDVIEW; + + /** + * 약관 + */ + public final Terms TERMS = Terms.TERMS; + + /** + * 약관_동의 + */ + public final TermsAgreement TERMS_AGREEMENT = TermsAgreement.TERMS_AGREEMENT; + + /** + * No further instances allowed + */ + private Public() { + super("public", null); + } + + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + return Arrays.asList( + Assistant.ASSISTANT, + AssistantEvaluation.ASSISTANT_EVALUATION, + AssistantMessage.ASSISTANT_MESSAGE, + AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE, + LoginAttempt.LOGIN_ATTEMPT, + Member.MEMBER, + MemberPassword.MEMBER_PASSWORD, + PgpArmorHeaders.PGP_ARMOR_HEADERS, + Product.PRODUCT, + ProductCharacter.PRODUCT_CHARACTER, + ProductCustomField.PRODUCT_CUSTOM_FIELD, + ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT, + ProductFixedMessage.PRODUCT_FIXED_MESSAGE, + ProductIdeanote.PRODUCT_IDEANOTE, + ProductMemo.PRODUCT_MEMO, + ProductPlot.PRODUCT_PLOT, + ProductSynopsis.PRODUCT_SYNOPSIS, + ProductWorldview.PRODUCT_WORLDVIEW, + Terms.TERMS, + TermsAgreement.TERMS_AGREEMENT + ); + } +} diff --git a/domain/src/main/generated/writeon/Routines.java b/domain/src/main/generated/writeon/Routines.java new file mode 100644 index 0000000..370498c --- /dev/null +++ b/domain/src/main/generated/writeon/Routines.java @@ -0,0 +1,1704 @@ +/* + * This file is generated by jOOQ. + */ +package writeon; + + +import java.util.UUID; + +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.Result; + +import writeon.routines.Armor1; +import writeon.routines.Armor2; +import writeon.routines.Crypt; +import writeon.routines.Dearmor; +import writeon.routines.Decrypt; +import writeon.routines.DecryptIv; +import writeon.routines.Digest1; +import writeon.routines.Digest2; +import writeon.routines.Encrypt; +import writeon.routines.EncryptIv; +import writeon.routines.GenRandomBytes; +import writeon.routines.GenRandomUuid; +import writeon.routines.GenSalt1; +import writeon.routines.GenSalt2; +import writeon.routines.Hmac1; +import writeon.routines.Hmac2; +import writeon.routines.PgpKeyId; +import writeon.routines.PgpPubDecrypt1; +import writeon.routines.PgpPubDecrypt2; +import writeon.routines.PgpPubDecrypt3; +import writeon.routines.PgpPubDecryptBytea1; +import writeon.routines.PgpPubDecryptBytea2; +import writeon.routines.PgpPubDecryptBytea3; +import writeon.routines.PgpPubEncrypt1; +import writeon.routines.PgpPubEncrypt2; +import writeon.routines.PgpPubEncryptBytea1; +import writeon.routines.PgpPubEncryptBytea2; +import writeon.routines.PgpSymDecrypt1; +import writeon.routines.PgpSymDecrypt2; +import writeon.routines.PgpSymDecryptBytea1; +import writeon.routines.PgpSymDecryptBytea2; +import writeon.routines.PgpSymEncrypt1; +import writeon.routines.PgpSymEncrypt2; +import writeon.routines.PgpSymEncryptBytea1; +import writeon.routines.PgpSymEncryptBytea2; +import writeon.tables.PgpArmorHeaders; +import writeon.tables.records.PgpArmorHeadersRecord; + + +/** + * Convenience access to all stored procedures and functions in public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Routines { + + /** + * Call public.armor + */ + public static String armor1( + Configuration configuration + , byte[] __1 + ) { + Armor1 f = new Armor1(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.armor as a field. + */ + public static Field armor1( + byte[] __1 + ) { + Armor1 f = new Armor1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get public.armor as a field. + */ + public static Field armor1( + Field __1 + ) { + Armor1 f = new Armor1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call public.armor + */ + public static String armor2( + Configuration configuration + , byte[] __1 + , String[] __2 + , String[] __3 + ) { + Armor2 f = new Armor2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.armor as a field. + */ + public static Field armor2( + byte[] __1 + , String[] __2 + , String[] __3 + ) { + Armor2 f = new Armor2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.armor as a field. + */ + public static Field armor2( + Field __1 + , Field __2 + , Field __3 + ) { + Armor2 f = new Armor2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.crypt + */ + public static String crypt( + Configuration configuration + , String __1 + , String __2 + ) { + Crypt f = new Crypt(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.crypt as a field. + */ + public static Field crypt( + String __1 + , String __2 + ) { + Crypt f = new Crypt(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.crypt as a field. + */ + public static Field crypt( + Field __1 + , Field __2 + ) { + Crypt f = new Crypt(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.dearmor + */ + public static byte[] dearmor( + Configuration configuration + , String __1 + ) { + Dearmor f = new Dearmor(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.dearmor as a field. + */ + public static Field dearmor( + String __1 + ) { + Dearmor f = new Dearmor(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get public.dearmor as a field. + */ + public static Field dearmor( + Field __1 + ) { + Dearmor f = new Dearmor(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call public.decrypt + */ + public static byte[] decrypt( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + ) { + Decrypt f = new Decrypt(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.decrypt as a field. + */ + public static Field decrypt( + byte[] __1 + , byte[] __2 + , String __3 + ) { + Decrypt f = new Decrypt(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.decrypt as a field. + */ + public static Field decrypt( + Field __1 + , Field __2 + , Field __3 + ) { + Decrypt f = new Decrypt(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.decrypt_iv + */ + public static byte[] decryptIv( + Configuration configuration + , byte[] __1 + , byte[] __2 + , byte[] __3 + , String __4 + ) { + DecryptIv f = new DecryptIv(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.decrypt_iv as a field. + */ + public static Field decryptIv( + byte[] __1 + , byte[] __2 + , byte[] __3 + , String __4 + ) { + DecryptIv f = new DecryptIv(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Get public.decrypt_iv as a field. + */ + public static Field decryptIv( + Field __1 + , Field __2 + , Field __3 + , Field __4 + ) { + DecryptIv f = new DecryptIv(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Call public.digest + */ + public static byte[] digest1( + Configuration configuration + , String __1 + , String __2 + ) { + Digest1 f = new Digest1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.digest as a field. + */ + public static Field digest1( + String __1 + , String __2 + ) { + Digest1 f = new Digest1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.digest as a field. + */ + public static Field digest1( + Field __1 + , Field __2 + ) { + Digest1 f = new Digest1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.digest + */ + public static byte[] digest2( + Configuration configuration + , byte[] __1 + , String __2 + ) { + Digest2 f = new Digest2(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.digest as a field. + */ + public static Field digest2( + byte[] __1 + , String __2 + ) { + Digest2 f = new Digest2(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.digest as a field. + */ + public static Field digest2( + Field __1 + , Field __2 + ) { + Digest2 f = new Digest2(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.encrypt + */ + public static byte[] encrypt( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + ) { + Encrypt f = new Encrypt(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.encrypt as a field. + */ + public static Field encrypt( + byte[] __1 + , byte[] __2 + , String __3 + ) { + Encrypt f = new Encrypt(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.encrypt as a field. + */ + public static Field encrypt( + Field __1 + , Field __2 + , Field __3 + ) { + Encrypt f = new Encrypt(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.encrypt_iv + */ + public static byte[] encryptIv( + Configuration configuration + , byte[] __1 + , byte[] __2 + , byte[] __3 + , String __4 + ) { + EncryptIv f = new EncryptIv(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.encrypt_iv as a field. + */ + public static Field encryptIv( + byte[] __1 + , byte[] __2 + , byte[] __3 + , String __4 + ) { + EncryptIv f = new EncryptIv(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Get public.encrypt_iv as a field. + */ + public static Field encryptIv( + Field __1 + , Field __2 + , Field __3 + , Field __4 + ) { + EncryptIv f = new EncryptIv(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Call public.gen_random_bytes + */ + public static byte[] genRandomBytes( + Configuration configuration + , Integer __1 + ) { + GenRandomBytes f = new GenRandomBytes(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.gen_random_bytes as a field. + */ + public static Field genRandomBytes( + Integer __1 + ) { + GenRandomBytes f = new GenRandomBytes(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get public.gen_random_bytes as a field. + */ + public static Field genRandomBytes( + Field __1 + ) { + GenRandomBytes f = new GenRandomBytes(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call public.gen_random_uuid + */ + public static UUID genRandomUuid( + Configuration configuration + ) { + GenRandomUuid f = new GenRandomUuid(); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.gen_random_uuid as a field. + */ + public static Field genRandomUuid() { + GenRandomUuid f = new GenRandomUuid(); + + return f.asField(); + } + + /** + * Call public.gen_salt + */ + public static String genSalt1( + Configuration configuration + , String __1 + ) { + GenSalt1 f = new GenSalt1(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.gen_salt as a field. + */ + public static Field genSalt1( + String __1 + ) { + GenSalt1 f = new GenSalt1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get public.gen_salt as a field. + */ + public static Field genSalt1( + Field __1 + ) { + GenSalt1 f = new GenSalt1(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call public.gen_salt + */ + public static String genSalt2( + Configuration configuration + , String __1 + , Integer __2 + ) { + GenSalt2 f = new GenSalt2(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.gen_salt as a field. + */ + public static Field genSalt2( + String __1 + , Integer __2 + ) { + GenSalt2 f = new GenSalt2(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.gen_salt as a field. + */ + public static Field genSalt2( + Field __1 + , Field __2 + ) { + GenSalt2 f = new GenSalt2(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.hmac + */ + public static byte[] hmac1( + Configuration configuration + , String __1 + , String __2 + , String __3 + ) { + Hmac1 f = new Hmac1(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.hmac as a field. + */ + public static Field hmac1( + String __1 + , String __2 + , String __3 + ) { + Hmac1 f = new Hmac1(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.hmac as a field. + */ + public static Field hmac1( + Field __1 + , Field __2 + , Field __3 + ) { + Hmac1 f = new Hmac1(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.hmac + */ + public static byte[] hmac2( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + ) { + Hmac2 f = new Hmac2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.hmac as a field. + */ + public static Field hmac2( + byte[] __1 + , byte[] __2 + , String __3 + ) { + Hmac2 f = new Hmac2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.hmac as a field. + */ + public static Field hmac2( + Field __1 + , Field __2 + , Field __3 + ) { + Hmac2 f = new Hmac2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_key_id + */ + public static String pgpKeyId( + Configuration configuration + , byte[] __1 + ) { + PgpKeyId f = new PgpKeyId(); + f.set__1(__1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_key_id as a field. + */ + public static Field pgpKeyId( + byte[] __1 + ) { + PgpKeyId f = new PgpKeyId(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Get public.pgp_key_id as a field. + */ + public static Field pgpKeyId( + Field __1 + ) { + PgpKeyId f = new PgpKeyId(); + f.set__1(__1); + + return f.asField(); + } + + /** + * Call public.pgp_pub_decrypt + */ + public static String pgpPubDecrypt1( + Configuration configuration + , byte[] __1 + , byte[] __2 + ) { + PgpPubDecrypt1 f = new PgpPubDecrypt1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_decrypt as a field. + */ + public static Field pgpPubDecrypt1( + byte[] __1 + , byte[] __2 + ) { + PgpPubDecrypt1 f = new PgpPubDecrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_pub_decrypt as a field. + */ + public static Field pgpPubDecrypt1( + Field __1 + , Field __2 + ) { + PgpPubDecrypt1 f = new PgpPubDecrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_pub_decrypt + */ + public static String pgpPubDecrypt2( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + ) { + PgpPubDecrypt2 f = new PgpPubDecrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_decrypt as a field. + */ + public static Field pgpPubDecrypt2( + byte[] __1 + , byte[] __2 + , String __3 + ) { + PgpPubDecrypt2 f = new PgpPubDecrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_pub_decrypt as a field. + */ + public static Field pgpPubDecrypt2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpPubDecrypt2 f = new PgpPubDecrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_pub_decrypt + */ + public static String pgpPubDecrypt3( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + , String __4 + ) { + PgpPubDecrypt3 f = new PgpPubDecrypt3(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_decrypt as a field. + */ + public static Field pgpPubDecrypt3( + byte[] __1 + , byte[] __2 + , String __3 + , String __4 + ) { + PgpPubDecrypt3 f = new PgpPubDecrypt3(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Get public.pgp_pub_decrypt as a field. + */ + public static Field pgpPubDecrypt3( + Field __1 + , Field __2 + , Field __3 + , Field __4 + ) { + PgpPubDecrypt3 f = new PgpPubDecrypt3(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Call public.pgp_pub_decrypt_bytea + */ + public static byte[] pgpPubDecryptBytea1( + Configuration configuration + , byte[] __1 + , byte[] __2 + ) { + PgpPubDecryptBytea1 f = new PgpPubDecryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_decrypt_bytea as a field. + */ + public static Field pgpPubDecryptBytea1( + byte[] __1 + , byte[] __2 + ) { + PgpPubDecryptBytea1 f = new PgpPubDecryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_pub_decrypt_bytea as a field. + */ + public static Field pgpPubDecryptBytea1( + Field __1 + , Field __2 + ) { + PgpPubDecryptBytea1 f = new PgpPubDecryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_pub_decrypt_bytea + */ + public static byte[] pgpPubDecryptBytea2( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + ) { + PgpPubDecryptBytea2 f = new PgpPubDecryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_decrypt_bytea as a field. + */ + public static Field pgpPubDecryptBytea2( + byte[] __1 + , byte[] __2 + , String __3 + ) { + PgpPubDecryptBytea2 f = new PgpPubDecryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_pub_decrypt_bytea as a field. + */ + public static Field pgpPubDecryptBytea2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpPubDecryptBytea2 f = new PgpPubDecryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_pub_decrypt_bytea + */ + public static byte[] pgpPubDecryptBytea3( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + , String __4 + ) { + PgpPubDecryptBytea3 f = new PgpPubDecryptBytea3(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_decrypt_bytea as a field. + */ + public static Field pgpPubDecryptBytea3( + byte[] __1 + , byte[] __2 + , String __3 + , String __4 + ) { + PgpPubDecryptBytea3 f = new PgpPubDecryptBytea3(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Get public.pgp_pub_decrypt_bytea as a field. + */ + public static Field pgpPubDecryptBytea3( + Field __1 + , Field __2 + , Field __3 + , Field __4 + ) { + PgpPubDecryptBytea3 f = new PgpPubDecryptBytea3(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + f.set__4(__4); + + return f.asField(); + } + + /** + * Call public.pgp_pub_encrypt + */ + public static byte[] pgpPubEncrypt1( + Configuration configuration + , String __1 + , byte[] __2 + ) { + PgpPubEncrypt1 f = new PgpPubEncrypt1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_encrypt as a field. + */ + public static Field pgpPubEncrypt1( + String __1 + , byte[] __2 + ) { + PgpPubEncrypt1 f = new PgpPubEncrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_pub_encrypt as a field. + */ + public static Field pgpPubEncrypt1( + Field __1 + , Field __2 + ) { + PgpPubEncrypt1 f = new PgpPubEncrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_pub_encrypt + */ + public static byte[] pgpPubEncrypt2( + Configuration configuration + , String __1 + , byte[] __2 + , String __3 + ) { + PgpPubEncrypt2 f = new PgpPubEncrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_encrypt as a field. + */ + public static Field pgpPubEncrypt2( + String __1 + , byte[] __2 + , String __3 + ) { + PgpPubEncrypt2 f = new PgpPubEncrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_pub_encrypt as a field. + */ + public static Field pgpPubEncrypt2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpPubEncrypt2 f = new PgpPubEncrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_pub_encrypt_bytea + */ + public static byte[] pgpPubEncryptBytea1( + Configuration configuration + , byte[] __1 + , byte[] __2 + ) { + PgpPubEncryptBytea1 f = new PgpPubEncryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_encrypt_bytea as a field. + */ + public static Field pgpPubEncryptBytea1( + byte[] __1 + , byte[] __2 + ) { + PgpPubEncryptBytea1 f = new PgpPubEncryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_pub_encrypt_bytea as a field. + */ + public static Field pgpPubEncryptBytea1( + Field __1 + , Field __2 + ) { + PgpPubEncryptBytea1 f = new PgpPubEncryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_pub_encrypt_bytea + */ + public static byte[] pgpPubEncryptBytea2( + Configuration configuration + , byte[] __1 + , byte[] __2 + , String __3 + ) { + PgpPubEncryptBytea2 f = new PgpPubEncryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_pub_encrypt_bytea as a field. + */ + public static Field pgpPubEncryptBytea2( + byte[] __1 + , byte[] __2 + , String __3 + ) { + PgpPubEncryptBytea2 f = new PgpPubEncryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_pub_encrypt_bytea as a field. + */ + public static Field pgpPubEncryptBytea2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpPubEncryptBytea2 f = new PgpPubEncryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_sym_decrypt + */ + public static String pgpSymDecrypt1( + Configuration configuration + , byte[] __1 + , String __2 + ) { + PgpSymDecrypt1 f = new PgpSymDecrypt1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_decrypt as a field. + */ + public static Field pgpSymDecrypt1( + byte[] __1 + , String __2 + ) { + PgpSymDecrypt1 f = new PgpSymDecrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_sym_decrypt as a field. + */ + public static Field pgpSymDecrypt1( + Field __1 + , Field __2 + ) { + PgpSymDecrypt1 f = new PgpSymDecrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_sym_decrypt + */ + public static String pgpSymDecrypt2( + Configuration configuration + , byte[] __1 + , String __2 + , String __3 + ) { + PgpSymDecrypt2 f = new PgpSymDecrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_decrypt as a field. + */ + public static Field pgpSymDecrypt2( + byte[] __1 + , String __2 + , String __3 + ) { + PgpSymDecrypt2 f = new PgpSymDecrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_sym_decrypt as a field. + */ + public static Field pgpSymDecrypt2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpSymDecrypt2 f = new PgpSymDecrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_sym_decrypt_bytea + */ + public static byte[] pgpSymDecryptBytea1( + Configuration configuration + , byte[] __1 + , String __2 + ) { + PgpSymDecryptBytea1 f = new PgpSymDecryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_decrypt_bytea as a field. + */ + public static Field pgpSymDecryptBytea1( + byte[] __1 + , String __2 + ) { + PgpSymDecryptBytea1 f = new PgpSymDecryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_sym_decrypt_bytea as a field. + */ + public static Field pgpSymDecryptBytea1( + Field __1 + , Field __2 + ) { + PgpSymDecryptBytea1 f = new PgpSymDecryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_sym_decrypt_bytea + */ + public static byte[] pgpSymDecryptBytea2( + Configuration configuration + , byte[] __1 + , String __2 + , String __3 + ) { + PgpSymDecryptBytea2 f = new PgpSymDecryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_decrypt_bytea as a field. + */ + public static Field pgpSymDecryptBytea2( + byte[] __1 + , String __2 + , String __3 + ) { + PgpSymDecryptBytea2 f = new PgpSymDecryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_sym_decrypt_bytea as a field. + */ + public static Field pgpSymDecryptBytea2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpSymDecryptBytea2 f = new PgpSymDecryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_sym_encrypt + */ + public static byte[] pgpSymEncrypt1( + Configuration configuration + , String __1 + , String __2 + ) { + PgpSymEncrypt1 f = new PgpSymEncrypt1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_encrypt as a field. + */ + public static Field pgpSymEncrypt1( + String __1 + , String __2 + ) { + PgpSymEncrypt1 f = new PgpSymEncrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_sym_encrypt as a field. + */ + public static Field pgpSymEncrypt1( + Field __1 + , Field __2 + ) { + PgpSymEncrypt1 f = new PgpSymEncrypt1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_sym_encrypt + */ + public static byte[] pgpSymEncrypt2( + Configuration configuration + , String __1 + , String __2 + , String __3 + ) { + PgpSymEncrypt2 f = new PgpSymEncrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_encrypt as a field. + */ + public static Field pgpSymEncrypt2( + String __1 + , String __2 + , String __3 + ) { + PgpSymEncrypt2 f = new PgpSymEncrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_sym_encrypt as a field. + */ + public static Field pgpSymEncrypt2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpSymEncrypt2 f = new PgpSymEncrypt2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_sym_encrypt_bytea + */ + public static byte[] pgpSymEncryptBytea1( + Configuration configuration + , byte[] __1 + , String __2 + ) { + PgpSymEncryptBytea1 f = new PgpSymEncryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_encrypt_bytea as a field. + */ + public static Field pgpSymEncryptBytea1( + byte[] __1 + , String __2 + ) { + PgpSymEncryptBytea1 f = new PgpSymEncryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Get public.pgp_sym_encrypt_bytea as a field. + */ + public static Field pgpSymEncryptBytea1( + Field __1 + , Field __2 + ) { + PgpSymEncryptBytea1 f = new PgpSymEncryptBytea1(); + f.set__1(__1); + f.set__2(__2); + + return f.asField(); + } + + /** + * Call public.pgp_sym_encrypt_bytea + */ + public static byte[] pgpSymEncryptBytea2( + Configuration configuration + , byte[] __1 + , String __2 + , String __3 + ) { + PgpSymEncryptBytea2 f = new PgpSymEncryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get public.pgp_sym_encrypt_bytea as a field. + */ + public static Field pgpSymEncryptBytea2( + byte[] __1 + , String __2 + , String __3 + ) { + PgpSymEncryptBytea2 f = new PgpSymEncryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Get public.pgp_sym_encrypt_bytea as a field. + */ + public static Field pgpSymEncryptBytea2( + Field __1 + , Field __2 + , Field __3 + ) { + PgpSymEncryptBytea2 f = new PgpSymEncryptBytea2(); + f.set__1(__1); + f.set__2(__2); + f.set__3(__3); + + return f.asField(); + } + + /** + * Call public.pgp_armor_headers. + */ + public static Result pgpArmorHeaders( + Configuration configuration + , String __1 + ) { + return configuration.dsl().selectFrom(writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + )).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static PgpArmorHeaders pgpArmorHeaders( + String __1 + ) { + return writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + ); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static PgpArmorHeaders pgpArmorHeaders( + Field __1 + ) { + return writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + ); + } +} diff --git a/domain/src/main/generated/writeon/Tables.java b/domain/src/main/generated/writeon/Tables.java new file mode 100644 index 0000000..57ab1ac --- /dev/null +++ b/domain/src/main/generated/writeon/Tables.java @@ -0,0 +1,173 @@ +/* + * This file is generated by jOOQ. + */ +package writeon; + + +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.Result; + +import writeon.tables.Assistant; +import writeon.tables.AssistantEvaluation; +import writeon.tables.AssistantMessage; +import writeon.tables.AssistantPlannerMessage; +import writeon.tables.LoginAttempt; +import writeon.tables.Member; +import writeon.tables.MemberPassword; +import writeon.tables.PgpArmorHeaders; +import writeon.tables.Product; +import writeon.tables.ProductCharacter; +import writeon.tables.ProductCustomField; +import writeon.tables.ProductFavoritePrompt; +import writeon.tables.ProductFixedMessage; +import writeon.tables.ProductIdeanote; +import writeon.tables.ProductMemo; +import writeon.tables.ProductPlot; +import writeon.tables.ProductSynopsis; +import writeon.tables.ProductWorldview; +import writeon.tables.Terms; +import writeon.tables.TermsAgreement; +import writeon.tables.records.PgpArmorHeadersRecord; + + +/** + * Convenience access to all tables in public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Tables { + + /** + * 어시스턴트 + */ + public static final Assistant ASSISTANT = Assistant.ASSISTANT; + + /** + * 어시스턴트 평가 + */ + public static final AssistantEvaluation ASSISTANT_EVALUATION = AssistantEvaluation.ASSISTANT_EVALUATION; + + /** + * The table public.assistant_message. + */ + public static final AssistantMessage ASSISTANT_MESSAGE = AssistantMessage.ASSISTANT_MESSAGE; + + /** + * The table public.assistant_planner_message. + */ + public static final AssistantPlannerMessage ASSISTANT_PLANNER_MESSAGE = AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE; + + /** + * 로그인_시도 + */ + public static final LoginAttempt LOGIN_ATTEMPT = LoginAttempt.LOGIN_ATTEMPT; + + /** + * 회원 + */ + public static final Member MEMBER = Member.MEMBER; + + /** + * 회원_비밀번호 + */ + public static final MemberPassword MEMBER_PASSWORD = MemberPassword.MEMBER_PASSWORD; + + /** + * The table public.pgp_armor_headers. + */ + public static final PgpArmorHeaders PGP_ARMOR_HEADERS = PgpArmorHeaders.PGP_ARMOR_HEADERS; + + /** + * Call public.pgp_armor_headers. + */ + public static Result PGP_ARMOR_HEADERS( + Configuration configuration + , String __1 + ) { + return configuration.dsl().selectFrom(writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + )).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static PgpArmorHeaders PGP_ARMOR_HEADERS( + String __1 + ) { + return writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + ); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static PgpArmorHeaders PGP_ARMOR_HEADERS( + Field __1 + ) { + return writeon.tables.PgpArmorHeaders.PGP_ARMOR_HEADERS.call( + __1 + ); + } + + /** + * 작품 + */ + public static final Product PRODUCT = Product.PRODUCT; + + /** + * 작품 등장인물 + */ + public static final ProductCharacter PRODUCT_CHARACTER = ProductCharacter.PRODUCT_CHARACTER; + + /** + * The table public.product_custom_field. + */ + public static final ProductCustomField PRODUCT_CUSTOM_FIELD = ProductCustomField.PRODUCT_CUSTOM_FIELD; + + /** + * The table public.product_favorite_prompt. + */ + public static final ProductFavoritePrompt PRODUCT_FAVORITE_PROMPT = ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT; + + /** + * The table public.product_fixed_message. + */ + public static final ProductFixedMessage PRODUCT_FIXED_MESSAGE = ProductFixedMessage.PRODUCT_FIXED_MESSAGE; + + /** + * 작품 아이디어 노트 + */ + public static final ProductIdeanote PRODUCT_IDEANOTE = ProductIdeanote.PRODUCT_IDEANOTE; + + /** + * 작품 메모 + */ + public static final ProductMemo PRODUCT_MEMO = ProductMemo.PRODUCT_MEMO; + + /** + * 작품 줄거리 + */ + public static final ProductPlot PRODUCT_PLOT = ProductPlot.PRODUCT_PLOT; + + /** + * 작품 시놉시스 + */ + public static final ProductSynopsis PRODUCT_SYNOPSIS = ProductSynopsis.PRODUCT_SYNOPSIS; + + /** + * 작품 세계관 + */ + public static final ProductWorldview PRODUCT_WORLDVIEW = ProductWorldview.PRODUCT_WORLDVIEW; + + /** + * 약관 + */ + public static final Terms TERMS = Terms.TERMS; + + /** + * 약관_동의 + */ + public static final TermsAgreement TERMS_AGREEMENT = TermsAgreement.TERMS_AGREEMENT; +} diff --git a/domain/src/main/generated/writeon/routines/Armor1.java b/domain/src/main/generated/writeon/routines/Armor1.java new file mode 100644 index 0000000..af54806 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Armor1.java @@ -0,0 +1,60 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Armor1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.armor.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.armor._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * Create a new routine call instance + */ + public Armor1() { + super("armor", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Armor1 set__1(Field field) { + setField(_1, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Armor2.java b/domain/src/main/generated/writeon/routines/Armor2.java new file mode 100644 index 0000000..fad96a5 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Armor2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Armor2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.armor.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.armor._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.armor._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB.array(), false, true); + + /** + * The parameter public.armor._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB.array(), false, true); + + /** + * Create a new routine call instance + */ + public Armor2() { + super("armor", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Armor2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Armor2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String[] value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Armor2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Crypt.java b/domain/src/main/generated/writeon/routines/Crypt.java new file mode 100644 index 0000000..b14c383 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Crypt.java @@ -0,0 +1,81 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Crypt extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.crypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.crypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.crypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Crypt() { + super("crypt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Crypt set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Crypt set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Dearmor.java b/domain/src/main/generated/writeon/routines/Dearmor.java new file mode 100644 index 0000000..bbda253 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Dearmor.java @@ -0,0 +1,59 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Dearmor extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.dearmor.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.dearmor._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Dearmor() { + super("dearmor", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Dearmor set__1(Field field) { + setField(_1, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Decrypt.java b/domain/src/main/generated/writeon/routines/Decrypt.java new file mode 100644 index 0000000..7942c1f --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Decrypt.java @@ -0,0 +1,103 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Decrypt extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.decrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.decrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.decrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.decrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Decrypt() { + super("decrypt", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Decrypt set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Decrypt set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Decrypt set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/DecryptIv.java b/domain/src/main/generated/writeon/routines/DecryptIv.java new file mode 100644 index 0000000..4f12930 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/DecryptIv.java @@ -0,0 +1,125 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class DecryptIv extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.decrypt_iv.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.decrypt_iv._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.decrypt_iv._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.decrypt_iv._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.BLOB, false, true); + + /** + * The parameter public.decrypt_iv._4. + */ + public static final Parameter _4 = Internal.createParameter("_4", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public DecryptIv() { + super("decrypt_iv", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + addInParameter(_4); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public DecryptIv set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public DecryptIv set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(byte[] value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public DecryptIv set__3(Field field) { + setField(_3, field); + return this; + } + + /** + * Set the _4 parameter IN value to the routine + */ + public void set__4(String value) { + setValue(_4, value); + } + + /** + * Set the _4 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public DecryptIv set__4(Field field) { + setField(_4, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Digest1.java b/domain/src/main/generated/writeon/routines/Digest1.java new file mode 100644 index 0000000..fce3a49 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Digest1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Digest1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.digest.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.digest._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.digest._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Digest1() { + super("digest", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Digest1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Digest1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Digest2.java b/domain/src/main/generated/writeon/routines/Digest2.java new file mode 100644 index 0000000..fdb0de4 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Digest2.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Digest2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.digest.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.digest._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.digest._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Digest2() { + super("digest", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Digest2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Digest2 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Encrypt.java b/domain/src/main/generated/writeon/routines/Encrypt.java new file mode 100644 index 0000000..a395888 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Encrypt.java @@ -0,0 +1,103 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Encrypt extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.encrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.encrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.encrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.encrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Encrypt() { + super("encrypt", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Encrypt set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Encrypt set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Encrypt set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/EncryptIv.java b/domain/src/main/generated/writeon/routines/EncryptIv.java new file mode 100644 index 0000000..52cf33f --- /dev/null +++ b/domain/src/main/generated/writeon/routines/EncryptIv.java @@ -0,0 +1,125 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class EncryptIv extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.encrypt_iv.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.encrypt_iv._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.encrypt_iv._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.encrypt_iv._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.BLOB, false, true); + + /** + * The parameter public.encrypt_iv._4. + */ + public static final Parameter _4 = Internal.createParameter("_4", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public EncryptIv() { + super("encrypt_iv", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + addInParameter(_4); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public EncryptIv set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public EncryptIv set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(byte[] value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public EncryptIv set__3(Field field) { + setField(_3, field); + return this; + } + + /** + * Set the _4 parameter IN value to the routine + */ + public void set__4(String value) { + setValue(_4, value); + } + + /** + * Set the _4 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public EncryptIv set__4(Field field) { + setField(_4, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/GenRandomBytes.java b/domain/src/main/generated/writeon/routines/GenRandomBytes.java new file mode 100644 index 0000000..db9124b --- /dev/null +++ b/domain/src/main/generated/writeon/routines/GenRandomBytes.java @@ -0,0 +1,59 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class GenRandomBytes extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.gen_random_bytes.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.gen_random_bytes._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.INTEGER, false, true); + + /** + * Create a new routine call instance + */ + public GenRandomBytes() { + super("gen_random_bytes", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(Integer value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public GenRandomBytes set__1(Field field) { + setField(_1, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/GenRandomUuid.java b/domain/src/main/generated/writeon/routines/GenRandomUuid.java new file mode 100644 index 0000000..a64820c --- /dev/null +++ b/domain/src/main/generated/writeon/routines/GenRandomUuid.java @@ -0,0 +1,38 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import java.util.UUID; + +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class GenRandomUuid extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.gen_random_uuid.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.UUID, false, false); + + /** + * Create a new routine call instance + */ + public GenRandomUuid() { + super("gen_random_uuid", Public.PUBLIC, SQLDataType.UUID); + + setReturnParameter(RETURN_VALUE); + } +} diff --git a/domain/src/main/generated/writeon/routines/GenSalt1.java b/domain/src/main/generated/writeon/routines/GenSalt1.java new file mode 100644 index 0000000..e07dad7 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/GenSalt1.java @@ -0,0 +1,60 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class GenSalt1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.gen_salt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.gen_salt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public GenSalt1() { + super("gen_salt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public GenSalt1 set__1(Field field) { + setField(_1, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/GenSalt2.java b/domain/src/main/generated/writeon/routines/GenSalt2.java new file mode 100644 index 0000000..b550f32 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/GenSalt2.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class GenSalt2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.gen_salt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.gen_salt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.gen_salt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.INTEGER, false, true); + + /** + * Create a new routine call instance + */ + public GenSalt2() { + super("gen_salt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public GenSalt2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(Integer value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public GenSalt2 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Hmac1.java b/domain/src/main/generated/writeon/routines/Hmac1.java new file mode 100644 index 0000000..cebb728 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Hmac1.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Hmac1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.hmac.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.hmac._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.hmac._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter public.hmac._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Hmac1() { + super("hmac", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Hmac1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Hmac1 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Hmac1 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/Hmac2.java b/domain/src/main/generated/writeon/routines/Hmac2.java new file mode 100644 index 0000000..843f386 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/Hmac2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Hmac2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.hmac.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.hmac._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.hmac._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.hmac._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public Hmac2() { + super("hmac", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Hmac2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Hmac2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public Hmac2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpKeyId.java b/domain/src/main/generated/writeon/routines/PgpKeyId.java new file mode 100644 index 0000000..d865377 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpKeyId.java @@ -0,0 +1,59 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpKeyId extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_key_id.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.pgp_key_id._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpKeyId() { + super("pgp_key_id", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpKeyId set__1(Field field) { + setField(_1, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubDecrypt1.java b/domain/src/main/generated/writeon/routines/PgpPubDecrypt1.java new file mode 100644 index 0000000..101b74d --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubDecrypt1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubDecrypt1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_decrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.pgp_pub_decrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubDecrypt1() { + super("pgp_pub_decrypt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubDecrypt2.java b/domain/src/main/generated/writeon/routines/PgpPubDecrypt2.java new file mode 100644 index 0000000..239c899 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubDecrypt2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubDecrypt2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_decrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.pgp_pub_decrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubDecrypt2() { + super("pgp_pub_decrypt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubDecrypt3.java b/domain/src/main/generated/writeon/routines/PgpPubDecrypt3.java new file mode 100644 index 0000000..ae09813 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubDecrypt3.java @@ -0,0 +1,126 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubDecrypt3 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_decrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.pgp_pub_decrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt._4. + */ + public static final Parameter _4 = Internal.createParameter("_4", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubDecrypt3() { + super("pgp_pub_decrypt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + addInParameter(_4); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt3 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt3 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt3 set__3(Field field) { + setField(_3, field); + return this; + } + + /** + * Set the _4 parameter IN value to the routine + */ + public void set__4(String value) { + setValue(_4, value); + } + + /** + * Set the _4 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecrypt3 set__4(Field field) { + setField(_4, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea1.java b/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea1.java new file mode 100644 index 0000000..3fe111b --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubDecryptBytea1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_decrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_decrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubDecryptBytea1() { + super("pgp_pub_decrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea2.java b/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea2.java new file mode 100644 index 0000000..4a8e919 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubDecryptBytea2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_decrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_decrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt_bytea._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubDecryptBytea2() { + super("pgp_pub_decrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea3.java b/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea3.java new file mode 100644 index 0000000..671282d --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubDecryptBytea3.java @@ -0,0 +1,126 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubDecryptBytea3 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_decrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_decrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt_bytea._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_pub_decrypt_bytea._4. + */ + public static final Parameter _4 = Internal.createParameter("_4", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubDecryptBytea3() { + super("pgp_pub_decrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + addInParameter(_4); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea3 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea3 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea3 set__3(Field field) { + setField(_3, field); + return this; + } + + /** + * Set the _4 parameter IN value to the routine + */ + public void set__4(String value) { + setValue(_4, value); + } + + /** + * Set the _4 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubDecryptBytea3 set__4(Field field) { + setField(_4, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubEncrypt1.java b/domain/src/main/generated/writeon/routines/PgpPubEncrypt1.java new file mode 100644 index 0000000..102680d --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubEncrypt1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubEncrypt1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_encrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_encrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_pub_encrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubEncrypt1() { + super("pgp_pub_encrypt", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncrypt1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncrypt1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubEncrypt2.java b/domain/src/main/generated/writeon/routines/PgpPubEncrypt2.java new file mode 100644 index 0000000..daf42ac --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubEncrypt2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubEncrypt2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_encrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_encrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_pub_encrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_encrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubEncrypt2() { + super("pgp_pub_encrypt", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncrypt2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncrypt2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncrypt2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubEncryptBytea1.java b/domain/src/main/generated/writeon/routines/PgpPubEncryptBytea1.java new file mode 100644 index 0000000..41f9da9 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubEncryptBytea1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubEncryptBytea1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_encrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_encrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_encrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubEncryptBytea1() { + super("pgp_pub_encrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncryptBytea1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncryptBytea1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpPubEncryptBytea2.java b/domain/src/main/generated/writeon/routines/PgpPubEncryptBytea2.java new file mode 100644 index 0000000..4248f15 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpPubEncryptBytea2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpPubEncryptBytea2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_pub_encrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_pub_encrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_encrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_pub_encrypt_bytea._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpPubEncryptBytea2() { + super("pgp_pub_encrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncryptBytea2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(byte[] value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncryptBytea2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpPubEncryptBytea2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymDecrypt1.java b/domain/src/main/generated/writeon/routines/PgpSymDecrypt1.java new file mode 100644 index 0000000..303ceae --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymDecrypt1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymDecrypt1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_decrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.pgp_sym_decrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_sym_decrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymDecrypt1() { + super("pgp_sym_decrypt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecrypt1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecrypt1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymDecrypt2.java b/domain/src/main/generated/writeon/routines/PgpSymDecrypt2.java new file mode 100644 index 0000000..35b2633 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymDecrypt2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymDecrypt2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_decrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.CLOB, false, false); + + /** + * The parameter public.pgp_sym_decrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_sym_decrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_sym_decrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymDecrypt2() { + super("pgp_sym_decrypt", Public.PUBLIC, SQLDataType.CLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecrypt2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecrypt2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecrypt2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymDecryptBytea1.java b/domain/src/main/generated/writeon/routines/PgpSymDecryptBytea1.java new file mode 100644 index 0000000..5febb59 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymDecryptBytea1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymDecryptBytea1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_decrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_sym_decrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_sym_decrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymDecryptBytea1() { + super("pgp_sym_decrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecryptBytea1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecryptBytea1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymDecryptBytea2.java b/domain/src/main/generated/writeon/routines/PgpSymDecryptBytea2.java new file mode 100644 index 0000000..a8da504 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymDecryptBytea2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymDecryptBytea2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_decrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_sym_decrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_sym_decrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_sym_decrypt_bytea._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymDecryptBytea2() { + super("pgp_sym_decrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecryptBytea2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecryptBytea2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymDecryptBytea2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymEncrypt1.java b/domain/src/main/generated/writeon/routines/PgpSymEncrypt1.java new file mode 100644 index 0000000..53c6df5 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymEncrypt1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymEncrypt1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_encrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_sym_encrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_sym_encrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymEncrypt1() { + super("pgp_sym_encrypt", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncrypt1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncrypt1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymEncrypt2.java b/domain/src/main/generated/writeon/routines/PgpSymEncrypt2.java new file mode 100644 index 0000000..883c799 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymEncrypt2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymEncrypt2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_encrypt.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_sym_encrypt._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_sym_encrypt._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_sym_encrypt._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymEncrypt2() { + super("pgp_sym_encrypt", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(String value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncrypt2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncrypt2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncrypt2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymEncryptBytea1.java b/domain/src/main/generated/writeon/routines/PgpSymEncryptBytea1.java new file mode 100644 index 0000000..d885f0b --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymEncryptBytea1.java @@ -0,0 +1,82 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymEncryptBytea1 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_encrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_sym_encrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_sym_encrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymEncryptBytea1() { + super("pgp_sym_encrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncryptBytea1 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncryptBytea1 set__2(Field field) { + setField(_2, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/routines/PgpSymEncryptBytea2.java b/domain/src/main/generated/writeon/routines/PgpSymEncryptBytea2.java new file mode 100644 index 0000000..5cdeca7 --- /dev/null +++ b/domain/src/main/generated/writeon/routines/PgpSymEncryptBytea2.java @@ -0,0 +1,104 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.routines; + + +import org.jooq.Field; +import org.jooq.Parameter; +import org.jooq.impl.AbstractRoutine; +import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; + +import writeon.Public; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpSymEncryptBytea2 extends AbstractRoutine { + + private static final long serialVersionUID = 1L; + + /** + * The parameter public.pgp_sym_encrypt_bytea.RETURN_VALUE. + */ + public static final Parameter RETURN_VALUE = Internal.createParameter("RETURN_VALUE", SQLDataType.BLOB, false, false); + + /** + * The parameter public.pgp_sym_encrypt_bytea._1. + */ + public static final Parameter _1 = Internal.createParameter("_1", SQLDataType.BLOB, false, true); + + /** + * The parameter public.pgp_sym_encrypt_bytea._2. + */ + public static final Parameter _2 = Internal.createParameter("_2", SQLDataType.CLOB, false, true); + + /** + * The parameter public.pgp_sym_encrypt_bytea._3. + */ + public static final Parameter _3 = Internal.createParameter("_3", SQLDataType.CLOB, false, true); + + /** + * Create a new routine call instance + */ + public PgpSymEncryptBytea2() { + super("pgp_sym_encrypt_bytea", Public.PUBLIC, SQLDataType.BLOB); + + setReturnParameter(RETURN_VALUE); + addInParameter(_1); + addInParameter(_2); + addInParameter(_3); + setOverloaded(true); + } + + /** + * Set the _1 parameter IN value to the routine + */ + public void set__1(byte[] value) { + setValue(_1, value); + } + + /** + * Set the _1 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncryptBytea2 set__1(Field field) { + setField(_1, field); + return this; + } + + /** + * Set the _2 parameter IN value to the routine + */ + public void set__2(String value) { + setValue(_2, value); + } + + /** + * Set the _2 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncryptBytea2 set__2(Field field) { + setField(_2, field); + return this; + } + + /** + * Set the _3 parameter IN value to the routine + */ + public void set__3(String value) { + setValue(_3, value); + } + + /** + * Set the _3 parameter to the function to be used with a + * {@link org.jooq.Select} statement + */ + public PgpSymEncryptBytea2 set__3(Field field) { + setField(_3, field); + return this; + } +} diff --git a/domain/src/main/generated/writeon/tables/Assistant.java b/domain/src/main/generated/writeon/tables/Assistant.java new file mode 100644 index 0000000..fd05d2f --- /dev/null +++ b/domain/src/main/generated/writeon/tables/Assistant.java @@ -0,0 +1,255 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.AssistantRecord; + + +/** + * 어시스턴트 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Assistant extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.assistant + */ + public static final Assistant ASSISTANT = new Assistant(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AssistantRecord.class; + } + + /** + * The column public.assistant.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column public.assistant.product_id. 작품 ID + */ + public final TableField PRODUCT_ID = createField(DSL.name("product_id"), SQLDataType.UUID.nullable(false), this, "작품 ID"); + + /** + * The column public.assistant.type. 기능 종류 + */ + public final TableField TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR(20).nullable(false), this, "기능 종류"); + + /** + * The column public.assistant.status. 진행 상태 + */ + public final TableField STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR(20).nullable(false), this, "진행 상태"); + + /** + * The column public.assistant.is_applied. 진행 상태 + */ + public final TableField IS_APPLIED = createField(DSL.name("is_applied"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "진행 상태"); + + /** + * The column public.assistant.created_at. 수정일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.assistant.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.assistant.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + private Assistant(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private Assistant(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("어시스턴트"), TableOptions.table(), where); + } + + /** + * Create an aliased public.assistant table reference + */ + public Assistant(String alias) { + this(DSL.name(alias), ASSISTANT); + } + + /** + * Create an aliased public.assistant table reference + */ + public Assistant(Name alias) { + this(alias, ASSISTANT); + } + + /** + * Create a public.assistant table reference + */ + public Assistant() { + this(DSL.name("assistant"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ASSISTANT_PK; + } + + @Override + public Assistant as(String alias) { + return new Assistant(DSL.name(alias), this); + } + + @Override + public Assistant as(Name alias) { + return new Assistant(alias, this); + } + + @Override + public Assistant as(Table alias) { + return new Assistant(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Assistant rename(String name) { + return new Assistant(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Assistant rename(Name name) { + return new Assistant(name, null); + } + + /** + * Rename this table + */ + @Override + public Assistant rename(Table name) { + return new Assistant(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Assistant where(Condition condition) { + return new Assistant(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Assistant where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Assistant where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Assistant where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Assistant where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Assistant where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Assistant where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Assistant where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Assistant whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Assistant whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/AssistantEvaluation.java b/domain/src/main/generated/writeon/tables/AssistantEvaluation.java new file mode 100644 index 0000000..d304498 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/AssistantEvaluation.java @@ -0,0 +1,243 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.AssistantEvaluationRecord; + + +/** + * 어시스턴트 평가 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantEvaluation extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.assistant_evaluation + */ + public static final AssistantEvaluation ASSISTANT_EVALUATION = new AssistantEvaluation(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AssistantEvaluationRecord.class; + } + + /** + * The column public.assistant_evaluation.assistant_id. 어시스턴트 + * ID + */ + public final TableField ASSISTANT_ID = createField(DSL.name("assistant_id"), SQLDataType.UUID.nullable(false), this, "어시스턴트 ID"); + + /** + * The column public.assistant_evaluation.is_good. 만족 여부 + */ + public final TableField IS_GOOD = createField(DSL.name("is_good"), SQLDataType.BOOLEAN.nullable(false), this, "만족 여부"); + + /** + * The column public.assistant_evaluation.feedback. 피드백 + */ + public final TableField FEEDBACK = createField(DSL.name("feedback"), SQLDataType.VARCHAR(255), this, "피드백"); + + /** + * The column public.assistant_evaluation.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.assistant_evaluation.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + private AssistantEvaluation(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private AssistantEvaluation(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("어시스턴트 평가"), TableOptions.table(), where); + } + + /** + * Create an aliased public.assistant_evaluation table + * reference + */ + public AssistantEvaluation(String alias) { + this(DSL.name(alias), ASSISTANT_EVALUATION); + } + + /** + * Create an aliased public.assistant_evaluation table + * reference + */ + public AssistantEvaluation(Name alias) { + this(alias, ASSISTANT_EVALUATION); + } + + /** + * Create a public.assistant_evaluation table reference + */ + public AssistantEvaluation() { + this(DSL.name("assistant_evaluation"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ASSISTANT_EVALUATION_PK; + } + + @Override + public AssistantEvaluation as(String alias) { + return new AssistantEvaluation(DSL.name(alias), this); + } + + @Override + public AssistantEvaluation as(Name alias) { + return new AssistantEvaluation(alias, this); + } + + @Override + public AssistantEvaluation as(Table alias) { + return new AssistantEvaluation(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AssistantEvaluation rename(String name) { + return new AssistantEvaluation(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AssistantEvaluation rename(Name name) { + return new AssistantEvaluation(name, null); + } + + /** + * Rename this table + */ + @Override + public AssistantEvaluation rename(Table name) { + return new AssistantEvaluation(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantEvaluation where(Condition condition) { + return new AssistantEvaluation(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantEvaluation where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantEvaluation where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantEvaluation where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantEvaluation where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantEvaluation where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantEvaluation where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantEvaluation where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantEvaluation whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantEvaluation whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/AssistantMessage.java b/domain/src/main/generated/writeon/tables/AssistantMessage.java new file mode 100644 index 0000000..c0c75f2 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/AssistantMessage.java @@ -0,0 +1,250 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.AssistantMessageRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantMessage extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.assistant_message + */ + public static final AssistantMessage ASSISTANT_MESSAGE = new AssistantMessage(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AssistantMessageRecord.class; + } + + /** + * The column public.assistant_message.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, ""); + + /** + * The column public.assistant_message.assistant_id. + */ + public final TableField ASSISTANT_ID = createField(DSL.name("assistant_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column public.assistant_message.role. + */ + public final TableField ROLE = createField(DSL.name("role"), SQLDataType.VARCHAR(10).nullable(false), this, ""); + + /** + * The column public.assistant_message.content. + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB, this, ""); + + /** + * The column public.assistant_message.prompt. + */ + public final TableField PROMPT = createField(DSL.name("prompt"), SQLDataType.CLOB, this, ""); + + /** + * The column public.assistant_message.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + /** + * The column public.assistant_message.created_by. + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, ""); + + private AssistantMessage(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private AssistantMessage(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); + } + + /** + * Create an aliased public.assistant_message table reference + */ + public AssistantMessage(String alias) { + this(DSL.name(alias), ASSISTANT_MESSAGE); + } + + /** + * Create an aliased public.assistant_message table reference + */ + public AssistantMessage(Name alias) { + this(alias, ASSISTANT_MESSAGE); + } + + /** + * Create a public.assistant_message table reference + */ + public AssistantMessage() { + this(DSL.name("assistant_message"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ASSISTANT_MESSAGE_PK; + } + + @Override + public AssistantMessage as(String alias) { + return new AssistantMessage(DSL.name(alias), this); + } + + @Override + public AssistantMessage as(Name alias) { + return new AssistantMessage(alias, this); + } + + @Override + public AssistantMessage as(Table alias) { + return new AssistantMessage(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AssistantMessage rename(String name) { + return new AssistantMessage(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AssistantMessage rename(Name name) { + return new AssistantMessage(name, null); + } + + /** + * Rename this table + */ + @Override + public AssistantMessage rename(Table name) { + return new AssistantMessage(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantMessage where(Condition condition) { + return new AssistantMessage(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantMessage where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantMessage where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantMessage where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantMessage where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantMessage where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantMessage where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantMessage where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantMessage whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantMessage whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/AssistantPlannerMessage.java b/domain/src/main/generated/writeon/tables/AssistantPlannerMessage.java new file mode 100644 index 0000000..a4284df --- /dev/null +++ b/domain/src/main/generated/writeon/tables/AssistantPlannerMessage.java @@ -0,0 +1,236 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.AssistantPlannerMessageRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantPlannerMessage extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.assistant_planner_message + */ + public static final AssistantPlannerMessage ASSISTANT_PLANNER_MESSAGE = new AssistantPlannerMessage(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AssistantPlannerMessageRecord.class; + } + + /** + * The column public.assistant_planner_message.assistant_id. + */ + public final TableField ASSISTANT_ID = createField(DSL.name("assistant_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column public.assistant_planner_message.genre. + */ + public final TableField GENRE = createField(DSL.name("genre"), SQLDataType.VARCHAR(30).nullable(false), this, ""); + + /** + * The column public.assistant_planner_message.logline. + */ + public final TableField LOGLINE = createField(DSL.name("logline"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.assistant_planner_message.section. + */ + public final TableField SECTION = createField(DSL.name("section"), SQLDataType.VARCHAR(30).nullable(false), this, ""); + + private AssistantPlannerMessage(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private AssistantPlannerMessage(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); + } + + /** + * Create an aliased public.assistant_planner_message table + * reference + */ + public AssistantPlannerMessage(String alias) { + this(DSL.name(alias), ASSISTANT_PLANNER_MESSAGE); + } + + /** + * Create an aliased public.assistant_planner_message table + * reference + */ + public AssistantPlannerMessage(Name alias) { + this(alias, ASSISTANT_PLANNER_MESSAGE); + } + + /** + * Create a public.assistant_planner_message table reference + */ + public AssistantPlannerMessage() { + this(DSL.name("assistant_planner_message"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ASSISTANT_PLANNER_MESSAGE_PK; + } + + @Override + public AssistantPlannerMessage as(String alias) { + return new AssistantPlannerMessage(DSL.name(alias), this); + } + + @Override + public AssistantPlannerMessage as(Name alias) { + return new AssistantPlannerMessage(alias, this); + } + + @Override + public AssistantPlannerMessage as(Table alias) { + return new AssistantPlannerMessage(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public AssistantPlannerMessage rename(String name) { + return new AssistantPlannerMessage(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AssistantPlannerMessage rename(Name name) { + return new AssistantPlannerMessage(name, null); + } + + /** + * Rename this table + */ + @Override + public AssistantPlannerMessage rename(Table name) { + return new AssistantPlannerMessage(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantPlannerMessage where(Condition condition) { + return new AssistantPlannerMessage(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantPlannerMessage where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantPlannerMessage where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantPlannerMessage where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantPlannerMessage where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantPlannerMessage where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantPlannerMessage where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public AssistantPlannerMessage where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantPlannerMessage whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public AssistantPlannerMessage whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/LoginAttempt.java b/domain/src/main/generated/writeon/tables/LoginAttempt.java new file mode 100644 index 0000000..97af241 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/LoginAttempt.java @@ -0,0 +1,240 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.OffsetDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.LoginAttemptRecord; + + +/** + * 로그인_시도 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class LoginAttempt extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.login_attempt + */ + public static final LoginAttempt LOGIN_ATTEMPT = new LoginAttempt(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return LoginAttemptRecord.class; + } + + /** + * The column public.login_attempt.id. 로그인 시도 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "로그인 시도 ID"); + + /** + * The column public.login_attempt.email. 로그인 시도한 이메일 + */ + public final TableField EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255).nullable(false), this, "로그인 시도한 이메일"); + + /** + * The column public.login_attempt.result. 로그인 시도 후 결과 + */ + public final TableField RESULT = createField(DSL.name("result"), SQLDataType.VARCHAR(10).nullable(false), this, "로그인 시도 후 결과"); + + /** + * The column public.login_attempt.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column public.login_attempt.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private LoginAttempt(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private LoginAttempt(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("로그인_시도"), TableOptions.table(), where); + } + + /** + * Create an aliased public.login_attempt table reference + */ + public LoginAttempt(String alias) { + this(DSL.name(alias), LOGIN_ATTEMPT); + } + + /** + * Create an aliased public.login_attempt table reference + */ + public LoginAttempt(Name alias) { + this(alias, LOGIN_ATTEMPT); + } + + /** + * Create a public.login_attempt table reference + */ + public LoginAttempt() { + this(DSL.name("login_attempt"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LOGIN_ATTEMPT_PK; + } + + @Override + public LoginAttempt as(String alias) { + return new LoginAttempt(DSL.name(alias), this); + } + + @Override + public LoginAttempt as(Name alias) { + return new LoginAttempt(alias, this); + } + + @Override + public LoginAttempt as(Table alias) { + return new LoginAttempt(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public LoginAttempt rename(String name) { + return new LoginAttempt(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public LoginAttempt rename(Name name) { + return new LoginAttempt(name, null); + } + + /** + * Rename this table + */ + @Override + public LoginAttempt rename(Table name) { + return new LoginAttempt(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public LoginAttempt where(Condition condition) { + return new LoginAttempt(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public LoginAttempt where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public LoginAttempt where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public LoginAttempt where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public LoginAttempt where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public LoginAttempt where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public LoginAttempt where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public LoginAttempt where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public LoginAttempt whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public LoginAttempt whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/Member.java b/domain/src/main/generated/writeon/tables/Member.java new file mode 100644 index 0000000..c4672fc --- /dev/null +++ b/domain/src/main/generated/writeon/tables/Member.java @@ -0,0 +1,252 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.MemberRecord; + + +/** + * 회원 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Member extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.member + */ + public static final Member MEMBER = new Member(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return MemberRecord.class; + } + + /** + * The column public.member.id. 회원 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "회원 ID"); + + /** + * The column public.member.email. 회원 이메일 + */ + public final TableField EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255).nullable(false), this, "회원 이메일"); + + /** + * The column public.member.nickname. 회원 닉네임 + */ + public final TableField NICKNAME = createField(DSL.name("nickname"), SQLDataType.VARCHAR(20).nullable(false), this, "회원 닉네임"); + + /** + * The column public.member.profile_image. 회원 프로필 이미지 경로 + */ + public final TableField PROFILE_IMAGE = createField(DSL.name("profile_image"), SQLDataType.VARCHAR(255), this, "회원 프로필 이미지 경로"); + + /** + * The column public.member.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column public.member.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private Member(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private Member(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("회원"), TableOptions.table(), where); + } + + /** + * Create an aliased public.member table reference + */ + public Member(String alias) { + this(DSL.name(alias), MEMBER); + } + + /** + * Create an aliased public.member table reference + */ + public Member(Name alias) { + this(alias, MEMBER); + } + + /** + * Create a public.member table reference + */ + public Member() { + this(DSL.name("member"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.MEMBER_PK; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.EMAIL_UK, Keys.NICKNAME_UK); + } + + @Override + public Member as(String alias) { + return new Member(DSL.name(alias), this); + } + + @Override + public Member as(Name alias) { + return new Member(alias, this); + } + + @Override + public Member as(Table alias) { + return new Member(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Member rename(String name) { + return new Member(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Member rename(Name name) { + return new Member(name, null); + } + + /** + * Rename this table + */ + @Override + public Member rename(Table name) { + return new Member(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Member where(Condition condition) { + return new Member(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Member where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Member where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Member where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Member where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Member where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Member where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Member where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Member whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Member whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/MemberPassword.java b/domain/src/main/generated/writeon/tables/MemberPassword.java new file mode 100644 index 0000000..61f2d8f --- /dev/null +++ b/domain/src/main/generated/writeon/tables/MemberPassword.java @@ -0,0 +1,235 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.OffsetDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.MemberPasswordRecord; + + +/** + * 회원_비밀번호 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class MemberPassword extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.member_password + */ + public static final MemberPassword MEMBER_PASSWORD = new MemberPassword(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return MemberPasswordRecord.class; + } + + /** + * The column public.member_password.member_id. 회원 ID + */ + public final TableField MEMBER_ID = createField(DSL.name("member_id"), SQLDataType.UUID.nullable(false), this, "회원 ID"); + + /** + * The column public.member_password.password. 회원 비밀번호 + */ + public final TableField PASSWORD = createField(DSL.name("password"), SQLDataType.VARCHAR(128).nullable(false), this, "회원 비밀번호"); + + /** + * The column public.member_password.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column public.member_password.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private MemberPassword(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private MemberPassword(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("회원_비밀번호"), TableOptions.table(), where); + } + + /** + * Create an aliased public.member_password table reference + */ + public MemberPassword(String alias) { + this(DSL.name(alias), MEMBER_PASSWORD); + } + + /** + * Create an aliased public.member_password table reference + */ + public MemberPassword(Name alias) { + this(alias, MEMBER_PASSWORD); + } + + /** + * Create a public.member_password table reference + */ + public MemberPassword() { + this(DSL.name("member_password"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.MEMBER_PASSWORD_PK; + } + + @Override + public MemberPassword as(String alias) { + return new MemberPassword(DSL.name(alias), this); + } + + @Override + public MemberPassword as(Name alias) { + return new MemberPassword(alias, this); + } + + @Override + public MemberPassword as(Table alias) { + return new MemberPassword(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public MemberPassword rename(String name) { + return new MemberPassword(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public MemberPassword rename(Name name) { + return new MemberPassword(name, null); + } + + /** + * Rename this table + */ + @Override + public MemberPassword rename(Table name) { + return new MemberPassword(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public MemberPassword where(Condition condition) { + return new MemberPassword(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public MemberPassword where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public MemberPassword where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public MemberPassword where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public MemberPassword where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public MemberPassword where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public MemberPassword where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public MemberPassword where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public MemberPassword whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public MemberPassword whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/PgpArmorHeaders.java b/domain/src/main/generated/writeon/tables/PgpArmorHeaders.java new file mode 100644 index 0000000..d99e0bb --- /dev/null +++ b/domain/src/main/generated/writeon/tables/PgpArmorHeaders.java @@ -0,0 +1,157 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Public; +import writeon.tables.records.PgpArmorHeadersRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpArmorHeaders extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.pgp_armor_headers + */ + public static final PgpArmorHeaders PGP_ARMOR_HEADERS = new PgpArmorHeaders(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return PgpArmorHeadersRecord.class; + } + + /** + * The column public.pgp_armor_headers.key. + */ + public final TableField KEY = createField(DSL.name("key"), SQLDataType.CLOB, this, ""); + + /** + * The column public.pgp_armor_headers.value. + */ + public final TableField VALUE = createField(DSL.name("value"), SQLDataType.CLOB, this, ""); + + private PgpArmorHeaders(Name alias, Table aliased) { + this(alias, aliased, new Field[] { + DSL.val(null, SQLDataType.CLOB) + }); + } + + private PgpArmorHeaders(Name alias, Table aliased, Field[] parameters) { + this(alias, aliased, parameters, null); + } + + private PgpArmorHeaders(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); + } + + /** + * Create an aliased public.pgp_armor_headers table reference + */ + public PgpArmorHeaders(String alias) { + this(DSL.name(alias), PGP_ARMOR_HEADERS); + } + + /** + * Create an aliased public.pgp_armor_headers table reference + */ + public PgpArmorHeaders(Name alias) { + this(alias, PGP_ARMOR_HEADERS); + } + + /** + * Create a public.pgp_armor_headers table reference + */ + public PgpArmorHeaders() { + this(DSL.name("pgp_armor_headers"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public PgpArmorHeaders as(String alias) { + return new PgpArmorHeaders(DSL.name(alias), this, parameters); + } + + @Override + public PgpArmorHeaders as(Name alias) { + return new PgpArmorHeaders(alias, this, parameters); + } + + @Override + public PgpArmorHeaders as(Table alias) { + return new PgpArmorHeaders(alias.getQualifiedName(), this, parameters); + } + + /** + * Rename this table + */ + @Override + public PgpArmorHeaders rename(String name) { + return new PgpArmorHeaders(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public PgpArmorHeaders rename(Name name) { + return new PgpArmorHeaders(name, null, parameters); + } + + /** + * Rename this table + */ + @Override + public PgpArmorHeaders rename(Table name) { + return new PgpArmorHeaders(name.getQualifiedName(), null, parameters); + } + + /** + * Call this table-valued function + */ + public PgpArmorHeaders call( + String __1 + ) { + PgpArmorHeaders result = new PgpArmorHeaders(DSL.name("pgp_armor_headers"), null, new Field[] { + DSL.val(__1, SQLDataType.CLOB) + }); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } + + /** + * Call this table-valued function + */ + public PgpArmorHeaders call( + Field __1 + ) { + PgpArmorHeaders result = new PgpArmorHeaders(DSL.name("pgp_armor_headers"), null, new Field[] { + __1 + }); + + return aliased() ? result.as(getUnqualifiedName()) : result; + } +} diff --git a/domain/src/main/generated/writeon/tables/Product.java b/domain/src/main/generated/writeon/tables/Product.java new file mode 100644 index 0000000..8c66d01 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/Product.java @@ -0,0 +1,301 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.InverseForeignKey; +import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.Record; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.ProductFixedMessage.ProductFixedMessagePath; +import writeon.tables.records.ProductRecord; + + +/** + * 작품 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Product extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product + */ + public static final Product PRODUCT = new Product(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductRecord.class; + } + + /** + * The column public.product.id. 작품 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "작품 ID"); + + /** + * The column public.product.title. 제목 + */ + public final TableField TITLE = createField(DSL.name("title"), SQLDataType.VARCHAR(50), this, "제목"); + + /** + * The column public.product.content. 내용 + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB, this, "내용"); + + /** + * The column public.product.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + private Product(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private Product(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product table reference + */ + public Product(String alias) { + this(DSL.name(alias), PRODUCT); + } + + /** + * Create an aliased public.product table reference + */ + public Product(Name alias) { + this(alias, PRODUCT); + } + + /** + * Create a public.product table reference + */ + public Product() { + this(DSL.name("product"), null); + } + + public Product(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PRODUCT); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class ProductPath extends Product implements Path { + + private static final long serialVersionUID = 1L; + public ProductPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private ProductPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public ProductPath as(String alias) { + return new ProductPath(DSL.name(alias), this); + } + + @Override + public ProductPath as(Name alias) { + return new ProductPath(alias, this); + } + + @Override + public ProductPath as(Table alias) { + return new ProductPath(alias.getQualifiedName(), this); + } + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_PK; + } + + private transient ProductFixedMessagePath _productFixedMessage; + + /** + * Get the implicit to-many join path to the + * public.product_fixed_message table + */ + public ProductFixedMessagePath productFixedMessage() { + if (_productFixedMessage == null) + _productFixedMessage = new ProductFixedMessagePath(this, null, Keys.PRODUCT_FIXED_MESSAGE__FK_PRODUCT.getInverseKey()); + + return _productFixedMessage; + } + + @Override + public Product as(String alias) { + return new Product(DSL.name(alias), this); + } + + @Override + public Product as(Name alias) { + return new Product(alias, this); + } + + @Override + public Product as(Table alias) { + return new Product(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Product rename(String name) { + return new Product(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Product rename(Name name) { + return new Product(name, null); + } + + /** + * Rename this table + */ + @Override + public Product rename(Table name) { + return new Product(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Product where(Condition condition) { + return new Product(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Product where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Product where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Product where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Product where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Product where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Product where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Product where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Product whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Product whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductCharacter.java b/domain/src/main/generated/writeon/tables/ProductCharacter.java new file mode 100644 index 0000000..2cd41b5 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductCharacter.java @@ -0,0 +1,290 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductCharacterRecord; + + +/** + * 작품 등장인물 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductCharacter extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_character + */ + public static final ProductCharacter PRODUCT_CHARACTER = new ProductCharacter(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductCharacterRecord.class; + } + + /** + * The column public.product_character.id. 등장인물 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "등장인물 ID"); + + /** + * The column public.product_character.product_id. 작품 ID + */ + public final TableField PRODUCT_ID = createField(DSL.name("product_id"), SQLDataType.UUID.nullable(false), this, "작품 ID"); + + /** + * The column public.product_character.intro. 소개 + */ + public final TableField INTRO = createField(DSL.name("intro"), SQLDataType.CLOB, this, "소개"); + + /** + * The column public.product_character.name. 이름 + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(50), this, "이름"); + + /** + * The column public.product_character.age. 나이 + */ + public final TableField AGE = createField(DSL.name("age"), SQLDataType.INTEGER, this, "나이"); + + /** + * The column public.product_character.gender. 성별 + */ + public final TableField GENDER = createField(DSL.name("gender"), SQLDataType.VARCHAR(10), this, "성별"); + + /** + * The column public.product_character.occupation. 직업 + */ + public final TableField OCCUPATION = createField(DSL.name("occupation"), SQLDataType.CLOB, this, "직업"); + + /** + * The column public.product_character.appearance. 외모 + */ + public final TableField APPEARANCE = createField(DSL.name("appearance"), SQLDataType.CLOB, this, "외모"); + + /** + * The column public.product_character.personality. 성격 + */ + public final TableField PERSONALITY = createField(DSL.name("personality"), SQLDataType.CLOB, this, "성격"); + + /** + * The column public.product_character.relationship. 주요 관계 + */ + public final TableField RELATIONSHIP = createField(DSL.name("relationship"), SQLDataType.CLOB, this, "주요 관계"); + + /** + * The column public.product_character.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_character.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_character.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_character.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + /** + * The column public.product_character.seq. + */ + public final TableField SEQ = createField(DSL.name("seq"), SQLDataType.INTEGER.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, ""); + + private ProductCharacter(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductCharacter(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품 등장인물"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_character table reference + */ + public ProductCharacter(String alias) { + this(DSL.name(alias), PRODUCT_CHARACTER); + } + + /** + * Create an aliased public.product_character table reference + */ + public ProductCharacter(Name alias) { + this(alias, PRODUCT_CHARACTER); + } + + /** + * Create a public.product_character table reference + */ + public ProductCharacter() { + this(DSL.name("product_character"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_CHARACTER_PK; + } + + @Override + public ProductCharacter as(String alias) { + return new ProductCharacter(DSL.name(alias), this); + } + + @Override + public ProductCharacter as(Name alias) { + return new ProductCharacter(alias, this); + } + + @Override + public ProductCharacter as(Table alias) { + return new ProductCharacter(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductCharacter rename(String name) { + return new ProductCharacter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductCharacter rename(Name name) { + return new ProductCharacter(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductCharacter rename(Table name) { + return new ProductCharacter(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCharacter where(Condition condition) { + return new ProductCharacter(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCharacter where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCharacter where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCharacter where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCharacter where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCharacter where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCharacter where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCharacter where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCharacter whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCharacter whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductCustomField.java b/domain/src/main/generated/writeon/tables/ProductCustomField.java new file mode 100644 index 0000000..5d7af12 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductCustomField.java @@ -0,0 +1,272 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductCustomFieldRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductCustomField extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_custom_field + */ + public static final ProductCustomField PRODUCT_CUSTOM_FIELD = new ProductCustomField(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductCustomFieldRecord.class; + } + + /** + * The column public.product_custom_field.id. 커스텀 필드 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "커스텀 필드 ID"); + + /** + * The column public.product_custom_field.product_id. 작품 ID + */ + public final TableField PRODUCT_ID = createField(DSL.name("product_id"), SQLDataType.UUID.nullable(false), this, "작품 ID"); + + /** + * The column public.product_custom_field.section_id. 섹션 ID + */ + public final TableField SECTION_ID = createField(DSL.name("section_id"), SQLDataType.UUID.nullable(false), this, "섹션 ID"); + + /** + * The column public.product_custom_field.section_type. 섹션 타입 + */ + public final TableField SECTION_TYPE = createField(DSL.name("section_type"), SQLDataType.VARCHAR(20).nullable(false), this, "섹션 타입"); + + /** + * The column public.product_custom_field.name. 이름 + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(30).nullable(false), this, "이름"); + + /** + * The column public.product_custom_field.content. 내용 + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB.nullable(false), this, "내용"); + + /** + * The column public.product_custom_field.seq. 순서 + */ + public final TableField SEQ = createField(DSL.name("seq"), SQLDataType.SMALLINT.nullable(false), this, "순서"); + + /** + * The column public.product_custom_field.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_custom_field.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_custom_field.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_custom_field.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + private ProductCustomField(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductCustomField(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_custom_field table + * reference + */ + public ProductCustomField(String alias) { + this(DSL.name(alias), PRODUCT_CUSTOM_FIELD); + } + + /** + * Create an aliased public.product_custom_field table + * reference + */ + public ProductCustomField(Name alias) { + this(alias, PRODUCT_CUSTOM_FIELD); + } + + /** + * Create a public.product_custom_field table reference + */ + public ProductCustomField() { + this(DSL.name("product_custom_field"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_CUSTOM_FIELD_PK; + } + + @Override + public ProductCustomField as(String alias) { + return new ProductCustomField(DSL.name(alias), this); + } + + @Override + public ProductCustomField as(Name alias) { + return new ProductCustomField(alias, this); + } + + @Override + public ProductCustomField as(Table alias) { + return new ProductCustomField(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductCustomField rename(String name) { + return new ProductCustomField(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductCustomField rename(Name name) { + return new ProductCustomField(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductCustomField rename(Table name) { + return new ProductCustomField(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCustomField where(Condition condition) { + return new ProductCustomField(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCustomField where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCustomField where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCustomField where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCustomField where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCustomField where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCustomField where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductCustomField where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCustomField whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductCustomField whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductFavoritePrompt.java b/domain/src/main/generated/writeon/tables/ProductFavoritePrompt.java new file mode 100644 index 0000000..291aa0e --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductFavoritePrompt.java @@ -0,0 +1,246 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Indexes; +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductFavoritePromptRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductFavoritePrompt extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_favorite_prompt + */ + public static final ProductFavoritePrompt PRODUCT_FAVORITE_PROMPT = new ProductFavoritePrompt(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductFavoritePromptRecord.class; + } + + /** + * The column public.product_favorite_prompt.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, ""); + + /** + * The column public.product_favorite_prompt.product_id. + */ + public final TableField PRODUCT_ID = createField(DSL.name("product_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column public.product_favorite_prompt.message_id. + */ + public final TableField MESSAGE_ID = createField(DSL.name("message_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column public.product_favorite_prompt.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + private ProductFavoritePrompt(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductFavoritePrompt(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_favorite_prompt table + * reference + */ + public ProductFavoritePrompt(String alias) { + this(DSL.name(alias), PRODUCT_FAVORITE_PROMPT); + } + + /** + * Create an aliased public.product_favorite_prompt table + * reference + */ + public ProductFavoritePrompt(Name alias) { + this(alias, PRODUCT_FAVORITE_PROMPT); + } + + /** + * Create a public.product_favorite_prompt table reference + */ + public ProductFavoritePrompt() { + this(DSL.name("product_favorite_prompt"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.IDX_PROMPT_PRODUCT_ID); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_FAVORITE_PROMPT_PK; + } + + @Override + public ProductFavoritePrompt as(String alias) { + return new ProductFavoritePrompt(DSL.name(alias), this); + } + + @Override + public ProductFavoritePrompt as(Name alias) { + return new ProductFavoritePrompt(alias, this); + } + + @Override + public ProductFavoritePrompt as(Table alias) { + return new ProductFavoritePrompt(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductFavoritePrompt rename(String name) { + return new ProductFavoritePrompt(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductFavoritePrompt rename(Name name) { + return new ProductFavoritePrompt(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductFavoritePrompt rename(Table name) { + return new ProductFavoritePrompt(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFavoritePrompt where(Condition condition) { + return new ProductFavoritePrompt(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFavoritePrompt where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFavoritePrompt where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFavoritePrompt where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFavoritePrompt where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFavoritePrompt where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFavoritePrompt where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFavoritePrompt where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFavoritePrompt whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFavoritePrompt whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductFixedMessage.java b/domain/src/main/generated/writeon/tables/ProductFixedMessage.java new file mode 100644 index 0000000..ec41b1c --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductFixedMessage.java @@ -0,0 +1,283 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.InverseForeignKey; +import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.Record; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.Product.ProductPath; +import writeon.tables.records.ProductFixedMessageRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductFixedMessage extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_fixed_message + */ + public static final ProductFixedMessage PRODUCT_FIXED_MESSAGE = new ProductFixedMessage(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductFixedMessageRecord.class; + } + + /** + * The column public.product_fixed_message.product_id. + */ + public final TableField PRODUCT_ID = createField(DSL.name("product_id"), SQLDataType.UUID.nullable(false), this, ""); + + /** + * The column public.product_fixed_message.message_id. + */ + public final TableField MESSAGE_ID = createField(DSL.name("message_id"), SQLDataType.UUID.nullable(false), this, ""); + + private ProductFixedMessage(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductFixedMessage(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_fixed_message table + * reference + */ + public ProductFixedMessage(String alias) { + this(DSL.name(alias), PRODUCT_FIXED_MESSAGE); + } + + /** + * Create an aliased public.product_fixed_message table + * reference + */ + public ProductFixedMessage(Name alias) { + this(alias, PRODUCT_FIXED_MESSAGE); + } + + /** + * Create a public.product_fixed_message table reference + */ + public ProductFixedMessage() { + this(DSL.name("product_fixed_message"), null); + } + + public ProductFixedMessage(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PRODUCT_FIXED_MESSAGE); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class ProductFixedMessagePath extends ProductFixedMessage implements Path { + + private static final long serialVersionUID = 1L; + public ProductFixedMessagePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private ProductFixedMessagePath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public ProductFixedMessagePath as(String alias) { + return new ProductFixedMessagePath(DSL.name(alias), this); + } + + @Override + public ProductFixedMessagePath as(Name alias) { + return new ProductFixedMessagePath(alias, this); + } + + @Override + public ProductFixedMessagePath as(Table alias) { + return new ProductFixedMessagePath(alias.getQualifiedName(), this); + } + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_FIXED_MESSAGE_PKEY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.PRODUCT_FIXED_MESSAGE__FK_PRODUCT); + } + + private transient ProductPath _product; + + /** + * Get the implicit join path to the public.product table. + */ + public ProductPath product() { + if (_product == null) + _product = new ProductPath(this, Keys.PRODUCT_FIXED_MESSAGE__FK_PRODUCT, null); + + return _product; + } + + @Override + public ProductFixedMessage as(String alias) { + return new ProductFixedMessage(DSL.name(alias), this); + } + + @Override + public ProductFixedMessage as(Name alias) { + return new ProductFixedMessage(alias, this); + } + + @Override + public ProductFixedMessage as(Table alias) { + return new ProductFixedMessage(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductFixedMessage rename(String name) { + return new ProductFixedMessage(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductFixedMessage rename(Name name) { + return new ProductFixedMessage(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductFixedMessage rename(Table name) { + return new ProductFixedMessage(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFixedMessage where(Condition condition) { + return new ProductFixedMessage(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFixedMessage where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFixedMessage where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFixedMessage where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFixedMessage where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFixedMessage where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFixedMessage where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductFixedMessage where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFixedMessage whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductFixedMessage whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductIdeanote.java b/domain/src/main/generated/writeon/tables/ProductIdeanote.java new file mode 100644 index 0000000..2354d2e --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductIdeanote.java @@ -0,0 +1,250 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductIdeanoteRecord; + + +/** + * 작품 아이디어 노트 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductIdeanote extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_ideanote + */ + public static final ProductIdeanote PRODUCT_IDEANOTE = new ProductIdeanote(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductIdeanoteRecord.class; + } + + /** + * The column public.product_ideanote.id. 아이디어 노트 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "아이디어 노트 ID"); + + /** + * The column public.product_ideanote.title. 제목 + */ + public final TableField TITLE = createField(DSL.name("title"), SQLDataType.VARCHAR(100).nullable(false), this, "제목"); + + /** + * The column public.product_ideanote.content. 내용 + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB.nullable(false), this, "내용"); + + /** + * The column public.product_ideanote.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_ideanote.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_ideanote.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_ideanote.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + private ProductIdeanote(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductIdeanote(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품 아이디어 노트"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_ideanote table reference + */ + public ProductIdeanote(String alias) { + this(DSL.name(alias), PRODUCT_IDEANOTE); + } + + /** + * Create an aliased public.product_ideanote table reference + */ + public ProductIdeanote(Name alias) { + this(alias, PRODUCT_IDEANOTE); + } + + /** + * Create a public.product_ideanote table reference + */ + public ProductIdeanote() { + this(DSL.name("product_ideanote"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_IDEANOTE_PK; + } + + @Override + public ProductIdeanote as(String alias) { + return new ProductIdeanote(DSL.name(alias), this); + } + + @Override + public ProductIdeanote as(Name alias) { + return new ProductIdeanote(alias, this); + } + + @Override + public ProductIdeanote as(Table alias) { + return new ProductIdeanote(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductIdeanote rename(String name) { + return new ProductIdeanote(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductIdeanote rename(Name name) { + return new ProductIdeanote(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductIdeanote rename(Table name) { + return new ProductIdeanote(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductIdeanote where(Condition condition) { + return new ProductIdeanote(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductIdeanote where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductIdeanote where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductIdeanote where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductIdeanote where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductIdeanote where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductIdeanote where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductIdeanote where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductIdeanote whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductIdeanote whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductMemo.java b/domain/src/main/generated/writeon/tables/ProductMemo.java new file mode 100644 index 0000000..ae2a5e9 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductMemo.java @@ -0,0 +1,275 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductMemoRecord; + + +/** + * 작품 메모 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductMemo extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_memo + */ + public static final ProductMemo PRODUCT_MEMO = new ProductMemo(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductMemoRecord.class; + } + + /** + * The column public.product_memo.id. 메모 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "메모 ID"); + + /** + * The column public.product_memo.product_id. 작품 ID + */ + public final TableField PRODUCT_ID = createField(DSL.name("product_id"), SQLDataType.UUID.nullable(false), this, "작품 ID"); + + /** + * The column public.product_memo.title. 제목 + */ + public final TableField TITLE = createField(DSL.name("title"), SQLDataType.VARCHAR(100), this, "제목"); + + /** + * The column public.product_memo.content. 내용 + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB.nullable(false), this, "내용"); + + /** + * The column public.product_memo.selected_text. + */ + public final TableField SELECTED_TEXT = createField(DSL.name("selected_text"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.product_memo.start_index. + */ + public final TableField START_INDEX = createField(DSL.name("start_index"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.product_memo.end_index. + */ + public final TableField END_INDEX = createField(DSL.name("end_index"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.product_memo.is_completed. 완료 여부 + */ + public final TableField IS_COMPLETED = createField(DSL.name("is_completed"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "완료 여부"); + + /** + * The column public.product_memo.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_memo.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_memo.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_memo.updated_by. 수정일시 + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정일시"); + + private ProductMemo(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductMemo(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품 메모"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_memo table reference + */ + public ProductMemo(String alias) { + this(DSL.name(alias), PRODUCT_MEMO); + } + + /** + * Create an aliased public.product_memo table reference + */ + public ProductMemo(Name alias) { + this(alias, PRODUCT_MEMO); + } + + /** + * Create a public.product_memo table reference + */ + public ProductMemo() { + this(DSL.name("product_memo"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_MEMO_PK; + } + + @Override + public ProductMemo as(String alias) { + return new ProductMemo(DSL.name(alias), this); + } + + @Override + public ProductMemo as(Name alias) { + return new ProductMemo(alias, this); + } + + @Override + public ProductMemo as(Table alias) { + return new ProductMemo(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductMemo rename(String name) { + return new ProductMemo(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductMemo rename(Name name) { + return new ProductMemo(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductMemo rename(Table name) { + return new ProductMemo(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductMemo where(Condition condition) { + return new ProductMemo(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductMemo where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductMemo where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductMemo where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductMemo where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductMemo where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductMemo where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductMemo where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductMemo whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductMemo whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductPlot.java b/domain/src/main/generated/writeon/tables/ProductPlot.java new file mode 100644 index 0000000..ea11741 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductPlot.java @@ -0,0 +1,245 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductPlotRecord; + + +/** + * 작품 줄거리 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductPlot extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_plot + */ + public static final ProductPlot PRODUCT_PLOT = new ProductPlot(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductPlotRecord.class; + } + + /** + * The column public.product_plot.id. 줄거리 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "줄거리 ID"); + + /** + * The column public.product_plot.content. 내용 + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB, this, "내용"); + + /** + * The column public.product_plot.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_plot.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_plot.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_plot.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + private ProductPlot(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductPlot(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품 줄거리"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_plot table reference + */ + public ProductPlot(String alias) { + this(DSL.name(alias), PRODUCT_PLOT); + } + + /** + * Create an aliased public.product_plot table reference + */ + public ProductPlot(Name alias) { + this(alias, PRODUCT_PLOT); + } + + /** + * Create a public.product_plot table reference + */ + public ProductPlot() { + this(DSL.name("product_plot"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_PLOT_PK; + } + + @Override + public ProductPlot as(String alias) { + return new ProductPlot(DSL.name(alias), this); + } + + @Override + public ProductPlot as(Name alias) { + return new ProductPlot(alias, this); + } + + @Override + public ProductPlot as(Table alias) { + return new ProductPlot(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductPlot rename(String name) { + return new ProductPlot(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductPlot rename(Name name) { + return new ProductPlot(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductPlot rename(Table name) { + return new ProductPlot(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductPlot where(Condition condition) { + return new ProductPlot(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductPlot where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductPlot where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductPlot where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductPlot where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductPlot where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductPlot where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductPlot where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductPlot whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductPlot whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductSynopsis.java b/domain/src/main/generated/writeon/tables/ProductSynopsis.java new file mode 100644 index 0000000..e320a8e --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductSynopsis.java @@ -0,0 +1,265 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductSynopsisRecord; + + +/** + * 작품 시놉시스 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductSynopsis extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_synopsis + */ + public static final ProductSynopsis PRODUCT_SYNOPSIS = new ProductSynopsis(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductSynopsisRecord.class; + } + + /** + * The column public.product_synopsis.id. 시놉시스 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "시놉시스 ID"); + + /** + * The column public.product_synopsis.genre. 장르 + */ + public final TableField GENRE = createField(DSL.name("genre"), SQLDataType.VARCHAR(100).nullable(false), this, "장르"); + + /** + * The column public.product_synopsis.length. 분량 + */ + public final TableField LENGTH = createField(DSL.name("length"), SQLDataType.VARCHAR(100), this, "분량"); + + /** + * The column public.product_synopsis.purpose. 기획 의도 + */ + public final TableField PURPOSE = createField(DSL.name("purpose"), SQLDataType.CLOB, this, "기획 의도"); + + /** + * The column public.product_synopsis.logline. 로그라인 + */ + public final TableField LOGLINE = createField(DSL.name("logline"), SQLDataType.CLOB.nullable(false), this, "로그라인"); + + /** + * The column public.product_synopsis.example. 예시 문장 + */ + public final TableField EXAMPLE = createField(DSL.name("example"), SQLDataType.CLOB, this, "예시 문장"); + + /** + * The column public.product_synopsis.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_synopsis.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_synopsis.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_synopsis.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + private ProductSynopsis(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductSynopsis(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품 시놉시스"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_synopsis table reference + */ + public ProductSynopsis(String alias) { + this(DSL.name(alias), PRODUCT_SYNOPSIS); + } + + /** + * Create an aliased public.product_synopsis table reference + */ + public ProductSynopsis(Name alias) { + this(alias, PRODUCT_SYNOPSIS); + } + + /** + * Create a public.product_synopsis table reference + */ + public ProductSynopsis() { + this(DSL.name("product_synopsis"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_SYNOPSIS_PK; + } + + @Override + public ProductSynopsis as(String alias) { + return new ProductSynopsis(DSL.name(alias), this); + } + + @Override + public ProductSynopsis as(Name alias) { + return new ProductSynopsis(alias, this); + } + + @Override + public ProductSynopsis as(Table alias) { + return new ProductSynopsis(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductSynopsis rename(String name) { + return new ProductSynopsis(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductSynopsis rename(Name name) { + return new ProductSynopsis(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductSynopsis rename(Table name) { + return new ProductSynopsis(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductSynopsis where(Condition condition) { + return new ProductSynopsis(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductSynopsis where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductSynopsis where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductSynopsis where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductSynopsis where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductSynopsis where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductSynopsis where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductSynopsis where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductSynopsis whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductSynopsis whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/ProductWorldview.java b/domain/src/main/generated/writeon/tables/ProductWorldview.java new file mode 100644 index 0000000..ca7e2d7 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/ProductWorldview.java @@ -0,0 +1,305 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.ProductWorldviewRecord; + + +/** + * 작품 세계관 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductWorldview extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.product_worldview + */ + public static final ProductWorldview PRODUCT_WORLDVIEW = new ProductWorldview(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return ProductWorldviewRecord.class; + } + + /** + * The column public.product_worldview.id. 세계관 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "세계관 ID"); + + /** + * The column public.product_worldview.geography. 지리 + */ + public final TableField GEOGRAPHY = createField(DSL.name("geography"), SQLDataType.CLOB, this, "지리"); + + /** + * The column public.product_worldview.history. 역사 + */ + public final TableField HISTORY = createField(DSL.name("history"), SQLDataType.CLOB, this, "역사"); + + /** + * The column public.product_worldview.politics. 정치 + */ + public final TableField POLITICS = createField(DSL.name("politics"), SQLDataType.CLOB, this, "정치"); + + /** + * The column public.product_worldview.society. 사회 + */ + public final TableField SOCIETY = createField(DSL.name("society"), SQLDataType.CLOB, this, "사회"); + + /** + * The column public.product_worldview.religion. 종교 + */ + public final TableField RELIGION = createField(DSL.name("religion"), SQLDataType.CLOB, this, "종교"); + + /** + * The column public.product_worldview.economy. 경제 + */ + public final TableField ECONOMY = createField(DSL.name("economy"), SQLDataType.CLOB, this, "경제"); + + /** + * The column public.product_worldview.technology. 기술 + */ + public final TableField TECHNOLOGY = createField(DSL.name("technology"), SQLDataType.CLOB, this, "기술"); + + /** + * The column public.product_worldview.lifestyle. 생활 + */ + public final TableField LIFESTYLE = createField(DSL.name("lifestyle"), SQLDataType.CLOB, this, "생활"); + + /** + * The column public.product_worldview.language. 언어 + */ + public final TableField LANGUAGE = createField(DSL.name("language"), SQLDataType.CLOB, this, "언어"); + + /** + * The column public.product_worldview.culture. 문화 + */ + public final TableField CULTURE = createField(DSL.name("culture"), SQLDataType.CLOB, this, "문화"); + + /** + * The column public.product_worldview.species. 종족 + */ + public final TableField SPECIES = createField(DSL.name("species"), SQLDataType.CLOB, this, "종족"); + + /** + * The column public.product_worldview.occupation. 직업 + */ + public final TableField OCCUPATION = createField(DSL.name("occupation"), SQLDataType.CLOB, this, "직업"); + + /** + * The column public.product_worldview.conflict. 갈등 관계 + */ + public final TableField CONFLICT = createField(DSL.name("conflict"), SQLDataType.CLOB, this, "갈등 관계"); + + /** + * The column public.product_worldview.created_at. 생성일시 + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "생성일시"); + + /** + * The column public.product_worldview.created_by. 생성자 ID + */ + public final TableField CREATED_BY = createField(DSL.name("created_by"), SQLDataType.UUID.nullable(false), this, "생성자 ID"); + + /** + * The column public.product_worldview.updated_at. 수정일시 + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "수정일시"); + + /** + * The column public.product_worldview.updated_by. 수정자 ID + */ + public final TableField UPDATED_BY = createField(DSL.name("updated_by"), SQLDataType.UUID.nullable(false), this, "수정자 ID"); + + private ProductWorldview(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private ProductWorldview(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("작품 세계관"), TableOptions.table(), where); + } + + /** + * Create an aliased public.product_worldview table reference + */ + public ProductWorldview(String alias) { + this(DSL.name(alias), PRODUCT_WORLDVIEW); + } + + /** + * Create an aliased public.product_worldview table reference + */ + public ProductWorldview(Name alias) { + this(alias, PRODUCT_WORLDVIEW); + } + + /** + * Create a public.product_worldview table reference + */ + public ProductWorldview() { + this(DSL.name("product_worldview"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PRODUCT_WORLDVIEW_PK; + } + + @Override + public ProductWorldview as(String alias) { + return new ProductWorldview(DSL.name(alias), this); + } + + @Override + public ProductWorldview as(Name alias) { + return new ProductWorldview(alias, this); + } + + @Override + public ProductWorldview as(Table alias) { + return new ProductWorldview(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public ProductWorldview rename(String name) { + return new ProductWorldview(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public ProductWorldview rename(Name name) { + return new ProductWorldview(name, null); + } + + /** + * Rename this table + */ + @Override + public ProductWorldview rename(Table name) { + return new ProductWorldview(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductWorldview where(Condition condition) { + return new ProductWorldview(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductWorldview where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductWorldview where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductWorldview where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductWorldview where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductWorldview where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductWorldview where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ProductWorldview where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductWorldview whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ProductWorldview whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/Terms.java b/domain/src/main/generated/writeon/tables/Terms.java new file mode 100644 index 0000000..3e581e9 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/Terms.java @@ -0,0 +1,255 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.OffsetDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.TermsRecord; + + +/** + * 약관 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Terms extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.terms + */ + public static final Terms TERMS = new Terms(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TermsRecord.class; + } + + /** + * The column public.terms.id. 약관 ID + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.UUID.nullable(false), this, "약관 ID"); + + /** + * The column public.terms.cd. 약관 코드 + */ + public final TableField CD = createField(DSL.name("cd"), SQLDataType.VARCHAR(10).nullable(false), this, "약관 코드"); + + /** + * The column public.terms.version. 약관 버전 + */ + public final TableField VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, "약관 버전"); + + /** + * The column public.terms.title. 약관 제목 + */ + public final TableField TITLE = createField(DSL.name("title"), SQLDataType.VARCHAR(50).nullable(false), this, "약관 제목"); + + /** + * The column public.terms.content. 약관 내용 + */ + public final TableField CONTENT = createField(DSL.name("content"), SQLDataType.CLOB.nullable(false), this, "약관 내용"); + + /** + * The column public.terms.is_required. 동의 필수 여부 + */ + public final TableField IS_REQUIRED = createField(DSL.name("is_required"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "동의 필수 여부"); + + /** + * The column public.terms.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column public.terms.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private Terms(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private Terms(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("약관"), TableOptions.table(), where); + } + + /** + * Create an aliased public.terms table reference + */ + public Terms(String alias) { + this(DSL.name(alias), TERMS); + } + + /** + * Create an aliased public.terms table reference + */ + public Terms(Name alias) { + this(alias, TERMS); + } + + /** + * Create a public.terms table reference + */ + public Terms() { + this(DSL.name("terms"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TERMS_PK; + } + + @Override + public Terms as(String alias) { + return new Terms(DSL.name(alias), this); + } + + @Override + public Terms as(Name alias) { + return new Terms(alias, this); + } + + @Override + public Terms as(Table alias) { + return new Terms(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Terms rename(String name) { + return new Terms(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Terms rename(Name name) { + return new Terms(name, null); + } + + /** + * Rename this table + */ + @Override + public Terms rename(Table name) { + return new Terms(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Terms where(Condition condition) { + return new Terms(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Terms where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Terms where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Terms where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Terms where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Terms where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Terms where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Terms where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Terms whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Terms whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/TermsAgreement.java b/domain/src/main/generated/writeon/tables/TermsAgreement.java new file mode 100644 index 0000000..dcf87be --- /dev/null +++ b/domain/src/main/generated/writeon/tables/TermsAgreement.java @@ -0,0 +1,235 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables; + + +import java.time.OffsetDateTime; +import java.util.Collection; +import java.util.UUID; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; +import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import writeon.Keys; +import writeon.Public; +import writeon.tables.records.TermsAgreementRecord; + + +/** + * 약관_동의 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class TermsAgreement extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.terms_agreement + */ + public static final TermsAgreement TERMS_AGREEMENT = new TermsAgreement(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TermsAgreementRecord.class; + } + + /** + * The column public.terms_agreement.terms_cd. 약관 코드 + */ + public final TableField TERMS_CD = createField(DSL.name("terms_cd"), SQLDataType.VARCHAR(10).nullable(false), this, "약관 코드"); + + /** + * The column public.terms_agreement.member_id. 회원 ID + */ + public final TableField MEMBER_ID = createField(DSL.name("member_id"), SQLDataType.UUID.nullable(false), this, "회원 ID"); + + /** + * The column public.terms_agreement.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + /** + * The column public.terms_agreement.updated_at. + */ + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + + private TermsAgreement(Name alias, Table aliased) { + this(alias, aliased, (Field[]) null, null); + } + + private TermsAgreement(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment("약관_동의"), TableOptions.table(), where); + } + + /** + * Create an aliased public.terms_agreement table reference + */ + public TermsAgreement(String alias) { + this(DSL.name(alias), TERMS_AGREEMENT); + } + + /** + * Create an aliased public.terms_agreement table reference + */ + public TermsAgreement(Name alias) { + this(alias, TERMS_AGREEMENT); + } + + /** + * Create a public.terms_agreement table reference + */ + public TermsAgreement() { + this(DSL.name("terms_agreement"), null); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TERMS_AGREEMENT_PK; + } + + @Override + public TermsAgreement as(String alias) { + return new TermsAgreement(DSL.name(alias), this); + } + + @Override + public TermsAgreement as(Name alias) { + return new TermsAgreement(alias, this); + } + + @Override + public TermsAgreement as(Table alias) { + return new TermsAgreement(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public TermsAgreement rename(String name) { + return new TermsAgreement(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TermsAgreement rename(Name name) { + return new TermsAgreement(name, null); + } + + /** + * Rename this table + */ + @Override + public TermsAgreement rename(Table name) { + return new TermsAgreement(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public TermsAgreement where(Condition condition) { + return new TermsAgreement(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public TermsAgreement where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public TermsAgreement where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public TermsAgreement where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public TermsAgreement where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public TermsAgreement where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public TermsAgreement where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public TermsAgreement where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public TermsAgreement whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public TermsAgreement whereNotExists(Select select) { + return where(DSL.notExists(select)); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/Assistant.java b/domain/src/main/generated/writeon/tables/pojos/Assistant.java new file mode 100644 index 0000000..9f4955f --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/Assistant.java @@ -0,0 +1,207 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 어시스턴트 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Assistant implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final UUID productId; + private final String type; + private final String status; + private final Boolean isApplied; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + + public Assistant(Assistant value) { + this.id = value.id; + this.productId = value.productId; + this.type = value.type; + this.status = value.status; + this.isApplied = value.isApplied; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + } + + public Assistant( + UUID id, + UUID productId, + String type, + String status, + Boolean isApplied, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt + ) { + this.id = id; + this.productId = productId; + this.type = type; + this.status = status; + this.isApplied = isApplied; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + } + + /** + * Getter for public.assistant.id. + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.assistant.product_id. 작품 ID + */ + public UUID getProductId() { + return this.productId; + } + + /** + * Getter for public.assistant.type. 기능 종류 + */ + public String getType() { + return this.type; + } + + /** + * Getter for public.assistant.status. 진행 상태 + */ + public String getStatus() { + return this.status; + } + + /** + * Getter for public.assistant.is_applied. 진행 상태 + */ + public Boolean getIsApplied() { + return this.isApplied; + } + + /** + * Getter for public.assistant.created_at. 수정일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.assistant.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.assistant.updated_at. + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Assistant other = (Assistant) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.productId == null) { + if (other.productId != null) + return false; + } + else if (!this.productId.equals(other.productId)) + return false; + if (this.type == null) { + if (other.type != null) + return false; + } + else if (!this.type.equals(other.type)) + return false; + if (this.status == null) { + if (other.status != null) + return false; + } + else if (!this.status.equals(other.status)) + return false; + if (this.isApplied == null) { + if (other.isApplied != null) + return false; + } + else if (!this.isApplied.equals(other.isApplied)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.productId == null) ? 0 : this.productId.hashCode()); + result = prime * result + ((this.type == null) ? 0 : this.type.hashCode()); + result = prime * result + ((this.status == null) ? 0 : this.status.hashCode()); + result = prime * result + ((this.isApplied == null) ? 0 : this.isApplied.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Assistant ("); + + sb.append(id); + sb.append(", ").append(productId); + sb.append(", ").append(type); + sb.append(", ").append(status); + sb.append(", ").append(isApplied); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/AssistantEvaluation.java b/domain/src/main/generated/writeon/tables/pojos/AssistantEvaluation.java new file mode 100644 index 0000000..2644fc1 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/AssistantEvaluation.java @@ -0,0 +1,151 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 어시스턴트 평가 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantEvaluation implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID assistantId; + private final Boolean isGood; + private final String feedback; + private final LocalDateTime createdAt; + private final UUID createdBy; + + public AssistantEvaluation(AssistantEvaluation value) { + this.assistantId = value.assistantId; + this.isGood = value.isGood; + this.feedback = value.feedback; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + } + + public AssistantEvaluation( + UUID assistantId, + Boolean isGood, + String feedback, + LocalDateTime createdAt, + UUID createdBy + ) { + this.assistantId = assistantId; + this.isGood = isGood; + this.feedback = feedback; + this.createdAt = createdAt; + this.createdBy = createdBy; + } + + /** + * Getter for public.assistant_evaluation.assistant_id. 어시스턴트 + * ID + */ + public UUID getAssistantId() { + return this.assistantId; + } + + /** + * Getter for public.assistant_evaluation.is_good. 만족 여부 + */ + public Boolean getIsGood() { + return this.isGood; + } + + /** + * Getter for public.assistant_evaluation.feedback. 피드백 + */ + public String getFeedback() { + return this.feedback; + } + + /** + * Getter for public.assistant_evaluation.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.assistant_evaluation.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final AssistantEvaluation other = (AssistantEvaluation) obj; + if (this.assistantId == null) { + if (other.assistantId != null) + return false; + } + else if (!this.assistantId.equals(other.assistantId)) + return false; + if (this.isGood == null) { + if (other.isGood != null) + return false; + } + else if (!this.isGood.equals(other.isGood)) + return false; + if (this.feedback == null) { + if (other.feedback != null) + return false; + } + else if (!this.feedback.equals(other.feedback)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.assistantId == null) ? 0 : this.assistantId.hashCode()); + result = prime * result + ((this.isGood == null) ? 0 : this.isGood.hashCode()); + result = prime * result + ((this.feedback == null) ? 0 : this.feedback.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("AssistantEvaluation ("); + + sb.append(assistantId); + sb.append(", ").append(isGood); + sb.append(", ").append(feedback); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/AssistantMessage.java b/domain/src/main/generated/writeon/tables/pojos/AssistantMessage.java new file mode 100644 index 0000000..346b4af --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/AssistantMessage.java @@ -0,0 +1,188 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantMessage implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final UUID assistantId; + private final String role; + private final String content; + private final String prompt; + private final LocalDateTime createdAt; + private final UUID createdBy; + + public AssistantMessage(AssistantMessage value) { + this.id = value.id; + this.assistantId = value.assistantId; + this.role = value.role; + this.content = value.content; + this.prompt = value.prompt; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + } + + public AssistantMessage( + UUID id, + UUID assistantId, + String role, + String content, + String prompt, + LocalDateTime createdAt, + UUID createdBy + ) { + this.id = id; + this.assistantId = assistantId; + this.role = role; + this.content = content; + this.prompt = prompt; + this.createdAt = createdAt; + this.createdBy = createdBy; + } + + /** + * Getter for public.assistant_message.id. + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.assistant_message.assistant_id. + */ + public UUID getAssistantId() { + return this.assistantId; + } + + /** + * Getter for public.assistant_message.role. + */ + public String getRole() { + return this.role; + } + + /** + * Getter for public.assistant_message.content. + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.assistant_message.prompt. + */ + public String getPrompt() { + return this.prompt; + } + + /** + * Getter for public.assistant_message.created_at. + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.assistant_message.created_by. + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final AssistantMessage other = (AssistantMessage) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.assistantId == null) { + if (other.assistantId != null) + return false; + } + else if (!this.assistantId.equals(other.assistantId)) + return false; + if (this.role == null) { + if (other.role != null) + return false; + } + else if (!this.role.equals(other.role)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.prompt == null) { + if (other.prompt != null) + return false; + } + else if (!this.prompt.equals(other.prompt)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.assistantId == null) ? 0 : this.assistantId.hashCode()); + result = prime * result + ((this.role == null) ? 0 : this.role.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.prompt == null) ? 0 : this.prompt.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("AssistantMessage ("); + + sb.append(id); + sb.append(", ").append(assistantId); + sb.append(", ").append(role); + sb.append(", ").append(content); + sb.append(", ").append(prompt); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/AssistantPlannerMessage.java b/domain/src/main/generated/writeon/tables/pojos/AssistantPlannerMessage.java new file mode 100644 index 0000000..4f65f96 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/AssistantPlannerMessage.java @@ -0,0 +1,130 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.util.UUID; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantPlannerMessage implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID assistantId; + private final String genre; + private final String logline; + private final String section; + + public AssistantPlannerMessage(AssistantPlannerMessage value) { + this.assistantId = value.assistantId; + this.genre = value.genre; + this.logline = value.logline; + this.section = value.section; + } + + public AssistantPlannerMessage( + UUID assistantId, + String genre, + String logline, + String section + ) { + this.assistantId = assistantId; + this.genre = genre; + this.logline = logline; + this.section = section; + } + + /** + * Getter for public.assistant_planner_message.assistant_id. + */ + public UUID getAssistantId() { + return this.assistantId; + } + + /** + * Getter for public.assistant_planner_message.genre. + */ + public String getGenre() { + return this.genre; + } + + /** + * Getter for public.assistant_planner_message.logline. + */ + public String getLogline() { + return this.logline; + } + + /** + * Getter for public.assistant_planner_message.section. + */ + public String getSection() { + return this.section; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final AssistantPlannerMessage other = (AssistantPlannerMessage) obj; + if (this.assistantId == null) { + if (other.assistantId != null) + return false; + } + else if (!this.assistantId.equals(other.assistantId)) + return false; + if (this.genre == null) { + if (other.genre != null) + return false; + } + else if (!this.genre.equals(other.genre)) + return false; + if (this.logline == null) { + if (other.logline != null) + return false; + } + else if (!this.logline.equals(other.logline)) + return false; + if (this.section == null) { + if (other.section != null) + return false; + } + else if (!this.section.equals(other.section)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.assistantId == null) ? 0 : this.assistantId.hashCode()); + result = prime * result + ((this.genre == null) ? 0 : this.genre.hashCode()); + result = prime * result + ((this.logline == null) ? 0 : this.logline.hashCode()); + result = prime * result + ((this.section == null) ? 0 : this.section.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("AssistantPlannerMessage ("); + + sb.append(assistantId); + sb.append(", ").append(genre); + sb.append(", ").append(logline); + sb.append(", ").append(section); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/LoginAttempt.java b/domain/src/main/generated/writeon/tables/pojos/LoginAttempt.java new file mode 100644 index 0000000..27048bb --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/LoginAttempt.java @@ -0,0 +1,150 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.OffsetDateTime; +import java.util.UUID; + + +/** + * 로그인_시도 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class LoginAttempt implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String email; + private final String result; + private final OffsetDateTime createdAt; + private final OffsetDateTime updatedAt; + + public LoginAttempt(LoginAttempt value) { + this.id = value.id; + this.email = value.email; + this.result = value.result; + this.createdAt = value.createdAt; + this.updatedAt = value.updatedAt; + } + + public LoginAttempt( + UUID id, + String email, + String result, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this.id = id; + this.email = email; + this.result = result; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Getter for public.login_attempt.id. 로그인 시도 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.login_attempt.email. 로그인 시도한 이메일 + */ + public String getEmail() { + return this.email; + } + + /** + * Getter for public.login_attempt.result. 로그인 시도 후 결과 + */ + public String getResult() { + return this.result; + } + + /** + * Getter for public.login_attempt.created_at. + */ + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.login_attempt.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final LoginAttempt other = (LoginAttempt) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.email == null) { + if (other.email != null) + return false; + } + else if (!this.email.equals(other.email)) + return false; + if (this.result == null) { + if (other.result != null) + return false; + } + else if (!this.result.equals(other.result)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.email == null) ? 0 : this.email.hashCode()); + result = prime * result + ((this.result == null) ? 0 : this.result.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("LoginAttempt ("); + + sb.append(id); + sb.append(", ").append(email); + sb.append(", ").append(result); + sb.append(", ").append(createdAt); + sb.append(", ").append(updatedAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/Member.java b/domain/src/main/generated/writeon/tables/pojos/Member.java new file mode 100644 index 0000000..e7dcd41 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/Member.java @@ -0,0 +1,169 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.OffsetDateTime; +import java.util.UUID; + + +/** + * 회원 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Member implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String email; + private final String nickname; + private final String profileImage; + private final OffsetDateTime createdAt; + private final OffsetDateTime updatedAt; + + public Member(Member value) { + this.id = value.id; + this.email = value.email; + this.nickname = value.nickname; + this.profileImage = value.profileImage; + this.createdAt = value.createdAt; + this.updatedAt = value.updatedAt; + } + + public Member( + UUID id, + String email, + String nickname, + String profileImage, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this.id = id; + this.email = email; + this.nickname = nickname; + this.profileImage = profileImage; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Getter for public.member.id. 회원 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.member.email. 회원 이메일 + */ + public String getEmail() { + return this.email; + } + + /** + * Getter for public.member.nickname. 회원 닉네임 + */ + public String getNickname() { + return this.nickname; + } + + /** + * Getter for public.member.profile_image. 회원 프로필 이미지 경로 + */ + public String getProfileImage() { + return this.profileImage; + } + + /** + * Getter for public.member.created_at. + */ + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.member.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Member other = (Member) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.email == null) { + if (other.email != null) + return false; + } + else if (!this.email.equals(other.email)) + return false; + if (this.nickname == null) { + if (other.nickname != null) + return false; + } + else if (!this.nickname.equals(other.nickname)) + return false; + if (this.profileImage == null) { + if (other.profileImage != null) + return false; + } + else if (!this.profileImage.equals(other.profileImage)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.email == null) ? 0 : this.email.hashCode()); + result = prime * result + ((this.nickname == null) ? 0 : this.nickname.hashCode()); + result = prime * result + ((this.profileImage == null) ? 0 : this.profileImage.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Member ("); + + sb.append(id); + sb.append(", ").append(email); + sb.append(", ").append(nickname); + sb.append(", ").append(profileImage); + sb.append(", ").append(createdAt); + sb.append(", ").append(updatedAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/MemberPassword.java b/domain/src/main/generated/writeon/tables/pojos/MemberPassword.java new file mode 100644 index 0000000..ebd2bb9 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/MemberPassword.java @@ -0,0 +1,131 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.OffsetDateTime; +import java.util.UUID; + + +/** + * 회원_비밀번호 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class MemberPassword implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID memberId; + private final String password; + private final OffsetDateTime createdAt; + private final OffsetDateTime updatedAt; + + public MemberPassword(MemberPassword value) { + this.memberId = value.memberId; + this.password = value.password; + this.createdAt = value.createdAt; + this.updatedAt = value.updatedAt; + } + + public MemberPassword( + UUID memberId, + String password, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this.memberId = memberId; + this.password = password; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Getter for public.member_password.member_id. 회원 ID + */ + public UUID getMemberId() { + return this.memberId; + } + + /** + * Getter for public.member_password.password. 회원 비밀번호 + */ + public String getPassword() { + return this.password; + } + + /** + * Getter for public.member_password.created_at. + */ + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.member_password.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final MemberPassword other = (MemberPassword) obj; + if (this.memberId == null) { + if (other.memberId != null) + return false; + } + else if (!this.memberId.equals(other.memberId)) + return false; + if (this.password == null) { + if (other.password != null) + return false; + } + else if (!this.password.equals(other.password)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.memberId == null) ? 0 : this.memberId.hashCode()); + result = prime * result + ((this.password == null) ? 0 : this.password.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("MemberPassword ("); + + sb.append(memberId); + sb.append(", ").append(password); + sb.append(", ").append(createdAt); + sb.append(", ").append(updatedAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/PgpArmorHeaders.java b/domain/src/main/generated/writeon/tables/pojos/PgpArmorHeaders.java new file mode 100644 index 0000000..feaccdf --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/PgpArmorHeaders.java @@ -0,0 +1,91 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpArmorHeaders implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String key; + private final String value; + + public PgpArmorHeaders(PgpArmorHeaders value) { + this.key = value.key; + this.value = value.value; + } + + public PgpArmorHeaders( + String key, + String value + ) { + this.key = key; + this.value = value; + } + + /** + * Getter for public.pgp_armor_headers.key. + */ + public String getKey() { + return this.key; + } + + /** + * Getter for public.pgp_armor_headers.value. + */ + public String getValue() { + return this.value; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final PgpArmorHeaders other = (PgpArmorHeaders) obj; + if (this.key == null) { + if (other.key != null) + return false; + } + else if (!this.key.equals(other.key)) + return false; + if (this.value == null) { + if (other.value != null) + return false; + } + else if (!this.value.equals(other.value)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.key == null) ? 0 : this.key.hashCode()); + result = prime * result + ((this.value == null) ? 0 : this.value.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("PgpArmorHeaders ("); + + sb.append(key); + sb.append(", ").append(value); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/Product.java b/domain/src/main/generated/writeon/tables/pojos/Product.java new file mode 100644 index 0000000..cd2f210 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/Product.java @@ -0,0 +1,188 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Product implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String title; + private final String content; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public Product(Product value) { + this.id = value.id; + this.title = value.title; + this.content = value.content; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public Product( + UUID id, + String title, + String content, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.title = title; + this.content = content; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product.id. 작품 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product.title. 제목 + */ + public String getTitle() { + return this.title; + } + + /** + * Getter for public.product.content. 내용 + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.product.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Product other = (Product) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.title == null) { + if (other.title != null) + return false; + } + else if (!this.title.equals(other.title)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.title == null) ? 0 : this.title.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Product ("); + + sb.append(id); + sb.append(", ").append(title); + sb.append(", ").append(content); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductCharacter.java b/domain/src/main/generated/writeon/tables/pojos/ProductCharacter.java new file mode 100644 index 0000000..f488a2b --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductCharacter.java @@ -0,0 +1,340 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 등장인물 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductCharacter implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final UUID productId; + private final String intro; + private final String name; + private final Integer age; + private final String gender; + private final String occupation; + private final String appearance; + private final String personality; + private final String relationship; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + private final Integer seq; + + public ProductCharacter(ProductCharacter value) { + this.id = value.id; + this.productId = value.productId; + this.intro = value.intro; + this.name = value.name; + this.age = value.age; + this.gender = value.gender; + this.occupation = value.occupation; + this.appearance = value.appearance; + this.personality = value.personality; + this.relationship = value.relationship; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + this.seq = value.seq; + } + + public ProductCharacter( + UUID id, + UUID productId, + String intro, + String name, + Integer age, + String gender, + String occupation, + String appearance, + String personality, + String relationship, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy, + Integer seq + ) { + this.id = id; + this.productId = productId; + this.intro = intro; + this.name = name; + this.age = age; + this.gender = gender; + this.occupation = occupation; + this.appearance = appearance; + this.personality = personality; + this.relationship = relationship; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + this.seq = seq; + } + + /** + * Getter for public.product_character.id. 등장인물 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_character.product_id. 작품 ID + */ + public UUID getProductId() { + return this.productId; + } + + /** + * Getter for public.product_character.intro. 소개 + */ + public String getIntro() { + return this.intro; + } + + /** + * Getter for public.product_character.name. 이름 + */ + public String getName() { + return this.name; + } + + /** + * Getter for public.product_character.age. 나이 + */ + public Integer getAge() { + return this.age; + } + + /** + * Getter for public.product_character.gender. 성별 + */ + public String getGender() { + return this.gender; + } + + /** + * Getter for public.product_character.occupation. 직업 + */ + public String getOccupation() { + return this.occupation; + } + + /** + * Getter for public.product_character.appearance. 외모 + */ + public String getAppearance() { + return this.appearance; + } + + /** + * Getter for public.product_character.personality. 성격 + */ + public String getPersonality() { + return this.personality; + } + + /** + * Getter for public.product_character.relationship. 주요 관계 + */ + public String getRelationship() { + return this.relationship; + } + + /** + * Getter for public.product_character.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_character.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_character.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_character.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + /** + * Getter for public.product_character.seq. + */ + public Integer getSeq() { + return this.seq; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductCharacter other = (ProductCharacter) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.productId == null) { + if (other.productId != null) + return false; + } + else if (!this.productId.equals(other.productId)) + return false; + if (this.intro == null) { + if (other.intro != null) + return false; + } + else if (!this.intro.equals(other.intro)) + return false; + if (this.name == null) { + if (other.name != null) + return false; + } + else if (!this.name.equals(other.name)) + return false; + if (this.age == null) { + if (other.age != null) + return false; + } + else if (!this.age.equals(other.age)) + return false; + if (this.gender == null) { + if (other.gender != null) + return false; + } + else if (!this.gender.equals(other.gender)) + return false; + if (this.occupation == null) { + if (other.occupation != null) + return false; + } + else if (!this.occupation.equals(other.occupation)) + return false; + if (this.appearance == null) { + if (other.appearance != null) + return false; + } + else if (!this.appearance.equals(other.appearance)) + return false; + if (this.personality == null) { + if (other.personality != null) + return false; + } + else if (!this.personality.equals(other.personality)) + return false; + if (this.relationship == null) { + if (other.relationship != null) + return false; + } + else if (!this.relationship.equals(other.relationship)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + if (this.seq == null) { + if (other.seq != null) + return false; + } + else if (!this.seq.equals(other.seq)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.productId == null) ? 0 : this.productId.hashCode()); + result = prime * result + ((this.intro == null) ? 0 : this.intro.hashCode()); + result = prime * result + ((this.name == null) ? 0 : this.name.hashCode()); + result = prime * result + ((this.age == null) ? 0 : this.age.hashCode()); + result = prime * result + ((this.gender == null) ? 0 : this.gender.hashCode()); + result = prime * result + ((this.occupation == null) ? 0 : this.occupation.hashCode()); + result = prime * result + ((this.appearance == null) ? 0 : this.appearance.hashCode()); + result = prime * result + ((this.personality == null) ? 0 : this.personality.hashCode()); + result = prime * result + ((this.relationship == null) ? 0 : this.relationship.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + result = prime * result + ((this.seq == null) ? 0 : this.seq.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductCharacter ("); + + sb.append(id); + sb.append(", ").append(productId); + sb.append(", ").append(intro); + sb.append(", ").append(name); + sb.append(", ").append(age); + sb.append(", ").append(gender); + sb.append(", ").append(occupation); + sb.append(", ").append(appearance); + sb.append(", ").append(personality); + sb.append(", ").append(relationship); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + sb.append(", ").append(seq); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductCustomField.java b/domain/src/main/generated/writeon/tables/pojos/ProductCustomField.java new file mode 100644 index 0000000..237bdb4 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductCustomField.java @@ -0,0 +1,264 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductCustomField implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final UUID productId; + private final UUID sectionId; + private final String sectionType; + private final String name; + private final String content; + private final Short seq; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public ProductCustomField(ProductCustomField value) { + this.id = value.id; + this.productId = value.productId; + this.sectionId = value.sectionId; + this.sectionType = value.sectionType; + this.name = value.name; + this.content = value.content; + this.seq = value.seq; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public ProductCustomField( + UUID id, + UUID productId, + UUID sectionId, + String sectionType, + String name, + String content, + Short seq, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.productId = productId; + this.sectionId = sectionId; + this.sectionType = sectionType; + this.name = name; + this.content = content; + this.seq = seq; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product_custom_field.id. 커스텀 필드 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_custom_field.product_id. 작품 ID + */ + public UUID getProductId() { + return this.productId; + } + + /** + * Getter for public.product_custom_field.section_id. 섹션 ID + */ + public UUID getSectionId() { + return this.sectionId; + } + + /** + * Getter for public.product_custom_field.section_type. 섹션 타입 + */ + public String getSectionType() { + return this.sectionType; + } + + /** + * Getter for public.product_custom_field.name. 이름 + */ + public String getName() { + return this.name; + } + + /** + * Getter for public.product_custom_field.content. 내용 + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.product_custom_field.seq. 순서 + */ + public Short getSeq() { + return this.seq; + } + + /** + * Getter for public.product_custom_field.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_custom_field.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_custom_field.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_custom_field.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductCustomField other = (ProductCustomField) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.productId == null) { + if (other.productId != null) + return false; + } + else if (!this.productId.equals(other.productId)) + return false; + if (this.sectionId == null) { + if (other.sectionId != null) + return false; + } + else if (!this.sectionId.equals(other.sectionId)) + return false; + if (this.sectionType == null) { + if (other.sectionType != null) + return false; + } + else if (!this.sectionType.equals(other.sectionType)) + return false; + if (this.name == null) { + if (other.name != null) + return false; + } + else if (!this.name.equals(other.name)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.seq == null) { + if (other.seq != null) + return false; + } + else if (!this.seq.equals(other.seq)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.productId == null) ? 0 : this.productId.hashCode()); + result = prime * result + ((this.sectionId == null) ? 0 : this.sectionId.hashCode()); + result = prime * result + ((this.sectionType == null) ? 0 : this.sectionType.hashCode()); + result = prime * result + ((this.name == null) ? 0 : this.name.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.seq == null) ? 0 : this.seq.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductCustomField ("); + + sb.append(id); + sb.append(", ").append(productId); + sb.append(", ").append(sectionId); + sb.append(", ").append(sectionType); + sb.append(", ").append(name); + sb.append(", ").append(content); + sb.append(", ").append(seq); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductFavoritePrompt.java b/domain/src/main/generated/writeon/tables/pojos/ProductFavoritePrompt.java new file mode 100644 index 0000000..f256c95 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductFavoritePrompt.java @@ -0,0 +1,131 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductFavoritePrompt implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final UUID productId; + private final UUID messageId; + private final LocalDateTime createdAt; + + public ProductFavoritePrompt(ProductFavoritePrompt value) { + this.id = value.id; + this.productId = value.productId; + this.messageId = value.messageId; + this.createdAt = value.createdAt; + } + + public ProductFavoritePrompt( + UUID id, + UUID productId, + UUID messageId, + LocalDateTime createdAt + ) { + this.id = id; + this.productId = productId; + this.messageId = messageId; + this.createdAt = createdAt; + } + + /** + * Getter for public.product_favorite_prompt.id. + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_favorite_prompt.product_id. + */ + public UUID getProductId() { + return this.productId; + } + + /** + * Getter for public.product_favorite_prompt.message_id. + */ + public UUID getMessageId() { + return this.messageId; + } + + /** + * Getter for public.product_favorite_prompt.created_at. + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductFavoritePrompt other = (ProductFavoritePrompt) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.productId == null) { + if (other.productId != null) + return false; + } + else if (!this.productId.equals(other.productId)) + return false; + if (this.messageId == null) { + if (other.messageId != null) + return false; + } + else if (!this.messageId.equals(other.messageId)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.productId == null) ? 0 : this.productId.hashCode()); + result = prime * result + ((this.messageId == null) ? 0 : this.messageId.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductFavoritePrompt ("); + + sb.append(id); + sb.append(", ").append(productId); + sb.append(", ").append(messageId); + sb.append(", ").append(createdAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductFixedMessage.java b/domain/src/main/generated/writeon/tables/pojos/ProductFixedMessage.java new file mode 100644 index 0000000..403ef3a --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductFixedMessage.java @@ -0,0 +1,92 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.util.UUID; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductFixedMessage implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID productId; + private final UUID messageId; + + public ProductFixedMessage(ProductFixedMessage value) { + this.productId = value.productId; + this.messageId = value.messageId; + } + + public ProductFixedMessage( + UUID productId, + UUID messageId + ) { + this.productId = productId; + this.messageId = messageId; + } + + /** + * Getter for public.product_fixed_message.product_id. + */ + public UUID getProductId() { + return this.productId; + } + + /** + * Getter for public.product_fixed_message.message_id. + */ + public UUID getMessageId() { + return this.messageId; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductFixedMessage other = (ProductFixedMessage) obj; + if (this.productId == null) { + if (other.productId != null) + return false; + } + else if (!this.productId.equals(other.productId)) + return false; + if (this.messageId == null) { + if (other.messageId != null) + return false; + } + else if (!this.messageId.equals(other.messageId)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.productId == null) ? 0 : this.productId.hashCode()); + result = prime * result + ((this.messageId == null) ? 0 : this.messageId.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductFixedMessage ("); + + sb.append(productId); + sb.append(", ").append(messageId); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductIdeanote.java b/domain/src/main/generated/writeon/tables/pojos/ProductIdeanote.java new file mode 100644 index 0000000..4b608f8 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductIdeanote.java @@ -0,0 +1,188 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 아이디어 노트 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductIdeanote implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String title; + private final String content; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public ProductIdeanote(ProductIdeanote value) { + this.id = value.id; + this.title = value.title; + this.content = value.content; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public ProductIdeanote( + UUID id, + String title, + String content, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.title = title; + this.content = content; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product_ideanote.id. 아이디어 노트 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_ideanote.title. 제목 + */ + public String getTitle() { + return this.title; + } + + /** + * Getter for public.product_ideanote.content. 내용 + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.product_ideanote.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_ideanote.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_ideanote.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_ideanote.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductIdeanote other = (ProductIdeanote) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.title == null) { + if (other.title != null) + return false; + } + else if (!this.title.equals(other.title)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.title == null) ? 0 : this.title.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductIdeanote ("); + + sb.append(id); + sb.append(", ").append(title); + sb.append(", ").append(content); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductMemo.java b/domain/src/main/generated/writeon/tables/pojos/ProductMemo.java new file mode 100644 index 0000000..dad311b --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductMemo.java @@ -0,0 +1,283 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 메모 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductMemo implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final UUID productId; + private final String title; + private final String content; + private final String selectedText; + private final Integer startIndex; + private final Integer endIndex; + private final Boolean isCompleted; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public ProductMemo(ProductMemo value) { + this.id = value.id; + this.productId = value.productId; + this.title = value.title; + this.content = value.content; + this.selectedText = value.selectedText; + this.startIndex = value.startIndex; + this.endIndex = value.endIndex; + this.isCompleted = value.isCompleted; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public ProductMemo( + UUID id, + UUID productId, + String title, + String content, + String selectedText, + Integer startIndex, + Integer endIndex, + Boolean isCompleted, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.productId = productId; + this.title = title; + this.content = content; + this.selectedText = selectedText; + this.startIndex = startIndex; + this.endIndex = endIndex; + this.isCompleted = isCompleted; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product_memo.id. 메모 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_memo.product_id. 작품 ID + */ + public UUID getProductId() { + return this.productId; + } + + /** + * Getter for public.product_memo.title. 제목 + */ + public String getTitle() { + return this.title; + } + + /** + * Getter for public.product_memo.content. 내용 + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.product_memo.selected_text. + */ + public String getSelectedText() { + return this.selectedText; + } + + /** + * Getter for public.product_memo.start_index. + */ + public Integer getStartIndex() { + return this.startIndex; + } + + /** + * Getter for public.product_memo.end_index. + */ + public Integer getEndIndex() { + return this.endIndex; + } + + /** + * Getter for public.product_memo.is_completed. 완료 여부 + */ + public Boolean getIsCompleted() { + return this.isCompleted; + } + + /** + * Getter for public.product_memo.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_memo.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_memo.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_memo.updated_by. 수정일시 + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductMemo other = (ProductMemo) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.productId == null) { + if (other.productId != null) + return false; + } + else if (!this.productId.equals(other.productId)) + return false; + if (this.title == null) { + if (other.title != null) + return false; + } + else if (!this.title.equals(other.title)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.selectedText == null) { + if (other.selectedText != null) + return false; + } + else if (!this.selectedText.equals(other.selectedText)) + return false; + if (this.startIndex == null) { + if (other.startIndex != null) + return false; + } + else if (!this.startIndex.equals(other.startIndex)) + return false; + if (this.endIndex == null) { + if (other.endIndex != null) + return false; + } + else if (!this.endIndex.equals(other.endIndex)) + return false; + if (this.isCompleted == null) { + if (other.isCompleted != null) + return false; + } + else if (!this.isCompleted.equals(other.isCompleted)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.productId == null) ? 0 : this.productId.hashCode()); + result = prime * result + ((this.title == null) ? 0 : this.title.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.selectedText == null) ? 0 : this.selectedText.hashCode()); + result = prime * result + ((this.startIndex == null) ? 0 : this.startIndex.hashCode()); + result = prime * result + ((this.endIndex == null) ? 0 : this.endIndex.hashCode()); + result = prime * result + ((this.isCompleted == null) ? 0 : this.isCompleted.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductMemo ("); + + sb.append(id); + sb.append(", ").append(productId); + sb.append(", ").append(title); + sb.append(", ").append(content); + sb.append(", ").append(selectedText); + sb.append(", ").append(startIndex); + sb.append(", ").append(endIndex); + sb.append(", ").append(isCompleted); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductPlot.java b/domain/src/main/generated/writeon/tables/pojos/ProductPlot.java new file mode 100644 index 0000000..ae6c36b --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductPlot.java @@ -0,0 +1,169 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 줄거리 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductPlot implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String content; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public ProductPlot(ProductPlot value) { + this.id = value.id; + this.content = value.content; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public ProductPlot( + UUID id, + String content, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.content = content; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product_plot.id. 줄거리 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_plot.content. 내용 + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.product_plot.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_plot.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_plot.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_plot.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductPlot other = (ProductPlot) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductPlot ("); + + sb.append(id); + sb.append(", ").append(content); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductSynopsis.java b/domain/src/main/generated/writeon/tables/pojos/ProductSynopsis.java new file mode 100644 index 0000000..3e3d726 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductSynopsis.java @@ -0,0 +1,245 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 시놉시스 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductSynopsis implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String genre; + private final String length; + private final String purpose; + private final String logline; + private final String example; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public ProductSynopsis(ProductSynopsis value) { + this.id = value.id; + this.genre = value.genre; + this.length = value.length; + this.purpose = value.purpose; + this.logline = value.logline; + this.example = value.example; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public ProductSynopsis( + UUID id, + String genre, + String length, + String purpose, + String logline, + String example, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.genre = genre; + this.length = length; + this.purpose = purpose; + this.logline = logline; + this.example = example; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product_synopsis.id. 시놉시스 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_synopsis.genre. 장르 + */ + public String getGenre() { + return this.genre; + } + + /** + * Getter for public.product_synopsis.length. 분량 + */ + public String getLength() { + return this.length; + } + + /** + * Getter for public.product_synopsis.purpose. 기획 의도 + */ + public String getPurpose() { + return this.purpose; + } + + /** + * Getter for public.product_synopsis.logline. 로그라인 + */ + public String getLogline() { + return this.logline; + } + + /** + * Getter for public.product_synopsis.example. 예시 문장 + */ + public String getExample() { + return this.example; + } + + /** + * Getter for public.product_synopsis.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_synopsis.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_synopsis.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_synopsis.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductSynopsis other = (ProductSynopsis) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.genre == null) { + if (other.genre != null) + return false; + } + else if (!this.genre.equals(other.genre)) + return false; + if (this.length == null) { + if (other.length != null) + return false; + } + else if (!this.length.equals(other.length)) + return false; + if (this.purpose == null) { + if (other.purpose != null) + return false; + } + else if (!this.purpose.equals(other.purpose)) + return false; + if (this.logline == null) { + if (other.logline != null) + return false; + } + else if (!this.logline.equals(other.logline)) + return false; + if (this.example == null) { + if (other.example != null) + return false; + } + else if (!this.example.equals(other.example)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.genre == null) ? 0 : this.genre.hashCode()); + result = prime * result + ((this.length == null) ? 0 : this.length.hashCode()); + result = prime * result + ((this.purpose == null) ? 0 : this.purpose.hashCode()); + result = prime * result + ((this.logline == null) ? 0 : this.logline.hashCode()); + result = prime * result + ((this.example == null) ? 0 : this.example.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductSynopsis ("); + + sb.append(id); + sb.append(", ").append(genre); + sb.append(", ").append(length); + sb.append(", ").append(purpose); + sb.append(", ").append(logline); + sb.append(", ").append(example); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/ProductWorldview.java b/domain/src/main/generated/writeon/tables/pojos/ProductWorldview.java new file mode 100644 index 0000000..669f547 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/ProductWorldview.java @@ -0,0 +1,397 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + + +/** + * 작품 세계관 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductWorldview implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String geography; + private final String history; + private final String politics; + private final String society; + private final String religion; + private final String economy; + private final String technology; + private final String lifestyle; + private final String language; + private final String culture; + private final String species; + private final String occupation; + private final String conflict; + private final LocalDateTime createdAt; + private final UUID createdBy; + private final LocalDateTime updatedAt; + private final UUID updatedBy; + + public ProductWorldview(ProductWorldview value) { + this.id = value.id; + this.geography = value.geography; + this.history = value.history; + this.politics = value.politics; + this.society = value.society; + this.religion = value.religion; + this.economy = value.economy; + this.technology = value.technology; + this.lifestyle = value.lifestyle; + this.language = value.language; + this.culture = value.culture; + this.species = value.species; + this.occupation = value.occupation; + this.conflict = value.conflict; + this.createdAt = value.createdAt; + this.createdBy = value.createdBy; + this.updatedAt = value.updatedAt; + this.updatedBy = value.updatedBy; + } + + public ProductWorldview( + UUID id, + String geography, + String history, + String politics, + String society, + String religion, + String economy, + String technology, + String lifestyle, + String language, + String culture, + String species, + String occupation, + String conflict, + LocalDateTime createdAt, + UUID createdBy, + LocalDateTime updatedAt, + UUID updatedBy + ) { + this.id = id; + this.geography = geography; + this.history = history; + this.politics = politics; + this.society = society; + this.religion = religion; + this.economy = economy; + this.technology = technology; + this.lifestyle = lifestyle; + this.language = language; + this.culture = culture; + this.species = species; + this.occupation = occupation; + this.conflict = conflict; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.updatedAt = updatedAt; + this.updatedBy = updatedBy; + } + + /** + * Getter for public.product_worldview.id. 세계관 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.product_worldview.geography. 지리 + */ + public String getGeography() { + return this.geography; + } + + /** + * Getter for public.product_worldview.history. 역사 + */ + public String getHistory() { + return this.history; + } + + /** + * Getter for public.product_worldview.politics. 정치 + */ + public String getPolitics() { + return this.politics; + } + + /** + * Getter for public.product_worldview.society. 사회 + */ + public String getSociety() { + return this.society; + } + + /** + * Getter for public.product_worldview.religion. 종교 + */ + public String getReligion() { + return this.religion; + } + + /** + * Getter for public.product_worldview.economy. 경제 + */ + public String getEconomy() { + return this.economy; + } + + /** + * Getter for public.product_worldview.technology. 기술 + */ + public String getTechnology() { + return this.technology; + } + + /** + * Getter for public.product_worldview.lifestyle. 생활 + */ + public String getLifestyle() { + return this.lifestyle; + } + + /** + * Getter for public.product_worldview.language. 언어 + */ + public String getLanguage() { + return this.language; + } + + /** + * Getter for public.product_worldview.culture. 문화 + */ + public String getCulture() { + return this.culture; + } + + /** + * Getter for public.product_worldview.species. 종족 + */ + public String getSpecies() { + return this.species; + } + + /** + * Getter for public.product_worldview.occupation. 직업 + */ + public String getOccupation() { + return this.occupation; + } + + /** + * Getter for public.product_worldview.conflict. 갈등 관계 + */ + public String getConflict() { + return this.conflict; + } + + /** + * Getter for public.product_worldview.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.product_worldview.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return this.createdBy; + } + + /** + * Getter for public.product_worldview.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Getter for public.product_worldview.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return this.updatedBy; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ProductWorldview other = (ProductWorldview) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.geography == null) { + if (other.geography != null) + return false; + } + else if (!this.geography.equals(other.geography)) + return false; + if (this.history == null) { + if (other.history != null) + return false; + } + else if (!this.history.equals(other.history)) + return false; + if (this.politics == null) { + if (other.politics != null) + return false; + } + else if (!this.politics.equals(other.politics)) + return false; + if (this.society == null) { + if (other.society != null) + return false; + } + else if (!this.society.equals(other.society)) + return false; + if (this.religion == null) { + if (other.religion != null) + return false; + } + else if (!this.religion.equals(other.religion)) + return false; + if (this.economy == null) { + if (other.economy != null) + return false; + } + else if (!this.economy.equals(other.economy)) + return false; + if (this.technology == null) { + if (other.technology != null) + return false; + } + else if (!this.technology.equals(other.technology)) + return false; + if (this.lifestyle == null) { + if (other.lifestyle != null) + return false; + } + else if (!this.lifestyle.equals(other.lifestyle)) + return false; + if (this.language == null) { + if (other.language != null) + return false; + } + else if (!this.language.equals(other.language)) + return false; + if (this.culture == null) { + if (other.culture != null) + return false; + } + else if (!this.culture.equals(other.culture)) + return false; + if (this.species == null) { + if (other.species != null) + return false; + } + else if (!this.species.equals(other.species)) + return false; + if (this.occupation == null) { + if (other.occupation != null) + return false; + } + else if (!this.occupation.equals(other.occupation)) + return false; + if (this.conflict == null) { + if (other.conflict != null) + return false; + } + else if (!this.conflict.equals(other.conflict)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.createdBy == null) { + if (other.createdBy != null) + return false; + } + else if (!this.createdBy.equals(other.createdBy)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + if (this.updatedBy == null) { + if (other.updatedBy != null) + return false; + } + else if (!this.updatedBy.equals(other.updatedBy)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.geography == null) ? 0 : this.geography.hashCode()); + result = prime * result + ((this.history == null) ? 0 : this.history.hashCode()); + result = prime * result + ((this.politics == null) ? 0 : this.politics.hashCode()); + result = prime * result + ((this.society == null) ? 0 : this.society.hashCode()); + result = prime * result + ((this.religion == null) ? 0 : this.religion.hashCode()); + result = prime * result + ((this.economy == null) ? 0 : this.economy.hashCode()); + result = prime * result + ((this.technology == null) ? 0 : this.technology.hashCode()); + result = prime * result + ((this.lifestyle == null) ? 0 : this.lifestyle.hashCode()); + result = prime * result + ((this.language == null) ? 0 : this.language.hashCode()); + result = prime * result + ((this.culture == null) ? 0 : this.culture.hashCode()); + result = prime * result + ((this.species == null) ? 0 : this.species.hashCode()); + result = prime * result + ((this.occupation == null) ? 0 : this.occupation.hashCode()); + result = prime * result + ((this.conflict == null) ? 0 : this.conflict.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.createdBy == null) ? 0 : this.createdBy.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + result = prime * result + ((this.updatedBy == null) ? 0 : this.updatedBy.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ProductWorldview ("); + + sb.append(id); + sb.append(", ").append(geography); + sb.append(", ").append(history); + sb.append(", ").append(politics); + sb.append(", ").append(society); + sb.append(", ").append(religion); + sb.append(", ").append(economy); + sb.append(", ").append(technology); + sb.append(", ").append(lifestyle); + sb.append(", ").append(language); + sb.append(", ").append(culture); + sb.append(", ").append(species); + sb.append(", ").append(occupation); + sb.append(", ").append(conflict); + sb.append(", ").append(createdAt); + sb.append(", ").append(createdBy); + sb.append(", ").append(updatedAt); + sb.append(", ").append(updatedBy); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/Terms.java b/domain/src/main/generated/writeon/tables/pojos/Terms.java new file mode 100644 index 0000000..d36e39f --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/Terms.java @@ -0,0 +1,207 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.OffsetDateTime; +import java.util.UUID; + + +/** + * 약관 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Terms implements Serializable { + + private static final long serialVersionUID = 1L; + + private final UUID id; + private final String cd; + private final Integer version; + private final String title; + private final String content; + private final Boolean isRequired; + private final OffsetDateTime createdAt; + private final OffsetDateTime updatedAt; + + public Terms(Terms value) { + this.id = value.id; + this.cd = value.cd; + this.version = value.version; + this.title = value.title; + this.content = value.content; + this.isRequired = value.isRequired; + this.createdAt = value.createdAt; + this.updatedAt = value.updatedAt; + } + + public Terms( + UUID id, + String cd, + Integer version, + String title, + String content, + Boolean isRequired, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this.id = id; + this.cd = cd; + this.version = version; + this.title = title; + this.content = content; + this.isRequired = isRequired; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Getter for public.terms.id. 약관 ID + */ + public UUID getId() { + return this.id; + } + + /** + * Getter for public.terms.cd. 약관 코드 + */ + public String getCd() { + return this.cd; + } + + /** + * Getter for public.terms.version. 약관 버전 + */ + public Integer getVersion() { + return this.version; + } + + /** + * Getter for public.terms.title. 약관 제목 + */ + public String getTitle() { + return this.title; + } + + /** + * Getter for public.terms.content. 약관 내용 + */ + public String getContent() { + return this.content; + } + + /** + * Getter for public.terms.is_required. 동의 필수 여부 + */ + public Boolean getIsRequired() { + return this.isRequired; + } + + /** + * Getter for public.terms.created_at. + */ + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.terms.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Terms other = (Terms) obj; + if (this.id == null) { + if (other.id != null) + return false; + } + else if (!this.id.equals(other.id)) + return false; + if (this.cd == null) { + if (other.cd != null) + return false; + } + else if (!this.cd.equals(other.cd)) + return false; + if (this.version == null) { + if (other.version != null) + return false; + } + else if (!this.version.equals(other.version)) + return false; + if (this.title == null) { + if (other.title != null) + return false; + } + else if (!this.title.equals(other.title)) + return false; + if (this.content == null) { + if (other.content != null) + return false; + } + else if (!this.content.equals(other.content)) + return false; + if (this.isRequired == null) { + if (other.isRequired != null) + return false; + } + else if (!this.isRequired.equals(other.isRequired)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.cd == null) ? 0 : this.cd.hashCode()); + result = prime * result + ((this.version == null) ? 0 : this.version.hashCode()); + result = prime * result + ((this.title == null) ? 0 : this.title.hashCode()); + result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); + result = prime * result + ((this.isRequired == null) ? 0 : this.isRequired.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Terms ("); + + sb.append(id); + sb.append(", ").append(cd); + sb.append(", ").append(version); + sb.append(", ").append(title); + sb.append(", ").append(content); + sb.append(", ").append(isRequired); + sb.append(", ").append(createdAt); + sb.append(", ").append(updatedAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/pojos/TermsAgreement.java b/domain/src/main/generated/writeon/tables/pojos/TermsAgreement.java new file mode 100644 index 0000000..0ccf7bf --- /dev/null +++ b/domain/src/main/generated/writeon/tables/pojos/TermsAgreement.java @@ -0,0 +1,131 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.pojos; + + +import java.io.Serializable; +import java.time.OffsetDateTime; +import java.util.UUID; + + +/** + * 약관_동의 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class TermsAgreement implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String termsCd; + private final UUID memberId; + private final OffsetDateTime createdAt; + private final OffsetDateTime updatedAt; + + public TermsAgreement(TermsAgreement value) { + this.termsCd = value.termsCd; + this.memberId = value.memberId; + this.createdAt = value.createdAt; + this.updatedAt = value.updatedAt; + } + + public TermsAgreement( + String termsCd, + UUID memberId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this.termsCd = termsCd; + this.memberId = memberId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Getter for public.terms_agreement.terms_cd. 약관 코드 + */ + public String getTermsCd() { + return this.termsCd; + } + + /** + * Getter for public.terms_agreement.member_id. 회원 ID + */ + public UUID getMemberId() { + return this.memberId; + } + + /** + * Getter for public.terms_agreement.created_at. + */ + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Getter for public.terms_agreement.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TermsAgreement other = (TermsAgreement) obj; + if (this.termsCd == null) { + if (other.termsCd != null) + return false; + } + else if (!this.termsCd.equals(other.termsCd)) + return false; + if (this.memberId == null) { + if (other.memberId != null) + return false; + } + else if (!this.memberId.equals(other.memberId)) + return false; + if (this.createdAt == null) { + if (other.createdAt != null) + return false; + } + else if (!this.createdAt.equals(other.createdAt)) + return false; + if (this.updatedAt == null) { + if (other.updatedAt != null) + return false; + } + else if (!this.updatedAt.equals(other.updatedAt)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.termsCd == null) ? 0 : this.termsCd.hashCode()); + result = prime * result + ((this.memberId == null) ? 0 : this.memberId.hashCode()); + result = prime * result + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()); + result = prime * result + ((this.updatedAt == null) ? 0 : this.updatedAt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TermsAgreement ("); + + sb.append(termsCd); + sb.append(", ").append(memberId); + sb.append(", ").append(createdAt); + sb.append(", ").append(updatedAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/domain/src/main/generated/writeon/tables/records/AssistantEvaluationRecord.java b/domain/src/main/generated/writeon/tables/records/AssistantEvaluationRecord.java new file mode 100644 index 0000000..9a60893 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/AssistantEvaluationRecord.java @@ -0,0 +1,150 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.AssistantEvaluation; + + +/** + * 어시스턴트 평가 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantEvaluationRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.assistant_evaluation.assistant_id. 어시스턴트 + * ID + */ + public AssistantEvaluationRecord setAssistantId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.assistant_evaluation.assistant_id. 어시스턴트 + * ID + */ + public UUID getAssistantId() { + return (UUID) get(0); + } + + /** + * Setter for public.assistant_evaluation.is_good. 만족 여부 + */ + public AssistantEvaluationRecord setIsGood(Boolean value) { + set(1, value); + return this; + } + + /** + * Getter for public.assistant_evaluation.is_good. 만족 여부 + */ + public Boolean getIsGood() { + return (Boolean) get(1); + } + + /** + * Setter for public.assistant_evaluation.feedback. 피드백 + */ + public AssistantEvaluationRecord setFeedback(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.assistant_evaluation.feedback. 피드백 + */ + public String getFeedback() { + return (String) get(2); + } + + /** + * Setter for public.assistant_evaluation.created_at. 생성일시 + */ + public AssistantEvaluationRecord setCreatedAt(LocalDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.assistant_evaluation.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(3); + } + + /** + * Setter for public.assistant_evaluation.created_by. 생성자 ID + */ + public AssistantEvaluationRecord setCreatedBy(UUID value) { + set(4, value); + return this; + } + + /** + * Getter for public.assistant_evaluation.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AssistantEvaluationRecord + */ + public AssistantEvaluationRecord() { + super(AssistantEvaluation.ASSISTANT_EVALUATION); + } + + /** + * Create a detached, initialised AssistantEvaluationRecord + */ + public AssistantEvaluationRecord(UUID assistantId, Boolean isGood, String feedback, LocalDateTime createdAt, UUID createdBy) { + super(AssistantEvaluation.ASSISTANT_EVALUATION); + + setAssistantId(assistantId); + setIsGood(isGood); + setFeedback(feedback); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised AssistantEvaluationRecord + */ + public AssistantEvaluationRecord(writeon.tables.pojos.AssistantEvaluation value) { + super(AssistantEvaluation.ASSISTANT_EVALUATION); + + if (value != null) { + setAssistantId(value.getAssistantId()); + setIsGood(value.getIsGood()); + setFeedback(value.getFeedback()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/AssistantMessageRecord.java b/domain/src/main/generated/writeon/tables/records/AssistantMessageRecord.java new file mode 100644 index 0000000..0e18c23 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/AssistantMessageRecord.java @@ -0,0 +1,182 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.AssistantMessage; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantMessageRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.assistant_message.id. + */ + public AssistantMessageRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.assistant_message.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.assistant_message.assistant_id. + */ + public AssistantMessageRecord setAssistantId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.assistant_message.assistant_id. + */ + public UUID getAssistantId() { + return (UUID) get(1); + } + + /** + * Setter for public.assistant_message.role. + */ + public AssistantMessageRecord setRole(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.assistant_message.role. + */ + public String getRole() { + return (String) get(2); + } + + /** + * Setter for public.assistant_message.content. + */ + public AssistantMessageRecord setContent(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.assistant_message.content. + */ + public String getContent() { + return (String) get(3); + } + + /** + * Setter for public.assistant_message.prompt. + */ + public AssistantMessageRecord setPrompt(String value) { + set(4, value); + return this; + } + + /** + * Getter for public.assistant_message.prompt. + */ + public String getPrompt() { + return (String) get(4); + } + + /** + * Setter for public.assistant_message.created_at. + */ + public AssistantMessageRecord setCreatedAt(LocalDateTime value) { + set(5, value); + return this; + } + + /** + * Getter for public.assistant_message.created_at. + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(5); + } + + /** + * Setter for public.assistant_message.created_by. + */ + public AssistantMessageRecord setCreatedBy(UUID value) { + set(6, value); + return this; + } + + /** + * Getter for public.assistant_message.created_by. + */ + public UUID getCreatedBy() { + return (UUID) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AssistantMessageRecord + */ + public AssistantMessageRecord() { + super(AssistantMessage.ASSISTANT_MESSAGE); + } + + /** + * Create a detached, initialised AssistantMessageRecord + */ + public AssistantMessageRecord(UUID id, UUID assistantId, String role, String content, String prompt, LocalDateTime createdAt, UUID createdBy) { + super(AssistantMessage.ASSISTANT_MESSAGE); + + setId(id); + setAssistantId(assistantId); + setRole(role); + setContent(content); + setPrompt(prompt); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised AssistantMessageRecord + */ + public AssistantMessageRecord(writeon.tables.pojos.AssistantMessage value) { + super(AssistantMessage.ASSISTANT_MESSAGE); + + if (value != null) { + setId(value.getId()); + setAssistantId(value.getAssistantId()); + setRole(value.getRole()); + setContent(value.getContent()); + setPrompt(value.getPrompt()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/AssistantPlannerMessageRecord.java b/domain/src/main/generated/writeon/tables/records/AssistantPlannerMessageRecord.java new file mode 100644 index 0000000..399bd74 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/AssistantPlannerMessageRecord.java @@ -0,0 +1,130 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.AssistantPlannerMessage; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantPlannerMessageRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.assistant_planner_message.assistant_id. + */ + public AssistantPlannerMessageRecord setAssistantId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.assistant_planner_message.assistant_id. + */ + public UUID getAssistantId() { + return (UUID) get(0); + } + + /** + * Setter for public.assistant_planner_message.genre. + */ + public AssistantPlannerMessageRecord setGenre(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.assistant_planner_message.genre. + */ + public String getGenre() { + return (String) get(1); + } + + /** + * Setter for public.assistant_planner_message.logline. + */ + public AssistantPlannerMessageRecord setLogline(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.assistant_planner_message.logline. + */ + public String getLogline() { + return (String) get(2); + } + + /** + * Setter for public.assistant_planner_message.section. + */ + public AssistantPlannerMessageRecord setSection(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.assistant_planner_message.section. + */ + public String getSection() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AssistantPlannerMessageRecord + */ + public AssistantPlannerMessageRecord() { + super(AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE); + } + + /** + * Create a detached, initialised AssistantPlannerMessageRecord + */ + public AssistantPlannerMessageRecord(UUID assistantId, String genre, String logline, String section) { + super(AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE); + + setAssistantId(assistantId); + setGenre(genre); + setLogline(logline); + setSection(section); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised AssistantPlannerMessageRecord + */ + public AssistantPlannerMessageRecord(writeon.tables.pojos.AssistantPlannerMessage value) { + super(AssistantPlannerMessage.ASSISTANT_PLANNER_MESSAGE); + + if (value != null) { + setAssistantId(value.getAssistantId()); + setGenre(value.getGenre()); + setLogline(value.getLogline()); + setSection(value.getSection()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/AssistantRecord.java b/domain/src/main/generated/writeon/tables/records/AssistantRecord.java new file mode 100644 index 0000000..aeff5e7 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/AssistantRecord.java @@ -0,0 +1,199 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.Assistant; + + +/** + * 어시스턴트 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AssistantRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.assistant.id. + */ + public AssistantRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.assistant.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.assistant.product_id. 작품 ID + */ + public AssistantRecord setProductId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.assistant.product_id. 작품 ID + */ + public UUID getProductId() { + return (UUID) get(1); + } + + /** + * Setter for public.assistant.type. 기능 종류 + */ + public AssistantRecord setType(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.assistant.type. 기능 종류 + */ + public String getType() { + return (String) get(2); + } + + /** + * Setter for public.assistant.status. 진행 상태 + */ + public AssistantRecord setStatus(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.assistant.status. 진행 상태 + */ + public String getStatus() { + return (String) get(3); + } + + /** + * Setter for public.assistant.is_applied. 진행 상태 + */ + public AssistantRecord setIsApplied(Boolean value) { + set(4, value); + return this; + } + + /** + * Getter for public.assistant.is_applied. 진행 상태 + */ + public Boolean getIsApplied() { + return (Boolean) get(4); + } + + /** + * Setter for public.assistant.created_at. 수정일시 + */ + public AssistantRecord setCreatedAt(LocalDateTime value) { + set(5, value); + return this; + } + + /** + * Getter for public.assistant.created_at. 수정일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(5); + } + + /** + * Setter for public.assistant.created_by. 생성자 ID + */ + public AssistantRecord setCreatedBy(UUID value) { + set(6, value); + return this; + } + + /** + * Getter for public.assistant.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(6); + } + + /** + * Setter for public.assistant.updated_at. + */ + public AssistantRecord setUpdatedAt(LocalDateTime value) { + set(7, value); + return this; + } + + /** + * Getter for public.assistant.updated_at. + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AssistantRecord + */ + public AssistantRecord() { + super(Assistant.ASSISTANT); + } + + /** + * Create a detached, initialised AssistantRecord + */ + public AssistantRecord(UUID id, UUID productId, String type, String status, Boolean isApplied, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt) { + super(Assistant.ASSISTANT); + + setId(id); + setProductId(productId); + setType(type); + setStatus(status); + setIsApplied(isApplied); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised AssistantRecord + */ + public AssistantRecord(writeon.tables.pojos.Assistant value) { + super(Assistant.ASSISTANT); + + if (value != null) { + setId(value.getId()); + setProductId(value.getProductId()); + setType(value.getType()); + setStatus(value.getStatus()); + setIsApplied(value.getIsApplied()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/LoginAttemptRecord.java b/domain/src/main/generated/writeon/tables/records/LoginAttemptRecord.java new file mode 100644 index 0000000..d24cca5 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/LoginAttemptRecord.java @@ -0,0 +1,148 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.LoginAttempt; + + +/** + * 로그인_시도 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class LoginAttemptRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.login_attempt.id. 로그인 시도 ID + */ + public LoginAttemptRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.login_attempt.id. 로그인 시도 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.login_attempt.email. 로그인 시도한 이메일 + */ + public LoginAttemptRecord setEmail(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.login_attempt.email. 로그인 시도한 이메일 + */ + public String getEmail() { + return (String) get(1); + } + + /** + * Setter for public.login_attempt.result. 로그인 시도 후 결과 + */ + public LoginAttemptRecord setResult(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.login_attempt.result. 로그인 시도 후 결과 + */ + public String getResult() { + return (String) get(2); + } + + /** + * Setter for public.login_attempt.created_at. + */ + public LoginAttemptRecord setCreatedAt(OffsetDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.login_attempt.created_at. + */ + public OffsetDateTime getCreatedAt() { + return (OffsetDateTime) get(3); + } + + /** + * Setter for public.login_attempt.updated_at. + */ + public LoginAttemptRecord setUpdatedAt(OffsetDateTime value) { + set(4, value); + return this; + } + + /** + * Getter for public.login_attempt.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return (OffsetDateTime) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached LoginAttemptRecord + */ + public LoginAttemptRecord() { + super(LoginAttempt.LOGIN_ATTEMPT); + } + + /** + * Create a detached, initialised LoginAttemptRecord + */ + public LoginAttemptRecord(UUID id, String email, String result, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + super(LoginAttempt.LOGIN_ATTEMPT); + + setId(id); + setEmail(email); + setResult(result); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised LoginAttemptRecord + */ + public LoginAttemptRecord(writeon.tables.pojos.LoginAttempt value) { + super(LoginAttempt.LOGIN_ATTEMPT); + + if (value != null) { + setId(value.getId()); + setEmail(value.getEmail()); + setResult(value.getResult()); + setCreatedAt(value.getCreatedAt()); + setUpdatedAt(value.getUpdatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/MemberPasswordRecord.java b/domain/src/main/generated/writeon/tables/records/MemberPasswordRecord.java new file mode 100644 index 0000000..ded569c --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/MemberPasswordRecord.java @@ -0,0 +1,131 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.MemberPassword; + + +/** + * 회원_비밀번호 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class MemberPasswordRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.member_password.member_id. 회원 ID + */ + public MemberPasswordRecord setMemberId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.member_password.member_id. 회원 ID + */ + public UUID getMemberId() { + return (UUID) get(0); + } + + /** + * Setter for public.member_password.password. 회원 비밀번호 + */ + public MemberPasswordRecord setPassword(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.member_password.password. 회원 비밀번호 + */ + public String getPassword() { + return (String) get(1); + } + + /** + * Setter for public.member_password.created_at. + */ + public MemberPasswordRecord setCreatedAt(OffsetDateTime value) { + set(2, value); + return this; + } + + /** + * Getter for public.member_password.created_at. + */ + public OffsetDateTime getCreatedAt() { + return (OffsetDateTime) get(2); + } + + /** + * Setter for public.member_password.updated_at. + */ + public MemberPasswordRecord setUpdatedAt(OffsetDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.member_password.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return (OffsetDateTime) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached MemberPasswordRecord + */ + public MemberPasswordRecord() { + super(MemberPassword.MEMBER_PASSWORD); + } + + /** + * Create a detached, initialised MemberPasswordRecord + */ + public MemberPasswordRecord(UUID memberId, String password, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + super(MemberPassword.MEMBER_PASSWORD); + + setMemberId(memberId); + setPassword(password); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised MemberPasswordRecord + */ + public MemberPasswordRecord(writeon.tables.pojos.MemberPassword value) { + super(MemberPassword.MEMBER_PASSWORD); + + if (value != null) { + setMemberId(value.getMemberId()); + setPassword(value.getPassword()); + setCreatedAt(value.getCreatedAt()); + setUpdatedAt(value.getUpdatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/MemberRecord.java b/domain/src/main/generated/writeon/tables/records/MemberRecord.java new file mode 100644 index 0000000..88d74ab --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/MemberRecord.java @@ -0,0 +1,165 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.Member; + + +/** + * 회원 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class MemberRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.member.id. 회원 ID + */ + public MemberRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.member.id. 회원 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.member.email. 회원 이메일 + */ + public MemberRecord setEmail(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.member.email. 회원 이메일 + */ + public String getEmail() { + return (String) get(1); + } + + /** + * Setter for public.member.nickname. 회원 닉네임 + */ + public MemberRecord setNickname(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.member.nickname. 회원 닉네임 + */ + public String getNickname() { + return (String) get(2); + } + + /** + * Setter for public.member.profile_image. 회원 프로필 이미지 경로 + */ + public MemberRecord setProfileImage(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.member.profile_image. 회원 프로필 이미지 경로 + */ + public String getProfileImage() { + return (String) get(3); + } + + /** + * Setter for public.member.created_at. + */ + public MemberRecord setCreatedAt(OffsetDateTime value) { + set(4, value); + return this; + } + + /** + * Getter for public.member.created_at. + */ + public OffsetDateTime getCreatedAt() { + return (OffsetDateTime) get(4); + } + + /** + * Setter for public.member.updated_at. + */ + public MemberRecord setUpdatedAt(OffsetDateTime value) { + set(5, value); + return this; + } + + /** + * Getter for public.member.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return (OffsetDateTime) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached MemberRecord + */ + public MemberRecord() { + super(Member.MEMBER); + } + + /** + * Create a detached, initialised MemberRecord + */ + public MemberRecord(UUID id, String email, String nickname, String profileImage, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + super(Member.MEMBER); + + setId(id); + setEmail(email); + setNickname(nickname); + setProfileImage(profileImage); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised MemberRecord + */ + public MemberRecord(writeon.tables.pojos.Member value) { + super(Member.MEMBER); + + if (value != null) { + setId(value.getId()); + setEmail(value.getEmail()); + setNickname(value.getNickname()); + setProfileImage(value.getProfileImage()); + setCreatedAt(value.getCreatedAt()); + setUpdatedAt(value.getUpdatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/PgpArmorHeadersRecord.java b/domain/src/main/generated/writeon/tables/records/PgpArmorHeadersRecord.java new file mode 100644 index 0000000..8e9c402 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/PgpArmorHeadersRecord.java @@ -0,0 +1,84 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import org.jooq.impl.TableRecordImpl; + +import writeon.tables.PgpArmorHeaders; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PgpArmorHeadersRecord extends TableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.pgp_armor_headers.key. + */ + public PgpArmorHeadersRecord setKey(String value) { + set(0, value); + return this; + } + + /** + * Getter for public.pgp_armor_headers.key. + */ + public String getKey() { + return (String) get(0); + } + + /** + * Setter for public.pgp_armor_headers.value. + */ + public PgpArmorHeadersRecord setValue(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.pgp_armor_headers.value. + */ + public String getValue() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached PgpArmorHeadersRecord + */ + public PgpArmorHeadersRecord() { + super(PgpArmorHeaders.PGP_ARMOR_HEADERS); + } + + /** + * Create a detached, initialised PgpArmorHeadersRecord + */ + public PgpArmorHeadersRecord(String key, String value) { + super(PgpArmorHeaders.PGP_ARMOR_HEADERS); + + setKey(key); + setValue(value); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised PgpArmorHeadersRecord + */ + public PgpArmorHeadersRecord(writeon.tables.pojos.PgpArmorHeaders value) { + super(PgpArmorHeaders.PGP_ARMOR_HEADERS); + + if (value != null) { + setKey(value.getKey()); + setValue(value.getValue()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductCharacterRecord.java b/domain/src/main/generated/writeon/tables/records/ProductCharacterRecord.java new file mode 100644 index 0000000..44bf415 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductCharacterRecord.java @@ -0,0 +1,318 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductCharacter; + + +/** + * 작품 등장인물 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductCharacterRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_character.id. 등장인물 ID + */ + public ProductCharacterRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_character.id. 등장인물 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_character.product_id. 작품 ID + */ + public ProductCharacterRecord setProductId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_character.product_id. 작품 ID + */ + public UUID getProductId() { + return (UUID) get(1); + } + + /** + * Setter for public.product_character.intro. 소개 + */ + public ProductCharacterRecord setIntro(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_character.intro. 소개 + */ + public String getIntro() { + return (String) get(2); + } + + /** + * Setter for public.product_character.name. 이름 + */ + public ProductCharacterRecord setName(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_character.name. 이름 + */ + public String getName() { + return (String) get(3); + } + + /** + * Setter for public.product_character.age. 나이 + */ + public ProductCharacterRecord setAge(Integer value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_character.age. 나이 + */ + public Integer getAge() { + return (Integer) get(4); + } + + /** + * Setter for public.product_character.gender. 성별 + */ + public ProductCharacterRecord setGender(String value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_character.gender. 성별 + */ + public String getGender() { + return (String) get(5); + } + + /** + * Setter for public.product_character.occupation. 직업 + */ + public ProductCharacterRecord setOccupation(String value) { + set(6, value); + return this; + } + + /** + * Getter for public.product_character.occupation. 직업 + */ + public String getOccupation() { + return (String) get(6); + } + + /** + * Setter for public.product_character.appearance. 외모 + */ + public ProductCharacterRecord setAppearance(String value) { + set(7, value); + return this; + } + + /** + * Getter for public.product_character.appearance. 외모 + */ + public String getAppearance() { + return (String) get(7); + } + + /** + * Setter for public.product_character.personality. 성격 + */ + public ProductCharacterRecord setPersonality(String value) { + set(8, value); + return this; + } + + /** + * Getter for public.product_character.personality. 성격 + */ + public String getPersonality() { + return (String) get(8); + } + + /** + * Setter for public.product_character.relationship. 주요 관계 + */ + public ProductCharacterRecord setRelationship(String value) { + set(9, value); + return this; + } + + /** + * Getter for public.product_character.relationship. 주요 관계 + */ + public String getRelationship() { + return (String) get(9); + } + + /** + * Setter for public.product_character.created_at. 생성일시 + */ + public ProductCharacterRecord setCreatedAt(LocalDateTime value) { + set(10, value); + return this; + } + + /** + * Getter for public.product_character.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(10); + } + + /** + * Setter for public.product_character.created_by. 생성자 ID + */ + public ProductCharacterRecord setCreatedBy(UUID value) { + set(11, value); + return this; + } + + /** + * Getter for public.product_character.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(11); + } + + /** + * Setter for public.product_character.updated_at. 수정일시 + */ + public ProductCharacterRecord setUpdatedAt(LocalDateTime value) { + set(12, value); + return this; + } + + /** + * Getter for public.product_character.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(12); + } + + /** + * Setter for public.product_character.updated_by. 수정자 ID + */ + public ProductCharacterRecord setUpdatedBy(UUID value) { + set(13, value); + return this; + } + + /** + * Getter for public.product_character.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(13); + } + + /** + * Setter for public.product_character.seq. + */ + public ProductCharacterRecord setSeq(Integer value) { + set(14, value); + return this; + } + + /** + * Getter for public.product_character.seq. + */ + public Integer getSeq() { + return (Integer) get(14); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductCharacterRecord + */ + public ProductCharacterRecord() { + super(ProductCharacter.PRODUCT_CHARACTER); + } + + /** + * Create a detached, initialised ProductCharacterRecord + */ + public ProductCharacterRecord(UUID id, UUID productId, String intro, String name, Integer age, String gender, String occupation, String appearance, String personality, String relationship, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy, Integer seq) { + super(ProductCharacter.PRODUCT_CHARACTER); + + setId(id); + setProductId(productId); + setIntro(intro); + setName(name); + setAge(age); + setGender(gender); + setOccupation(occupation); + setAppearance(appearance); + setPersonality(personality); + setRelationship(relationship); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + setSeq(seq); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductCharacterRecord + */ + public ProductCharacterRecord(writeon.tables.pojos.ProductCharacter value) { + super(ProductCharacter.PRODUCT_CHARACTER); + + if (value != null) { + setId(value.getId()); + setProductId(value.getProductId()); + setIntro(value.getIntro()); + setName(value.getName()); + setAge(value.getAge()); + setGender(value.getGender()); + setOccupation(value.getOccupation()); + setAppearance(value.getAppearance()); + setPersonality(value.getPersonality()); + setRelationship(value.getRelationship()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + setSeq(value.getSeq()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductCustomFieldRecord.java b/domain/src/main/generated/writeon/tables/records/ProductCustomFieldRecord.java new file mode 100644 index 0000000..c8910e5 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductCustomFieldRecord.java @@ -0,0 +1,250 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductCustomField; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductCustomFieldRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_custom_field.id. 커스텀 필드 ID + */ + public ProductCustomFieldRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_custom_field.id. 커스텀 필드 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_custom_field.product_id. 작품 ID + */ + public ProductCustomFieldRecord setProductId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_custom_field.product_id. 작품 ID + */ + public UUID getProductId() { + return (UUID) get(1); + } + + /** + * Setter for public.product_custom_field.section_id. 섹션 ID + */ + public ProductCustomFieldRecord setSectionId(UUID value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_custom_field.section_id. 섹션 ID + */ + public UUID getSectionId() { + return (UUID) get(2); + } + + /** + * Setter for public.product_custom_field.section_type. 섹션 타입 + */ + public ProductCustomFieldRecord setSectionType(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_custom_field.section_type. 섹션 타입 + */ + public String getSectionType() { + return (String) get(3); + } + + /** + * Setter for public.product_custom_field.name. 이름 + */ + public ProductCustomFieldRecord setName(String value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_custom_field.name. 이름 + */ + public String getName() { + return (String) get(4); + } + + /** + * Setter for public.product_custom_field.content. 내용 + */ + public ProductCustomFieldRecord setContent(String value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_custom_field.content. 내용 + */ + public String getContent() { + return (String) get(5); + } + + /** + * Setter for public.product_custom_field.seq. 순서 + */ + public ProductCustomFieldRecord setSeq(Short value) { + set(6, value); + return this; + } + + /** + * Getter for public.product_custom_field.seq. 순서 + */ + public Short getSeq() { + return (Short) get(6); + } + + /** + * Setter for public.product_custom_field.created_at. 생성일시 + */ + public ProductCustomFieldRecord setCreatedAt(LocalDateTime value) { + set(7, value); + return this; + } + + /** + * Getter for public.product_custom_field.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(7); + } + + /** + * Setter for public.product_custom_field.created_by. 생성자 ID + */ + public ProductCustomFieldRecord setCreatedBy(UUID value) { + set(8, value); + return this; + } + + /** + * Getter for public.product_custom_field.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(8); + } + + /** + * Setter for public.product_custom_field.updated_at. 수정일시 + */ + public ProductCustomFieldRecord setUpdatedAt(LocalDateTime value) { + set(9, value); + return this; + } + + /** + * Getter for public.product_custom_field.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(9); + } + + /** + * Setter for public.product_custom_field.updated_by. 수정자 ID + */ + public ProductCustomFieldRecord setUpdatedBy(UUID value) { + set(10, value); + return this; + } + + /** + * Getter for public.product_custom_field.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(10); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductCustomFieldRecord + */ + public ProductCustomFieldRecord() { + super(ProductCustomField.PRODUCT_CUSTOM_FIELD); + } + + /** + * Create a detached, initialised ProductCustomFieldRecord + */ + public ProductCustomFieldRecord(UUID id, UUID productId, UUID sectionId, String sectionType, String name, String content, Short seq, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(ProductCustomField.PRODUCT_CUSTOM_FIELD); + + setId(id); + setProductId(productId); + setSectionId(sectionId); + setSectionType(sectionType); + setName(name); + setContent(content); + setSeq(seq); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductCustomFieldRecord + */ + public ProductCustomFieldRecord(writeon.tables.pojos.ProductCustomField value) { + super(ProductCustomField.PRODUCT_CUSTOM_FIELD); + + if (value != null) { + setId(value.getId()); + setProductId(value.getProductId()); + setSectionId(value.getSectionId()); + setSectionType(value.getSectionType()); + setName(value.getName()); + setContent(value.getContent()); + setSeq(value.getSeq()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductFavoritePromptRecord.java b/domain/src/main/generated/writeon/tables/records/ProductFavoritePromptRecord.java new file mode 100644 index 0000000..17a6128 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductFavoritePromptRecord.java @@ -0,0 +1,131 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductFavoritePrompt; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductFavoritePromptRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_favorite_prompt.id. + */ + public ProductFavoritePromptRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_favorite_prompt.id. + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_favorite_prompt.product_id. + */ + public ProductFavoritePromptRecord setProductId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_favorite_prompt.product_id. + */ + public UUID getProductId() { + return (UUID) get(1); + } + + /** + * Setter for public.product_favorite_prompt.message_id. + */ + public ProductFavoritePromptRecord setMessageId(UUID value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_favorite_prompt.message_id. + */ + public UUID getMessageId() { + return (UUID) get(2); + } + + /** + * Setter for public.product_favorite_prompt.created_at. + */ + public ProductFavoritePromptRecord setCreatedAt(LocalDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_favorite_prompt.created_at. + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductFavoritePromptRecord + */ + public ProductFavoritePromptRecord() { + super(ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT); + } + + /** + * Create a detached, initialised ProductFavoritePromptRecord + */ + public ProductFavoritePromptRecord(UUID id, UUID productId, UUID messageId, LocalDateTime createdAt) { + super(ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT); + + setId(id); + setProductId(productId); + setMessageId(messageId); + setCreatedAt(createdAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductFavoritePromptRecord + */ + public ProductFavoritePromptRecord(writeon.tables.pojos.ProductFavoritePrompt value) { + super(ProductFavoritePrompt.PRODUCT_FAVORITE_PROMPT); + + if (value != null) { + setId(value.getId()); + setProductId(value.getProductId()); + setMessageId(value.getMessageId()); + setCreatedAt(value.getCreatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductFixedMessageRecord.java b/domain/src/main/generated/writeon/tables/records/ProductFixedMessageRecord.java new file mode 100644 index 0000000..4d84654 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductFixedMessageRecord.java @@ -0,0 +1,96 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductFixedMessage; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductFixedMessageRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_fixed_message.product_id. + */ + public ProductFixedMessageRecord setProductId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_fixed_message.product_id. + */ + public UUID getProductId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_fixed_message.message_id. + */ + public ProductFixedMessageRecord setMessageId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_fixed_message.message_id. + */ + public UUID getMessageId() { + return (UUID) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductFixedMessageRecord + */ + public ProductFixedMessageRecord() { + super(ProductFixedMessage.PRODUCT_FIXED_MESSAGE); + } + + /** + * Create a detached, initialised ProductFixedMessageRecord + */ + public ProductFixedMessageRecord(UUID productId, UUID messageId) { + super(ProductFixedMessage.PRODUCT_FIXED_MESSAGE); + + setProductId(productId); + setMessageId(messageId); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductFixedMessageRecord + */ + public ProductFixedMessageRecord(writeon.tables.pojos.ProductFixedMessage value) { + super(ProductFixedMessage.PRODUCT_FIXED_MESSAGE); + + if (value != null) { + setProductId(value.getProductId()); + setMessageId(value.getMessageId()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductIdeanoteRecord.java b/domain/src/main/generated/writeon/tables/records/ProductIdeanoteRecord.java new file mode 100644 index 0000000..03b5299 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductIdeanoteRecord.java @@ -0,0 +1,182 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductIdeanote; + + +/** + * 작품 아이디어 노트 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductIdeanoteRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_ideanote.id. 아이디어 노트 ID + */ + public ProductIdeanoteRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_ideanote.id. 아이디어 노트 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_ideanote.title. 제목 + */ + public ProductIdeanoteRecord setTitle(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_ideanote.title. 제목 + */ + public String getTitle() { + return (String) get(1); + } + + /** + * Setter for public.product_ideanote.content. 내용 + */ + public ProductIdeanoteRecord setContent(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_ideanote.content. 내용 + */ + public String getContent() { + return (String) get(2); + } + + /** + * Setter for public.product_ideanote.created_at. 생성일시 + */ + public ProductIdeanoteRecord setCreatedAt(LocalDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_ideanote.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(3); + } + + /** + * Setter for public.product_ideanote.created_by. 생성자 ID + */ + public ProductIdeanoteRecord setCreatedBy(UUID value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_ideanote.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(4); + } + + /** + * Setter for public.product_ideanote.updated_at. 수정일시 + */ + public ProductIdeanoteRecord setUpdatedAt(LocalDateTime value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_ideanote.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(5); + } + + /** + * Setter for public.product_ideanote.updated_by. 수정자 ID + */ + public ProductIdeanoteRecord setUpdatedBy(UUID value) { + set(6, value); + return this; + } + + /** + * Getter for public.product_ideanote.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductIdeanoteRecord + */ + public ProductIdeanoteRecord() { + super(ProductIdeanote.PRODUCT_IDEANOTE); + } + + /** + * Create a detached, initialised ProductIdeanoteRecord + */ + public ProductIdeanoteRecord(UUID id, String title, String content, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(ProductIdeanote.PRODUCT_IDEANOTE); + + setId(id); + setTitle(title); + setContent(content); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductIdeanoteRecord + */ + public ProductIdeanoteRecord(writeon.tables.pojos.ProductIdeanote value) { + super(ProductIdeanote.PRODUCT_IDEANOTE); + + if (value != null) { + setId(value.getId()); + setTitle(value.getTitle()); + setContent(value.getContent()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductMemoRecord.java b/domain/src/main/generated/writeon/tables/records/ProductMemoRecord.java new file mode 100644 index 0000000..1dd6acf --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductMemoRecord.java @@ -0,0 +1,267 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductMemo; + + +/** + * 작품 메모 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductMemoRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_memo.id. 메모 ID + */ + public ProductMemoRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_memo.id. 메모 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_memo.product_id. 작품 ID + */ + public ProductMemoRecord setProductId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_memo.product_id. 작품 ID + */ + public UUID getProductId() { + return (UUID) get(1); + } + + /** + * Setter for public.product_memo.title. 제목 + */ + public ProductMemoRecord setTitle(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_memo.title. 제목 + */ + public String getTitle() { + return (String) get(2); + } + + /** + * Setter for public.product_memo.content. 내용 + */ + public ProductMemoRecord setContent(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_memo.content. 내용 + */ + public String getContent() { + return (String) get(3); + } + + /** + * Setter for public.product_memo.selected_text. + */ + public ProductMemoRecord setSelectedText(String value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_memo.selected_text. + */ + public String getSelectedText() { + return (String) get(4); + } + + /** + * Setter for public.product_memo.start_index. + */ + public ProductMemoRecord setStartIndex(Integer value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_memo.start_index. + */ + public Integer getStartIndex() { + return (Integer) get(5); + } + + /** + * Setter for public.product_memo.end_index. + */ + public ProductMemoRecord setEndIndex(Integer value) { + set(6, value); + return this; + } + + /** + * Getter for public.product_memo.end_index. + */ + public Integer getEndIndex() { + return (Integer) get(6); + } + + /** + * Setter for public.product_memo.is_completed. 완료 여부 + */ + public ProductMemoRecord setIsCompleted(Boolean value) { + set(7, value); + return this; + } + + /** + * Getter for public.product_memo.is_completed. 완료 여부 + */ + public Boolean getIsCompleted() { + return (Boolean) get(7); + } + + /** + * Setter for public.product_memo.created_at. 생성일시 + */ + public ProductMemoRecord setCreatedAt(LocalDateTime value) { + set(8, value); + return this; + } + + /** + * Getter for public.product_memo.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(8); + } + + /** + * Setter for public.product_memo.created_by. 생성자 ID + */ + public ProductMemoRecord setCreatedBy(UUID value) { + set(9, value); + return this; + } + + /** + * Getter for public.product_memo.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(9); + } + + /** + * Setter for public.product_memo.updated_at. 수정일시 + */ + public ProductMemoRecord setUpdatedAt(LocalDateTime value) { + set(10, value); + return this; + } + + /** + * Getter for public.product_memo.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(10); + } + + /** + * Setter for public.product_memo.updated_by. 수정일시 + */ + public ProductMemoRecord setUpdatedBy(UUID value) { + set(11, value); + return this; + } + + /** + * Getter for public.product_memo.updated_by. 수정일시 + */ + public UUID getUpdatedBy() { + return (UUID) get(11); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductMemoRecord + */ + public ProductMemoRecord() { + super(ProductMemo.PRODUCT_MEMO); + } + + /** + * Create a detached, initialised ProductMemoRecord + */ + public ProductMemoRecord(UUID id, UUID productId, String title, String content, String selectedText, Integer startIndex, Integer endIndex, Boolean isCompleted, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(ProductMemo.PRODUCT_MEMO); + + setId(id); + setProductId(productId); + setTitle(title); + setContent(content); + setSelectedText(selectedText); + setStartIndex(startIndex); + setEndIndex(endIndex); + setIsCompleted(isCompleted); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductMemoRecord + */ + public ProductMemoRecord(writeon.tables.pojos.ProductMemo value) { + super(ProductMemo.PRODUCT_MEMO); + + if (value != null) { + setId(value.getId()); + setProductId(value.getProductId()); + setTitle(value.getTitle()); + setContent(value.getContent()); + setSelectedText(value.getSelectedText()); + setStartIndex(value.getStartIndex()); + setEndIndex(value.getEndIndex()); + setIsCompleted(value.getIsCompleted()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductPlotRecord.java b/domain/src/main/generated/writeon/tables/records/ProductPlotRecord.java new file mode 100644 index 0000000..3aa11af --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductPlotRecord.java @@ -0,0 +1,165 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductPlot; + + +/** + * 작품 줄거리 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductPlotRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_plot.id. 줄거리 ID + */ + public ProductPlotRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_plot.id. 줄거리 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_plot.content. 내용 + */ + public ProductPlotRecord setContent(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_plot.content. 내용 + */ + public String getContent() { + return (String) get(1); + } + + /** + * Setter for public.product_plot.created_at. 생성일시 + */ + public ProductPlotRecord setCreatedAt(LocalDateTime value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_plot.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(2); + } + + /** + * Setter for public.product_plot.created_by. 생성자 ID + */ + public ProductPlotRecord setCreatedBy(UUID value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_plot.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(3); + } + + /** + * Setter for public.product_plot.updated_at. 수정일시 + */ + public ProductPlotRecord setUpdatedAt(LocalDateTime value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_plot.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(4); + } + + /** + * Setter for public.product_plot.updated_by. 수정자 ID + */ + public ProductPlotRecord setUpdatedBy(UUID value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_plot.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductPlotRecord + */ + public ProductPlotRecord() { + super(ProductPlot.PRODUCT_PLOT); + } + + /** + * Create a detached, initialised ProductPlotRecord + */ + public ProductPlotRecord(UUID id, String content, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(ProductPlot.PRODUCT_PLOT); + + setId(id); + setContent(content); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductPlotRecord + */ + public ProductPlotRecord(writeon.tables.pojos.ProductPlot value) { + super(ProductPlot.PRODUCT_PLOT); + + if (value != null) { + setId(value.getId()); + setContent(value.getContent()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductRecord.java b/domain/src/main/generated/writeon/tables/records/ProductRecord.java new file mode 100644 index 0000000..04c789d --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductRecord.java @@ -0,0 +1,182 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.Product; + + +/** + * 작품 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product.id. 작품 ID + */ + public ProductRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product.id. 작품 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product.title. 제목 + */ + public ProductRecord setTitle(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.product.title. 제목 + */ + public String getTitle() { + return (String) get(1); + } + + /** + * Setter for public.product.content. 내용 + */ + public ProductRecord setContent(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.product.content. 내용 + */ + public String getContent() { + return (String) get(2); + } + + /** + * Setter for public.product.created_at. 생성일시 + */ + public ProductRecord setCreatedAt(LocalDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.product.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(3); + } + + /** + * Setter for public.product.created_by. 생성자 ID + */ + public ProductRecord setCreatedBy(UUID value) { + set(4, value); + return this; + } + + /** + * Getter for public.product.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(4); + } + + /** + * Setter for public.product.updated_at. 수정일시 + */ + public ProductRecord setUpdatedAt(LocalDateTime value) { + set(5, value); + return this; + } + + /** + * Getter for public.product.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(5); + } + + /** + * Setter for public.product.updated_by. 수정자 ID + */ + public ProductRecord setUpdatedBy(UUID value) { + set(6, value); + return this; + } + + /** + * Getter for public.product.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductRecord + */ + public ProductRecord() { + super(Product.PRODUCT); + } + + /** + * Create a detached, initialised ProductRecord + */ + public ProductRecord(UUID id, String title, String content, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(Product.PRODUCT); + + setId(id); + setTitle(title); + setContent(content); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductRecord + */ + public ProductRecord(writeon.tables.pojos.Product value) { + super(Product.PRODUCT); + + if (value != null) { + setId(value.getId()); + setTitle(value.getTitle()); + setContent(value.getContent()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductSynopsisRecord.java b/domain/src/main/generated/writeon/tables/records/ProductSynopsisRecord.java new file mode 100644 index 0000000..1ecebbc --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductSynopsisRecord.java @@ -0,0 +1,233 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductSynopsis; + + +/** + * 작품 시놉시스 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductSynopsisRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_synopsis.id. 시놉시스 ID + */ + public ProductSynopsisRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_synopsis.id. 시놉시스 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_synopsis.genre. 장르 + */ + public ProductSynopsisRecord setGenre(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_synopsis.genre. 장르 + */ + public String getGenre() { + return (String) get(1); + } + + /** + * Setter for public.product_synopsis.length. 분량 + */ + public ProductSynopsisRecord setLength(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_synopsis.length. 분량 + */ + public String getLength() { + return (String) get(2); + } + + /** + * Setter for public.product_synopsis.purpose. 기획 의도 + */ + public ProductSynopsisRecord setPurpose(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_synopsis.purpose. 기획 의도 + */ + public String getPurpose() { + return (String) get(3); + } + + /** + * Setter for public.product_synopsis.logline. 로그라인 + */ + public ProductSynopsisRecord setLogline(String value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_synopsis.logline. 로그라인 + */ + public String getLogline() { + return (String) get(4); + } + + /** + * Setter for public.product_synopsis.example. 예시 문장 + */ + public ProductSynopsisRecord setExample(String value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_synopsis.example. 예시 문장 + */ + public String getExample() { + return (String) get(5); + } + + /** + * Setter for public.product_synopsis.created_at. 생성일시 + */ + public ProductSynopsisRecord setCreatedAt(LocalDateTime value) { + set(6, value); + return this; + } + + /** + * Getter for public.product_synopsis.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(6); + } + + /** + * Setter for public.product_synopsis.created_by. 생성자 ID + */ + public ProductSynopsisRecord setCreatedBy(UUID value) { + set(7, value); + return this; + } + + /** + * Getter for public.product_synopsis.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(7); + } + + /** + * Setter for public.product_synopsis.updated_at. 수정일시 + */ + public ProductSynopsisRecord setUpdatedAt(LocalDateTime value) { + set(8, value); + return this; + } + + /** + * Getter for public.product_synopsis.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(8); + } + + /** + * Setter for public.product_synopsis.updated_by. 수정자 ID + */ + public ProductSynopsisRecord setUpdatedBy(UUID value) { + set(9, value); + return this; + } + + /** + * Getter for public.product_synopsis.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductSynopsisRecord + */ + public ProductSynopsisRecord() { + super(ProductSynopsis.PRODUCT_SYNOPSIS); + } + + /** + * Create a detached, initialised ProductSynopsisRecord + */ + public ProductSynopsisRecord(UUID id, String genre, String length, String purpose, String logline, String example, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(ProductSynopsis.PRODUCT_SYNOPSIS); + + setId(id); + setGenre(genre); + setLength(length); + setPurpose(purpose); + setLogline(logline); + setExample(example); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductSynopsisRecord + */ + public ProductSynopsisRecord(writeon.tables.pojos.ProductSynopsis value) { + super(ProductSynopsis.PRODUCT_SYNOPSIS); + + if (value != null) { + setId(value.getId()); + setGenre(value.getGenre()); + setLength(value.getLength()); + setPurpose(value.getPurpose()); + setLogline(value.getLogline()); + setExample(value.getExample()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/ProductWorldviewRecord.java b/domain/src/main/generated/writeon/tables/records/ProductWorldviewRecord.java new file mode 100644 index 0000000..e2164d0 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/ProductWorldviewRecord.java @@ -0,0 +1,369 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.LocalDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.ProductWorldview; + + +/** + * 작품 세계관 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ProductWorldviewRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.product_worldview.id. 세계관 ID + */ + public ProductWorldviewRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.product_worldview.id. 세계관 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.product_worldview.geography. 지리 + */ + public ProductWorldviewRecord setGeography(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.product_worldview.geography. 지리 + */ + public String getGeography() { + return (String) get(1); + } + + /** + * Setter for public.product_worldview.history. 역사 + */ + public ProductWorldviewRecord setHistory(String value) { + set(2, value); + return this; + } + + /** + * Getter for public.product_worldview.history. 역사 + */ + public String getHistory() { + return (String) get(2); + } + + /** + * Setter for public.product_worldview.politics. 정치 + */ + public ProductWorldviewRecord setPolitics(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.product_worldview.politics. 정치 + */ + public String getPolitics() { + return (String) get(3); + } + + /** + * Setter for public.product_worldview.society. 사회 + */ + public ProductWorldviewRecord setSociety(String value) { + set(4, value); + return this; + } + + /** + * Getter for public.product_worldview.society. 사회 + */ + public String getSociety() { + return (String) get(4); + } + + /** + * Setter for public.product_worldview.religion. 종교 + */ + public ProductWorldviewRecord setReligion(String value) { + set(5, value); + return this; + } + + /** + * Getter for public.product_worldview.religion. 종교 + */ + public String getReligion() { + return (String) get(5); + } + + /** + * Setter for public.product_worldview.economy. 경제 + */ + public ProductWorldviewRecord setEconomy(String value) { + set(6, value); + return this; + } + + /** + * Getter for public.product_worldview.economy. 경제 + */ + public String getEconomy() { + return (String) get(6); + } + + /** + * Setter for public.product_worldview.technology. 기술 + */ + public ProductWorldviewRecord setTechnology(String value) { + set(7, value); + return this; + } + + /** + * Getter for public.product_worldview.technology. 기술 + */ + public String getTechnology() { + return (String) get(7); + } + + /** + * Setter for public.product_worldview.lifestyle. 생활 + */ + public ProductWorldviewRecord setLifestyle(String value) { + set(8, value); + return this; + } + + /** + * Getter for public.product_worldview.lifestyle. 생활 + */ + public String getLifestyle() { + return (String) get(8); + } + + /** + * Setter for public.product_worldview.language. 언어 + */ + public ProductWorldviewRecord setLanguage(String value) { + set(9, value); + return this; + } + + /** + * Getter for public.product_worldview.language. 언어 + */ + public String getLanguage() { + return (String) get(9); + } + + /** + * Setter for public.product_worldview.culture. 문화 + */ + public ProductWorldviewRecord setCulture(String value) { + set(10, value); + return this; + } + + /** + * Getter for public.product_worldview.culture. 문화 + */ + public String getCulture() { + return (String) get(10); + } + + /** + * Setter for public.product_worldview.species. 종족 + */ + public ProductWorldviewRecord setSpecies(String value) { + set(11, value); + return this; + } + + /** + * Getter for public.product_worldview.species. 종족 + */ + public String getSpecies() { + return (String) get(11); + } + + /** + * Setter for public.product_worldview.occupation. 직업 + */ + public ProductWorldviewRecord setOccupation(String value) { + set(12, value); + return this; + } + + /** + * Getter for public.product_worldview.occupation. 직업 + */ + public String getOccupation() { + return (String) get(12); + } + + /** + * Setter for public.product_worldview.conflict. 갈등 관계 + */ + public ProductWorldviewRecord setConflict(String value) { + set(13, value); + return this; + } + + /** + * Getter for public.product_worldview.conflict. 갈등 관계 + */ + public String getConflict() { + return (String) get(13); + } + + /** + * Setter for public.product_worldview.created_at. 생성일시 + */ + public ProductWorldviewRecord setCreatedAt(LocalDateTime value) { + set(14, value); + return this; + } + + /** + * Getter for public.product_worldview.created_at. 생성일시 + */ + public LocalDateTime getCreatedAt() { + return (LocalDateTime) get(14); + } + + /** + * Setter for public.product_worldview.created_by. 생성자 ID + */ + public ProductWorldviewRecord setCreatedBy(UUID value) { + set(15, value); + return this; + } + + /** + * Getter for public.product_worldview.created_by. 생성자 ID + */ + public UUID getCreatedBy() { + return (UUID) get(15); + } + + /** + * Setter for public.product_worldview.updated_at. 수정일시 + */ + public ProductWorldviewRecord setUpdatedAt(LocalDateTime value) { + set(16, value); + return this; + } + + /** + * Getter for public.product_worldview.updated_at. 수정일시 + */ + public LocalDateTime getUpdatedAt() { + return (LocalDateTime) get(16); + } + + /** + * Setter for public.product_worldview.updated_by. 수정자 ID + */ + public ProductWorldviewRecord setUpdatedBy(UUID value) { + set(17, value); + return this; + } + + /** + * Getter for public.product_worldview.updated_by. 수정자 ID + */ + public UUID getUpdatedBy() { + return (UUID) get(17); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached ProductWorldviewRecord + */ + public ProductWorldviewRecord() { + super(ProductWorldview.PRODUCT_WORLDVIEW); + } + + /** + * Create a detached, initialised ProductWorldviewRecord + */ + public ProductWorldviewRecord(UUID id, String geography, String history, String politics, String society, String religion, String economy, String technology, String lifestyle, String language, String culture, String species, String occupation, String conflict, LocalDateTime createdAt, UUID createdBy, LocalDateTime updatedAt, UUID updatedBy) { + super(ProductWorldview.PRODUCT_WORLDVIEW); + + setId(id); + setGeography(geography); + setHistory(history); + setPolitics(politics); + setSociety(society); + setReligion(religion); + setEconomy(economy); + setTechnology(technology); + setLifestyle(lifestyle); + setLanguage(language); + setCulture(culture); + setSpecies(species); + setOccupation(occupation); + setConflict(conflict); + setCreatedAt(createdAt); + setCreatedBy(createdBy); + setUpdatedAt(updatedAt); + setUpdatedBy(updatedBy); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised ProductWorldviewRecord + */ + public ProductWorldviewRecord(writeon.tables.pojos.ProductWorldview value) { + super(ProductWorldview.PRODUCT_WORLDVIEW); + + if (value != null) { + setId(value.getId()); + setGeography(value.getGeography()); + setHistory(value.getHistory()); + setPolitics(value.getPolitics()); + setSociety(value.getSociety()); + setReligion(value.getReligion()); + setEconomy(value.getEconomy()); + setTechnology(value.getTechnology()); + setLifestyle(value.getLifestyle()); + setLanguage(value.getLanguage()); + setCulture(value.getCulture()); + setSpecies(value.getSpecies()); + setOccupation(value.getOccupation()); + setConflict(value.getConflict()); + setCreatedAt(value.getCreatedAt()); + setCreatedBy(value.getCreatedBy()); + setUpdatedAt(value.getUpdatedAt()); + setUpdatedBy(value.getUpdatedBy()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/TermsAgreementRecord.java b/domain/src/main/generated/writeon/tables/records/TermsAgreementRecord.java new file mode 100644 index 0000000..3bd4bfd --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/TermsAgreementRecord.java @@ -0,0 +1,131 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.jooq.Record2; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.TermsAgreement; + + +/** + * 약관_동의 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class TermsAgreementRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.terms_agreement.terms_cd. 약관 코드 + */ + public TermsAgreementRecord setTermsCd(String value) { + set(0, value); + return this; + } + + /** + * Getter for public.terms_agreement.terms_cd. 약관 코드 + */ + public String getTermsCd() { + return (String) get(0); + } + + /** + * Setter for public.terms_agreement.member_id. 회원 ID + */ + public TermsAgreementRecord setMemberId(UUID value) { + set(1, value); + return this; + } + + /** + * Getter for public.terms_agreement.member_id. 회원 ID + */ + public UUID getMemberId() { + return (UUID) get(1); + } + + /** + * Setter for public.terms_agreement.created_at. + */ + public TermsAgreementRecord setCreatedAt(OffsetDateTime value) { + set(2, value); + return this; + } + + /** + * Getter for public.terms_agreement.created_at. + */ + public OffsetDateTime getCreatedAt() { + return (OffsetDateTime) get(2); + } + + /** + * Setter for public.terms_agreement.updated_at. + */ + public TermsAgreementRecord setUpdatedAt(OffsetDateTime value) { + set(3, value); + return this; + } + + /** + * Getter for public.terms_agreement.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return (OffsetDateTime) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TermsAgreementRecord + */ + public TermsAgreementRecord() { + super(TermsAgreement.TERMS_AGREEMENT); + } + + /** + * Create a detached, initialised TermsAgreementRecord + */ + public TermsAgreementRecord(String termsCd, UUID memberId, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + super(TermsAgreement.TERMS_AGREEMENT); + + setTermsCd(termsCd); + setMemberId(memberId); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised TermsAgreementRecord + */ + public TermsAgreementRecord(writeon.tables.pojos.TermsAgreement value) { + super(TermsAgreement.TERMS_AGREEMENT); + + if (value != null) { + setTermsCd(value.getTermsCd()); + setMemberId(value.getMemberId()); + setCreatedAt(value.getCreatedAt()); + setUpdatedAt(value.getUpdatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/generated/writeon/tables/records/TermsRecord.java b/domain/src/main/generated/writeon/tables/records/TermsRecord.java new file mode 100644 index 0000000..d4bfb27 --- /dev/null +++ b/domain/src/main/generated/writeon/tables/records/TermsRecord.java @@ -0,0 +1,199 @@ +/* + * This file is generated by jOOQ. + */ +package writeon.tables.records; + + +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.jooq.Record1; +import org.jooq.impl.UpdatableRecordImpl; + +import writeon.tables.Terms; + + +/** + * 약관 + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class TermsRecord extends UpdatableRecordImpl { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.terms.id. 약관 ID + */ + public TermsRecord setId(UUID value) { + set(0, value); + return this; + } + + /** + * Getter for public.terms.id. 약관 ID + */ + public UUID getId() { + return (UUID) get(0); + } + + /** + * Setter for public.terms.cd. 약관 코드 + */ + public TermsRecord setCd(String value) { + set(1, value); + return this; + } + + /** + * Getter for public.terms.cd. 약관 코드 + */ + public String getCd() { + return (String) get(1); + } + + /** + * Setter for public.terms.version. 약관 버전 + */ + public TermsRecord setVersion(Integer value) { + set(2, value); + return this; + } + + /** + * Getter for public.terms.version. 약관 버전 + */ + public Integer getVersion() { + return (Integer) get(2); + } + + /** + * Setter for public.terms.title. 약관 제목 + */ + public TermsRecord setTitle(String value) { + set(3, value); + return this; + } + + /** + * Getter for public.terms.title. 약관 제목 + */ + public String getTitle() { + return (String) get(3); + } + + /** + * Setter for public.terms.content. 약관 내용 + */ + public TermsRecord setContent(String value) { + set(4, value); + return this; + } + + /** + * Getter for public.terms.content. 약관 내용 + */ + public String getContent() { + return (String) get(4); + } + + /** + * Setter for public.terms.is_required. 동의 필수 여부 + */ + public TermsRecord setIsRequired(Boolean value) { + set(5, value); + return this; + } + + /** + * Getter for public.terms.is_required. 동의 필수 여부 + */ + public Boolean getIsRequired() { + return (Boolean) get(5); + } + + /** + * Setter for public.terms.created_at. + */ + public TermsRecord setCreatedAt(OffsetDateTime value) { + set(6, value); + return this; + } + + /** + * Getter for public.terms.created_at. + */ + public OffsetDateTime getCreatedAt() { + return (OffsetDateTime) get(6); + } + + /** + * Setter for public.terms.updated_at. + */ + public TermsRecord setUpdatedAt(OffsetDateTime value) { + set(7, value); + return this; + } + + /** + * Getter for public.terms.updated_at. + */ + public OffsetDateTime getUpdatedAt() { + return (OffsetDateTime) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TermsRecord + */ + public TermsRecord() { + super(Terms.TERMS); + } + + /** + * Create a detached, initialised TermsRecord + */ + public TermsRecord(UUID id, String cd, Integer version, String title, String content, Boolean isRequired, OffsetDateTime createdAt, OffsetDateTime updatedAt) { + super(Terms.TERMS); + + setId(id); + setCd(cd); + setVersion(version); + setTitle(title); + setContent(content); + setIsRequired(isRequired); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + resetChangedOnNotNull(); + } + + /** + * Create a detached, initialised TermsRecord + */ + public TermsRecord(writeon.tables.pojos.Terms value) { + super(Terms.TERMS); + + if (value != null) { + setId(value.getId()); + setCd(value.getCd()); + setVersion(value.getVersion()); + setTitle(value.getTitle()); + setContent(value.getContent()); + setIsRequired(value.getIsRequired()); + setCreatedAt(value.getCreatedAt()); + setUpdatedAt(value.getUpdatedAt()); + resetChangedOnNotNull(); + } + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/Assistant.java b/domain/src/main/java/writeon/domain/assistant/Assistant.java new file mode 100644 index 0000000..89fd120 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/Assistant.java @@ -0,0 +1,62 @@ +package writeon.domain.assistant; + +import com.fasterxml.uuid.Generators; +import jakarta.persistence.*; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import writeon.domain.assistant.enums.AssistantStatus; +import writeon.domain.assistant.enums.AssistantType; +import writeon.domain.common.BaseTimeEntity; + +import java.util.UUID; + +@Getter +@Entity +@NoArgsConstructor +@Table(name = "assistant") +public class Assistant extends BaseTimeEntity { + + @Id + @Column(name = "id", updatable = false) + private final UUID id = Generators.timeBasedEpochGenerator().generate(); + + @Column(name = "product_id", updatable = false, nullable = false) + private UUID productId; + + @Convert(converter = AssistantType.TypeCodeConverter.class) + @Column(name = "type", nullable = false) + private AssistantType type; + + @Convert(converter = AssistantStatus.TypeCodeConverter.class) + @Column(name = "status", nullable = false) + private AssistantStatus status = AssistantStatus.DRAFT; + + @Column(name = "is_applied", nullable = false) + private Boolean isApplied = Boolean.FALSE; + + @Column(name = "is_archived", nullable = false) + private Boolean isArchived = Boolean.FALSE; + + @Column(name = "created_by", updatable = false, nullable = false) + private UUID createdBy; + + @Builder + public Assistant(UUID productId, AssistantType type, UUID createdBy) { + this.productId = productId; + this.type = type; + this.createdBy = createdBy; + } + + public void apply() { + this.isApplied = Boolean.TRUE; + } + + public void archive() { + this.isArchived = Boolean.TRUE; + } + + public void updateStatus(AssistantStatus status) { + this.status = status; + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantEvaluation.java b/domain/src/main/java/writeon/domain/assistant/AssistantEvaluation.java new file mode 100644 index 0000000..940c960 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantEvaluation.java @@ -0,0 +1,47 @@ +package writeon.domain.assistant; + +import jakarta.persistence.*; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.CreatedBy; +import writeon.domain.assistant.enums.FeedbackType; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Getter +@Entity +@NoArgsConstructor +@Table(name = "assistant_evaluation") +public class AssistantEvaluation { + + @Id + @Column(name = "assistant_id", updatable = false) + private UUID assistantId; + + @Column(name = "is_good", nullable = false) + private Boolean isGood; + + @Convert(converter = FeedbackType.TypeCodeConverter.class) + @Column(name = "feedback_type") + private FeedbackType feedbackType; + + @Column(name = "feedback") + private String feedback; + + @Column(name = "created_at", updatable = false, nullable = false) + protected final LocalDateTime createdAt = LocalDateTime.now(); + + @CreatedBy + @Column(name = "created_by", updatable = false, nullable = false) + protected UUID createdBy = UUID.randomUUID(); + + @Builder + public AssistantEvaluation(UUID assistantId, Boolean isGood, FeedbackType feedbackType, String feedback) { + this.assistantId = assistantId; + this.isGood = isGood; + this.feedbackType = feedbackType; + this.feedback = feedback; + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantEvaluationJpaRepository.java b/domain/src/main/java/writeon/domain/assistant/AssistantEvaluationJpaRepository.java new file mode 100644 index 0000000..4423129 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantEvaluationJpaRepository.java @@ -0,0 +1,10 @@ +package writeon.domain.assistant; + +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +import java.util.UUID; + +public interface AssistantEvaluationJpaRepository extends JpaRepository { + List getByCreatedBy(UUID createdBy); +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantJpaRepository.java b/domain/src/main/java/writeon/domain/assistant/AssistantJpaRepository.java new file mode 100644 index 0000000..ab3a534 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantJpaRepository.java @@ -0,0 +1,21 @@ +package writeon.domain.assistant; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import writeon.domain.assistant.enums.AssistantStatus; + +import java.util.Optional; +import java.util.UUID; + +public interface AssistantJpaRepository extends JpaRepository { + + Optional findByIdAndCreatedBy(UUID assistantId, UUID createdBy); + + boolean existsByIdAndCreatedBy(UUID assistantId, UUID createdBy); + + @Modifying + @Query("UPDATE Assistant a SET a.status = :status WHERE a.id = :assistantId") + void updateStatus(@Param("assistantId") UUID assistantId, @Param("status") AssistantStatus status); +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantMessage.java b/domain/src/main/java/writeon/domain/assistant/AssistantMessage.java new file mode 100644 index 0000000..dec3604 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantMessage.java @@ -0,0 +1,58 @@ +package writeon.domain.assistant; + +import com.fasterxml.uuid.Generators; + +import java.time.LocalDateTime; +import java.util.UUID; + +import jakarta.persistence.Column; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import writeon.domain.assistant.enums.MessageSenderRole; + +@Getter +@Entity +@NoArgsConstructor +@Table(name = "assistant_message") +public class AssistantMessage { + + @Id + @Column(updatable = false, nullable = false) + private final UUID id = Generators.timeBasedEpochGenerator().generate(); + + @Column(name = "assistant_id", nullable = false) + private UUID assistantId; + + @Embedded + private MessageContent messageContent; + + @Column(name = "prompt") + private String prompt; + + @Column(name = "created_at", updatable = false, nullable = false) + private final LocalDateTime createdAt = LocalDateTime.now(); + + @Column(name = "created_by", updatable = false) + private UUID createdBy; + + @Builder + public AssistantMessage(UUID assistantId, MessageSenderRole role, String content, String prompt, UUID createdBy) { + this.assistantId = assistantId; + this.messageContent = new MessageContent(role, content); + this.prompt = prompt; + this.createdBy = createdBy; + } + + public MessageSenderRole getRole() { + return messageContent.getRole(); + } + + public String getContent() { + return messageContent.getContent(); + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantMessageJpaRepository.java b/domain/src/main/java/writeon/domain/assistant/AssistantMessageJpaRepository.java new file mode 100644 index 0000000..235ebd2 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantMessageJpaRepository.java @@ -0,0 +1,14 @@ +package writeon.domain.assistant; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.assistant.enums.MessageSenderRole; + +import java.util.Optional; +import java.util.UUID; + +public interface AssistantMessageJpaRepository extends JpaRepository { + + boolean existsByAssistantIdAndMessageContent_Role(UUID assistantId, MessageSenderRole role); + + Optional findByAssistantIdAndMessageContent_Role(UUID assistantId, MessageSenderRole role); +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantPlannerMessage.java b/domain/src/main/java/writeon/domain/assistant/AssistantPlannerMessage.java new file mode 100644 index 0000000..3ac5a43 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantPlannerMessage.java @@ -0,0 +1,36 @@ +package writeon.domain.assistant; + +import jakarta.persistence.*; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.UUID; + +@Getter +@Entity +@NoArgsConstructor +@Table(name = "assistant_planner_message") +public class AssistantPlannerMessage { + + @Id + @Column(name = "assistant_id", updatable = false, nullable = false) + private UUID assistantId; + + @Column(name = "genre", nullable = false) + private String genre; + + @Column(name = "logline", nullable = false) + private String logline; + + @Column(name = "section", nullable = false) + private String section; + + @Builder + public AssistantPlannerMessage(UUID assistantId, String genre, String logline, String section) { + this.assistantId = assistantId; + this.genre = genre; + this.logline = logline; + this.section = section; + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/AssistantPlannerMessageJpaRepository.java b/domain/src/main/java/writeon/domain/assistant/AssistantPlannerMessageJpaRepository.java new file mode 100644 index 0000000..842192e --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/AssistantPlannerMessageJpaRepository.java @@ -0,0 +1,8 @@ +package writeon.domain.assistant; + +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.UUID; + +public interface AssistantPlannerMessageJpaRepository extends JpaRepository { +} diff --git a/domain/src/main/java/writeon/domain/assistant/MessageContent.java b/domain/src/main/java/writeon/domain/assistant/MessageContent.java new file mode 100644 index 0000000..bb112a4 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/MessageContent.java @@ -0,0 +1,30 @@ +package writeon.domain.assistant; + +import jakarta.persistence.Column; +import jakarta.persistence.Convert; +import jakarta.persistence.Embeddable; +import lombok.Data; +import lombok.NoArgsConstructor; +import writeon.domain.assistant.enums.MessageSenderRole; + +@Data +@Embeddable +@NoArgsConstructor +public class MessageContent { + + @Convert(converter = MessageSenderRole.TypeCodeConverter.class) + @Column(name = "role", nullable = false) + private MessageSenderRole role; + + @Column(name = "content") + private String content; + + public MessageContent(MessageSenderRole role, String content) { + this.role = role; + this.content = content; + } + + public void updateContent(String content) { + this.content = content; + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/enums/AssistantException.java b/domain/src/main/java/writeon/domain/assistant/enums/AssistantException.java new file mode 100644 index 0000000..d43597d --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/enums/AssistantException.java @@ -0,0 +1,25 @@ +package writeon.domain.assistant.enums; + +import org.springframework.http.HttpStatus; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum AssistantException implements CodeInfo { + + NOT_EXIST(HttpStatus.NOT_FOUND, "AI-001", "존재하지 않는 Assistant입니다."), + NOT_EXIST_MESSAGE(HttpStatus.NOT_FOUND, "AI-002", "존재하지 않는 메세지입니다."), + SSE_SEND_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "AI-003", "SSE 데이터 전송 중 오류가 발생했습니다."), + ALREADY_ANSWERED(HttpStatus.BAD_REQUEST, "AI-004", "이미 응답된 메세지입니다."), + ALREADY_EVALUATED(HttpStatus.BAD_REQUEST, "AI-005", "이미 평가되었습니다."), + CANNOT_BE_COMPLETED(HttpStatus.BAD_REQUEST, "AI-006", "완료 처리할 수 없는 상태입니다."), + CANNOT_BE_APPLIED(HttpStatus.BAD_REQUEST, "AI-007", "적용 처리할 수 없는 상태입니다."), + WEBCLIENT_REQUEST_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "AI-008", "WebClient 요청 중 오류가 발생했습니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/domain/src/main/java/writeon/domain/assistant/enums/AssistantStatus.java b/domain/src/main/java/writeon/domain/assistant/enums/AssistantStatus.java new file mode 100644 index 0000000..6839dae --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/enums/AssistantStatus.java @@ -0,0 +1,26 @@ +package writeon.domain.assistant.enums; + +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +@Getter +@RequiredArgsConstructor +public enum AssistantStatus implements Codable { + + DRAFT("draft"), + IN_PROGRESS("in progress"), + COMPLETED("completed"); + + private final String code; + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public AssistantStatus convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(AssistantStatus.class, dbData); + } + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/enums/AssistantType.java b/domain/src/main/java/writeon/domain/assistant/enums/AssistantType.java new file mode 100644 index 0000000..0c6f441 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/enums/AssistantType.java @@ -0,0 +1,28 @@ +package writeon.domain.assistant.enums; + +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +@Getter +@RequiredArgsConstructor +public enum AssistantType implements Codable { + + AUTO_MODIFY("auto modify"), + FEEDBACK("feedback"), + CHAT("chat"), + USER_MODIFY("user modify"), + PLANNER("planner"); + + private final String code; + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public AssistantType convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(AssistantType.class, dbData); + } + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/enums/FeedbackType.java b/domain/src/main/java/writeon/domain/assistant/enums/FeedbackType.java new file mode 100644 index 0000000..9f9cc08 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/enums/FeedbackType.java @@ -0,0 +1,31 @@ +package writeon.domain.assistant.enums; + +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +@Getter +@RequiredArgsConstructor +public enum FeedbackType implements Codable { + + AWKWARD_SENTENCE("AWKWARD_SENTENCE"), + INACCURATE_INFO("INACCURATE_INFO"), + UNAPPLIED_SETTING("UNAPPLIED_SETTING"), + ETC("ETC"); + + private final String code; + + public static FeedbackType fromCode(final String code) { + return Codable.fromCode(FeedbackType.class, code); + } + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public FeedbackType convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(FeedbackType.class, dbData); + } + } +} diff --git a/domain/src/main/java/writeon/domain/assistant/enums/MessageSenderRole.java b/domain/src/main/java/writeon/domain/assistant/enums/MessageSenderRole.java new file mode 100644 index 0000000..b4bbe84 --- /dev/null +++ b/domain/src/main/java/writeon/domain/assistant/enums/MessageSenderRole.java @@ -0,0 +1,25 @@ +package writeon.domain.assistant.enums; + +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +@Getter +@RequiredArgsConstructor +public enum MessageSenderRole implements Codable { + + MEMBER("member"), + ASSISTANT("assistant"); + + private final String code; + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public MessageSenderRole convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(MessageSenderRole.class, dbData); + } + } +} diff --git a/domain/src/main/java/writeon/domain/auth/BaseToken.java b/domain/src/main/java/writeon/domain/auth/BaseToken.java new file mode 100644 index 0000000..a250adb --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/BaseToken.java @@ -0,0 +1,19 @@ +package writeon.domain.auth; + +import jakarta.persistence.MappedSuperclass; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@MappedSuperclass +public class BaseToken { + @Id + protected String tokenString; + + public BaseToken(String tokenString) { + this.tokenString = tokenString; + } +} diff --git a/domain/src/main/java/writeon/domain/auth/ChangePasswordToken.java b/domain/src/main/java/writeon/domain/auth/ChangePasswordToken.java new file mode 100644 index 0000000..40bacea --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/ChangePasswordToken.java @@ -0,0 +1,15 @@ +package writeon.domain.auth; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.springframework.data.redis.core.RedisHash; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@RedisHash(value = "changePasswordToken", timeToLive = 60 * 60) +public class ChangePasswordToken extends BaseToken { + public ChangePasswordToken(String tokenString) { + super(tokenString); + } +} \ No newline at end of file diff --git a/domain/src/main/java/writeon/domain/auth/JoinToken.java b/domain/src/main/java/writeon/domain/auth/JoinToken.java new file mode 100644 index 0000000..f16bae7 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/JoinToken.java @@ -0,0 +1,27 @@ +package writeon.domain.auth; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.springframework.data.redis.core.RedisHash; +import writeon.domain.member.Member; +import writeon.domain.member.MemberPassword; +import writeon.domain.terms.TermsAgreement; + +import java.util.List; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@RedisHash(value = "joinToken", timeToLive = 60 * 60) +public class JoinToken extends BaseToken { + private Member member; + private MemberPassword memberPassword; + private List termsAgreementList; + + public JoinToken(String tokenString, Member member, MemberPassword memberPassword, List termsAgreementList) { + super(tokenString); + this.member = member; + this.memberPassword = memberPassword; + this.termsAgreementList = termsAgreementList; + } +} diff --git a/domain/src/main/java/writeon/domain/auth/JwtPayload.java b/domain/src/main/java/writeon/domain/auth/JwtPayload.java new file mode 100644 index 0000000..463c9f4 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/JwtPayload.java @@ -0,0 +1,16 @@ +package writeon.domain.auth; + +import lombok.*; + +import java.util.UUID; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class JwtPayload { + private Long iat; + private Long exp; + private UUID memberId; +} diff --git a/domain/src/main/java/writeon/domain/auth/LoginAttempt.java b/domain/src/main/java/writeon/domain/auth/LoginAttempt.java new file mode 100644 index 0000000..c9d73e9 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/LoginAttempt.java @@ -0,0 +1,28 @@ +package writeon.domain.auth; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.auth.enums.LoginAttemptResultType; +import writeon.domain.common.BaseTimeEntity; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "login_attempt") +public class LoginAttempt extends BaseTimeEntity { + @Id + @Column(updatable = false, nullable = false) + private UUID id = UUID.randomUUID(); + + @Column(nullable = false) + private String email; + + @Convert(converter = LoginAttemptResultType.TypeCodeConverter.class) + @Column(nullable = false) + private LoginAttemptResultType result; +} diff --git a/domain/src/main/java/writeon/domain/auth/RefreshToken.java b/domain/src/main/java/writeon/domain/auth/RefreshToken.java new file mode 100644 index 0000000..2d07cc5 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/RefreshToken.java @@ -0,0 +1,22 @@ +package writeon.domain.auth; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.springframework.data.redis.core.RedisHash; +import org.springframework.data.redis.core.index.Indexed; + +import java.util.UUID; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@RedisHash(value = "refreshToken", timeToLive = 60 * 60 * 24 * 90) +public class RefreshToken extends BaseToken { + @Indexed + private UUID memberId; + + public RefreshToken(String tokenString, UUID memberId) { + super(tokenString); + this.memberId = memberId; + } +} \ No newline at end of file diff --git a/domain/src/main/java/writeon/domain/auth/dto/AuthTokenDto.java b/domain/src/main/java/writeon/domain/auth/dto/AuthTokenDto.java new file mode 100644 index 0000000..2734bb6 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/dto/AuthTokenDto.java @@ -0,0 +1,13 @@ +package writeon.domain.auth.dto; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@RequiredArgsConstructor +public class AuthTokenDto { + private final String accessToken; + private final String refreshToken; +} diff --git a/domain/src/main/java/writeon/domain/auth/enums/AuthException.java b/domain/src/main/java/writeon/domain/auth/enums/AuthException.java new file mode 100644 index 0000000..ea196f3 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/enums/AuthException.java @@ -0,0 +1,29 @@ +package writeon.domain.auth.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum AuthException implements CodeInfo { + ACCESS_TOKEN_NOT_VALID(HttpStatus.UNAUTHORIZED, "AUTH-001", "액세스 토큰이 유효하지 않습니다."), + REFRESH_TOKEN_NOT_VALID(HttpStatus.UNAUTHORIZED, "AUTH-002", "리프레시 토큰이 유효하지 않습니다."), + JOIN_TOKEN_NOT_VALID(HttpStatus.UNAUTHORIZED, "AUTH-101", "가입 토큰이 유효하지 않습니다."), + JOIN_ALREADY_EXIST_MEMBER(HttpStatus.CONFLICT, "AUTH-102", "이미 있는 회원입니다."), + LOGIN_FAILED(HttpStatus.UNAUTHORIZED, "AUTH-201", "이메일 또는 비밀번호가 잘못되었거나 존재하지 않습니다."), + LOGIN_FAILED_WITH_WARNING(HttpStatus.UNAUTHORIZED, "AUTH-202", "5회 이상 실패하면 1시간 동안 로그인이 제한됩니다"), + LOGIN_BLOCKED(HttpStatus.UNAUTHORIZED, "AUTH-203", "로그인 실패 가능 횟수를 초과하였습니다."), + MAIL_SEND_FAILED(HttpStatus.UNAUTHORIZED, "AUTH-301", "이메일 발송에 실패했습니다."), + CHANGE_PASSWORD_TOKEN_NOT_VALID(HttpStatus.UNAUTHORIZED, "AUTH-401", "비밀번호 변경 토큰이 유효하지 않습니다."), + CHANGE_PASSWORD_EMAIL_NOT_FOUND(HttpStatus.NOT_FOUND, "AUTH-402", "가입되지 않은 이메일입니다."), + CHANGE_PASSWORD_USED_PASSWORD_BEFORE(HttpStatus.BAD_REQUEST, "AUTH-403", "이전에 사용된 비밀번호입니다."), + TERMS_AGREE_REQUIRED(HttpStatus.BAD_REQUEST, "AUTH-404", "필수 약관 동의가 필요합니다."), + NICKNAME_ALREADY_EXIST(HttpStatus.CONFLICT, "AUTH-501", "이미 존재하는 닉네임입니다."), + AUTH_FAILED_BY_UNKNOWN_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "AUTH-901", "알 수 없는 오류로 인증에 실패했습니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/domain/src/main/java/writeon/domain/auth/enums/LoginAttemptResultType.java b/domain/src/main/java/writeon/domain/auth/enums/LoginAttemptResultType.java new file mode 100644 index 0000000..d834e02 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/enums/LoginAttemptResultType.java @@ -0,0 +1,25 @@ +package writeon.domain.auth.enums; + +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +@Getter +@RequiredArgsConstructor +public enum LoginAttemptResultType implements Codable { + SUCCEED("succeed"), + FAILED("failed"), + BLOCKED("blocked"); + + private final String code; + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public LoginAttemptResultType convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(LoginAttemptResultType.class, dbData); + } + } +} diff --git a/domain/src/main/java/writeon/domain/auth/repository/ChangePasswordTokenRedisRepository.java b/domain/src/main/java/writeon/domain/auth/repository/ChangePasswordTokenRedisRepository.java new file mode 100644 index 0000000..0dd088b --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/repository/ChangePasswordTokenRedisRepository.java @@ -0,0 +1,8 @@ +package writeon.domain.auth.repository; + +import org.springframework.data.repository.CrudRepository; +import writeon.domain.auth.ChangePasswordToken; + +public interface ChangePasswordTokenRedisRepository extends CrudRepository { + +} \ No newline at end of file diff --git a/domain/src/main/java/writeon/domain/auth/repository/JoinTokenRedisRepository.java b/domain/src/main/java/writeon/domain/auth/repository/JoinTokenRedisRepository.java new file mode 100644 index 0000000..9158065 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/repository/JoinTokenRedisRepository.java @@ -0,0 +1,8 @@ +package writeon.domain.auth.repository; + +import org.springframework.data.repository.CrudRepository; +import writeon.domain.auth.JoinToken; + +public interface JoinTokenRedisRepository extends CrudRepository { + +} diff --git a/domain/src/main/java/writeon/domain/auth/repository/LoginAttemptJpaRepository.java b/domain/src/main/java/writeon/domain/auth/repository/LoginAttemptJpaRepository.java new file mode 100644 index 0000000..957c773 --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/repository/LoginAttemptJpaRepository.java @@ -0,0 +1,11 @@ +package writeon.domain.auth.repository; + +import org.springframework.data.repository.CrudRepository; +import writeon.domain.auth.LoginAttempt; + +import java.util.List; +import java.util.UUID; + +public interface LoginAttemptJpaRepository extends CrudRepository { + List findTop5ByEmailOrderByCreatedAtDesc(String email); +} diff --git a/domain/src/main/java/writeon/domain/auth/repository/RefreshTokenRedisRepository.java b/domain/src/main/java/writeon/domain/auth/repository/RefreshTokenRedisRepository.java new file mode 100644 index 0000000..0344f9e --- /dev/null +++ b/domain/src/main/java/writeon/domain/auth/repository/RefreshTokenRedisRepository.java @@ -0,0 +1,11 @@ +package writeon.domain.auth.repository; + +import org.springframework.data.repository.CrudRepository; +import writeon.domain.auth.RefreshToken; + +import java.util.Optional; +import java.util.UUID; + +public interface RefreshTokenRedisRepository extends CrudRepository { + Optional findByMemberId(UUID memberId); +} diff --git a/domain/src/main/java/writeon/domain/common/BaseAuditTimeEntity.java b/domain/src/main/java/writeon/domain/common/BaseAuditTimeEntity.java new file mode 100644 index 0000000..390eed5 --- /dev/null +++ b/domain/src/main/java/writeon/domain/common/BaseAuditTimeEntity.java @@ -0,0 +1,42 @@ +package writeon.domain.common; + +import jakarta.persistence.*; +import lombok.Getter; +import org.springframework.data.annotation.CreatedBy; +import org.springframework.data.annotation.LastModifiedBy; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.UUID; + +@Getter +@MappedSuperclass +@EntityListeners(AuditingEntityListener.class) +public class BaseAuditTimeEntity implements Serializable { + + @CreatedBy + @Column(name = "created_by", updatable = false, nullable = false) + protected UUID createdBy; + + @LastModifiedBy + @Column(name = "updated_by", nullable = false) + protected UUID updatedBy; + + @Column(name = "created_at", updatable = false, nullable = false) + protected LocalDateTime createdAt; + + @Column(name = "updated_at", nullable = false) + protected LocalDateTime updatedAt; + + @PrePersist + protected void onPrePersist() { + this.createdAt = LocalDateTime.now(); + this.updatedAt = this.createdAt; + } + + @PreUpdate + protected void onPreUpdate() { + this.updatedAt = LocalDateTime.now(); + } +} diff --git a/domain/src/main/java/writeon/domain/common/BaseTimeEntity.java b/domain/src/main/java/writeon/domain/common/BaseTimeEntity.java new file mode 100644 index 0000000..265b858 --- /dev/null +++ b/domain/src/main/java/writeon/domain/common/BaseTimeEntity.java @@ -0,0 +1,31 @@ +package writeon.domain.common; + +import jakarta.persistence.*; +import lombok.Getter; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Getter +@MappedSuperclass +@EntityListeners(AuditingEntityListener.class) +public class BaseTimeEntity implements Serializable { + + @Column(name = "created_at", updatable = false, nullable = false) + protected LocalDateTime createdAt; + + @Column(name = "updated_at", nullable = false) + protected LocalDateTime updatedAt; + + @PrePersist + protected void onPrePersist() { + this.createdAt = LocalDateTime.now(); + this.updatedAt = this.createdAt; + } + + @PreUpdate + protected void onPreUpdate() { + this.updatedAt = LocalDateTime.now(); + } +} diff --git a/domain/src/main/java/writeon/domain/common/MemberSession.java b/domain/src/main/java/writeon/domain/common/MemberSession.java new file mode 100644 index 0000000..2a6bc0f --- /dev/null +++ b/domain/src/main/java/writeon/domain/common/MemberSession.java @@ -0,0 +1,54 @@ +package writeon.domain.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Collection; +import java.util.List; +import java.util.UUID; + +@Getter +@AllArgsConstructor +@Builder +public class MemberSession implements UserDetails { + private UUID memberId; + + @Override + public Collection getAuthorities() { + return List.of(new SimpleGrantedAuthority("ROLE_USER")); + } + + @Override + public String getPassword() { + return null; + } + + @Override + public String getUsername() { + return memberId.toString(); + } + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return true; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return true; + } +} diff --git a/domain/src/main/java/writeon/domain/common/converter/AbstractEnumCodeConverter.java b/domain/src/main/java/writeon/domain/common/converter/AbstractEnumCodeConverter.java new file mode 100644 index 0000000..e575d05 --- /dev/null +++ b/domain/src/main/java/writeon/domain/common/converter/AbstractEnumCodeConverter.java @@ -0,0 +1,26 @@ +package writeon.domain.common.converter; + +import jakarta.persistence.AttributeConverter; +import org.apache.commons.lang3.StringUtils; +import writeon.domain.common.enums.Codable; + +public abstract class AbstractEnumCodeConverter & Codable> implements AttributeConverter { + + @Override + public String convertToDatabaseColumn(E attribute) { + return this.toDatabaseColumn(attribute); + } + + @Override + public E convertToEntityAttribute(String dbData) { + return null; + } + + public E toEntityAttribute(Class cls, String code) { + return StringUtils.isBlank(code) ? null : Codable.fromCode(cls, code); + } + + private String toDatabaseColumn(E attr) { + return (attr == null) ? null : attr.getCode(); + } +} \ No newline at end of file diff --git a/domain/src/main/java/writeon/domain/common/enums/Codable.java b/domain/src/main/java/writeon/domain/common/enums/Codable.java new file mode 100644 index 0000000..ad70e1a --- /dev/null +++ b/domain/src/main/java/writeon/domain/common/enums/Codable.java @@ -0,0 +1,20 @@ +package writeon.domain.common.enums; + +import java.util.stream.Stream; + +public interface Codable { + + static & Codable> E fromCode(Class cls, String code) { + if (code == null) { + return null; + } + final String t = code.trim(); + return Stream.of(cls.getEnumConstants()) + .filter(e -> e.getCode().equalsIgnoreCase(t)) + .findAny() + .orElseThrow( + () -> new IllegalArgumentException(String.format("%s에 %s가 존재하지 않습니다.", cls.getName(), code))); + } + + String getCode(); +} diff --git a/domain/src/main/java/writeon/domain/common/enums/CodeInfo.java b/domain/src/main/java/writeon/domain/common/enums/CodeInfo.java new file mode 100644 index 0000000..ba7e232 --- /dev/null +++ b/domain/src/main/java/writeon/domain/common/enums/CodeInfo.java @@ -0,0 +1,10 @@ +package writeon.domain.common.enums; + +import org.springframework.http.HttpStatus; + +public interface CodeInfo { + + HttpStatus getStatus(); + String getCode(); + String getMessage(); +} diff --git a/domain/src/main/java/writeon/domain/file/enums/FileException.java b/domain/src/main/java/writeon/domain/file/enums/FileException.java new file mode 100644 index 0000000..8e2192c --- /dev/null +++ b/domain/src/main/java/writeon/domain/file/enums/FileException.java @@ -0,0 +1,17 @@ +package writeon.domain.file.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum FileException implements CodeInfo { + UNSUPPORTED_CONTENT_TYPE(HttpStatus.BAD_REQUEST, "FILE-001", "지원하지 않는 컨텐츠 타입입니다."), + MAX_FILE_SIZE_EXCEEDED(HttpStatus.BAD_REQUEST, "FILE-002", "업로드 가능한 파일 최대 크기를 초과했습니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/domain/src/main/java/writeon/domain/file/enums/FileUploadType.java b/domain/src/main/java/writeon/domain/file/enums/FileUploadType.java new file mode 100644 index 0000000..d4f7128 --- /dev/null +++ b/domain/src/main/java/writeon/domain/file/enums/FileUploadType.java @@ -0,0 +1,42 @@ +package writeon.domain.file.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +import java.util.List; + +@Getter +@RequiredArgsConstructor +@Slf4j +public enum FileUploadType implements Codable { + IDEA_NOTE("idea-note", "idea-note", List.of("image/png", "image/jpeg", "image/webp"), 31457280L); + + private final String code; + private final String path; + private final List allowedContentType; + private final Long maxFileSize; + + @JsonCreator + public static FileUploadType fromCode(final String code) { + return Codable.fromCode(FileUploadType.class, code); + } + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public FileUploadType convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(FileUploadType.class, dbData); + } + } + + @JsonValue + public String getCode() { + return code; + } +} diff --git a/domain/src/main/java/writeon/domain/member/Member.java b/domain/src/main/java/writeon/domain/member/Member.java new file mode 100644 index 0000000..0e32b68 --- /dev/null +++ b/domain/src/main/java/writeon/domain/member/Member.java @@ -0,0 +1,35 @@ +package writeon.domain.member; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.*; +import writeon.domain.common.BaseTimeEntity; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Builder +@AllArgsConstructor +@Table(name = "member") +public class Member extends BaseTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + @Builder.Default + private UUID id = UUID.randomUUID(); + + @Column(nullable = false) + private String email; + + @Column(nullable = false) + private String nickname; + + @Column(name = "profile_image") + private String profileImage; + +} diff --git a/domain/src/main/java/writeon/domain/member/MemberPassword.java b/domain/src/main/java/writeon/domain/member/MemberPassword.java new file mode 100644 index 0000000..c424527 --- /dev/null +++ b/domain/src/main/java/writeon/domain/member/MemberPassword.java @@ -0,0 +1,26 @@ +package writeon.domain.member; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.*; +import writeon.domain.common.BaseTimeEntity; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +@Table(name = "member_password") +public class MemberPassword extends BaseTimeEntity { + @Id + @Column(name = "member_id") + private UUID memberId; + + @Column(nullable = false) + private String password; +} diff --git a/domain/src/main/java/writeon/domain/member/enums/MemberException.java b/domain/src/main/java/writeon/domain/member/enums/MemberException.java new file mode 100644 index 0000000..72b6a2e --- /dev/null +++ b/domain/src/main/java/writeon/domain/member/enums/MemberException.java @@ -0,0 +1,17 @@ +package writeon.domain.member.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum MemberException implements CodeInfo { + + NOT_EXIST(HttpStatus.NOT_FOUND, "MBR-001", "존재하지 않는 회원입니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/domain/src/main/java/writeon/domain/member/repository/MemberJpaRepository.java b/domain/src/main/java/writeon/domain/member/repository/MemberJpaRepository.java new file mode 100644 index 0000000..9900a3a --- /dev/null +++ b/domain/src/main/java/writeon/domain/member/repository/MemberJpaRepository.java @@ -0,0 +1,12 @@ +package writeon.domain.member.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.member.Member; + +import java.util.Optional; +import java.util.UUID; + +public interface MemberJpaRepository extends JpaRepository { + Optional findByEmail(String email); + Optional findByNickname(String nickname); +} diff --git a/domain/src/main/java/writeon/domain/member/repository/MemberPasswordJpaRepository.java b/domain/src/main/java/writeon/domain/member/repository/MemberPasswordJpaRepository.java new file mode 100644 index 0000000..725d6fd --- /dev/null +++ b/domain/src/main/java/writeon/domain/member/repository/MemberPasswordJpaRepository.java @@ -0,0 +1,10 @@ +package writeon.domain.member.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.member.MemberPassword; + +import java.util.UUID; + +public interface MemberPasswordJpaRepository extends JpaRepository { + +} diff --git a/domain/src/main/java/writeon/domain/product/Product.java b/domain/src/main/java/writeon/domain/product/Product.java new file mode 100644 index 0000000..a6bc44e --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/Product.java @@ -0,0 +1,92 @@ +package writeon.domain.product; + +import com.fasterxml.uuid.Generators; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import writeon.domain.common.BaseAuditTimeEntity; + +@Getter +@Entity +@NoArgsConstructor +@Table(name = "product") +public class Product extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id = Generators.timeBasedEpochGenerator().generate(); + + @Column(name = "title") + private String title; + + @Column(name = "content") + private String content; + + @OneToMany(fetch = FetchType.LAZY) + @JoinColumn(name = "product_id") + private List characters = new ArrayList<>(); + + @OneToMany(fetch = FetchType.LAZY) + @JoinColumn(name = "product_id") + private List customFields = new ArrayList<>(); + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "id") + private ProductIdeaNote ideaNote; + + @OneToMany(fetch = FetchType.LAZY) + @JoinColumn(name = "product_id") + private List memos = new ArrayList<>(); + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "id") + private ProductPlot plot; + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "id") + private ProductSynopsis synopsis; + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "id") + private ProductWorldview worldview; + + @OneToMany(mappedBy = "product", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) + private List favoritePrompts = new ArrayList<>(); + + @OneToOne(mappedBy = "product", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) + private ProductFixedMessage fixedMessage; + + public void update(String title, String content) { + this.title = title; + this.content = content; + } + + public void deleteFavoritePrompt(ProductFavoritePrompt favoritePrompt) { + this.favoritePrompts.remove(favoritePrompt); + } + + public void setFixedMessage(ProductFixedMessage fixedMessage) { + this.fixedMessage = fixedMessage; + fixedMessage.setProduct(this); + } + + public void deleteFixedMessage() { + if (this.fixedMessage != null) { + this.fixedMessage.setProduct(null); + this.fixedMessage = null; + } + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductCharacter.java b/domain/src/main/java/writeon/domain/product/ProductCharacter.java new file mode 100644 index 0000000..71aa8ca --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductCharacter.java @@ -0,0 +1,88 @@ +package writeon.domain.product; + +import com.fasterxml.uuid.Generators; + +import jakarta.persistence.*; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.SQLRestriction; +import writeon.domain.common.BaseAuditTimeEntity; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_character") +public class ProductCharacter extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id = Generators.timeBasedEpochGenerator().generate(); + + @Column(name = "product_id", nullable = false) + private UUID productId; + + @Column(name = "intro") + private String intro; + + @Column(name = "name") + private String name; + + @Column(name = "age") + private Short age; + + @Column(name = "gender") + private String gender; + + @Column(name = "occupation") + private String occupation; + + @Column(name = "appearance") + private String appearance; + + @Column(name = "personality") + private String personality; + + @Column(name = "relationship") + private String relationship; + + @Column(name = "seq", nullable = false) + private Integer seq; + + @OneToMany(fetch = FetchType.LAZY) + @JoinColumn(name = "section_id") + @SQLRestriction("section_type = 'character'") + private List customFields = new ArrayList<>(); + + @Builder + public ProductCharacter(UUID productId, String intro, String name, Short age, String gender, String occupation, String appearance, String personality, String relationship, Integer seq) { + this.productId = productId; + this.intro = intro; + this.name = name; + this.age = age; + this.gender = gender; + this.occupation = occupation; + this.appearance = appearance; + this.personality = personality; + this.relationship = relationship; + this.seq = seq; + } + + public void update(String intro, String name, Short age, String gender, String occupation, String appearance, String personality, String relationship, Integer seq) { + this.intro = intro; + this.name = name; + this.age = age; + this.gender = gender; + this.occupation = occupation; + this.appearance = appearance; + this.personality = personality; + this.relationship = relationship; + this.seq = seq; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductCustomField.java b/domain/src/main/java/writeon/domain/product/ProductCustomField.java new file mode 100644 index 0000000..78c58e3 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductCustomField.java @@ -0,0 +1,59 @@ +package writeon.domain.product; + +import com.fasterxml.uuid.Generators; + +import jakarta.persistence.*; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.common.BaseAuditTimeEntity; +import writeon.domain.product.enums.ProductSectionType; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_custom_field") +public class ProductCustomField extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id = Generators.timeBasedEpochGenerator().generate(); + + @Column(name = "product_id", nullable = false) + private UUID productId; + + @Column(name = "section_id", nullable = false) + private UUID sectionId; + + @Convert(converter = ProductSectionType.TypeCodeConverter.class) + @Column(name = "section_type", nullable = false) + private ProductSectionType sectionType; + + @Column(name = "name", nullable = false) + private String name; + + @Column(name = "content", nullable = false) + private String content; + + @Column(name = "seq", nullable = false) + private Short seq; + + @Builder + public ProductCustomField(UUID productId, UUID sectionId, ProductSectionType sectionType, String name, String content, Short seq) { + this.productId = productId; + this.sectionId = sectionId; + this.sectionType = sectionType; + this.name = name; + this.content = content; + this.seq = seq; + } + + public void update(String name, String content) { + this.name = name; + this.content = content; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductFavoritePrompt.java b/domain/src/main/java/writeon/domain/product/ProductFavoritePrompt.java new file mode 100644 index 0000000..8ef20da --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductFavoritePrompt.java @@ -0,0 +1,41 @@ +package writeon.domain.product; + +import com.fasterxml.uuid.Generators; +import jakarta.persistence.*; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_favorite_prompt") +public class ProductFavoritePrompt { + + @Id + @Column(updatable = false, nullable = false) + private UUID id = Generators.timeBasedEpochGenerator().generate(); + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "product_id", nullable = false) + private Product product; + + @Column(name = "messageId", nullable = false) + private UUID messageId; + + @Column(name = "created_at", updatable = false, nullable = false) + protected final LocalDateTime createdAt = LocalDateTime.now(); + + public ProductFavoritePrompt(Product product, UUID messageId) { + this.product = product; + this.messageId = messageId; + } + + public void delete() { + this.product = null; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductFixedMessage.java b/domain/src/main/java/writeon/domain/product/ProductFixedMessage.java new file mode 100644 index 0000000..e393e06 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductFixedMessage.java @@ -0,0 +1,41 @@ +package writeon.domain.product; + +import java.util.UUID; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.MapsId; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.assistant.AssistantMessage; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_fixed_message") +public class ProductFixedMessage { + + @Id + @Column(name = "product_id", updatable = false, nullable = false) + private UUID productId; + + @OneToOne(fetch = FetchType.LAZY) + @MapsId + @JoinColumn(name = "product_id") + private Product product; + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "message_id", nullable = false, updatable = false) + private AssistantMessage message; + + public ProductFixedMessage(AssistantMessage message) { + this.message = message; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductIdeaNote.java b/domain/src/main/java/writeon/domain/product/ProductIdeaNote.java new file mode 100644 index 0000000..0304bf9 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductIdeaNote.java @@ -0,0 +1,41 @@ +package writeon.domain.product; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.common.BaseAuditTimeEntity; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_ideanote") +public class ProductIdeaNote extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id; + + @Column(nullable = false) + private String title; + + @Column(nullable = false) + private String content; + + public ProductIdeaNote(UUID id, String title, String content) { + this.id = id; + this.title = title; + this.content = content; + } + + public void update(String title, String content) { + this.title = title; + this.content = content; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductMemo.java b/domain/src/main/java/writeon/domain/product/ProductMemo.java new file mode 100644 index 0000000..8af3acd --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductMemo.java @@ -0,0 +1,65 @@ +package writeon.domain.product; + +import com.fasterxml.uuid.Generators; + +import java.util.UUID; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.common.BaseAuditTimeEntity; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_memo") +public class ProductMemo extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id = Generators.timeBasedEpochGenerator().generate(); + + @Column(name = "product_id", nullable = false) + private UUID productId; + + @Column(name = "title") + private String title; + + @Column(name = "content", nullable = false) + private String content; + + @Column(name = "selected_text", nullable = false) + private String selectedText; + + @Column(name = "start_index", nullable = false) + private Integer startIndex; + + @Column(name = "endIndex", nullable = false) + private Integer endIndex; + + @Column(name = "is_completed", nullable = false) + private Boolean isCompleted = Boolean.FALSE; + + public ProductMemo(UUID productId, String title, String content, + String selected_text, Integer startIndex, Integer endIndex) { + this.productId = productId; + this.title = title; + this.content = content; + this.selectedText = selected_text; + this.startIndex = startIndex; + this.endIndex = endIndex; + } + + public void update(String title, String content, String selectedText, Integer startIndex, Integer endIndex) { + this.title = title; + this.content = content; + this.selectedText = selectedText; + this.startIndex = startIndex; + this.endIndex = endIndex; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductPlot.java b/domain/src/main/java/writeon/domain/product/ProductPlot.java new file mode 100644 index 0000000..8c15c82 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductPlot.java @@ -0,0 +1,38 @@ +package writeon.domain.product; + +import java.util.UUID; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.common.BaseAuditTimeEntity; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_plot") +public class ProductPlot extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id; + + @Column + private String content; + + @Builder + public ProductPlot(UUID id, String content) { + this.id = id; + this.content = content; + } + + public void update(String content) { + this.content = content; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductSynopsis.java b/domain/src/main/java/writeon/domain/product/ProductSynopsis.java new file mode 100644 index 0000000..a32b65a --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductSynopsis.java @@ -0,0 +1,58 @@ +package writeon.domain.product; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.common.BaseAuditTimeEntity; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_synopsis") +public class ProductSynopsis extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id; + + @Column(name = "genre", nullable = false) + private String genre; + + @Column(name = "length") + private String length; + + @Column(name = "purpose") + private String purpose; + + @Column(name = "logline", nullable = false) + private String logline; + + @Column(name = "example") + private String example; + + @Builder + public ProductSynopsis(UUID id, String genre, String length, String purpose, String logline, String example) { + this.id = id; + this.genre = genre; + this.length = length; + this.purpose = purpose; + this.logline = logline; + this.example = example; + } + + public void update(String genre, String length, String purpose, String logline, String example) { + this.genre = genre; + this.length = length; + this.purpose = purpose; + this.logline = logline; + this.example = example; + } +} diff --git a/domain/src/main/java/writeon/domain/product/ProductWorldview.java b/domain/src/main/java/writeon/domain/product/ProductWorldview.java new file mode 100644 index 0000000..9876134 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/ProductWorldview.java @@ -0,0 +1,103 @@ +package writeon.domain.product; + +import jakarta.persistence.*; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.SQLRestriction; +import writeon.domain.common.BaseAuditTimeEntity; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "product_worldview") +public class ProductWorldview extends BaseAuditTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id; + + @Column(name = "geography") + private String geography; + + @Column(name = "history") + private String history; + + @Column(name = "politics") + private String politics; + + @Column(name = "society") + private String society; + + @Column(name = "religion") + private String religion; + + @Column(name = "economy") + private String economy; + + @Column(name = "technology") + private String technology; + + @Column(name = "lifestyle") + private String lifestyle; + + @Column(name = "language") + private String language; + + @Column(name = "culture") + private String culture; + + @Column(name = "species") + private String species; + + @Column(name = "occupation") + private String occupation; + + @Column(name = "conflict") + private String conflict; + + @OneToMany(fetch = FetchType.LAZY) + @JoinColumn(name = "section_id") + @SQLRestriction("section_type = 'worldview'") + private List customFields = new ArrayList<>(); + + @Builder + public ProductWorldview(UUID id, String geography, String history, String politics, String society, String religion, String economy, String technology, String lifestyle, String language, String culture, String species, String occupation, String conflict) { + this.id = id; + this.geography = geography; + this.history = history; + this.politics = politics; + this.society = society; + this.religion = religion; + this.economy = economy; + this.technology = technology; + this.lifestyle = lifestyle; + this.language = language; + this.culture = culture; + this.species = species; + this.occupation = occupation; + this.conflict = conflict; + } + + public void update(String geography, String history, String politics, String society, String religion, String economy, String technology, String lifestyle, String language, String culture, String species, String occupation, String conflict) { + this.geography = geography; + this.history = history; + this.politics = politics; + this.society = society; + this.religion = religion; + this.economy = economy; + this.technology = technology; + this.lifestyle = lifestyle; + this.language = language; + this.culture = culture; + this.species = species; + this.occupation = occupation; + this.conflict = conflict; + } +} diff --git a/domain/src/main/java/writeon/domain/product/enums/ProductException.java b/domain/src/main/java/writeon/domain/product/enums/ProductException.java new file mode 100644 index 0000000..954b367 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/enums/ProductException.java @@ -0,0 +1,23 @@ +package writeon.domain.product.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum ProductException implements CodeInfo { + + NOT_EXIST(HttpStatus.NOT_FOUND, "PRD-001", "존재하지 않는 작품입니다."), + NOT_EXIST_CHARACTER(HttpStatus.NOT_FOUND, "PRD-002", "존재하지 않는 등장인물 입니다."), + NOT_EXIST_CUSTOM_FIELD(HttpStatus.NOT_FOUND, "PRD-003", "존재하지 않는 커스텀 필드입니다."), + NOT_EXIST_MEMO(HttpStatus.NOT_FOUND, "PRD-004", "존재하지 않는 메모입니다."), + NOT_EXIST_FAVORITE_PROMPT(HttpStatus.NOT_FOUND, "PRD-005", "존재하지 않는 프롬프트입니다.."), + ALREADY_EXIST_FAVORITE_PROMPT(HttpStatus.BAD_REQUEST, "PRD-006", "이미 즐겨찾기에 추가한 프롬프트입니다."), + INVALID_FAVORITE_PROMPT_TYPE(HttpStatus.BAD_REQUEST, "PRD-007", "자유 대화 기능의 프롬프트만 즐겨찾기에 등록할 수 있습니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/domain/src/main/java/writeon/domain/product/enums/ProductSectionType.java b/domain/src/main/java/writeon/domain/product/enums/ProductSectionType.java new file mode 100644 index 0000000..aa56f8b --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/enums/ProductSectionType.java @@ -0,0 +1,43 @@ +package writeon.domain.product.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +import java.util.EnumSet; + +@Getter +@RequiredArgsConstructor +public enum ProductSectionType implements Codable { + + CHARACTER("character"), + WORLDVIEW("worldview"); + + private final String code; + + public static boolean containCode(String code) { + return EnumSet.allOf(ProductSectionType.class).stream().anyMatch(e -> e.getCode().equals(code)); + } + + @JsonCreator + public static ProductSectionType fromCode(final String code) { + return Codable.fromCode(ProductSectionType.class, code); + } + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public ProductSectionType convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(ProductSectionType.class, dbData); + } + } + + @JsonValue + public String getCode() { + return code; + } +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductCharacterJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductCharacterJpaRepository.java new file mode 100644 index 0000000..90a3c22 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductCharacterJpaRepository.java @@ -0,0 +1,9 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductCharacter; + +import java.util.UUID; + +public interface ProductCharacterJpaRepository extends JpaRepository { +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductCustomFieldJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductCustomFieldJpaRepository.java new file mode 100644 index 0000000..d9b00af --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductCustomFieldJpaRepository.java @@ -0,0 +1,16 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import writeon.domain.product.ProductCustomField; + +import java.util.UUID; + +public interface ProductCustomFieldJpaRepository extends JpaRepository { + + @Modifying + @Query(value = "DELETE FROM product_custom_field WHERE product_id = :productId AND section_type = :sectionType", nativeQuery = true) + void deleteAllByProductIdAndSectionType(@Param("productId") UUID productId, @Param("sectionType") String sectionType); +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductFavoritePromptJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductFavoritePromptJpaRepository.java new file mode 100644 index 0000000..144dec6 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductFavoritePromptJpaRepository.java @@ -0,0 +1,11 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductFavoritePrompt; + +import java.util.UUID; + +public interface ProductFavoritePromptJpaRepository extends JpaRepository { + + boolean existsByProduct_IdAndMessageId(UUID productId, UUID messageId); +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductIdeaNoteJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductIdeaNoteJpaRepository.java new file mode 100644 index 0000000..6a8b741 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductIdeaNoteJpaRepository.java @@ -0,0 +1,9 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductIdeaNote; + +import java.util.UUID; + +public interface ProductIdeaNoteJpaRepository extends JpaRepository { +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductJpaRepository.java new file mode 100644 index 0000000..c0f48ce --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductJpaRepository.java @@ -0,0 +1,14 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.Product; + +import java.util.Optional; +import java.util.UUID; + +public interface ProductJpaRepository extends JpaRepository { + + Optional findByIdAndCreatedBy(UUID productId, UUID createdBy); + + boolean existsByIdAndCreatedBy(UUID productId, UUID createdBy); +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductMemoJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductMemoJpaRepository.java new file mode 100644 index 0000000..25a42be --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductMemoJpaRepository.java @@ -0,0 +1,12 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductMemo; + +import java.util.Optional; +import java.util.UUID; + +public interface ProductMemoJpaRepository extends JpaRepository { + + Optional findByIdAndCreatedBy(UUID memoId, UUID createdBy); +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductPlotJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductPlotJpaRepository.java new file mode 100644 index 0000000..38f4678 --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductPlotJpaRepository.java @@ -0,0 +1,9 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductPlot; + +import java.util.UUID; + +public interface ProductPlotJpaRepository extends JpaRepository { +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductSynopsisJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductSynopsisJpaRepository.java new file mode 100644 index 0000000..6813eaf --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductSynopsisJpaRepository.java @@ -0,0 +1,9 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductSynopsis; + +import java.util.UUID; + +public interface ProductSynopsisJpaRepository extends JpaRepository { +} diff --git a/domain/src/main/java/writeon/domain/product/repository/ProductWorldviewJpaRepository.java b/domain/src/main/java/writeon/domain/product/repository/ProductWorldviewJpaRepository.java new file mode 100644 index 0000000..da9066a --- /dev/null +++ b/domain/src/main/java/writeon/domain/product/repository/ProductWorldviewJpaRepository.java @@ -0,0 +1,9 @@ +package writeon.domain.product.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import writeon.domain.product.ProductWorldview; + +import java.util.UUID; + +public interface ProductWorldviewJpaRepository extends JpaRepository { +} diff --git a/domain/src/main/java/writeon/domain/terms/Terms.java b/domain/src/main/java/writeon/domain/terms/Terms.java new file mode 100644 index 0000000..af9d461 --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/Terms.java @@ -0,0 +1,45 @@ +package writeon.domain.terms; + +import java.util.UUID; + +import jakarta.persistence.Column; +import jakarta.persistence.Convert; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import writeon.domain.common.BaseTimeEntity; +import writeon.domain.terms.enums.TermsCode; +import writeon.tables.records.TermsRecord; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@Table(name = "terms") +public class Terms extends BaseTimeEntity { + + @Id + @Column(updatable = false, nullable = false) + private UUID id = UUID.randomUUID(); + + @Convert(converter = TermsCode.TypeCodeConverter.class) + @Column(nullable = false) + private String cd; + + @Column(nullable = false) + private String title; + + @Column(nullable = false) + private String content; + + @Column(name = "is_required", nullable = false) + private Boolean isRequired; + + public Terms(TermsRecord terms) { + this.id = terms.getId(); + } + +} diff --git a/domain/src/main/java/writeon/domain/terms/TermsAgreement.java b/domain/src/main/java/writeon/domain/terms/TermsAgreement.java new file mode 100644 index 0000000..317783d --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/TermsAgreement.java @@ -0,0 +1,28 @@ +package writeon.domain.terms; + +import jakarta.persistence.*; +import lombok.*; +import writeon.domain.common.BaseTimeEntity; +import writeon.domain.terms.enums.TermsCode; + +import java.util.UUID; + +@Getter +@Setter +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +@Builder +@Table(name = "terms_agreement") +@IdClass(TermsAgreementId.class) +public class TermsAgreement extends BaseTimeEntity { + + @Id + @Column(name = "terms_cd", nullable = false) + private TermsCode termsCd; + + @Id + @Column(name = "member_id", nullable = false) + private UUID memberId; + +} diff --git a/domain/src/main/java/writeon/domain/terms/TermsAgreementId.java b/domain/src/main/java/writeon/domain/terms/TermsAgreementId.java new file mode 100644 index 0000000..4f2eb65 --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/TermsAgreementId.java @@ -0,0 +1,26 @@ +package writeon.domain.terms; + +import jakarta.persistence.Column; +import jakarta.persistence.Convert; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import writeon.domain.terms.enums.TermsCode; + +import java.io.Serializable; +import java.util.UUID; + +@Getter +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class TermsAgreementId implements Serializable { + + @Convert(converter = TermsCode.TypeCodeConverter.class) + @Column(name = "terms_cd", nullable = false) + private TermsCode termsCd; + + @Column(name = "member_id", nullable = false) + private UUID memberId; + +} diff --git a/domain/src/main/java/writeon/domain/terms/enums/TermsCode.java b/domain/src/main/java/writeon/domain/terms/enums/TermsCode.java new file mode 100644 index 0000000..464127e --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/enums/TermsCode.java @@ -0,0 +1,46 @@ +package writeon.domain.terms.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.persistence.Converter; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import writeon.domain.common.converter.AbstractEnumCodeConverter; +import writeon.domain.common.enums.Codable; + +@Getter +@RequiredArgsConstructor +@Slf4j +public enum TermsCode implements Codable { + PRIVACY_POLICY("1001"), + MARKETING_AGREEMENT("1002"), + TERMS_OF_USE("1003"); + + private final String code; + + @JsonCreator + public static TermsCode fromCode(final String code) { + return Codable.fromCode(TermsCode.class, code); + } + + @Converter + public static class TypeCodeConverter extends AbstractEnumCodeConverter { + @Override + public TermsCode convertToEntityAttribute(String dbData) { + return this.toEntityAttribute(TermsCode.class, dbData); + } + } + + public static class SpringConverter implements org.springframework.core.convert.converter.Converter { + @Override + public TermsCode convert(String code) { + return TermsCode.fromCode(code); + } + } + + @JsonValue + public String getCode() { + return code; + } +} diff --git a/domain/src/main/java/writeon/domain/terms/enums/TermsException.java b/domain/src/main/java/writeon/domain/terms/enums/TermsException.java new file mode 100644 index 0000000..82daeba --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/enums/TermsException.java @@ -0,0 +1,16 @@ +package writeon.domain.terms.enums; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import writeon.domain.common.enums.CodeInfo; + +@Getter +@RequiredArgsConstructor +public enum TermsException implements CodeInfo { + TERMS_NOT_FOUND(HttpStatus.NOT_FOUND, "TERMS-001", "약관을 찾을 수 없습니다."); + + private final HttpStatus status; + private final String code; + private final String message; +} diff --git a/domain/src/main/java/writeon/domain/terms/repository/TermsAgreeJpaRepository.java b/domain/src/main/java/writeon/domain/terms/repository/TermsAgreeJpaRepository.java new file mode 100644 index 0000000..e937c32 --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/repository/TermsAgreeJpaRepository.java @@ -0,0 +1,8 @@ +package writeon.domain.terms.repository; + +import org.springframework.data.repository.CrudRepository; +import writeon.domain.terms.TermsAgreement; + +public interface TermsAgreeJpaRepository extends CrudRepository { + +} diff --git a/domain/src/main/java/writeon/domain/terms/repository/TermsJpaRepository.java b/domain/src/main/java/writeon/domain/terms/repository/TermsJpaRepository.java new file mode 100644 index 0000000..7655b3c --- /dev/null +++ b/domain/src/main/java/writeon/domain/terms/repository/TermsJpaRepository.java @@ -0,0 +1,10 @@ +package writeon.domain.terms.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import writeon.domain.terms.Terms; + +@Repository +public interface TermsJpaRepository extends CrudRepository { + +} diff --git a/settings.gradle b/settings.gradle index 1e86aa5..b090ebe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,4 @@ -rootProject.name = 'writely' +rootProject.name = 'writeon' +include 'api' +include 'assistant-api-client' +include 'domain' \ No newline at end of file diff --git a/sql/init.sql b/sql/init.sql new file mode 100644 index 0000000..1d9d5ac --- /dev/null +++ b/sql/init.sql @@ -0,0 +1,443 @@ +-- DDL + +--- 회원 +create table member +( + id uuid default gen_random_uuid() constraint member_pk primary key, + email varchar(255) constraint email_uk unique not null, + nickname varchar(20) constraint nickname_uk unique not null, + profile_image varchar(255), + created_at timestamp with time zone not null, + updated_at timestamp with time zone not null +); +comment on table member is '회원'; +comment on column member.id is '회원 ID'; +comment on column member.email is '회원 이메일'; +comment on column member.nickname is '회원 닉네임'; +comment on column member.profile_image is '회원 프로필 이미지 경로'; + +create table member_password +( + member_id uuid constraint member_password_pk primary key, + password varchar(128) not null, + created_at timestamp with time zone not null, + updated_at timestamp with time zone not null +); +comment on table member_password is '회원_비밀번호'; +comment on column member_password.member_id is '회원 ID'; +comment on column member_password.password is '회원 비밀번호'; + +create table login_attempt +( + id uuid constraint login_attempt_pk primary key, + email varchar(255) not null, + result varchar(10) not null, + created_at timestamp with time zone not null, + updated_at timestamp with time zone not null +); +comment on table login_attempt is '로그인_시도'; +comment on column login_attempt.id is '로그인 시도 ID'; +comment on column login_attempt.email is '로그인 시도한 이메일'; +comment on column login_attempt.result is '로그인 시도 후 결과'; + +-- terms +create table terms +( + id uuid constraint terms_pk primary key, + cd varchar(10) not null, + version int not null, + title varchar(50) not null, + content text not null, + is_required boolean default false not null, + created_at timestamp with time zone not null, + updated_at timestamp with time zone not null +); +comment on table terms is '약관'; +comment on column terms.id is '약관 ID'; +comment on column terms.cd is '약관 코드'; +comment on column terms.version is '약관 버전'; +comment on column terms.title is '약관 제목'; +comment on column terms.content is '약관 내용'; +comment on column terms.is_required is '동의 필수 여부'; + +create table terms_agreement +( + terms_cd varchar(10) not null, + member_id uuid not null, + created_at timestamp with time zone not null, + updated_at timestamp with time zone not null, + constraint terms_agreement_pk primary key (terms_cd, member_id) +); +comment on table terms_agreement is '약관_동의'; +comment on column terms_agreement.terms_cd is '약관 코드'; +comment on column terms_agreement.member_id is '회원 ID'; + +-- product +create table product +( + id uuid default gen_random_uuid() not null + constraint product_pk + primary key, + title varchar(50), + content text, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product is '작품'; +comment on column product.id is '작품 ID'; +comment on column product.title is '제목'; +comment on column product.content is '내용'; +comment on column product.created_at is '생성일시'; +comment on column product.created_by is '생성자 ID'; +comment on column product.updated_at is '수정일시'; +comment on column product.updated_by is '수정자 ID'; + +alter table product + owner to postgres; + +--product_character +create table product_character +( + id uuid default gen_random_uuid() not null + constraint product_character_pk + primary key, + product_id uuid not null, + intro text, + name varchar(50), + age integer, + gender varchar(10), + occupation text, + appearance text, + personality text, + relationship text, + seq integer not null, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product_character is '작품 등장인물'; +comment on column product_character.id is '등장인물 ID'; +comment on column product_character.product_id is '작품 ID'; +comment on column product_character.intro is '소개'; +comment on column product_character.name is '이름'; +comment on column product_character.age is '나이'; +comment on column product_character.gender is '성별'; +comment on column product_character.occupation is '직업'; +comment on column product_character.appearance is '외모'; +comment on column product_character.personality is '성격/특징'; +comment on column product_character.relationship is '주요 관계'; +comment on column product_character.created_at is '생성일시'; +comment on column product_character.created_by is '생성자 ID'; +comment on column product_character.updated_at is '수정일시'; +comment on column product_character.updated_by is '수정자 ID'; + +alter table product_character + owner to postgres; + +--product_custom_field +create table product_custom_field +( + id uuid default gen_random_uuid() not null + constraint product_custom_field_pk + primary key, + product_id uuid not null, + section_id uuid not null, + section_type varchar(20) not null, + name varchar(30) not null, + content text not null, + seq smallint not null, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on column product_custom_field.id is '커스텀 필드 ID'; +comment on column product_custom_field.product_id is '작품 ID'; +comment on column product_custom_field.section_id is '섹션 ID'; +comment on column product_custom_field.section_type is '섹션 타입'; +comment on column product_custom_field.name is '이름'; +comment on column product_custom_field.content is '내용'; +comment on column product_custom_field.seq is '순서'; +comment on column product_custom_field.created_at is '생성일시'; +comment on column product_custom_field.created_by is '생성자 ID'; +comment on column product_custom_field.updated_at is '수정일시'; +comment on column product_custom_field.updated_by is '수정자 ID'; + +alter table product_custom_field + owner to postgres; + + +--product_ideanote +create table product_ideanote +( + id uuid not null + constraint product_ideanote_pk + primary key, + title varchar(100) not null, + content text not null, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product_ideanote is '작품 아이디어 노트'; +comment on column product_ideanote.id is '아이디어 노트 ID'; +comment on column product_ideanote.title is '제목'; +comment on column product_ideanote.content is '내용'; +comment on column product_ideanote.created_at is '생성일시'; +comment on column product_ideanote.created_by is '생성자 ID'; +comment on column product_ideanote.updated_at is '수정일시'; +comment on column product_ideanote.updated_by is '수정자 ID'; + +alter table product_ideanote + owner to postgres; + +-- product_memo +create table product_memo +( + id uuid default gen_random_uuid() not null + constraint product_memo_pk + primary key, + product_id uuid not null, + title varchar(100), + content text not null, + selected_text text not null, + start_index integer not null, + end_index integer not null, + is_completed boolean default false not null, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product_memo is '작품 메모'; +comment on column product_memo.id is '메모 ID'; +comment on column product_memo.product_id is '작품 ID'; +comment on column product_memo.title is '제목'; +comment on column product_memo.content is '내용'; +comment on column product_memo.is_completed is '완료 여부'; +comment on column product_memo.created_at is '생성일시'; +comment on column product_memo.created_by is '생성자 ID'; +comment on column product_memo.updated_at is '수정일시'; +comment on column product_memo.updated_by is '수정일시'; + +alter table product_memo + owner to postgres; + +--product_plot +create table product_plot +( + id uuid not null + constraint product_plot_pk + primary key, + content text, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product_plot is '작품 줄거리'; +comment on column product_plot.id is '줄거리 ID'; +comment on column product_plot.content is '내용'; +comment on column product_plot.created_at is '생성일시'; +comment on column product_plot.created_by is '생성자 ID'; +comment on column product_plot.updated_at is '수정일시'; +comment on column product_plot.updated_by is '수정자 ID'; + +alter table product_plot + owner to postgres; + +-- product_synopsis +create table product_synopsis +( + id uuid not null + constraint product_synopsis_pk + primary key, + genre varchar(30) not null, + length varchar(100), + purpose text, + logline text not null, + example text, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product_synopsis is '작품 시놉시스'; +comment on column product_synopsis.id is '시놉시스 ID'; +comment on column product_synopsis.genre is '장르'; +comment on column product_synopsis.length is '분량'; +comment on column product_synopsis.purpose is '기획 의도'; +comment on column product_synopsis.logline is '로그라인'; +comment on column product_synopsis.example is '예시 문장'; +comment on column product_synopsis.created_at is '생성일시'; +comment on column product_synopsis.created_by is '생성자 ID'; +comment on column product_synopsis.updated_at is '수정일시'; +comment on column product_synopsis.updated_by is '수정자 ID'; + +alter table product_synopsis + owner to postgres; + +--product_worldview +create table product_worldview +( + id uuid not null + constraint product_worldview_pk + primary key, + geography text, + history text, + politics text, + society text, + religion text, + economy text, + technology text, + lifestyle text, + language text, + culture text, + species text, + occupation text, + conflict text, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null, + updated_by uuid not null +); + +comment on table product_worldview is '작품 세계관'; +comment on column product_worldview.id is '세계관 ID'; +comment on column product_worldview.geography is '지리'; +comment on column product_worldview.history is '역사'; +comment on column product_worldview.politics is '정치'; +comment on column product_worldview.society is '사회'; +comment on column product_worldview.religion is '종교'; +comment on column product_worldview.economy is '경제'; +comment on column product_worldview.technology is '기술'; +comment on column product_worldview.lifestyle is '생활'; +comment on column product_worldview.language is '언어'; +comment on column product_worldview.culture is '문화'; +comment on column product_worldview.species is '종족'; +comment on column product_worldview.occupation is '직업'; +comment on column product_worldview.conflict is '갈등 관계'; +comment on column product_worldview.created_at is '생성일시'; +comment on column product_worldview.created_by is '생성자 ID'; +comment on column product_worldview.updated_at is '수정일시'; +comment on column product_worldview.updated_by is '수정자 ID'; + +alter table product_worldview + owner to postgres; + +create table product_favorite_prompt +( + id uuid default gen_random_uuid() not null + constraint product_favorite_prompt_pk + primary key, + product_id uuid not null, + message_id uuid not null, + created_at timestamp not null +); + +alter table product_favorite_prompt + owner to postgres; + +create index idx_prompt_product_id + on product_favorite_prompt (product_id); + +create table product_fixed_message +( + product_id uuid not null + primary key + constraint fk_product + references product + on delete cascade, + message_id uuid not null +); + +alter table product_fixed_message + owner to postgres; + +create table assistant +( + id uuid not null + constraint assistant_pk + primary key, + product_id uuid not null, + type varchar(20) not null, + status varchar(20) not null, + is_applied boolean default false not null, + is_archived boolean default false not null, + created_at timestamp not null, + created_by uuid not null, + updated_at timestamp not null +); + +comment on table assistant is '어시스턴트'; +comment on column assistant.product_id is '작품 ID'; +comment on column assistant.type is '기능 종류'; +comment on column assistant.status is '진행 상태'; +comment on column assistant.is_applied is '답변 적용 여부'; +comment on column assistant.is_archived is '영구 보관 여부'; +comment on column assistant.created_at is '수정일시'; +comment on column assistant.created_by is '생성자 ID'; + +alter table assistant + owner to postgres; + +create table assistant_evaluation +( + assistant_id uuid not null + constraint assistant_evaluation_pk + primary key, + is_good boolean not null, + feedback varchar(255), + created_at timestamp not null, + created_by uuid not null +); + +comment on table assistant_evaluation is '어시스턴트 평가'; +comment on column assistant_evaluation.assistant_id is '어시스턴트 ID'; +comment on column assistant_evaluation.is_good is '만족 여부'; +comment on column assistant_evaluation.feedback is '피드백'; +comment on column assistant_evaluation.created_at is '생성일시'; +comment on column assistant_evaluation.created_by is '생성자 ID'; + +alter table assistant_evaluation + owner to postgres; + +create table assistant_message +( + id uuid default gen_random_uuid() not null + constraint assistant_message_pk + primary key, + assistant_id uuid not null, + role varchar(10) not null, + content text, + prompt text, + created_at timestamp not null, + created_by uuid +); + +alter table assistant_message + owner to postgres; + +create table assistant_planner_message +( + assistant_id uuid not null + constraint assistant_planner_message_pk + primary key, + genre varchar(100) not null, + logline text not null, + section varchar(30) not null +); + +alter table assistant_planner_message + owner to postgres; \ No newline at end of file diff --git a/src/main/java/com/writely/WritelyApplication.java b/src/main/java/com/writely/WritelyApplication.java deleted file mode 100644 index 03bd712..0000000 --- a/src/main/java/com/writely/WritelyApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.writely; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class WritelyApplication { - - public static void main(String[] args) { - SpringApplication.run(WritelyApplication.class, args); - } - -} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index 926ba1b..0000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,3 +0,0 @@ -spring: - application: - name: writely diff --git a/src/test/java/com/writely/WritelyApplicationTests.java b/src/test/java/com/writely/WritelyApplicationTests.java deleted file mode 100644 index 71ea883..0000000 --- a/src/test/java/com/writely/WritelyApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.writely; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class WritelyApplicationTests { - - @Test - void contextLoads() { - } - -}