64 lines
2.2 KiB
Java
64 lines
2.2 KiB
Java
|
|
package com.ai.da.controller;
|
||
|
|
|
||
|
|
|
||
|
|
import com.ai.da.common.response.Response;
|
||
|
|
import com.ai.da.mapper.primary.entity.Affiliate;
|
||
|
|
import com.ai.da.model.dto.AffiliateQueryDTO;
|
||
|
|
import com.ai.da.model.vo.AffiliateVO;
|
||
|
|
import com.ai.da.service.AffiliateService;
|
||
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||
|
|
import io.swagger.annotations.ApiOperation;
|
||
|
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import javax.annotation.Resource;
|
||
|
|
import javax.validation.Valid;
|
||
|
|
|
||
|
|
@Slf4j
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/api/affiliate")
|
||
|
|
public class AffiliateController {
|
||
|
|
|
||
|
|
@Resource
|
||
|
|
private AffiliateService affiliateService;
|
||
|
|
|
||
|
|
@ApiOperation(value = "注册成为affiliate")
|
||
|
|
@GetMapping("/registration")
|
||
|
|
public Response<Boolean> completeGuidance(@RequestParam("promotionMethod") String promotionMethod) {
|
||
|
|
return Response.success(affiliateService.registerAsAnAffiliate(promotionMethod));
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "获取affiliate列表")
|
||
|
|
@PostMapping("/list")
|
||
|
|
public Response<IPage<Affiliate>> getAffiliateList(@Valid @RequestBody AffiliateQueryDTO affiliateQueryDTO) {
|
||
|
|
return Response.success(affiliateService.getAffiliateList(affiliateQueryDTO));
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "获取affiliate个人中心")
|
||
|
|
@GetMapping("/personalCenter")
|
||
|
|
public Response<AffiliateVO> personalAffiliateCenter() {
|
||
|
|
return Response.success(affiliateService.personalAffiliateCenter());
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "审批affiliate申请")
|
||
|
|
@GetMapping("/approval")
|
||
|
|
public Response<Boolean> applicationApproval(@RequestParam("id") Long id, @RequestParam("isApproved")Boolean isApproved) {
|
||
|
|
return Response.success(affiliateService.applicationApproval(id, isApproved));
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "审批affiliate申请")
|
||
|
|
@GetMapping("/testTask")
|
||
|
|
public Response<String> testTask() {
|
||
|
|
affiliateService.updateAffiliateInfoWithPayment();
|
||
|
|
return Response.success("success ");
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "affiliate链接浏览量增加")
|
||
|
|
@GetMapping("/viewsIncrease")
|
||
|
|
public Response<Boolean> viewsGet(@RequestParam("id") Long id) {
|
||
|
|
return Response.success(affiliateService.affiliateLinkViewsIncrease(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|