| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.EncyclopedicKnowledge; |
| | | import com.stylefeng.guns.modular.system.model.SysDataType; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | |
| | | |
| | | @Autowired |
| | | private ISysDataTypeService sysDataTypeService; |
| | | @Autowired |
| | | private IAppUserService appUserService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header") |
| | | }) |
| | | public ResultUtil<EncyclopedicKnowledgeInfoRes> getEncyclopedicKnowledgeInfo(Integer id){ |
| | | |
| | | EncyclopedicKnowledgeInfoRes encyclopedicKnowledgeInfo = encyclopedicKnowledgeService.getEncyclopedicKnowledgeInfo(id); |
| | | return ResultUtil.success(encyclopedicKnowledgeInfo); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/encyclopedicKnowledge/upvoteEncyclopedicKnowledge") |
| | | @PostMapping("/base/encyclopedicKnowledge/upvoteEncyclopedicKnowledge") |
| | | @ApiOperation(value = "点赞/取消点赞", tags = {"知识百科"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "数据id", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil upvoteEncyclopedicKnowledge(Integer id){ |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if(null != appUser && (appUser.getStatus() == 2|| appUser.getStatus() == 3)){ |
| | | return ResultUtil.errorLogin("当前账号已被冻结或删除"); |
| | | } |
| | | return encyclopedicKnowledgeService.upvoteEncyclopedicKnowledge(id); |
| | | } |
| | | |