CsdnController.java 1.1 KB
Newer Older
1 2 3 4 5 6
package com.kwan.springbootkwan.controller;

import com.kwan.springbootkwan.entity.Result;
import com.kwan.springbootkwan.service.CsdnService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
7
import org.apache.ibatis.annotations.Param;
8 9 10 11 12 13 14 15 16 17 18
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
19
    private CsdnService csdnService;
20

21 22 23 24 25 26 27 28 29 30 31
    @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("三连完成");
32 33
    }
}