blob: d2842887a5f687b75ae89a4c4a660b85dc1b0aff [file] [log] [blame]
rootcd436562025-05-08 14:09:19 +00001package database;
2
root9eb33942025-05-11 08:16:16 +00003import object.BegInfo;
4import object.Notice;
5import object.Post;
6import object.Profile;
rootcd436562025-05-08 14:09:19 +00007import object.Seed;
8import object.User;
9import object.UserPT;
rootcd436562025-05-08 14:09:19 +000010public interface DataManagerInterface{
root26d34b42025-05-08 14:44:21 +000011//DB1
12
rootcd436562025-05-08 14:09:19 +000013 public int RegisterUser(User userinfo);// 返回状态:0 success,1 邮箱重复,2其他原因
14 public int UpdateInformation(User userinfo);// 返回状态:0 success,1 不存在,2其他原因
15 public User GetInformation(String userid);// 返回用户的全部基本信息
16
17 public UserPT GetInformationPT(String userid);//返回用户的全部pt站信息
18 public int UpdateInformationPT(UserPT userinfo);//返回状态:0 success,1 邮箱重复,2其他原因
19 public int RegisterUserPT(UserPT userinfo);//返回状态:0 success,1 邮箱重复,2其他原因
20
21 public Seed GetSeedInformation(String seedid);//返回种子的全部信息;
22 public int RegisterSeed(Seed seedinfo);//添加一个新的种子,0成功,其他失败信息待定;
23 public int UpdateSeed(Seed seedinfo);//接收新的种子然后更新其全部属性;
24
25 public Seed[] SearchSeed(String userQ);//传入搜索的关键词或句子,返回搜索到的种子信息(按照公共字符数量排序)
26
27 public int AddNotice(Notice notice);//返回状态:0 success,1 重复,2其他原因
28 public boolean UpdateNotice(Notice notice);//返回状态:0 success,1 重复,2其他原因
29 public boolean DeleteNotice(String noticeid);//删除公告,返回状态:0 success,1 重复,2其他原因
30
31 public int GetUserAvailableInviteTimes(String userid);//获取用户的剩余邀请次数
32 public int InviteUser(String inviterid,String inviteemail);//邀请用户,返回状态:0 success,1 重复,2其他原因
33
root1672cc22025-05-11 08:02:58 +000034 public boolean AddCollect(String userid,String postid);//添加一个收藏,返回状态:0 success,1 不存在,2其他原因
35 public boolean DeleteCollect(String userid,String postid);//删除一个收藏,返回状态:0 success,1 不存在,2其他原因
36
root26d34b42025-05-08 14:44:21 +000037
38
39// ----------------------------------------------------------------------------------------------------
40
41//DB2
root9eb33942025-05-11 08:16:16 +000042 public int AddBegSeed(BegInfo info);//添加一个新的求种信息,返回状态:0 success,1 重复,2其他原因
43 public int UpdateBegSeed(BegInfo info);//更新一个求种信息,返回状态:0 success,1 重复,2其他原因
44 public int DeleteBegSeed(String begid);//删除一个求种信息,返回状态:0 success,1 重复,2其他原因
956303669fb7b9202025-05-11 16:18:15 +080045 public int VoteSeed(String begId, String seedId, String userId);//求种结果投票,返回状态:0 success,1 重复,2其他原因
rootcd436562025-05-08 14:09:19 +000046 public int SubmitSeed(String begid,Seed seed);//提交种子,返回状态:0 success,1 重复,2其他原因
47 public void SettleBeg();//结算所有求种信息,求种信息中需要增加Beg截止日期,默认14天,期间投票>的则Beg成功,否则Beg失败,并发放对应奖励
48
49 public int AddPost(Post post);//添加一个新的帖子,返回状态:0 success,1 重复,2其他原因
50 public int UpdatePost(Post post);//更新一个帖子,返回状态:0 success,1 不存在,2其他原因
51 public int DeletePost(String postid);//删除一个帖子,返回状态:0 success,1 不存在,2其他原因
52
956303669fb7b9202025-05-11 16:18:15 +080053 public int AddComment(String postid, String userid, String comment);//添加一个评论,返回状态:0 success,1 不存在,2其他原因
rootcd436562025-05-08 14:09:19 +000054 public int DeleteComment(String postid,String commentid);//删除一个评论,返回状态:0 success,1 不存在,2其他原因
55
root1672cc22025-05-11 08:02:58 +000056
rootcd436562025-05-08 14:09:19 +000057
58 public boolean ExchangeMagicToUpload(String userid,int magic);//将魔力值兑换为上传量,返回状态:0 success,1 不存在,2其他原因
59 public boolean ExchangeMagicToDownload(String userid,int magic);//将魔力值兑换为下载量,返回状态:0 success,1 不存在,2其他原因
60 public boolean ExchangeMagicToVip(String userid,int magic);//将魔力值兑换为VIP次数,返回状态:0 success,1 不存在,2其他原因
61
62 public boolean UploadTransmitProfile(Profile profile);
63 public Profile GetTransmitProfile(String profileid);//获取迁移信息
64 public boolean ExamTransmitProfile(String profileid,boolean result);//审核迁移信息,0成功,1失败
65 public Profile[] GetTransmitProfileList();//获取所有迁移信息
66
67}