package com.kwan.springbootkwan.controller; import com.kwan.springbootkwan.entity.Result; import com.kwan.springbootkwan.service.CsdnLikeService; import com.kwan.springbootkwan.service.CsdnService; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @Slf4j @RestController @RequestMapping("/csdn") public class CsdnController { @Autowired private CsdnService csdnService; @Autowired private CsdnLikeService csdnLikeService; @ApiOperation(value = "单人点赞", notes = "单人点赞") @GetMapping("/singleLike") public Result singleLike(@Param("articleId") String articleId) { return Result.ok(csdnLikeService.like(articleId)); } @ApiOperation(value = "单人三连", notes = "单人三连") @GetMapping("/singleTriplet") public Result singleTriplet(@Param("username") String username) { return Result.ok(csdnService.singleArticle(username)); } @ApiOperation(value = "多人三连", notes = "多人三连") @GetMapping("/multiTriplet") public Result multiTriplet() { csdnService.multiTriplet(); return Result.ok("三连完成"); } }