平台参数设置

master
382696293@qq.com 2 years ago
parent eed0982e7e
commit 8adf4c0582

@ -0,0 +1,27 @@
package com.flossom.miniProgram.Enums;
/**
* -key
*/
public enum SystemSettingKeyEnum {
USER_AGREEMENT("USER_AGREEMENT", "用户协议"),
PRIVACY_AGREEMENT("PRIVACY_AGREEMENT", "隐私协议"),
INTEGRAL_RULE("INTEGRAL_RULE", "积分规则"),
ABOUT_US("ABOUT_US", "关于我们");
private final String key;
private final String remark;
SystemSettingKeyEnum(String key, String remark) {
this.key = key;
this.remark = remark;
}
public String getKey() {
return key;
}
public String getRemark() {
return remark;
}
}

@ -0,0 +1,61 @@
package com.flossom.miniProgram.controller;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.miniProgram.service.ISystemSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
*/
@RestController
@RequestMapping("/system/setting")
public class SystemSettingController extends BaseController {
@Autowired
private ISystemSettingService systemSettingService;
/**
*
*
* @return
*/
@GetMapping("/getUserAgreement")
public AjaxResult getUserAgreement() {
return AjaxResult.success(systemSettingService.getUserAgreement());
}
/**
*
*
* @return
*/
@GetMapping("/getPrivacyAgreement")
public AjaxResult getPrivacyAgreement() {
return AjaxResult.success(systemSettingService.getPrivacyAgreement());
}
/**
*
*
* @return
*/
@GetMapping("/getIntegralRule")
public AjaxResult getIntegralRule() {
return AjaxResult.success(systemSettingService.getIntegralRule());
}
/**
*
*
* @return
*/
@GetMapping("/getAboutUs")
public AjaxResult getAboutUs() {
return AjaxResult.success(systemSettingService.getAboutUs());
}
}

@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
*/
@RestController
@RequestMapping("/welcome")
public class WelcomeController extends BaseController {

@ -0,0 +1,79 @@
package com.flossom.miniProgram.domain;
import com.flossom.common.core.web.domain.BaseEntity;
public class WxSystemSetting extends BaseEntity {
private String id;
/**
*
*/
private String key;
/**
*
*/
private String value;
/**
*
*/
private String instructions;
/**
* 0 1
*/
private String status;
public WxSystemSetting() {
}
public WxSystemSetting(String id, String key, String value, String instructions, String status) {
this.id = id;
this.key = key;
this.value = value;
this.instructions = instructions;
this.status = status;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getInstructions() {
return instructions;
}
public void setInstructions(String instructions) {
this.instructions = instructions;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

@ -0,0 +1,10 @@
package com.flossom.miniProgram.mapper;
import com.flossom.miniProgram.Enums.SystemSettingKeyEnum;
import com.flossom.miniProgram.domain.WxSystemSetting;
public interface SystemSettingMapper {
WxSystemSetting getSystemSettingByKey(String systemSetKey);
}

@ -0,0 +1,14 @@
package com.flossom.miniProgram.service;
import com.flossom.miniProgram.domain.WxSystemSetting;
public interface ISystemSettingService {
WxSystemSetting getUserAgreement();
WxSystemSetting getPrivacyAgreement();
WxSystemSetting getIntegralRule();
WxSystemSetting getAboutUs();
}

@ -0,0 +1,57 @@
package com.flossom.miniProgram.service.impl;
import com.flossom.miniProgram.Enums.SystemSettingKeyEnum;
import com.flossom.miniProgram.domain.WxSystemSetting;
import com.flossom.miniProgram.mapper.SystemSettingMapper;
import com.flossom.miniProgram.service.ISystemSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SystemSettingServiceImpl implements ISystemSettingService {
@Autowired
private SystemSettingMapper systemSettingMapper;
/**
*
*
* @return
*/
@Override
public WxSystemSetting getUserAgreement() {
return systemSettingMapper.getSystemSettingByKey(SystemSettingKeyEnum.USER_AGREEMENT.getKey());
}
/**
*
*
* @return
*/
@Override
public WxSystemSetting getPrivacyAgreement() {
return systemSettingMapper.getSystemSettingByKey(SystemSettingKeyEnum.PRIVACY_AGREEMENT.getKey());
}
/**
*
*
* @return
*/
@Override
public WxSystemSetting getIntegralRule() {
return systemSettingMapper.getSystemSettingByKey(SystemSettingKeyEnum.INTEGRAL_RULE.getKey());
}
/**
*
*
* @return
*/
@Override
public WxSystemSetting getAboutUs() {
return systemSettingMapper.getSystemSettingByKey(SystemSettingKeyEnum.ABOUT_US.getKey());
}
}

@ -0,0 +1,51 @@
<?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.flossom.miniProgram.mapper.SystemSettingMapper">
<resultMap type="WxSystemSetting" id="wxSystemSetting">
<id property="id" column="id"/>
<result property="key" column="key"/>
<result property="value" column="value"/>
<result property="instructions" column="instructions"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectWxSystemSettingVo">
select id,
`key`,
`value`,
instructions,
status,
create_by,
create_time,
update_by,
update_time,
remark
from wx_system_setting
</sql>
<!-- 查询条件 -->
<sql id="sqlwhereSearch">
<where>
<if test="key !=null">
and `key` = #{key}
</if>
</where>
</sql>
<select id="getSystemSettingByKey" parameterType="String" resultMap="wxSystemSetting">
<include refid="selectWxSystemSettingVo"/>
<include refid="sqlwhereSearch"/>
order by update_time desc
limit 1
</select>
</mapper>
Loading…
Cancel
Save