init
This commit is contained in:
@@ -32,14 +32,11 @@ public class AgreementSettingController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取协议设置详细信息
|
* 获取协议设置详细信息
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cai:agreementSetting:query")
|
@SaCheckPermission("cai:agreementSetting:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/info")
|
||||||
public R<AgreementSetting> getInfo(@NotNull(message = "主键不能为空")
|
public R<AgreementSetting> getInfo() {
|
||||||
@PathVariable Long id) {
|
return R.ok(agreementSettingService.getAgreementSetting());
|
||||||
return R.ok(agreementSettingService.getById(id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
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 = "获取用户协议")
|
||||||
|
public R<AgreementDTO> userAgreement() {
|
||||||
|
String userAgreement = agreementSettingService.getAgreementSetting().getUserAgreement();
|
||||||
|
return R.ok(new AgreementDTO(userAgreement));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/anchorJoinAgreement")
|
||||||
|
@Operation(summary = "用户主播入驻协议")
|
||||||
|
public R<AgreementDTO> anchorJoinAgreement() {
|
||||||
|
String anchorJoinAgreement = agreementSettingService.getAgreementSetting().getAnchorJoinAgreement();
|
||||||
|
return R.ok(new AgreementDTO(anchorJoinAgreement));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,13 +1,10 @@
|
|||||||
package com.ruoyi.cai.domain;
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 协议设置对象 cai_agreement_setting
|
* 协议设置对象 cai_agreement_setting
|
||||||
@@ -16,9 +13,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||||||
* @date 2024-01-14
|
* @date 2024-01-14
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("cai_agreement_setting")
|
@TableName("cai_agreement_setting")
|
||||||
public class AgreementSetting extends BaseEntity {
|
public class AgreementSetting implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.cai.dto.app.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AgreementDTO {
|
||||||
|
private String agreement;
|
||||||
|
|
||||||
|
public AgreementDTO() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public AgreementDTO(String agreement) {
|
||||||
|
this.agreement = agreement;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,4 +11,7 @@ import com.ruoyi.cai.domain.AgreementSetting;
|
|||||||
*/
|
*/
|
||||||
public interface AgreementSettingService extends IService<AgreementSetting> {
|
public interface AgreementSettingService extends IService<AgreementSetting> {
|
||||||
|
|
||||||
|
AgreementSetting getAgreementSetting();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,8 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class AgreementSettingServiceImpl extends ServiceImpl<AgreementSettingMapper,AgreementSetting> implements AgreementSettingService {
|
public class AgreementSettingServiceImpl extends ServiceImpl<AgreementSettingMapper,AgreementSetting> implements AgreementSettingService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AgreementSetting getAgreementSetting() {
|
||||||
|
return this.getById(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user