init
This commit is contained in:
@@ -12,15 +12,16 @@ import com.ruoyi.cai.service.CaiUserGiftService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/anchor")
|
||||
@Tag(name = "主播相关接口")
|
||||
public class CaiAnchorAppController {
|
||||
|
||||
@Autowired
|
||||
@@ -31,19 +32,23 @@ public class CaiAnchorAppController {
|
||||
private CaiUserGiftService userGiftService;
|
||||
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo<AnchorListVo> page(PageQuery page, AnchorListQuery query){
|
||||
@Operation(summary = "查询主播-分页")
|
||||
public TableDataInfo<AnchorListVo> page(@Parameter(description = "name") PageQuery page,
|
||||
@Parameter(description = "name2") AnchorListQuery query){
|
||||
Page<AnchorListVo> res = anchorService.pageApp(page,query);
|
||||
return TableDataInfo.build(res);
|
||||
}
|
||||
|
||||
@PostMapping("/give/guard")
|
||||
public R<Boolean> giveGuard(GiveGuardRes query){
|
||||
@Operation(summary = "赠送主播守护")
|
||||
public R<Boolean> giveGuard(@RequestBody GiveGuardRes query){
|
||||
boolean res = guardTotalService.giveGuard(query);
|
||||
return R.ok(res);
|
||||
}
|
||||
|
||||
@PostMapping("/give/gift")
|
||||
public R<Boolean> giveGift(GiveGiftRes query){
|
||||
@Operation(summary = "赠送主播礼物")
|
||||
public R<Boolean> giveGift(@RequestBody GiveGiftRes query){
|
||||
boolean res = userGiftService.giveGift(query);
|
||||
return R.ok(res);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.ruoyi.cai.dto.app.query;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "主播查询条件")
|
||||
public class AnchorListQuery {
|
||||
|
||||
/**
|
||||
@@ -11,7 +13,9 @@ public class AnchorListQuery {
|
||||
* 2-新人查询
|
||||
* 3-同城查询
|
||||
*/
|
||||
@Schema(description = "类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "城市")
|
||||
private String city;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.ruoyi.cai.dto.app.query;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "赠送守护入参")
|
||||
public class GiveGuardRes {
|
||||
|
||||
@Schema(description = "接收方用户ID")
|
||||
private Long toUserId;
|
||||
|
||||
@Schema(description = "赠送数量")
|
||||
private Long guardNum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user