-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from Dapp-Learning-DAO/feature/arc_share
feat(share)
- Loading branch information
Showing
41 changed files
with
549 additions
and
221 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/dl/officialsite/common/base/Pagination.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,36 @@ | ||
package com.dl.officialsite.common.base; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Pagination { | ||
|
||
/** | ||
* 总数据条目 | ||
*/ | ||
private int totalCount; | ||
|
||
/** | ||
* 总共页数 | ||
*/ | ||
private int totalPages; | ||
|
||
/** | ||
* 当前页码 | ||
*/ | ||
private int currentPage; | ||
|
||
/** | ||
* 当前页面包含条目数 | ||
*/ | ||
private int currentPageSize; | ||
|
||
/** | ||
* 是否还有下一页 | ||
*/ | ||
private boolean hasNext; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/dl/officialsite/sharing/constant/SharingLanguageEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.dl.officialsite.sharing.constant; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum SharingLanguageEnum { | ||
|
||
CHINESE(0), | ||
|
||
ENGLISH(1), | ||
|
||
FRENCH(2), | ||
|
||
JAPANESE(3); | ||
|
||
private int code; | ||
|
||
SharingLanguageEnum(int code){ | ||
this.code = code; | ||
} | ||
|
||
public static SharingLanguageEnum codeOf(int languageCode) { | ||
for(SharingLanguageEnum language: SharingLanguageEnum.values()){ | ||
if(language.code == languageCode){ | ||
return language; | ||
} | ||
} | ||
throw new IllegalArgumentException("languageCode "+languageCode); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/dl/officialsite/sharing/constant/SharingLockStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.dl.officialsite.sharing.constant; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum SharingLockStatus { | ||
|
||
UNLOCKED(0), | ||
|
||
LOCKED(1); | ||
|
||
private int code; | ||
|
||
SharingLockStatus(int code){ | ||
this.code = code; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/dl/officialsite/sharing/constant/SharingMeetingType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.dl.officialsite.sharing.constant; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum SharingMeetingType { | ||
|
||
TENCENT(0), | ||
|
||
GOOGLE(1), | ||
|
||
ZOOM(2), | ||
|
||
TELEGRAM(3), | ||
|
||
DC(4); | ||
|
||
private int code; | ||
|
||
SharingMeetingType(int code){ | ||
this.code = code; | ||
} | ||
|
||
public static SharingMeetingType codeOf(int meetingType) { | ||
for(SharingMeetingType m: SharingMeetingType.values()){ | ||
if(m.code == meetingType){ | ||
return m; | ||
} | ||
} | ||
throw new IllegalArgumentException("meetingType "+meetingType); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/com/dl/officialsite/sharing/dao/ISharingRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.dl.officialsite.sharing.dao; | ||
|
||
import com.dl.officialsite.sharing.model.db.TbShare; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import java.util.List; | ||
|
||
public interface ISharingRepository extends JpaRepository<TbShare, Long> { | ||
|
||
@Query(value = "select * from tb_share limit :offset, :limit", nativeQuery = true) | ||
List<TbShare> findAllSharesPaged(@Param("offset") int offset, @Param("limit") int limit); | ||
|
||
@Query(value = "select count(*) from tb_share", nativeQuery = true) | ||
int loadAllCount(); | ||
|
||
@Query(value = "select * from tb_share where member_id = :memberId limit :offset, :limit", nativeQuery = true) | ||
List<TbShare> findAllSharesByUidPaged(@Param("memberId") long memberId, @Param("offset") int offset, @Param("limit") int limit); | ||
|
||
@Query(value = "select count(*) from tb_share where member_id = :memberId", nativeQuery = true) | ||
int loadCountByUid(@Param("memberId") long memberId); | ||
|
||
|
||
} |
84 changes: 84 additions & 0 deletions
84
src/main/java/com/dl/officialsite/sharing/model/db/TbShare.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package com.dl.officialsite.sharing.model.db; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.*; | ||
|
||
@Data | ||
@Entity | ||
@Table(name = "tb_share", | ||
uniqueConstraints={@UniqueConstraint(columnNames={"theme"})}, | ||
indexes= { | ||
@Index(columnList="member_id") | ||
}) | ||
public class TbShare { | ||
|
||
/** | ||
* 分享Id | ||
*/ | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private long id; | ||
|
||
/** | ||
* 分享主题 | ||
*/ | ||
private String theme; | ||
|
||
/** | ||
* 分享日期 | ||
*/ | ||
private String date; | ||
|
||
/** | ||
* 分享时间(UTC+8) | ||
*/ | ||
private String time; | ||
|
||
/** | ||
* 分享语言 | ||
*/ | ||
private int language; // 0 Chinese 1 English | ||
|
||
/** | ||
* 分享人昵称 | ||
*/ | ||
private String presenter; | ||
|
||
/** | ||
* 分享所属组织 | ||
*/ | ||
private String org; | ||
|
||
/** | ||
* 分享人twitter | ||
*/ | ||
private String twitter; | ||
|
||
/** | ||
* 分享人 | ||
*/ | ||
@Column(name = "member_id") | ||
private long memberId; | ||
|
||
/** | ||
* 文档连接 | ||
*/ | ||
@Column(name = "sharing_doc") | ||
private String sharingDoc; | ||
|
||
/** | ||
* 标签类别 | ||
*/ | ||
private String label; | ||
|
||
/** | ||
* 锁定状态 | ||
*/ | ||
@Column(name = "lock_status") | ||
private int lockStatus; | ||
|
||
private int meetingType; | ||
|
||
private String meetingLink; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/com/dl/officialsite/sharing/model/resp/AllSharingResp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.dl.officialsite.sharing.model.resp; | ||
|
||
import com.dl.officialsite.common.base.PagedList; | ||
import com.dl.officialsite.sharing.model.vo.SharingVo; | ||
|
||
public class AllSharingResp extends PagedList<SharingVo> { | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.