root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 1 | package database; |
| 2 | |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 3 | import entity.BegInfo; |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame^] | 4 | import entity.BegSeedDetail; |
root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 5 | import entity.Notice; |
| 6 | import entity.Post; |
| 7 | import entity.Profile; |
| 8 | import entity.Seed; |
| 9 | import entity.User; |
| 10 | import entity.UserPT; |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame^] | 11 | import entity.UserStar; |
rhj | 5b69b7e | 2025-06-07 01:28:08 +0800 | [diff] [blame] | 12 | import entity.PostReply; |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame^] | 13 | import entity.SeedWithVotes; |
| 14 | import java.io.File; |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 15 | public interface DataManagerInterface{ |
root | 26d34b4 | 2025-05-08 14:44:21 +0000 | [diff] [blame] | 16 | //DB1 |
| 17 | |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 18 | public int RegisterUser(User userinfo);// 返回状态:0 success,1 邮箱重复,2其他原因 |
TRM-coding | cdfe548 | 2025-06-06 17:31:01 +0800 | [diff] [blame] | 19 | public String LoginUser(User userinfo); |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 20 | public int UpdateInformation(User userinfo);// 返回状态:0 success,1 不存在,2其他原因 |
| 21 | public User GetInformation(String userid);// 返回用户的全部基本信息 |
| 22 | |
| 23 | public UserPT GetInformationPT(String userid);//返回用户的全部pt站信息 |
| 24 | public int UpdateInformationPT(UserPT userinfo);//返回状态:0 success,1 邮箱重复,2其他原因 |
| 25 | public int RegisterUserPT(UserPT userinfo);//返回状态:0 success,1 邮箱重复,2其他原因 |
| 26 | |
| 27 | public Seed GetSeedInformation(String seedid);//返回种子的全部信息; |
| 28 | public int RegisterSeed(Seed seedinfo);//添加一个新的种子,0成功,其他失败信息待定; |
| 29 | public int UpdateSeed(Seed seedinfo);//接收新的种子然后更新其全部属性; |
rhj | c6a4ee0 | 2025-06-06 00:45:18 +0800 | [diff] [blame] | 30 | public int DeleteSeed(String seedid);//删除一个种子,返回状态:0 success,1 不存在,2其他原因 |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 31 | |
| 32 | public Seed[] SearchSeed(String userQ);//传入搜索的关键词或句子,返回搜索到的种子信息(按照公共字符数量排序) |
Raver | aae0612 | 2025-06-05 08:13:35 +0000 | [diff] [blame] | 33 | public Seed[] GetSeedListByTag(String tag);//获取某个标签下的种子列表 |
rhj | c6a4ee0 | 2025-06-06 00:45:18 +0800 | [diff] [blame] | 34 | public Seed[] GetSeedListByUser(String userid);//获取某个用户的种子列表 |
Raver | aae0612 | 2025-06-05 08:13:35 +0000 | [diff] [blame] | 35 | |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 36 | public int AddNotice(Notice notice);//返回状态:0 success,1 重复,2其他原因 |
| 37 | public boolean UpdateNotice(Notice notice);//返回状态:0 success,1 重复,2其他原因 |
| 38 | public boolean DeleteNotice(String noticeid);//删除公告,返回状态:0 success,1 重复,2其他原因 |
| 39 | |
| 40 | public int GetUserAvailableInviteTimes(String userid);//获取用户的剩余邀请次数 |
| 41 | public int InviteUser(String inviterid,String inviteemail);//邀请用户,返回状态:0 success,1 重复,2其他原因 |
| 42 | |
root | 0dbc981 | 2025-05-19 04:41:57 +0000 | [diff] [blame] | 43 | public boolean AddCollect(String userid,String seedid);//添加一个收藏,返回状态:0 success,1 不存在,2其他原因 |
| 44 | public boolean DeleteCollect(String userid,String seedid);//删除一个收藏,返回状态:0 success,1 不存在,2其他原因 |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame^] | 45 | public UserStar[] GetUserStarList(String userid);//获取用户的收藏列表 |
| 46 | |
| 47 | public int CheckAdmin(String userid);//检查用户是否为管理员,返回状态:0 success,1 不存在,2其他原因 |
root | 26d34b4 | 2025-05-08 14:44:21 +0000 | [diff] [blame] | 48 | |
| 49 | |
| 50 | // ---------------------------------------------------------------------------------------------------- |
| 51 | |
| 52 | //DB2 |
root | 9eb3394 | 2025-05-11 08:16:16 +0000 | [diff] [blame] | 53 | public int AddBegSeed(BegInfo info);//添加一个新的求种信息,返回状态:0 success,1 重复,2其他原因 |
| 54 | public int UpdateBegSeed(BegInfo info);//更新一个求种信息,返回状态:0 success,1 重复,2其他原因 |
| 55 | public int DeleteBegSeed(String begid);//删除一个求种信息,返回状态:0 success,1 重复,2其他原因 |
956303669 | fb7b920 | 2025-05-11 16:18:15 +0800 | [diff] [blame] | 56 | public int VoteSeed(String begId, String seedId, String userId);//求种结果投票,返回状态:0 success,1 重复,2其他原因 |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 57 | public int SubmitSeed(String begid,Seed seed);//提交种子,返回状态:0 success,1 重复,2其他原因 |
| 58 | public void SettleBeg();//结算所有求种信息,求种信息中需要增加Beg截止日期,默认14天,期间投票>的则Beg成功,否则Beg失败,并发放对应奖励 |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame^] | 59 | public BegSeedDetail[] GetBegList();//获取所有求种信息(包含BegSeed表内容和BegInfo的Info字段) |
| 60 | public BegInfo GetBegDetail(String begid);//获取一个求种信息的详细信息 |
| 61 | public BegSeedDetail GetBegSeedDetail(String begid);//获取一个求种信息的详细信息(包含BegSeed表数据和BegInfo表的Info字段) |
| 62 | public SeedWithVotes[] GetBegSeedListWithVotes(String begid);//获取一个求种信息下的种子列表(包含投票信息) |
| 63 | public int SubmitBegSeed(String begid, String seedid, String userid);//提交一个种子到求种信息中,返回状态:0 success,1 重复,2其他原因 |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 64 | |
rhj | 5ebd93c | 2025-06-07 15:57:28 +0800 | [diff] [blame] | 65 | public Post[] SearchPost(String userQ);//传入搜索的关键词或句子,返回搜索到的帖子信息(按照公共字符数量排序) |
rhj | 46f62c4 | 2025-06-06 23:24:10 +0800 | [diff] [blame] | 66 | public Post[] GetPostList();//获取用户的帖子列表 |
rhj | 5b69b7e | 2025-06-07 01:28:08 +0800 | [diff] [blame] | 67 | public Post GetPost(String postid);//获取一个帖子的详细信息 |
| 68 | public PostReply[] GetPostReplyList(String postid);//获取一个帖子的回复列表 |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 69 | public int AddPost(Post post);//添加一个新的帖子,返回状态:0 success,1 重复,2其他原因 |
| 70 | public int UpdatePost(Post post);//更新一个帖子,返回状态:0 success,1 不存在,2其他原因 |
| 71 | public int DeletePost(String postid);//删除一个帖子,返回状态:0 success,1 不存在,2其他原因 |
| 72 | |
956303669 | fb7b920 | 2025-05-11 16:18:15 +0800 | [diff] [blame] | 73 | public int AddComment(String postid, String userid, String comment);//添加一个评论,返回状态:0 success,1 不存在,2其他原因 |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 74 | public int DeleteComment(String postid,String commentid);//删除一个评论,返回状态:0 success,1 不存在,2其他原因 |
| 75 | |
root | 1672cc2 | 2025-05-11 08:02:58 +0000 | [diff] [blame] | 76 | |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 77 | |
| 78 | public boolean ExchangeMagicToUpload(String userid,int magic);//将魔力值兑换为上传量,返回状态:0 success,1 不存在,2其他原因 |
| 79 | public boolean ExchangeMagicToDownload(String userid,int magic);//将魔力值兑换为下载量,返回状态:0 success,1 不存在,2其他原因 |
| 80 | public boolean ExchangeMagicToVip(String userid,int magic);//将魔力值兑换为VIP次数,返回状态:0 success,1 不存在,2其他原因 |
| 81 | |
| 82 | public boolean UploadTransmitProfile(Profile profile); |
| 83 | public Profile GetTransmitProfile(String profileid);//获取迁移信息 |
| 84 | public boolean ExamTransmitProfile(String profileid,boolean result);//审核迁移信息,0成功,1失败 |
| 85 | public Profile[] GetTransmitProfileList();//获取所有迁移信息 |
rhj | e18c3f7 | 2025-06-08 00:27:01 +0800 | [diff] [blame^] | 86 | public int InviteNewUser(String inviterid, String invitedemail);//邀请新用户,返回状态:0 success,1 重复,2其他原因 |
| 87 | public int UploadMigration(String userid, File file); |
| 88 | public int createBagSeed(BegInfo begInfo, String userid, String info); |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 89 | } |