package com.xinquan.system.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.xinquan.common.core.domain.R;
|
import com.xinquan.system.domain.ContentSetting;
|
import com.xinquan.system.domain.HotWords;
|
import com.xinquan.system.domain.VipSetting;
|
import com.xinquan.system.service.VipSettingService;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.omg.CORBA.PRIVATE_MEMBER;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
/**
|
* <p>
|
* 会员设置表 前端控制器
|
* </p>
|
*
|
* @author mitao
|
* @since 2024-08-21
|
*/
|
@RestController
|
@RequestMapping("/system/vip-setting")
|
public class VipSettingController {
|
@Resource
|
private VipSettingService vipSettingService;
|
|
@PostMapping("/queryVip")
|
@ApiOperation(value = "获取会员价格设置", tags = {"管理后台-会员设置"})
|
public R<VipSetting> queryVip() {
|
VipSetting one = vipSettingService.lambdaQuery()
|
.eq(VipSetting::getSettingType, 1).one();
|
return R.ok(one);
|
}
|
@PostMapping("/saveVip")
|
@ApiOperation(value = "保存会员价格设置", tags = {"管理后台-会员设置"})
|
public R<VipSetting> saveVip(@RequestBody VipSetting vipSetting) {
|
vipSettingService.updateById(vipSetting);
|
return R.ok();
|
}
|
@PostMapping("/updateVipContent")
|
@ApiOperation(value = "修改会员权益介绍/获取会员用户协议/获取续费管理说明",tags = "管理后台-会员设置")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "内容类型 1=会员权益介绍 2=会员用户协议 3=续费管理说明", name = "type", required = true, dataType = "int"),
|
@ApiImplicitParam(value = "富文本内容", name = "content", required = true, dataType = "String"),
|
})
|
public R updateVipContent(Integer type,String content) {
|
VipSetting one = vipSettingService.lambdaQuery()
|
.eq(VipSetting::getSettingType, type+1).one();
|
one.setContent(content);
|
vipSettingService.updateById(one);
|
return R.ok();
|
}
|
@PostMapping("/getVipPrice")
|
@ApiOperation(value = "安卓-获取月度 季度 年度会员价格",tags = "APP-会员")
|
public R<VipSetting> getVipPrice() {
|
VipSetting one = vipSettingService.lambdaQuery().eq(VipSetting::getClientType, 1)
|
.eq(VipSetting::getSettingType, 1).one();
|
return R.ok(one);
|
}
|
@PostMapping("/getVipPriceApple")
|
@ApiOperation(value = "苹果-获取月度 季度 年度会员价格",tags = "APP-会员")
|
public R<VipSetting> getVipPriceApple() {
|
VipSetting one = vipSettingService.lambdaQuery().eq(VipSetting::getClientType, 2)
|
.eq(VipSetting::getSettingType, 1).one();
|
return R.ok(one);
|
}
|
@PostMapping("/getVipContent")
|
@ApiOperation(value = "获取会员权益介绍/获取会员用户协议/获取续费管理说明",tags = "APP/管理后台通用-会员")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "内容类型 1=会员权益介绍 2=会员用户协议 3=续费管理说明", name = "type", required = true, dataType = "int"),
|
})
|
public R<String> getVipPriceApple(Integer type) {
|
VipSetting one = vipSettingService.lambdaQuery()
|
.eq(VipSetting::getSettingType, type+1).one();
|
return R.ok(one.getContent());
|
}
|
|
}
|