init
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
package com.ruoyi.cai.controller.admin;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.ruoyi.cai.domain.AgreementSetting;
|
||||||
|
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 lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cai/agreementSetting")
|
||||||
|
public class AgreementSettingController extends BaseController {
|
||||||
|
|
||||||
|
private final AgreementSettingService agreementSettingService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取协议设置详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:agreementSetting:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<AgreementSetting> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(agreementSettingService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改协议设置
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:agreementSetting:edit")
|
||||||
|
@Log(title = "协议设置", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgreementSetting bo) {
|
||||||
|
return toAjax(agreementSettingService.updateById(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置对象 cai_agreement_setting
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("cai_agreement_setting")
|
||||||
|
public class AgreementSetting extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 用户协议
|
||||||
|
*/
|
||||||
|
private String userAgreement;
|
||||||
|
/**
|
||||||
|
* 主播入驻协议
|
||||||
|
*/
|
||||||
|
private String anchorJoinAgreement;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.cai.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置业务对象 cai_agreement_setting
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class AgreementSettingBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "ID不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "用户协议不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String userAgreement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播入驻协议
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "主播入驻协议不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String anchorJoinAgreement;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.cai.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置视图对象 cai_agreement_setting
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AgreementSettingVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户协议")
|
||||||
|
private String userAgreement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播入驻协议
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主播入驻协议")
|
||||||
|
private String anchorJoinAgreement;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.cai.domain.AgreementSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置Mapper接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
public interface AgreementSettingMapper extends BaseMapper<AgreementSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.cai.domain.AgreementSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置Service接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
public interface AgreementSettingService extends IService<AgreementSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.cai.domain.AgreementSetting;
|
||||||
|
import com.ruoyi.cai.mapper.AgreementSettingMapper;
|
||||||
|
import com.ruoyi.cai.service.AgreementSettingService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议设置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2024-01-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AgreementSettingServiceImpl extends ServiceImpl<AgreementSettingMapper,AgreementSetting> implements AgreementSettingService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.cai.mapper.AgreementSettingMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.cai.domain.AgreementSetting" id="AgreementSettingResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="userAgreement" column="user_agreement"/>
|
||||||
|
<result property="anchorJoinAgreement" column="anchor_join_agreement"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user