123
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.cai.controller.app;
|
||||
|
||||
|
||||
import com.ruoyi.cai.domain.Adolescent;
|
||||
import com.ruoyi.cai.dto.app.query.user.AdolescentSetting;
|
||||
import com.ruoyi.cai.dto.app.query.user.AdolescentSwitch;
|
||||
import com.ruoyi.cai.dto.app.vo.user.AdolescentVo;
|
||||
import com.ruoyi.cai.service.AdolescentService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/adolescent")
|
||||
@Tag(name = "青少年模式接口")
|
||||
public class AdolescentAppController {
|
||||
|
||||
@Autowired
|
||||
private AdolescentService adolescentService;
|
||||
|
||||
@PostMapping("/set")
|
||||
@Operation(summary = "设置青少年模式")
|
||||
@Log(title = "设置青少年模式", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<Void> set(@RequestBody AdolescentSetting setting){
|
||||
adolescentService.setAdolescent(setting);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取用户青少年模式状态")
|
||||
@Log(title = "获取用户青少年模式状态", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<AdolescentVo> get(){
|
||||
Long userId = LoginHelper.getUserId();
|
||||
Adolescent adolescent = adolescentService.getByUserId(userId);
|
||||
AdolescentVo vo = new AdolescentVo();
|
||||
if(adolescent != null){
|
||||
vo.setIsSetAdolescent(1);
|
||||
vo.setIsSetPwd(1);
|
||||
vo.setIsOpen(adolescent.getOpen());
|
||||
}
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/switch")
|
||||
@Operation(summary = "青少年模式开关")
|
||||
@Log(title = "青少年模式开关", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<Void> switchAdolescent(@RequestBody AdolescentSwitch adolescentSwitch){
|
||||
adolescentService.switchAdolescent(adolescentSwitch);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.ruoyi.cai.controller.app;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.cai.domain.AgreementSetting;
|
||||
import com.ruoyi.cai.dto.app.vo.AgreementDTO;
|
||||
import com.ruoyi.cai.service.AgreementSettingService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 协议设置
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-01-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/app/agreementSetting")
|
||||
@Tag(name = "协议相关接口")
|
||||
public class AgreementSettingAppController extends BaseController {
|
||||
|
||||
private final AgreementSettingService agreementSettingService;
|
||||
|
||||
|
||||
@GetMapping("/userAgreement")
|
||||
@Operation(summary = "获取用户协议")
|
||||
@Log(title = "获取用户协议", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<AgreementDTO> userAgreement() {
|
||||
String userAgreement = agreementSettingService.getAgreementSetting().getUserAgreement();
|
||||
return R.ok(new AgreementDTO(userAgreement));
|
||||
}
|
||||
|
||||
@GetMapping("/anchorJoinAgreement")
|
||||
@Operation(summary = "用户主播入驻协议")
|
||||
@Log(title = "用户主播入驻协议", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<AgreementDTO> anchorJoinAgreement() {
|
||||
String anchorJoinAgreement = agreementSettingService.getAgreementSetting().getAnchorJoinAgreement();
|
||||
return R.ok(new AgreementDTO(anchorJoinAgreement));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.ruoyi.cai.controller.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.cai.domain.*;
|
||||
import com.ruoyi.cai.domain.Gift;
|
||||
import com.ruoyi.cai.domain.Goods;
|
||||
import com.ruoyi.cai.domain.ReportCate;
|
||||
import com.ruoyi.cai.domain.WithdrawExchange;
|
||||
import com.ruoyi.cai.dto.app.vo.AgreementDTO;
|
||||
import com.ruoyi.cai.dto.app.vo.GiftVo;
|
||||
import com.ruoyi.cai.service.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
@@ -16,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/setting")
|
||||
@@ -31,6 +34,8 @@ public class SettingAppController {
|
||||
private ReportCateService reportCateService;
|
||||
@Autowired
|
||||
private GiftService giftService;
|
||||
@Autowired
|
||||
private AgreementSettingService agreementSettingService;
|
||||
|
||||
@GetMapping("/goods")
|
||||
@Operation(summary = "充值配置")
|
||||
@@ -68,4 +73,20 @@ public class SettingAppController {
|
||||
return R.ok(BeanConvertUtil.convertListTo(res, GiftVo::new));
|
||||
}
|
||||
|
||||
@GetMapping("/agreement/user")
|
||||
@Operation(summary = "获取用户协议")
|
||||
@Log(title = "获取用户协议", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<AgreementDTO> userAgreement() {
|
||||
String userAgreement = agreementSettingService.getAgreementSetting().getUserAgreement();
|
||||
return R.ok(new AgreementDTO(userAgreement));
|
||||
}
|
||||
|
||||
@GetMapping("/agreement/user")
|
||||
@Operation(summary = "用户主播入驻协议")
|
||||
@Log(title = "用户主播入驻协议", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<AgreementDTO> anchorJoinAgreement() {
|
||||
String anchorJoinAgreement = agreementSettingService.getAgreementSetting().getAnchorJoinAgreement();
|
||||
return R.ok(new AgreementDTO(anchorJoinAgreement));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user