Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QChildProblemStatistic is a Querydsl query type for ChildProblemStatistic
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QChildProblemStatistic extends EntityPathBase<ChildProblemStatistic> {

private static final long serialVersionUID = 1136828573L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QChildProblemStatistic childProblemStatistic = new QChildProblemStatistic("childProblemStatistic");

public final NumberPath<Long> childProblemId = createNumber("childProblemId", Long.class);

public final QCountStatistic countStatistic;

public final NumberPath<Long> id = createNumber("id", Long.class);

public QChildProblemStatistic(String variable) {
this(ChildProblemStatistic.class, forVariable(variable), INITS);
}

public QChildProblemStatistic(Path<? extends ChildProblemStatistic> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QChildProblemStatistic(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QChildProblemStatistic(PathMetadata metadata, PathInits inits) {
this(ChildProblemStatistic.class, metadata, inits);
}

public QChildProblemStatistic(Class<? extends ChildProblemStatistic> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.countStatistic = inits.isInitialized("countStatistic") ? new QCountStatistic(forProperty("countStatistic")) : null;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;


/**
* QCountStatistic is a Querydsl query type for CountStatistic
*/
@Generated("com.querydsl.codegen.DefaultEmbeddableSerializer")
public class QCountStatistic extends BeanPath<CountStatistic> {

private static final long serialVersionUID = 1047466257L;

public static final QCountStatistic countStatistic = new QCountStatistic("countStatistic");

public final NumberPath<Long> submitCount = createNumber("submitCount", Long.class);

public final NumberPath<Long> viewCount = createNumber("viewCount", Long.class);

public QCountStatistic(String variable) {
super(CountStatistic.class, forVariable(variable));
}

public QCountStatistic(Path<? extends CountStatistic> path) {
super(path.getType(), path.getMetadata());
}

public QCountStatistic(PathMetadata metadata) {
super(CountStatistic.class, metadata);
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QProblemSetStatistic is a Querydsl query type for ProblemSetStatistic
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QProblemSetStatistic extends EntityPathBase<ProblemSetStatistic> {

private static final long serialVersionUID = -1319940803L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QProblemSetStatistic problemSetStatistic = new QProblemSetStatistic("problemSetStatistic");

public final QCountStatistic countStatistic;

public final NumberPath<Long> id = createNumber("id", Long.class);

public final NumberPath<Long> problemSetId = createNumber("problemSetId", Long.class);

public QProblemSetStatistic(String variable) {
this(ProblemSetStatistic.class, forVariable(variable), INITS);
}

public QProblemSetStatistic(Path<? extends ProblemSetStatistic> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QProblemSetStatistic(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QProblemSetStatistic(PathMetadata metadata, PathInits inits) {
this(ProblemSetStatistic.class, metadata, inits);
}

public QProblemSetStatistic(Class<? extends ProblemSetStatistic> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.countStatistic = inits.isInitialized("countStatistic") ? new QCountStatistic(forProperty("countStatistic")) : null;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QProblemStatistic is a Querydsl query type for ProblemStatistic
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QProblemStatistic extends EntityPathBase<ProblemStatistic> {

private static final long serialVersionUID = 843488641L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QProblemStatistic problemStatistic = new QProblemStatistic("problemStatistic");

public final QCountStatistic countStatistic;

public final NumberPath<Long> id = createNumber("id", Long.class);

public final NumberPath<Long> problemId = createNumber("problemId", Long.class);

public QProblemStatistic(String variable) {
this(ProblemStatistic.class, forVariable(variable), INITS);
}

public QProblemStatistic(Path<? extends ProblemStatistic> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QProblemStatistic(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QProblemStatistic(PathMetadata metadata, PathInits inits) {
this(ProblemStatistic.class, metadata, inits);
}

public QProblemStatistic(Class<? extends ProblemStatistic> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.countStatistic = inits.isInitialized("countStatistic") ? new QCountStatistic(forProperty("countStatistic")) : null;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public enum ErrorCode {
ALREADY_PUBLISHED_ERROR(HttpStatus.BAD_REQUEST, "이미 발행된 문항세트는 컨펌해제할 수 없습니다."),
PROBLEM_SET_DELETED(HttpStatus.BAD_REQUEST, "삭제된 문항세트는 발행할 수 없습니다"),
PROBLEM_SET_NOT_CONFIRMED(HttpStatus.BAD_REQUEST, "컨펌되지 않은 문항세트는 발행할 수 없습니다"),

// 통계
PROBLEM_STATISTIC_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 문항의 통계 정보를 찾을 수 없습니다"),
PROBLEM_SET_STATISTIC_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 문항세트의 통계 정보를 찾을 수 없습니다"),
CHILD_PROBLEM_STATISTIC_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 새끼 문항의 통계 정보를 찾을 수 없습니다"),
FUTURE_PUBLISH_NOT_ACCESSIBLE(HttpStatus.BAD_REQUEST, "오늘 이후의 발행을 조회할 수 없습니다."),

// 문항 제출
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ChildProblemStatistic implements StatisticCounter {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "child_problem_statistic_id")
private Long id;

private Long childProblemId;

@Embedded
private CountStatistic countStatistic;

public ChildProblemStatistic(Long childProblemId) {
this.childProblemId = childProblemId;
this.countStatistic = new CountStatistic();
}

@Override
public void addViewCount() {
this.countStatistic.addViewCount();
}

@Override
public void addSubmitCount() {
this.countStatistic.addSubmitCount();
}

public Long getViewCount() {
return this.countStatistic.getViewCount();
}

public Long getSubmitCount() {
return this.countStatistic.getSubmitCount();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import jakarta.persistence.Embeddable;
import lombok.Getter;

@Getter
@Embeddable
public class CountStatistic implements StatisticCounter {
private Long viewCount;
private Long submitCount;

public CountStatistic() {
this.viewCount = 0L;
this.submitCount = 0L;
}

@Override
public void addViewCount() {
this.viewCount++;
}

@Override
public void addSubmitCount() {
this.submitCount++;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ProblemSetStatistic implements StatisticCounter {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "problem_set_statistic_id")
private Long id;

private Long problemSetId;

@Embedded
private CountStatistic countStatistic;

public ProblemSetStatistic(Long problemSetId) {
this.problemSetId = problemSetId;
this.countStatistic = new CountStatistic();
}

@Override
public void addViewCount() {
this.countStatistic.addViewCount();
}

@Override
public void addSubmitCount() {
this.countStatistic.addSubmitCount();
}

public Long getViewCount() {
return this.countStatistic.getViewCount();
}

public Long getSubmitCount() {
return this.countStatistic.getSubmitCount();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.moplus.moplus_server.statistic.Problem.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ProblemStatistic implements StatisticCounter {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "problem_statistic_id")
private Long id;

private Long problemId;

@Embedded
private CountStatistic countStatistic;

@Builder
public ProblemStatistic(Long problemId) {
this.problemId = problemId;
this.countStatistic = new CountStatistic();
}

@Override
public void addViewCount() {
this.countStatistic.addViewCount();
}

@Override
public void addSubmitCount() {
this.countStatistic.addSubmitCount();
}

public Long getViewCount() {
return this.countStatistic.getViewCount();
}

public Long getSubmitCount() {
return this.countStatistic.getSubmitCount();
}
}
Loading