Commit e9904ab8 authored by m1991's avatar m1991

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
parents b1a843e2 9f3a3168
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.CultivatingPrizeInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
/**
* 培育奖详情记录
* @author zw
*/
public interface CultivatingPrizeInfoMapper extends BaseMapper<CultivatingPrizeInfo> {
CultivatingPrizeInfo getOneByUserId(String userId);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.CultivatingPrize;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.math.BigDecimal;
/**
* 培育奖金额对应表
* @author zw
*/
public interface CultivatingPrizeMapper extends BaseMapper<CultivatingPrize> {
/**
* 根据用户等级获取培育奖对应金额
* @return
*/
CultivatingPrize getcultivatingPrizeByUserLevel(int userLevel);
}
......@@ -62,6 +62,6 @@ public interface TradeRecordMapper extends BaseMapper<TradeRecord> {
* @param yearMonth 年月
* @return 交易列表
*/
List<WithdrawalRecordVo> getWithdrawalRecord(@Param("userId") String userId, Date yearMonth);
List<WithdrawalRecordVo> getWithdrawalRecord(@Param("userId") String userId, @Param("yearMonth") Date yearMonth);
}
......@@ -24,7 +24,7 @@
</sql>
<sql id="cols_exclude_id">
user_id,user_level,year_month,extract_money,earnings_month,frozen_money,earnings_total,create_time,update_time
user_id,user_level,`year_month`,extract_money,earnings_month,frozen_money,earnings_total,create_time,update_time
</sql>
<sql id="vals">
......@@ -35,7 +35,7 @@
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="yearMonth != null">year_month =#{yearMonth},</if>
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
<if test="extractMoney != null">extract_money =#{extractMoney},</if>
<if test="earningsMonth != null">earnings_month =#{earningsMonth},</if>
<if test="frozenMoney != null">frozen_money =#{frozenMoney},</if>
......@@ -47,7 +47,7 @@
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="yearMonth != null">and year_month =#{yearMonth}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="extractMoney != null">and extract_money =#{extractMoney}</if>
<if test="earningsMonth != null">and earnings_month =#{earningsMonth}</if>
<if test="frozenMoney != null">and frozen_money =#{frozenMoney}</if>
......@@ -99,7 +99,7 @@
<include refid="table"/>
<where>
user_id=#{userId}
and year_month=#{yearMonth}
and `year_month`=#{yearMonth}
</where>
</select>
......
<?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="cn.wisenergy.mapper.CultivatingPrizeInfoMapper">
<resultMap id="bankMap" type="cn.wisenergy.model.app.CultivatingPrizeInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="seedling" property="seedling"/>
<result column="bronze_tree" property="bronzeTree"/>
<result column="silver_tree" property="silverTree"/>
<result column="gold_tree" property="goldTree"/>
<result column="farmer" property="farmer"/>
<result column="forest_start" property="forestStart"/>
<result column="partner" property="partner"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
cultivating_prize_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,seedling,bronze_tree,silver_tree,gold_tree,farmer,forest_start,partner,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{seedling},#{bronzeTree},#{silverTree},#{goldTree},#{farmer},#{forestStart},#{partner},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="seedling != null">seedling = #{seedling},</if>
<if test="bronzeTree != null">bronze_tree = #{bronzeTree},</if>
<if test="silverTree != null">silver_tree = #{silverTree},</if>
<if test="goldTree != null">gold_tree = #{goldTree},</if>
<if test="farmer != null">farmer = #{farmer},</if>
<if test="forestStart != null">forest_start = #{forestStart},</if>
<if test="partner != null">partner = #{partner},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="seedling != null">and seedling = #{seedling}</if>
<if test="bronzeTree != null">and bronze_tree = #{bronzeTree}</if>
<if test="silverTree != null">and silver_tree = #{silverTree}</if>
<if test="goldTree != null">and gold_tree = #{goldTree}</if>
<if test="farmer != null">and farmer = #{farmer}</if>
<if test="forestStart != null">and forest_start = #{forestStart}</if>
<if test="partner != null">and partner = #{partner}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="getOneByUserId" resultType="cn.wisenergy.model.app.CultivatingPrizeInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id = #{userId}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.CultivatingPrizeMapper">
<resultMap id="bankMap" type="cn.wisenergy.model.app.CultivatingPrize">
<id column="id" property="id"/>
<result column="user_level" property="userLevel"/>
<result column="cultivating_prize" property="cultivatingPrize"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
cultivating_prize
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_level,cultivating_prize,create_time,update_time
</sql>
<sql id="vals">
#{userLevel},#{cultivatingPrize},now(),now()
</sql>
<sql id="updateCondition">
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="cultivatingPrize != null">cultivating_prize = #{cultivatingPrize},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="cultivatingPrize != null">and cultivating_prize = #{cultivatingPrize}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="getcultivatingPrizeByUserLevel" resultType="cn.wisenergy.model.app.CultivatingPrize">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_level = #{userLevel}
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -15,7 +15,7 @@
</resultMap>
<sql id="table">
last_month_account_info
last_month_account
</sql>
<sql id="cols_all">
......@@ -24,7 +24,7 @@
</sql>
<sql id="cols_exclude_id">
user_id,user_level,year_month,extract_money,earnings_month,frozen_money,earnings_total,create_time,update_time
user_id,user_level,`year_month`,extract_money,earnings_month,frozen_money,earnings_total,create_time,update_time
</sql>
<sql id="vals">
......@@ -35,7 +35,7 @@
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="yearMonth != null">year_month =#{yearMonth},</if>
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
<if test="extractMoney != null">extract_money =#{extractMoney},</if>
<if test="earningsMonth != null">earnings_month =#{earningsMonth},</if>
<if test="frozenMoney != null">frozen_money =#{frozenMoney},</if>
......@@ -47,7 +47,7 @@
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="yearMonth != null">and year_month =#{yearMonth}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="extractMoney != null">and extract_money =#{extractMoney}</if>
<if test="earningsMonth != null">and earnings_month =#{earningsMonth}</if>
<if test="frozenMoney != null">and frozen_money =#{frozenMoney}</if>
......@@ -64,7 +64,7 @@
<include refid="table"/>
<where>
user_id=#{userId}
and year_month=#{yearMonth}
and `year_month`=#{yearMonth}
</where>
</select>
......
......@@ -101,8 +101,8 @@
</if>
<if test="yearMonth != null">
AND(
YEAR(year_month) = YEAR(#{yearMonth})
AND MONTH(year_month) = MONTH(#{yearMonth}))
YEAR(create_time) = YEAR(#{yearMonth})
AND MONTH(create_time) = MONTH(#{yearMonth}))
</if>
</where>
</select>
......@@ -115,6 +115,7 @@
WHERE date_format(create_time,'%Y-%m') &lt; date_format(now(),'%Y-%m')
and date_format(create_time,'%Y-%m') >= date_format(now() - interval 7 month,'%Y-%m')
and (status=1 or status=3)
and user_id=#{userId}
group by user_id ,create_time desc;
</select>
......
package cn.wisenergy.model.app;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author zw
* @ Description: 培育奖实体类
* @ Author : zw
* @ Date : 2021/3/5 14:12
*/
@Data
@ApiModel(value = "CultivatingPrize")
public class CultivatingPrize implements Serializable {
private static final long serialVersionUID = 1506184523154720202L;
/**
* 主键id
*/
@ApiModelProperty(name = "id", value = "主键id")
private int id;
/**
* 用户等级
*/
@ApiModelProperty(name = "cultivatingPrize", value = "用户等级")
private int userLevel;
/**
* 培育奖金额
*/
@ApiModelProperty(name = "cultivatingPrize", value = "培育奖金额")
private BigDecimal cultivatingPrize;
/**
* 创建时间
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@ApiModelProperty(name = "updateTime", value = "修改时间")
private Date updateTime;
}
package cn.wisenergy.model.app;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author zw
* @ Description: 培育奖记录
* @ Author : zw
* @ Date : 2021/3/5 14:12
*/
@Data
@ApiModel(value = "CultivatingPrizeInfo")
public class CultivatingPrizeInfo implements Serializable {
private static final long serialVersionUID = 8336018752382673469L;
/**
* 主键id
*/
@ApiModelProperty(name = "id", value = "主键id")
private int id;
/**
* 用户id
*/
@ApiModelProperty(name = "userId", value = "用户id")
private String userId;
/**
* 幼苗状态培育奖记录 0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "seedling", value = "幼苗等级培育奖记录")
private int seedling;
/**
* 青铜树等级培育奖记录0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "bronze_tree", value = "青铜树等级培育奖记录")
private int bronzeTree;
/**
* 白银树等级培育奖记录0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "silver_tree", value = "白银树等级培育奖记录")
private int silverTree;
/**
* 黄金树等级培育奖记录0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "gold_tree", value = "黄金树等级培育奖记录")
private int goldTree;
/**
* 农场主等级培育奖记录0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "forest_start", value = "农场主等级培育奖记录")
private int farmer;
/**
* 森林之星等级培育奖记录0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "forest_start", value = "森林之星等级培育奖记录")
private int forestStart;
/**
* 西田森合伙人等级培育奖记录0:表示上级用户没有获得过当前等级的培育奖
* 1: 表示上级用户已经获得过当前等级的培育奖
*/
@ApiModelProperty(name = "partner", value = "西田森合伙人等级培育奖记录")
private int partner;
/**
* 创建时间
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@ApiModelProperty(name = "updateTime", value = "修改时间")
private Date updateTime;
}
package cn.wisenergy.model.app;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -17,6 +18,7 @@ import java.util.Date;
@Data
@ApiModel(value = "RecommendUser")
@TableName("recommend_user")
public class RecommendUser implements Serializable {
private static final long serialVersionUID = 7885137366850583004L;
......
package cn.wisenergy.model.app;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -17,6 +18,7 @@ import java.util.Date;
*/
@Data
@ApiModel(value = "User")
@TableName("user_info")
public class User extends Model<User> implements Serializable{
private static final long serialVersionUID = 2525339404301884673L;
......
package cn.wisenergy.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
......@@ -12,16 +13,19 @@ public class UserAndRecommendVo {
/**
* 用户id
*/
@ApiModelProperty(value = "用户id", name = "userId")
private String userId;
/**
* 当月消费金额
*/
@ApiModelProperty(value = "用户本月新增业绩", name = "monthyCount")
private BigDecimal monthyCount;
/**
* 累计消费金额
*/
@ApiModelProperty(value = "用户累计业绩", name = "historyCount")
private BigDecimal historyCount;
}
......@@ -105,7 +105,7 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
}
//1、获取用户信息
User user = usersMapper.selectById(userId);
User user = usersMapper.getByUserId(userId);
if (null == user) {
return R.error("用户信息不存在!");
}
......
......@@ -12,9 +12,7 @@ import cn.wisenergy.model.vo.AerialDeliveryVo;
import cn.wisenergy.model.vo.UserPoolVo;
import cn.wisenergy.service.app.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.xml.internal.bind.v2.TODO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -79,7 +77,6 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
@Override
public Map userByZx(String userId, String beInvitedCode) {
//查询数据库,看看是否存在该用户
// Integer yh=usersMapper.getuserIdById(userId);
User byUserId = usersMapper.getByUserId(userId);
......@@ -114,6 +111,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
map.put("msg:","注册失败!邀请码无效,请重新填写!");
return map;
}
if (null == beInvitedCode || "" == beInvitedCode) {
beInvitedCode = String.valueOf(1);
}
}
//根据插入的用户手机号,查询用户唯一ID
......@@ -229,7 +230,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
//私有构造方法-传入被邀请码
private R teamgg(String beInvitedCode) {
//用户的被邀请码,查询到推荐人用户,根据推荐人用户的邀请码查询/修改
User user=usersMapper.getByBeInvitedCode(beInvitedCode);
User user = usersMapper.getByBeInvitedCode(beInvitedCode);
//根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID=userid
String userid = String.valueOf(usersMapper.inviteCodeBeInvitedCode(Integer.valueOf(beInvitedCode)));
//根据用户推荐人的userid,查询数据库,看推荐人用户是否存在
......@@ -244,9 +245,9 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
} else {
return R.error(0, "验证码无效");
}
beInvitedCode=user.getBeInvitedCode();
beInvitedCode = user.getBeInvitedCode();
//递归向上修改团队用户信息表
teamgg(beInvitedCode);
return R.ok("团队表普通用户数量+1成功!",0);
return R.ok("团队表普通用户数量+1成功!", 0);
}
}
......@@ -9,7 +9,9 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......
......@@ -2,10 +2,10 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.enums.ResultEnum;
import cn.wisenergy.common.utils.*;
import cn.wisenergy.web.sms.*;
import cn.wisenergy.model.app.User;
import cn.wisenergy.model.app.UsersDto;
import cn.wisenergy.service.app.UserService;
import cn.wisenergy.web.sms.BaseException;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......
......@@ -2,13 +2,12 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.enums.ResultEnum;
import cn.wisenergy.common.utils.*;
import cn.wisenergy.web.sms.*;
import cn.wisenergy.web.sms.BaseException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......
......@@ -4,6 +4,11 @@ import cn.wisenergy.common.utils.Result;
import cn.wisenergy.model.app.Page;
import cn.wisenergy.model.app.shopZx;
import cn.wisenergy.service.app.UploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -11,12 +16,8 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.*;
import java.util.List;
import java.util.Map;
/**
......@@ -96,11 +97,11 @@ public class UploadController {
@ApiOperation(value = "资讯信息-文字/多图片上传接口", notes = "上传图片,返回路径给前台", httpMethod = "POST", produces = "application/json; charset=UTF-8")
@ApiImplicitParams({
@ApiImplicitParam(name = "zxField", value = "资讯文字", dataType = "String"),
@ApiImplicitParam(name = "file[]", value = "多图片", dataType = "MultipartFile"),
@ApiImplicitParam(name = "files", value = "多图片", paramType = "form", allowMultiple=true, dataType = "__file"),
@ApiImplicitParam(name = "zxAddress", value = "发表地址", dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户手机号", required = true, dataType = "String")})
@RequestMapping("/multipleImageUpload")
public List multipleImageUpload(MultipartFile[] files, String userId, String zxField, String zxAddress) {
@RequestMapping(method = RequestMethod.POST, value = "/multipleImageUpload", headers = "content-type=multipart/form-data")
public List multipleImageUpload(@RequestParam(value = "files") MultipartFile[] files, String userId, String zxField, String zxAddress) {
return uploadService.imageUpload(files, userId, zxField, zxAddress);
}
......
......@@ -3,17 +3,11 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.constant.RedisConsts;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.common.utils.RedisUtils;
import cn.wisenergy.common.utils.StringUtil;
import cn.wisenergy.mapper.RecommendUserMapper;
import cn.wisenergy.mapper.TeamUserInfoMapper;
import cn.wisenergy.model.app.RecommendUser;
import cn.wisenergy.model.app.TeamUserInfo;
import cn.wisenergy.model.app.User;
import cn.wisenergy.model.app.UsersDto;
import cn.wisenergy.model.dto.WithdrawBankDto;
import cn.wisenergy.model.vo.AerialDeliveryVo;
import cn.wisenergy.model.vo.UserAndRecommendVo;
import cn.wisenergy.model.vo.WithdrawalRecordVo;
import cn.wisenergy.service.app.RecommendUserService;
import cn.wisenergy.service.app.TeamUserInfoService;
import cn.wisenergy.service.app.UserForestStatusService;
......@@ -21,9 +15,6 @@ import cn.wisenergy.service.app.UserService;
import cn.wisenergy.web.common.BaseController;
import cn.wisenergy.web.config.JwtConfig;
import cn.wisenergy.web.shiro.JwtUtil;
import cn.wisenergy.web.sms.*;
import com.alibaba.druid.sql.ast.statement.SQLIfStatement;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -34,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import java.time.Month;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -144,11 +134,8 @@ public class UserController extends BaseController {
@ApiOperation(value = "查询空投池信息", notes = "查询空投池信息", httpMethod = "GET")
@GetMapping("/queryAerialDelivery")
public R<AerialDeliveryVo> queryAerialDelivery(String userId, String yearMonth) {
log.info("shop-mall[]UserController[]getWithdrawalRecord[]input.param.userId:{},yearMonth:" + userId, yearMonth);
if (StringUtils.isBlank(yearMonth)) {
return R.error("入参不能为空!");
}
public R<AerialDeliveryVo> queryAerialDelivery() {
log.info("shop-mall[]UserController[]queryAerialDelivery[]input.method" );
return userService.queryAerialDelivery();
}
......
package cn.wisenergy.web.config;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.util.Arrays;
@Configuration
public class GlobalCorsConfig {
@Value("${cors.url.list:#{null}}")
private String corsUrlList;
@Bean
public CorsFilter corsFilter() {
//1.添加CORS配置信息
CorsConfiguration config = new CorsConfiguration();
//1) 允许通过的域,不要写*,否则cookie就无法使用了
if (corsUrlList != null && corsUrlList.length() > 1) {
config.setAllowedOrigins(Arrays.asList(StringUtils.split(corsUrlList, ",")));
} else {
config.addAllowedOrigin("*");
}
//2) 是否发送Cookie信息
config.setAllowCredentials(true);
//3) 允许的请求方式
config.addAllowedMethod("OPTIONS");
config.addAllowedMethod("GET");
config.addAllowedMethod("POST");
config.addAllowedMethod("PUT");
config.addAllowedMethod("DELETE");
// 4)允许的头信息
config.addAllowedHeader("*");
//2.添加映射路径,我们拦截一切请求
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
//3.返回新的CorsFilter.
return new CorsFilter(configSource);
}
}
......@@ -5,6 +5,8 @@ server:
max: 1000
min-spare: 30
port: 8997
servlet:
context-path: /shop-mall
spring:
main:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment