站内信消息优化
This commit is contained in:
commit
41835aaece
@ -14,7 +14,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
* 买家API
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:03 下午
|
||||
* @since 2020/11/16 10:03 下午
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableJpaAuditing
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
* 买家端,商品分类接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/16 10:05 下午
|
||||
* @since: 2020/11/16 10:05 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,商品分类接口")
|
||||
|
@ -5,7 +5,6 @@ import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.distribution.service.DistributionService;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsVO;
|
||||
@ -38,7 +37,7 @@ import java.util.Map;
|
||||
* 买家端,商品接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:06 下午
|
||||
* @since 2020/11/16 10:06 下午
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "买家端,商品接口")
|
||||
@ -61,12 +60,6 @@ public class GoodsBuyerController {
|
||||
*/
|
||||
@Autowired
|
||||
private EsGoodsSearchService goodsSearchService;
|
||||
/**
|
||||
* 分销员
|
||||
*/
|
||||
@Autowired
|
||||
private DistributionService distributionService;
|
||||
|
||||
|
||||
@ApiOperation(value = "通过id获取商品信息")
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path", dataType = "Long")
|
||||
|
@ -27,7 +27,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,买家优惠券接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/11/17 3:35 下午
|
||||
* @since 2020/11/17 3:35 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,买家优惠券接口")
|
||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||
* 买家端,浏览历史接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/16 10:06 下午
|
||||
* @since: 2020/11/16 10:06 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,浏览历史接口")
|
||||
|
@ -20,7 +20,7 @@ import javax.validation.Valid;
|
||||
* 买家端,会员地址接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员地址接口")
|
||||
|
@ -18,7 +18,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,会员收藏接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/17 2:32 下午
|
||||
* @since: 2020/11/17 2:32 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员收藏接口")
|
||||
|
@ -24,7 +24,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,会员商品评价接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/16 10:08 下午
|
||||
* @since: 2020/11/16 10:08 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员商品评价接口")
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 买家端,会员站内消息接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员站内消息接口")
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 买家端,会员发票接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date: 2021-03-29 14:10:16
|
||||
* @since: 2021-03-29 14:10:16
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员发票接口")
|
||||
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||
* 会员签到控制器
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员签到API")
|
||||
|
@ -30,7 +30,7 @@ import javax.validation.constraints.Pattern;
|
||||
* 买家端,会员余额接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员余额接口")
|
||||
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,余额提现记录接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,余额提现记录接口")
|
||||
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,会员积分历史接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020-02-25 14:10:16
|
||||
* @since 2020-02-25 14:10:16
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员积分历史接口")
|
||||
|
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,预存款充值记录接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,预存款充值记录接口")
|
||||
|
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,会员站服务消息接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/17 2:31 下午
|
||||
* @since: 2020/11/17 2:31 下午
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/service/notice")
|
||||
|
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,APP版本
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/21 11:15 上午
|
||||
* @since: 2021/5/21 11:15 上午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,APP版本")
|
||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||
* 买家端,文章接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/16 10:02 下午
|
||||
* @since: 2020/11/16 10:02 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,文章接口")
|
||||
|
@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,意见反馈接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020-05-5 15:10:16
|
||||
* @since 2020-05-5 15:10:16
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,意见反馈接口")
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* 买家端,物流公司接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020-05-5 15:10:16
|
||||
* @since 2020-05-5 15:10:16
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,物流公司接口")
|
||||
|
@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,页面接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:08 下午
|
||||
* @since 2020/11/16 10:08 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,页面接口")
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,直播间接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/20 12:03 下午
|
||||
* @since: 2021/5/20 12:03 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,直播间接口")
|
||||
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 买家端,分销员接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:03 下午
|
||||
* @since: 2020/11/16 10:03 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,分销员接口")
|
||||
|
@ -26,7 +26,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,分销商品佣金提现接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:03 下午
|
||||
* @since: 2020/11/16 10:03 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,分销商品佣金提现接口")
|
||||
|
@ -25,7 +25,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,分销商品接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/16 10:06 下午
|
||||
* @since: 2020/11/16 10:06 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,分销商品接口")
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,分销商品佣金提现接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:03 下午
|
||||
* @since: 2020/11/16 10:03 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,分销订单接口")
|
||||
|
@ -23,7 +23,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,会员接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员接口")
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* 买家端,app/小程序 联合登录
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-11-25 19:29
|
||||
* @since 2020-11-25 19:29
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,app/小程序 联合登录")
|
||||
|
@ -29,7 +29,6 @@ import java.io.IOException;
|
||||
* 买家端,web联合登录
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-11-25 19:29
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||
* 买家端,小程序登录接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/2/19 09:28
|
||||
* @since 2021/2/19 09:28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buyer/mini-program")
|
||||
|
@ -25,7 +25,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
* 买家端,收银台接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-12-18 16:59
|
||||
* @since 2020-12-18 16:59
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* 买家端,退款回调
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-12-18 16:59
|
||||
* @since 2020-12-18 16:59
|
||||
*/
|
||||
@Api(tags = "买家端,退款回调")
|
||||
@RestController
|
||||
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||
* 买家端,拼团接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2021/2/20
|
||||
* @since 2021/2/20
|
||||
**/
|
||||
@Api(tags = "买家端,拼团接口")
|
||||
@RestController
|
||||
|
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,积分商品接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2021/1/19
|
||||
* @since 2021/1/19
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "买家端,积分商品接口")
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
* 买家端,秒杀活动接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/11/17 2:30 下午
|
||||
* @since 2020/11/17 2:30 下午
|
||||
*/
|
||||
@Api(tags = "买家端,秒杀活动接口")
|
||||
@RestController
|
||||
|
@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,采购接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/16 10:06 下午
|
||||
* @since: 2020/11/16 10:06 下午
|
||||
*/
|
||||
@Api(tags = "买家端,采购接口")
|
||||
@RestController
|
||||
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||
* 买家端,采购报价接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/16 10:06 下午
|
||||
* @since: 2020/11/16 10:06 下午
|
||||
*/
|
||||
@Api(tags = "买家端,采购报价接口")
|
||||
@RestController
|
||||
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||
* 买家端,店铺接口
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2020/11/17 2:32 下午
|
||||
* @since: 2020/11/17 2:32 下午
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buyer/store")
|
||||
|
@ -30,7 +30,7 @@ import java.util.List;
|
||||
* 买家端,售后管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:02 下午
|
||||
* @since 2020/11/16 10:02 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,售后管理接口")
|
||||
@ -95,7 +95,7 @@ public class AfterSaleBuyerController {
|
||||
public ResultMessage<AfterSale> delivery(@NotNull(message = "售后编号不能为空") @PathVariable("afterSaleSn") String afterSaleSn,
|
||||
@NotNull(message = "发货单号不能为空") @RequestParam String logisticsNo,
|
||||
@NotNull(message = "请选择物流公司") @RequestParam String logisticsId,
|
||||
@NotNull(message = "请选择发货时间") @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date mDeliverTime) {
|
||||
@NotNull(message = "请选择发货时间") @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date mDeliverTime) {
|
||||
return ResultUtil.data(afterSaleService.buyerDelivery(afterSaleSn, logisticsNo, logisticsId, mDeliverTime));
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,购物车接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:04 下午
|
||||
* @since 2020/11/16 10:04 下午
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -28,7 +28,7 @@ import javax.validation.constraints.NotNull;
|
||||
* 买家端,订单接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:08 下午
|
||||
* @since 2020/11/16 10:08 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,订单接口")
|
||||
|
@ -21,7 +21,7 @@ import javax.validation.constraints.Min;
|
||||
* 买家端,预存款充值记录接口
|
||||
*
|
||||
* @author paulG
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,预存款充值记录接口")
|
||||
|
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 买家端,预存款变动日志记录接口
|
||||
*
|
||||
* @author pikachu
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
* @since: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,预存款变动日志记录接口")
|
||||
|
@ -35,8 +35,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.1
|
||||
* @date 2020/11/17 3:37 下午
|
||||
* @Description:
|
||||
* @since 2020/11/17 3:37 下午
|
||||
* @since
|
||||
*/
|
||||
@Slf4j
|
||||
|
@ -19,7 +19,6 @@ import org.springframework.web.cors.CorsConfigurationSource;
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.0
|
||||
* @Description:
|
||||
* @since 2020/11/14 16:20
|
||||
*/
|
||||
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.cache.annotation.EnableCaching;
|
||||
* 基础API
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 3:38 下午
|
||||
* @since 2020/11/17 3:38 下午
|
||||
*/
|
||||
@EnableCaching
|
||||
@SpringBootApplication
|
||||
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||
* 文件管理管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/26 15:41
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "文件管理管理接口")
|
||||
|
@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 文件管理管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/26 15:41
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "文件管理管理接口")
|
||||
|
@ -19,7 +19,6 @@ import java.util.List;
|
||||
* 地址信息接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date: 2020/11/16 10:07 下午
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "地址信息接口")
|
||||
|
@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 滑块验证码接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/26 15:41
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 短信验证码接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/26 15:41
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "短信验证码接口")
|
||||
|
@ -35,7 +35,7 @@ import java.io.InputStream;
|
||||
* 文件上传接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/26 15:41
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -17,7 +17,6 @@ import org.springframework.web.cors.CorsConfigurationSource;
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.0
|
||||
* @Description:
|
||||
* @since 2020/11/14 16:20
|
||||
*/
|
||||
@Slf4j
|
||||
|
@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* 消费者
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/16 10:03 下午
|
||||
* @since 2020/11/16 10:03 下午
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class ConsumerApplication {
|
||||
|
@ -7,7 +7,7 @@ import cn.lili.modules.order.order.entity.dos.AfterSale;
|
||||
* 售后单改变状态
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 7:13 下午
|
||||
* @since 2020/11/17 7:13 下午
|
||||
*/
|
||||
public interface AfterSaleStatusChangeEvent {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||
* 订单状态改变事件
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 7:13 下午
|
||||
* @since 2020/11/17 7:13 下午
|
||||
*/
|
||||
public interface GoodsCommentCompleteEvent {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.member.entity.dto.MemberPointMessage;
|
||||
* 会员积分改变消息
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 7:13 下午
|
||||
* @since 2020/11/17 7:13 下午
|
||||
*/
|
||||
public interface MemberPointChangeEvent {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.member.entity.dos.Member;
|
||||
* 会员注册消息
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 7:13 下午
|
||||
* @since 2020/11/17 7:13 下午
|
||||
*/
|
||||
public interface MemberRegisterEvent {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.member.entity.dto.MemberWithdrawalMessage;
|
||||
* 会员提现消息
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 7:13 下午
|
||||
* @since 2020/11/17 7:13 下午
|
||||
*/
|
||||
public interface MemberWithdrawalEvent {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||
* 订单状态改变事件
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 7:13 下午
|
||||
* @since 2020/11/17 7:13 下午
|
||||
*/
|
||||
public interface OrderStatusChangeEvent {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||
* 订单创建消息
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/2/2 15:15
|
||||
* @since 2021/2/2 15:15
|
||||
*/
|
||||
public interface TradeEvent {
|
||||
|
||||
|
@ -22,7 +22,7 @@ import javax.annotation.Resource;
|
||||
* 分销订单入库
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
* 商品SKU变化
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
*/
|
||||
@Service
|
||||
public class GoodsSkuExecute implements GoodsCommentCompleteEvent {
|
||||
|
@ -24,7 +24,7 @@ import org.springframework.stereotype.Service;
|
||||
* 会员经验值
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/16 11:16 下午
|
||||
* @since: 2021/5/16 11:16 下午
|
||||
*/
|
||||
@Service
|
||||
public class MemberExperienceExecute implements MemberRegisterEvent, GoodsCommentCompleteEvent, OrderStatusChangeEvent {
|
||||
|
@ -28,7 +28,7 @@ import org.springframework.stereotype.Service;
|
||||
* 会员积分
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
*/
|
||||
@Service
|
||||
public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentCompleteEvent, OrderStatusChangeEvent, AfterSaleStatusChangeEvent {
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
|
||||
* 会员钱包创建
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
*/
|
||||
@Service
|
||||
public class MemberWalletExecute implements MemberRegisterEvent {
|
||||
|
@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* 通知类消息实现
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
**/
|
||||
@Service
|
||||
public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent, AfterSaleStatusChangeEvent, MemberPointChangeEvent, MemberWithdrawalEvent {
|
||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||
* 订单创建发票相关处理
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
**/
|
||||
@Service
|
||||
public class OrderCreateReceiptExecute implements TradeEvent {
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
* 订单状态处理类
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
**/
|
||||
@Service
|
||||
public class OrderStatusHandlerExecute implements TradeEvent {
|
||||
|
@ -18,7 +18,7 @@ import org.springframework.stereotype.Service;
|
||||
* 支付
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021-03-13 16:58
|
||||
* @since 2021-03-13 16:58
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
* 注册赠券活动
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/24 10:48 上午
|
||||
* @since: 2021/5/24 10:48 上午
|
||||
*/
|
||||
@Component
|
||||
public class RegisteredCouponActivityExecute implements MemberRegisterEvent {
|
||||
|
@ -26,7 +26,7 @@ import java.util.List;
|
||||
* 库存扣减,他表示了订单状态是否出库成功
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020-07-03 11:20
|
||||
* @since 2020-07-03 11:20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -161,6 +161,11 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
||||
/**
|
||||
* 同步库存和促销库存
|
||||
*
|
||||
* 需修改:DB:商品库存、Sku商品库存、活动商品库存
|
||||
* 1.获取需要修改的Sku列表、活动商品列表
|
||||
* 2.写入sku商品库存,批量修改
|
||||
* 3.写入促销商品的卖出数量、剩余数量,批量修改
|
||||
* 4.调用方法修改商品库存
|
||||
* @param order 订单
|
||||
*/
|
||||
private void synchroDB(OrderDetailVO order) {
|
||||
|
@ -21,7 +21,7 @@ import org.springframework.stereotype.Component;
|
||||
* 虚拟商品
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/29 9:17 上午
|
||||
* @since: 2021/5/29 9:17 上午
|
||||
*/
|
||||
@Component
|
||||
public class VerificationOrderExecute implements OrderStatusChangeEvent {
|
||||
|
@ -5,7 +5,7 @@ package cn.lili.timetask.handler;
|
||||
* 每日凌晨1点执行
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/12/24 11:52
|
||||
* @since 2020/12/24 11:52
|
||||
*/
|
||||
public interface EveryDayExecute {
|
||||
|
||||
|
@ -4,7 +4,7 @@ package cn.lili.timetask.handler;
|
||||
* 每小时任务
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/12/24 11:52
|
||||
* @since 2020/12/24 11:52
|
||||
*/
|
||||
public interface EveryHourExecute {
|
||||
|
||||
|
@ -4,7 +4,7 @@ package cn.lili.timetask.handler;
|
||||
* 每分钟任务
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/12/24 11:52
|
||||
* @since 2020/12/24 11:52
|
||||
*/
|
||||
public interface EveryMinuteExecute {
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
* 店铺结算执行
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date 2021/2/18 3:45 下午
|
||||
* @since 2021/2/18 3:45 下午
|
||||
*/
|
||||
@Component
|
||||
public class BillExecute implements EveryDayExecute {
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
|
||||
* 小程序直播状态获取
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/20 2:52 下午
|
||||
* @since: 2021/5/20 2:52 下午
|
||||
*/
|
||||
@Component
|
||||
public class BroadcastExecute implements EveryHourExecute {
|
||||
|
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
* 优惠券状态监测
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/24 10:08 上午
|
||||
* @since: 2021/5/24 10:08 上午
|
||||
*/
|
||||
@Component
|
||||
public class CouponExecute implements EveryDayExecute {
|
||||
|
@ -18,7 +18,7 @@ import java.util.Map;
|
||||
* 商品定时器
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/3/18 3:23 下午
|
||||
* @since 2021/3/18 3:23 下午
|
||||
*/
|
||||
@Component
|
||||
public class GoodsExecute implements EveryDayExecute {
|
||||
|
@ -23,7 +23,7 @@ import java.util.stream.Collectors;
|
||||
* 订单自动取消(每分钟执行)
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2021/3/11
|
||||
* @since 2021/3/11
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
@ -33,7 +33,7 @@ import java.util.List;
|
||||
* 促销活动每日定时器
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/3/18 3:23 下午
|
||||
* @since 2021/3/18 3:23 下午
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
@ -14,7 +14,7 @@ import java.util.Date;
|
||||
* 会员数据统计
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021-03-02 14:56
|
||||
* @since 2021-03-02 14:56
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
||||
* 实时在线人数统计
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021-02-21 09:47
|
||||
* @since 2021-02-21 09:47
|
||||
*/
|
||||
@Component
|
||||
public class OnlineMemberStatistics implements EveryHourExecute {
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
* 店铺评分
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/3/15 5:30 下午
|
||||
* @since 2021/3/15 5:30 下午
|
||||
*/
|
||||
@Component
|
||||
public class StoreRatingExecute implements EveryDayExecute {
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||
* 统计 入库
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021-01-15 18:20
|
||||
* @since 2021-01-15 18:20
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
|
||||
* 事件触发消费者
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/11/17 7:19 下午
|
||||
* @since 2020/11/17 7:19 下午
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
|
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
* 直播间事件触发
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/6/1 5:02 下午
|
||||
* @since: 2021/6/1 5:02 下午
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(TimeExecuteConstant.BROADCAST_EXECUTOR)
|
||||
|
@ -20,7 +20,7 @@ import org.springframework.stereotype.Component;
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.1
|
||||
* @date 2020/11/17 7:20 下午
|
||||
* @since 2020/11/17 7:20 下午
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(TimeExecuteConstant.PROMOTION_EXECUTOR)
|
||||
|
@ -57,7 +57,7 @@ public abstract class BaseEntity implements Serializable {
|
||||
|
||||
@CreatedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间", hidden = true)
|
||||
private Date createTime;
|
||||
@ -69,7 +69,7 @@ public abstract class BaseEntity implements Serializable {
|
||||
|
||||
@LastModifiedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间", hidden = true)
|
||||
private Date updateTime;
|
||||
|
@ -19,7 +19,7 @@ public interface Cache<T> {
|
||||
/**
|
||||
* Get an item from the cache, nontransactionally
|
||||
*
|
||||
* @param key
|
||||
* @param key 缓存key
|
||||
* @return the cached object or <tt>null</tt>
|
||||
*/
|
||||
T get(Object key);
|
||||
@ -27,7 +27,7 @@ public interface Cache<T> {
|
||||
/**
|
||||
* Get an item from the cache, nontransactionally
|
||||
*
|
||||
* @param key
|
||||
* @param key 缓存key
|
||||
* @return the cached object or <tt>null</tt>
|
||||
*/
|
||||
String getString(Object key);
|
||||
@ -37,14 +37,14 @@ public interface Cache<T> {
|
||||
* multiGet
|
||||
*
|
||||
* @param keys 要查询的key集合
|
||||
* @return
|
||||
* @return 集合
|
||||
*/
|
||||
List multiGet(Collection keys);
|
||||
|
||||
/**
|
||||
* 批量set
|
||||
*
|
||||
* @param map
|
||||
* @param map 键值对
|
||||
*/
|
||||
void multiSet(Map map);
|
||||
|
||||
@ -60,16 +60,16 @@ public interface Cache<T> {
|
||||
* Add an item to the cache, nontransactionally, with
|
||||
* failfast semantics
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @param key 缓存key
|
||||
* @param value 缓存value
|
||||
*/
|
||||
void put(Object key, T value);
|
||||
|
||||
/**
|
||||
* 往缓存中写入内容
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @param key 缓存key
|
||||
* @param value 缓存value
|
||||
* @param exp 超时时间,单位为秒
|
||||
*/
|
||||
void put(Object key, T value, Long exp);
|
||||
@ -77,24 +77,24 @@ public interface Cache<T> {
|
||||
/**
|
||||
* 往缓存中写入内容
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @param exp
|
||||
* @param timeUnit 写入单位
|
||||
* @param key 缓存key
|
||||
* @param value 缓存value
|
||||
* @param exp 过期时间
|
||||
* @param timeUnit 过期单位
|
||||
*/
|
||||
void put(Object key, T value, Long exp, TimeUnit timeUnit);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param key
|
||||
* @param key 缓存key
|
||||
*/
|
||||
void remove(Object key);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param key
|
||||
* @param key 缓存key
|
||||
*/
|
||||
void vagueDel(Object key);
|
||||
|
||||
@ -116,33 +116,34 @@ public interface Cache<T> {
|
||||
/**
|
||||
* 玩缓存中写入内容
|
||||
*
|
||||
* @param key
|
||||
* @param map
|
||||
* @param key 缓存key
|
||||
* @param map map value
|
||||
*/
|
||||
void putAllHash(Object key, Map map);
|
||||
|
||||
/**
|
||||
* 读取缓存值
|
||||
*
|
||||
* @param key
|
||||
* @param hashKey
|
||||
* @return
|
||||
* @param key 缓存key
|
||||
* @param hashKey map value
|
||||
* @return 返回缓存中的数据
|
||||
*/
|
||||
T getHash(Object key, Object hashKey);
|
||||
|
||||
/**
|
||||
* 读取缓存值
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key 缓存key
|
||||
* @return 缓存中的数据
|
||||
*/
|
||||
Map<Object, Object> getHash(Object key);
|
||||
|
||||
/**
|
||||
* 是否包含
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key 缓存key
|
||||
* @return 缓存中的数据
|
||||
*
|
||||
*/
|
||||
boolean hasKey(Object key);
|
||||
|
||||
@ -150,8 +151,8 @@ public interface Cache<T> {
|
||||
/**
|
||||
* 模糊匹配key
|
||||
*
|
||||
* @param pattern
|
||||
* @return
|
||||
* @param pattern 模糊key
|
||||
* @return 缓存中的数据
|
||||
*/
|
||||
List<String> keys(String pattern);
|
||||
|
||||
@ -163,9 +164,9 @@ public interface Cache<T> {
|
||||
* 效率较高的 计数器
|
||||
* 如需清零,按照普通key 移除即可
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @return
|
||||
* @param key key值
|
||||
* @param value 去重统计值
|
||||
* @return 计数器结果
|
||||
*/
|
||||
Long cumulative(Object key, Object value);
|
||||
|
||||
@ -175,8 +176,8 @@ public interface Cache<T> {
|
||||
* 效率较高的 计数器 统计返回
|
||||
* 如需清零,按照普通key 移除即可
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key 计数器key
|
||||
* @return 计数器结果
|
||||
*/
|
||||
Long counter(Object key);
|
||||
|
||||
@ -184,7 +185,7 @@ public interface Cache<T> {
|
||||
* 批量计数
|
||||
*
|
||||
* @param keys 要查询的key集合
|
||||
* @return
|
||||
* @return 批量计数
|
||||
*/
|
||||
List multiCounter(Collection keys);
|
||||
|
||||
@ -194,8 +195,8 @@ public interface Cache<T> {
|
||||
* 效率较高的 计数器 统计返回
|
||||
* 如需清零,按照普通key 移除即可
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
* @param key key值
|
||||
* @return 计数器结果
|
||||
*/
|
||||
Long mergeCounter(Object... key);
|
||||
//---------------------------------------------------用于特殊场景,redis去重统计-----------------------------------------
|
||||
@ -208,7 +209,7 @@ public interface Cache<T> {
|
||||
*
|
||||
* @param key 为累计的key,同一key每次调用则值 +1
|
||||
* @param liveTime 单位秒后失效
|
||||
* @return
|
||||
* @return 计数器结果
|
||||
*/
|
||||
Long incr(String key, long liveTime);
|
||||
//-----------------------------------------------redis计数---------------------------------------------
|
||||
@ -230,7 +231,7 @@ public interface Cache<T> {
|
||||
* @param sortedSetName sortedSetName
|
||||
* @param start 查询范围开始位置
|
||||
* @param end 查询范围结束位置
|
||||
* @return
|
||||
* @return 获取满足条件的集合
|
||||
*/
|
||||
Set<ZSetOperations.TypedTuple<Object>> reverseRangeWithScores(String sortedSetName, Integer start, Integer end);
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class RedisCache implements Cache {
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param key
|
||||
* @param key 模糊删除key
|
||||
*/
|
||||
@Override
|
||||
public void vagueDel(Object key) {
|
||||
@ -130,7 +130,7 @@ public class RedisCache implements Cache {
|
||||
* 获取符合条件的key
|
||||
*
|
||||
* @param pattern 表达式
|
||||
* @return
|
||||
* @return 模糊匹配key
|
||||
*/
|
||||
@Override
|
||||
public List<String> keys(String pattern) {
|
||||
@ -236,7 +236,7 @@ public class RedisCache implements Cache {
|
||||
* @param sortedSetName sortedSetName
|
||||
* @param start 查询范围开始位置
|
||||
* @param end 查询范围结束位置
|
||||
* @return
|
||||
* @return 符合排序的集合
|
||||
*/
|
||||
@Override
|
||||
public Set<ZSetOperations.TypedTuple<Object>> reverseRangeWithScores(String sortedSetName, Integer start, Integer end) {
|
||||
|
@ -335,7 +335,7 @@ public abstract class BaseElasticsearchService {
|
||||
* @param index index名
|
||||
* @return boolean
|
||||
* @author fanxb
|
||||
* @date 2019/7/24 14:57
|
||||
* @since 2019/7/24 14:57
|
||||
*/
|
||||
public boolean indexExist(String index) {
|
||||
try {
|
||||
|
@ -5,7 +5,7 @@ package cn.lili.common.enums;
|
||||
* 客户端类型
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/12/8 9:46
|
||||
* @since 2020/12/8 9:46
|
||||
*/
|
||||
|
||||
public enum ClientTypeEnum {
|
||||
|
@ -5,7 +5,7 @@ package cn.lili.common.enums;
|
||||
* 第一位 1:商品;2:用户;3:交易,4:促销,5:店铺,6:页面,7:设置,8:其他
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2020/4/8 1:36 下午
|
||||
* @since 2020/4/8 1:36 下午
|
||||
*/
|
||||
public enum ResultCode {
|
||||
|
||||
@ -243,11 +243,12 @@ public enum ResultCode {
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
COUPON_LIMIT_ERROR(41000, "超出领取限制"),
|
||||
COUPON_EDIT_STATUS_SUCCESS(41001, "修改状态成功!"),
|
||||
COUPON_CANCELLATION_SUCCESS(41002, "会员优惠券作废成功"),
|
||||
COUPON_EXPIRED(41003, "优惠券已使用/已过期,不能使用"),
|
||||
COUPON_EDIT_STATUS_ERROR(41004, "优惠券修改状态失败!"),
|
||||
COUPON_RECEIVE_ERROR(41005, "当前优惠券状态不可领取"),
|
||||
COUPON_RECEIVE_ERROR(41005, "当前优惠券已经被领取完了,下次要早点来哦"),
|
||||
COUPON_NUM_INSUFFICIENT_ERROR(41006, "优惠券剩余领取数量不足"),
|
||||
COUPON_NOT_EXIST(41007, "当前优惠券不存在"),
|
||||
COUPON_LIMIT_NUM_LESS_THAN_0(41008, "领取限制数量不能为负数"),
|
||||
|
@ -33,8 +33,8 @@ public class ResultUtil<T> {
|
||||
/**
|
||||
* 返回数据
|
||||
*
|
||||
* @param t
|
||||
* @return
|
||||
* @param t 范型
|
||||
* @return 消息
|
||||
*/
|
||||
public ResultMessage<T> setData(T t) {
|
||||
this.resultMessage.setResult(t);
|
||||
@ -58,9 +58,9 @@ public class ResultUtil<T> {
|
||||
|
||||
/**
|
||||
* 抽象静态方法,返回结果集
|
||||
* @param t
|
||||
* @param <T>
|
||||
* @return
|
||||
* @param t 范型
|
||||
* @param <T> 范型
|
||||
* @return 消息
|
||||
*/
|
||||
public static <T> ResultMessage<T> data(T t) {
|
||||
return new ResultUtil<T>().setData(t);
|
||||
@ -70,6 +70,7 @@ public class ResultUtil<T> {
|
||||
* 返回成功
|
||||
*
|
||||
* @param resultCode 返回状态码
|
||||
* @return 消息
|
||||
*/
|
||||
public static <T> ResultMessage<T> success(ResultCode resultCode) {
|
||||
return new ResultUtil<T>().setSuccessMsg(resultCode);
|
||||
@ -77,6 +78,7 @@ public class ResultUtil<T> {
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
* @return 消息
|
||||
*/
|
||||
public static <T> ResultMessage<T> success() {
|
||||
return new ResultUtil<T>().setSuccessMsg(ResultCode.SUCCESS);
|
||||
@ -86,6 +88,7 @@ public class ResultUtil<T> {
|
||||
* 返回失败
|
||||
*
|
||||
* @param resultCode 返回状态码
|
||||
* @return 消息
|
||||
*/
|
||||
public static <T> ResultMessage<T> error(ResultCode resultCode) {
|
||||
return new ResultUtil<T>().setErrorMsg(resultCode);
|
||||
@ -96,6 +99,7 @@ public class ResultUtil<T> {
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回消息
|
||||
* @return 消息
|
||||
*/
|
||||
public static <T> ResultMessage<T> error(Integer code, String msg) {
|
||||
return new ResultUtil<T>().setErrorMsg(code, msg);
|
||||
@ -103,8 +107,8 @@ public class ResultUtil<T> {
|
||||
|
||||
/**
|
||||
* 服务器异常 追加状态码
|
||||
*
|
||||
* @param resultCode 返回码
|
||||
* @return 消息
|
||||
*/
|
||||
public ResultMessage<T> setErrorMsg(ResultCode resultCode) {
|
||||
this.resultMessage.setSuccess(false);
|
||||
@ -118,6 +122,7 @@ public class ResultUtil<T> {
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回消息
|
||||
* @return 消息
|
||||
*/
|
||||
public ResultMessage<T> setErrorMsg(Integer code, String msg) {
|
||||
this.resultMessage.setSuccess(false);
|
||||
|
@ -24,7 +24,7 @@ public class ServiceException extends RuntimeException {
|
||||
private ResultCode resultCode;
|
||||
|
||||
public ServiceException(String msg) {
|
||||
super(msg);
|
||||
this.resultCode = ResultCode.ERROR;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ import java.util.Map;
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.0
|
||||
* @Description:
|
||||
* @since 2020/12/24 19:31
|
||||
*/
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
package cn.lili.common.security.context;
|
||||
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 获取用户信息 处理
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.0
|
||||
* @Description:
|
||||
* @since 2020/11/14 20:35
|
||||
*/
|
||||
@Component
|
||||
public class AuthenticationHandler {
|
||||
|
||||
/**
|
||||
* 获取当前用户信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public AuthUser getAuthUser() {
|
||||
//获取spring security 权限信息,如果token有权限,在这里就会得到内容
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication == null) {
|
||||
return null;
|
||||
}
|
||||
Object object = authentication.getDetails();
|
||||
if (object instanceof AuthUser) {
|
||||
return (AuthUser) authentication.getDetails();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -19,7 +19,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v4.0
|
||||
* @Description:
|
||||
* @since 2020/11/14 20:27
|
||||
*/
|
||||
public class UserContext {
|
||||
@ -27,7 +26,7 @@ public class UserContext {
|
||||
/**
|
||||
* 根据request获取用户信息
|
||||
*
|
||||
* @return
|
||||
* @return 授权用户
|
||||
*/
|
||||
public static AuthUser getCurrentUser() {
|
||||
if (RequestContextHolder.getRequestAttributes() != null) {
|
||||
@ -44,7 +43,7 @@ public class UserContext {
|
||||
*
|
||||
* @param cache 缓存
|
||||
* @param accessToken token
|
||||
* @return
|
||||
* @return 授权用户
|
||||
*/
|
||||
public static AuthUser getAuthUser(Cache cache, String accessToken) {
|
||||
try {
|
||||
@ -61,7 +60,7 @@ public class UserContext {
|
||||
* 根据jwt获取token重的用户信息
|
||||
*
|
||||
* @param accessToken token
|
||||
* @return
|
||||
* @return 授权用户
|
||||
*/
|
||||
public static AuthUser getAuthUser(String accessToken) {
|
||||
try {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user