货币规则

This commit is contained in:
ronger 2020-12-10 16:24:11 +08:00
parent 618a07d435
commit 978e75735f
7 changed files with 132 additions and 1 deletions

View File

@ -71,7 +71,7 @@ public class WebMvcConfigurer extends WebMvcConfigurationSupport {
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(restAuthTokenInterceptor()).addPathPatterns("/api/**")
.excludePathPatterns("/api/v1/console/**", "/api/v1/article/articles/**", "/api/v1/article/detail/**"
, "/api/v1/topic/**", "/api/v1/user/**", "/api/v1/article/*/comments");
, "/api/v1/topic/**", "/api/v1/user/**", "/api/v1/article/*/comments", "/api/v1/rule/currency/**");
}

View File

@ -0,0 +1,57 @@
package com.rymcu.forest.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author ronger
*/
@Table(name="vertical_currency_rule")
@Data
public class CurrencyRule implements Serializable, Cloneable {
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
private Integer idCurrencyRule;
/**
* 规则名称
*/
private String ruleName;
/**
* 规则标志(与枚举变量对应)
*/
private String ruleSign;
/**
* 规则描述
*/
private String ruleDescription;
/**
* 金额
*/
private BigDecimal money;
/**
* 奖励(0)/消耗(1)状态
*/
private String awardStatus;
/**
* 上限金额
*/
private BigDecimal maximumMoney;
/**
* 重复(0: 不重复,单位:)
*/
private Integer repeatDays;
/**
* 状态
*/
private String status;
}

View File

@ -0,0 +1,10 @@
package com.rymcu.forest.mapper;
import com.rymcu.forest.core.mapper.Mapper;
import com.rymcu.forest.entity.CurrencyRule;
/**
* @author ronger
*/
public interface CurrencyRuleMapper extends Mapper<CurrencyRule> {
}

View File

@ -0,0 +1,10 @@
package com.rymcu.forest.service;
import com.rymcu.forest.core.service.Service;
import com.rymcu.forest.entity.CurrencyRule;
/**
* @author ronger
*/
public interface CurrencyRuleService extends Service<CurrencyRule> {
}

View File

@ -0,0 +1,20 @@
package com.rymcu.forest.service.impl;
import com.rymcu.forest.core.service.AbstractService;
import com.rymcu.forest.entity.CurrencyRule;
import com.rymcu.forest.mapper.CurrencyRuleMapper;
import com.rymcu.forest.service.CurrencyRuleService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author ronger
*/
@Service
public class CurrencyRuleServiceImpl extends AbstractService<CurrencyRule> implements CurrencyRuleService {
@Resource
private CurrencyRuleMapper currencyRuleMapper;
}

View File

@ -0,0 +1,30 @@
package com.rymcu.forest.web.api.rule;
import com.rymcu.forest.core.result.GlobalResult;
import com.rymcu.forest.core.result.GlobalResultGenerator;
import com.rymcu.forest.entity.CurrencyRule;
import com.rymcu.forest.service.CurrencyRuleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author ronger
*/
@RestController
@RequestMapping("/api/v1/rule/currency")
public class CurrencyRuleController {
@Resource
private CurrencyRuleService currencyRuleService;
@GetMapping("/list")
public GlobalResult list() {
List<CurrencyRule> list = currencyRuleService.findAll();
return GlobalResultGenerator.genSuccessResult(list);
}
}

View File

@ -0,0 +1,4 @@
<?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.rymcu.forest.mapper.CurrencyRuleMapper">
</mapper>