parent
8301cfd96d
commit
6dffd636ec
@ -0,0 +1,30 @@
|
||||
package cn.teammodel.dao;
|
||||
|
||||
import cn.teammodel.model.entity.appraise.Appraise;
|
||||
import cn.teammodel.model.entity.appraise.AppraiseTreeNode;
|
||||
import com.azure.cosmos.models.PartitionKey;
|
||||
import com.azure.spring.data.cosmos.repository.CosmosRepository;
|
||||
import com.azure.spring.data.cosmos.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2023-11-20 14:39 <br/>
|
||||
* Page<User> findByLastname(String lastname, Pageable pageable); <br/>
|
||||
* Slice<User> findByLastname(String lastname, Pageable pageable);<br/>
|
||||
* Window<User> findTop10ByLastname(String lastname, ScrollPosition position, Sort sort);<br/>
|
||||
* List<User> findByLastname(String lastname, Sort sort);<br/>
|
||||
* List<User> findByLastname(String lastname, Sort sort, Limit limit);<br/>
|
||||
* List<User> findByLastname(String lastname, Pageable pageable);<br/>
|
||||
*/
|
||||
@Repository
|
||||
public interface AppraiseRepository extends CosmosRepository<Appraise, String> {
|
||||
Appraise findBySchoolId(String schoolId, PartitionKey partitionKey);
|
||||
Appraise findAppraiseBySchoolIdAndPeriodIdAndCode(String schoolId, String periodId, String code);
|
||||
@Query("SELECT value n FROM School AS s join n in s.nodes where s.schoolId = @schoolId and s.periodId = @periodId and s.code = @code and n.id = @nodeId")
|
||||
List<AppraiseTreeNode> findNodeById(@Param("schoolId") String schoolId, @Param("periodId") String periodId, @Param("code") String code, @Param("nodeId") String nodeId);
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.teammodel.dao;
|
||||
|
||||
import cn.teammodel.model.entity.school.School;
|
||||
import com.azure.spring.data.cosmos.repository.CosmosRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2023-11-28 17:39
|
||||
*/
|
||||
@Repository
|
||||
public interface SchoolRepository extends CosmosRepository<School, String> {
|
||||
//@Query("select c.period.semesters from c where c.id = @id and c.code = @code")
|
||||
//List<School.Semester> findSemestersById(@Param("id") String id, @Param("code") String code);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.teammodel.model.dto.Appraise;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2023-11-28 16:16
|
||||
*/
|
||||
@Data
|
||||
public class AppraiseVoteDto {
|
||||
@NotNull
|
||||
private String studentId;
|
||||
@NotNull // todo: semester 还是 period
|
||||
private String semesterId;
|
||||
@NotNull
|
||||
private String appraiseId;
|
||||
// 校区 id
|
||||
private String periodId;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.teammodel.model.dto;
|
||||
package cn.teammodel.model.dto.Appraise;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.teammodel.model.dto;
|
||||
package cn.teammodel.model.dto.Appraise;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.teammodel.model.dto;
|
||||
package cn.teammodel.model.dto.Appraise;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
@ -1,4 +1,4 @@
|
||||
package cn.teammodel.model.dto;
|
||||
package cn.teammodel.model.dto.Appraise;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -0,0 +1,94 @@
|
||||
package cn.teammodel.model.entity.school;
|
||||
|
||||
import cn.teammodel.model.entity.BaseItem;
|
||||
import com.azure.spring.data.cosmos.core.mapping.Container;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Container(containerName = "School")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class School extends BaseItem {
|
||||
/**
|
||||
* 学校名字
|
||||
*/
|
||||
private String name;
|
||||
private String schoolCode;
|
||||
private String region;
|
||||
private String province;
|
||||
private String city;
|
||||
private String dist;
|
||||
private String areaId;
|
||||
private Integer size;
|
||||
private Integer tsize;
|
||||
private String address;
|
||||
private String picture;
|
||||
private TimeZone timeZone;
|
||||
private Integer type;
|
||||
private String standard;
|
||||
private Integer hpappraise;
|
||||
private Integer scale;
|
||||
private Edition edition;
|
||||
private long createTime;
|
||||
private boolean isinit;
|
||||
private boolean openLessonRecord;
|
||||
//private Module[] modules;
|
||||
private String pk;
|
||||
private List<Period> period;
|
||||
private List<Campus> campuses;
|
||||
|
||||
@Data
|
||||
public static class Period {
|
||||
private List<Major> majors;
|
||||
private List<String> grades;
|
||||
private List<Subject> subjects;
|
||||
private List<Semester> semesters;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Major {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Subject {
|
||||
private String id;
|
||||
private String name;
|
||||
private Integer type;
|
||||
private String bindId;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class Semester {
|
||||
private String name;
|
||||
private Integer start;
|
||||
private Integer month;
|
||||
private Integer day;
|
||||
private String id;
|
||||
}
|
||||
@Data
|
||||
public static class Campus {
|
||||
private String name;
|
||||
private String id;
|
||||
|
||||
}
|
||||
@Data
|
||||
public static class TimeZone {
|
||||
private String label;
|
||||
private String value;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Edition {
|
||||
private Integer current;
|
||||
private Integer record;
|
||||
private String scaleVersion;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue