blob: cf98f46cc5ecf1cfb29ad97ac4dc000ba2cb7333 [file] [log] [blame]
rootcd436562025-05-08 14:09:19 +00001package database;
2
rootff0769a2025-05-18 17:24:41 +00003import entity.BegInfo;
rhje18c3f72025-06-08 00:27:01 +08004import entity.BegSeedDetail;
rootff0769a2025-05-18 17:24:41 +00005import entity.Notice;
6import entity.Post;
7import entity.Profile;
8import entity.Seed;
rhj7912f2c2025-06-09 17:21:32 +08009import entity.SeedPromotion;
10import entity.SeedWithPromotionDTO;
rootff0769a2025-05-18 17:24:41 +000011import entity.User;
12import entity.UserPT;
rhje18c3f72025-06-08 00:27:01 +080013import entity.UserStar;
rhj5b69b7e2025-06-07 01:28:08 +080014import entity.PostReply;
rhje18c3f72025-06-08 00:27:01 +080015import entity.SeedWithVotes;
16import java.io.File;
rhj7912f2c2025-06-09 17:21:32 +080017import java.util.Date;
rootcd436562025-05-08 14:09:19 +000018public interface DataManagerInterface{
root26d34b42025-05-08 14:44:21 +000019//DB1
20
rootcd436562025-05-08 14:09:19 +000021 public int RegisterUser(User userinfo);// 返回状态:0 success,1 邮箱重复,2其他原因
TRM-codingcdfe5482025-06-06 17:31:01 +080022 public String LoginUser(User userinfo);
rootcd436562025-05-08 14:09:19 +000023 public int UpdateInformation(User userinfo);// 返回状态:0 success,1 不存在,2其他原因
24 public User GetInformation(String userid);// 返回用户的全部基本信息
25
26 public UserPT GetInformationPT(String userid);//返回用户的全部pt站信息
27 public int UpdateInformationPT(UserPT userinfo);//返回状态:0 success,1 邮箱重复,2其他原因
28 public int RegisterUserPT(UserPT userinfo);//返回状态:0 success,1 邮箱重复,2其他原因
29
30 public Seed GetSeedInformation(String seedid);//返回种子的全部信息;
31 public int RegisterSeed(Seed seedinfo);//添加一个新的种子,0成功,其他失败信息待定;
32 public int UpdateSeed(Seed seedinfo);//接收新的种子然后更新其全部属性;
rhjc6a4ee02025-06-06 00:45:18 +080033 public int DeleteSeed(String seedid);//删除一个种子,返回状态:0 success,1 不存在,2其他原因
rootcd436562025-05-08 14:09:19 +000034
35 public Seed[] SearchSeed(String userQ);//传入搜索的关键词或句子,返回搜索到的种子信息(按照公共字符数量排序)
rhj7912f2c2025-06-09 17:21:32 +080036 public SeedWithPromotionDTO[] GetSeedListByTag(String tag);//获取某个标签下的种子列表
rhjc6a4ee02025-06-06 00:45:18 +080037 public Seed[] GetSeedListByUser(String userid);//获取某个用户的种子列表
Raveraae06122025-06-05 08:13:35 +000038
rootcd436562025-05-08 14:09:19 +000039 public int AddNotice(Notice notice);//返回状态:0 success,1 重复,2其他原因
40 public boolean UpdateNotice(Notice notice);//返回状态:0 success,1 重复,2其他原因
41 public boolean DeleteNotice(String noticeid);//删除公告,返回状态:0 success,1 重复,2其他原因
42
43 public int GetUserAvailableInviteTimes(String userid);//获取用户的剩余邀请次数
44 public int InviteUser(String inviterid,String inviteemail);//邀请用户,返回状态:0 success,1 重复,2其他原因
45
root0dbc9812025-05-19 04:41:57 +000046 public boolean AddCollect(String userid,String seedid);//添加一个收藏,返回状态:0 success,1 不存在,2其他原因
47 public boolean DeleteCollect(String userid,String seedid);//删除一个收藏,返回状态:0 success,1 不存在,2其他原因
rhje18c3f72025-06-08 00:27:01 +080048 public UserStar[] GetUserStarList(String userid);//获取用户的收藏列表
49
50 public int CheckAdmin(String userid);//检查用户是否为管理员,返回状态:0 success,1 不存在,2其他原因
root26d34b42025-05-08 14:44:21 +000051
52
53// ----------------------------------------------------------------------------------------------------
54
55//DB2
root9eb33942025-05-11 08:16:16 +000056 public int AddBegSeed(BegInfo info);//添加一个新的求种信息,返回状态:0 success,1 重复,2其他原因
57 public int UpdateBegSeed(BegInfo info);//更新一个求种信息,返回状态:0 success,1 重复,2其他原因
58 public int DeleteBegSeed(String begid);//删除一个求种信息,返回状态:0 success,1 重复,2其他原因
956303669fb7b9202025-05-11 16:18:15 +080059 public int VoteSeed(String begId, String seedId, String userId);//求种结果投票,返回状态:0 success,1 重复,2其他原因
rootcd436562025-05-08 14:09:19 +000060 public int SubmitSeed(String begid,Seed seed);//提交种子,返回状态:0 success,1 重复,2其他原因
61 public void SettleBeg();//结算所有求种信息,求种信息中需要增加Beg截止日期,默认14天,期间投票>的则Beg成功,否则Beg失败,并发放对应奖励
rhje18c3f72025-06-08 00:27:01 +080062 public BegSeedDetail[] GetBegList();//获取所有求种信息(包含BegSeed表内容和BegInfo的Info字段)
63 public BegInfo GetBegDetail(String begid);//获取一个求种信息的详细信息
64 public BegSeedDetail GetBegSeedDetail(String begid);//获取一个求种信息的详细信息(包含BegSeed表数据和BegInfo表的Info字段)
65 public SeedWithVotes[] GetBegSeedListWithVotes(String begid);//获取一个求种信息下的种子列表(包含投票信息)
66 public int SubmitBegSeed(String begid, String seedid, String userid);//提交一个种子到求种信息中,返回状态:0 success,1 重复,2其他原因
rootcd436562025-05-08 14:09:19 +000067
rhj5ebd93c2025-06-07 15:57:28 +080068 public Post[] SearchPost(String userQ);//传入搜索的关键词或句子,返回搜索到的帖子信息(按照公共字符数量排序)
rhj46f62c42025-06-06 23:24:10 +080069 public Post[] GetPostList();//获取用户的帖子列表
rhj5b69b7e2025-06-07 01:28:08 +080070 public Post GetPost(String postid);//获取一个帖子的详细信息
71 public PostReply[] GetPostReplyList(String postid);//获取一个帖子的回复列表
rootcd436562025-05-08 14:09:19 +000072 public int AddPost(Post post);//添加一个新的帖子,返回状态:0 success,1 重复,2其他原因
73 public int UpdatePost(Post post);//更新一个帖子,返回状态:0 success,1 不存在,2其他原因
74 public int DeletePost(String postid);//删除一个帖子,返回状态:0 success,1 不存在,2其他原因
75
956303669fb7b9202025-05-11 16:18:15 +080076 public int AddComment(String postid, String userid, String comment);//添加一个评论,返回状态:0 success,1 不存在,2其他原因
rootcd436562025-05-08 14:09:19 +000077 public int DeleteComment(String postid,String commentid);//删除一个评论,返回状态:0 success,1 不存在,2其他原因
78
root1672cc22025-05-11 08:02:58 +000079
rootcd436562025-05-08 14:09:19 +000080
81 public boolean ExchangeMagicToUpload(String userid,int magic);//将魔力值兑换为上传量,返回状态:0 success,1 不存在,2其他原因
82 public boolean ExchangeMagicToDownload(String userid,int magic);//将魔力值兑换为下载量,返回状态:0 success,1 不存在,2其他原因
83 public boolean ExchangeMagicToVip(String userid,int magic);//将魔力值兑换为VIP次数,返回状态:0 success,1 不存在,2其他原因
84
85 public boolean UploadTransmitProfile(Profile profile);
86 public Profile GetTransmitProfile(String profileid);//获取迁移信息
rhj7912f2c2025-06-09 17:21:32 +080087 public boolean ExamTransmitProfile(String profileid, boolean result, Integer grantedUpload);//审核迁移信息,0成功,1失败
rootcd436562025-05-08 14:09:19 +000088 public Profile[] GetTransmitProfileList();//获取所有迁移信息
rhje18c3f72025-06-08 00:27:01 +080089 public int InviteNewUser(String inviterid, String invitedemail);//邀请新用户,返回状态:0 success,1 重复,2其他原因
rhj7912f2c2025-06-09 17:21:32 +080090 public int UploadMigration(String userid, File file, String uploadtogive);
rhje18c3f72025-06-08 00:27:01 +080091 public int createBagSeed(BegInfo begInfo, String userid, String info);
rhj7912f2c2025-06-09 17:21:32 +080092 public Seed[] getAllSeeds(); // 获取所有种子信息
93 public SeedPromotion[] getAllSeedPromotions(); // 获取所有种子推广信息
94 public int createSeedPromotion(String seedid, Date startTime, Date endTime, Integer discount); // 添加种子推广信息
rootcd436562025-05-08 14:09:19 +000095}