108 lines
7.7 KiB
JavaScript
108 lines
7.7 KiB
JavaScript
const host1 = 'http://127.0.0.1:'; //81 82
|
||
const host2 = 'https://127.0.0.1:'; //83 84 85 86 88
|
||
const port1 = '81'; //登录,注册,通过id查找信息
|
||
const port2 = '82'; // 创建、修改、查找、删除、通过类型查找诗\词
|
||
const port3 = '83'; //关注
|
||
const port4 = '84'; //收藏
|
||
const port5 = '85'; //点赞
|
||
const port6 = '86'; //评论
|
||
const port8 = '88'; // 诗\词类型
|
||
const variate1 = 'userId'; //用户id
|
||
const variate2 = 'poemName';
|
||
const variate3 = 'username';
|
||
const variate4 = 'poemId';
|
||
const variate5 = 'dynastyId';
|
||
const variate6 = 'type';
|
||
const variate7 = 'dynastyName';
|
||
const variate8 = 'followers'; //关注
|
||
const variate9 = 'byfollowers'; //被关注
|
||
const variate10 = 'attentionId'; //取消关注
|
||
const variate11 = 'giveLikeId'; //点赞
|
||
const variate12 = 'commentsInformation'; //评论回复内容
|
||
const variate13 = 'repLyerId'; //评论诗的 评论id
|
||
const variate14 = 'commentsId'; //评论
|
||
const variate15 = 'seasonsId'; //删除诗词类型
|
||
const variate16 = 'page'; //通过类型查找
|
||
const variate17 = 'size'; //通过类型查找
|
||
|
||
const $api = {
|
||
//81
|
||
login: '${host1+port1}/consumer/login', //登录
|
||
registered: '${host1+port1}/consumer/registered/', //注册
|
||
fineById: '${host1+port1}/consumer/user/fineById/${variate1}', //通过id查找全部信息
|
||
modification: '${host1+port1}/consumer/user/modification', //修改信息
|
||
//82
|
||
findpoemName: '${host1+port2}/consumer/do/fine/poem/poemName/${variate2}', //查找词ByPoemName
|
||
findusername: '${host1+port2}/consumer/do/fine/dynasty/username/${variate3}', //查找诗ByUserName
|
||
deletepoemId: '${host1+port2}/consumer/delete/poemId/${variate4}', //删除诗
|
||
deletedynastyId: '${host1+port2}/consumer/delete/dynastyId/${variate5}', //删除词
|
||
typedynasty: '${host1+port2}/consumer/do/dynasty/type/${variate6}', //通过类型查找诗
|
||
typepoem: '${host1+port2}/consumer/do/fine/poem/type/${variate6}', //通过类型查找词
|
||
creationpoem: '${host1+port2}/consumer/creation/poem', //创建词
|
||
creationdynasty: '${host1+port2}/consumer/creation/dynasty', //创建诗
|
||
updatepoem: '${host1+port2}/consumer/update/poem', //修改词
|
||
updatedynasty: '${host1+port2}/consumer/update/dynasty', //修改诗
|
||
finedynastyuserId: '${host1+port2}/consumer/do/fine/dynasty/userId/${variate1}', //查找诗ByUserId
|
||
finedynastyId: '${host1+port2}/consumer/do/fine/dynasty/dynastyId/${variate5}', //查找诗ByDynastyId
|
||
finedynastyName: '${host1+port2}/consumer/do/fine/dynasty/dynastyName/${variate7}', //查找诗ByDynastyName
|
||
finepoemuserId: '${host1+port2}/consumer/do/fine/poem/userId/${variate1}', //查找词ByUserId
|
||
fineusername: '${host1+port2}/consumer/do/fine/poem/username/${variate3}', //查找词ByUserName
|
||
finepoemId: '${host1+port2}/consumer/do/fine/poem/poemId/${variate4}', //查找词ByPoemId
|
||
//83
|
||
attention: '${host2+port3}/consumer/user/attention/${variate8}/${variate9}', //关注
|
||
unfollow: '${ host2+port3}/consumer/user/unfollow/${variate10}', //取消关注
|
||
seefollowersList: '${ host2+port3}/consumer/user/followersList/${variate8}', //查看关注列表
|
||
seeattention: '${ host2+port3}/consumer/user/see/attention/${variate8}/${variate9}', //查看是否关注
|
||
//84
|
||
collectionpoem: '${host2+port4}/consumer/collection/poem/${variate1}/${variate4}', //收藏词
|
||
collectiondynasty: '${host2+port4}/consumer/collection/dynasty/${variate1}/${variate5}', //收藏诗
|
||
seecollectionpoem: '${host2+port4}/consumer/see/collection/poem/${variate1}', //查看已收藏的词
|
||
seecollectiondynasty: '${host2+port4}/consumer/see/collection/dynasty/${variate1}', //查看已收藏的诗
|
||
seecollectionpoemnum: '${host2+port4}/consumer/do/see/collection/poem/num/${variate4}', //查看词被收藏的数量
|
||
seecollectiondynastynum: '${host2+port4}/consumer/do/see/collection/dynasty/num/${variate5}', //查看诗被收藏的数量
|
||
seedynastycollection: '${host2+port4}/consumer/see/dynasty/collection/${variate1}/${variate4}', //查看词是否被用户收藏
|
||
seepoemcollection: '${host2+port4}/consumer/see/poem/collection/${variate1}/${variate5}', //查看诗是否被用户收藏
|
||
deletpoemcollection: '${host2+port4}/consumer/delet/poem/collection/${variate4}', //删除收藏词
|
||
deletdynastycollection: '${host2+port4}/consumer/delet/dynasty/collection/${variate5}', //删除收藏诗
|
||
//85
|
||
poemgivelike: '${host2+port5}/consumer/poem/give/like/${variate1}/${variate4}', //词点赞
|
||
dynastygivelike: '${host2+port5}/consumer/dynasty/give/like/${variate1}/${variate5}', //诗点赞
|
||
givelike: '${host2+port5}/consumer/poem/give/like/cancel/${variate11}', //取消词点赞
|
||
givelike: '${host2+port5}/consumer/dynasty/give/like/cancel/${variate11}', //取消诗点赞
|
||
doseedynastygivelike: '${host2+port5}/consumer/do/see/dynasty/give/like/${variate1}/${variate5}', //查看用户是否已经给诗点赞
|
||
doseepoemgivelike: '${host2+port5}/consumer/do/see/poem/give/like/${variate1}/${variate4}', //查看用户是否已经给词点赞
|
||
seepoemgivelike: '${host2+port5}/consumer/see/poem/give/like/${variate5}', //查看词点赞详细信息
|
||
seedynastygivelike: '${host2+port5}/consumer/see/dynasty/give/like/${variate4}', //查看诗点赞详细信息
|
||
seepoemgivelikenum: '${host2+port5}/consumer/do/see/poem/give/like/num/${variate4}', //查看词点赞
|
||
seedynastygivelikenum: '${host2+port5}/consumer/do/see/dynasty/give/like/num/${variate5}', //查看诗点赞
|
||
deletepoemgiveLike: '${host2+port5}/consumer/delete/poem/giveLike/${variate4}', //删除点赞ByPoem
|
||
deletedynastygiveLike: '${host2+port5}/consumer/delete/dynasty/giveLike/${variate5}', //删除点赞ByDynasty
|
||
//86
|
||
usercommentspoem: '${host2+port6}/consumer/user/comments/poem/${variate1}/${variate4}/${variate12}', //评论词
|
||
usercommentsdynasty: '${host2+port6}/consumer/user/comments/dynasty/${variate1}/${variate5}/${variate12}', //评论诗
|
||
usercommentspoemrepLyerId: '${host2+port6}/consumer/user/comments/poem/${variate1}/${variate4}/${variate12}/${variate13}', //回复评论词
|
||
usercommentsdynastyrepLyerId: '${host2+port6}/consumer/user/comments/dynasty/${variate1}/${variate5}/${variate12}/${variate13}', //回复评论诗
|
||
userdeletecommentspoem: '${host2+port6}/consumer/user/delete/comments/poem/${variate14}', //删除词的评论
|
||
userdeletecommentsdynasty: '${host2+port6}/consumer/user/delete/comments/dynasty/${variate14}', //删除诗的评论
|
||
|
||
|
||
doseepoemcomments: '${host2}${port6}/consumer/do/see/poem/comments/${variate4}', //查看某首词的所有评论
|
||
|
||
|
||
doseepoemcommentsreply: '${host2+port6}/consumer/do/see/poem/comments/reply/${variate14}', //查看某首词评论的回复
|
||
doseedynastycomments: '${host2+port6}/consumer/do/see/dynasty/comments/${variate5}', //查看某首诗的所有评论
|
||
doseedynastycommentsreply: '${host2+port6}/consumer/do/see/dynasty/comments/reply/${variate14}', //查看某首诗评论的回复
|
||
// 88
|
||
addpoemtype: '${host2+port8}/consumer/add/poem/type', //增词加类型
|
||
adddynastytype: '${host2+port8}/consumer/add/dynasty/type', //增诗加类型
|
||
seedynastytype: '${host2+port8}/consumer/see/dynasty/type', //查看诗的类型
|
||
seepoemtype: '${host2+port8}/consumer/see/poem/type', //查看词的类型
|
||
deletePoemType: '${host2+port8}/consumer/delete/PoemType/${variate15}', //删除词类型
|
||
deleteDynastyType: '${host2+port8}/consumer/delete/DynastyType/${variate15}', //删除诗类型
|
||
dofinedynastytype: '${host2+port8}/consumer/do/fine/dynasty/type/${variate6}/${variate16}/${variate17}', //通过类型查找诗
|
||
dofinepoemtype: '${host2+port8}/consumer/do/fine/poem/type/${variate6}/${variate16}/${variate17}', //通过类型产找词
|
||
|
||
|
||
|
||
|
||
} |