commit
1c6c009f14
@ -0,0 +1,18 @@
|
|||||||
|
package cn.lili.sucurity;
|
||||||
|
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/2/18
|
||||||
|
**/
|
||||||
|
@Component
|
||||||
|
public class ConsumerSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
|
http.formLogin().disable();
|
||||||
|
}
|
||||||
|
}
|
@ -62,14 +62,16 @@ public class PromotionEverydayExecute implements EveryDayExecute {
|
|||||||
/**
|
/**
|
||||||
* 添加秒杀活动
|
* 添加秒杀活动
|
||||||
* 从系统设置中获取秒杀活动的配置
|
* 从系统设置中获取秒杀活动的配置
|
||||||
* 添加30天后的秒杀活动
|
* 添加明天后的秒杀活动
|
||||||
*/
|
*/
|
||||||
private void addSeckill() {
|
private void addSeckill() {
|
||||||
Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name());
|
||||||
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
||||||
|
log.info("生成秒杀活动设置:{}", seckillSetting);
|
||||||
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
||||||
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
||||||
seckillService.savePromotions(seckill);
|
boolean result = seckillService.savePromotions(seckill);
|
||||||
|
log.info("生成秒杀活动参数:{},结果:{}", seckill, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package cn.lili.modules.promotion.entity.dos;
|
package cn.lili.modules.promotion.entity.dos;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateField;
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.lili.modules.promotion.entity.vos.SeckillVO;
|
import cn.lili.modules.promotion.entity.vos.SeckillVO;
|
||||||
@ -59,8 +58,8 @@ public class Seckill extends BasePromotions {
|
|||||||
|
|
||||||
public Seckill(int day, String hours, String seckillRule) {
|
public Seckill(int day, String hours, String seckillRule) {
|
||||||
//默认创建*天后的秒杀活动
|
//默认创建*天后的秒杀活动
|
||||||
DateTime dateTime = DateUtil.beginOfDay(DateUtil.offset(new DateTime(), DateField.DAY_OF_YEAR, day));
|
DateTime dateTime = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), day));
|
||||||
this.applyEndTime = dateTime;
|
this.applyEndTime = DateUtil.offsetHour(new Date(), Integer.parseInt(hours) - 1);
|
||||||
this.hours = hours;
|
this.hours = hours;
|
||||||
this.seckillRule = seckillRule;
|
this.seckillRule = seckillRule;
|
||||||
this.goodsNum = 0;
|
this.goodsNum = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user