记得上下班打卡 | git大法好,push需谨慎

Commit b8ec0a79 authored by 胡佳晨's avatar 胡佳晨

提交smile

parent 8cc9af0c
......@@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-goblin-do</artifactId>
<artifactId>liquidnet-service-smile</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
......
package com.liquidnet.service.goblin.constant;
public class GoblinRedisConst {
public static final String PREFIX = "goblin:";
/* ----------------------------------------------------------------- */
/**
* 认证中店铺UID关系缓存
* {goblin:bsc:ustore:${uid}, List<store_id>}
*/
public static final String BASIC_USTORE = PREFIX.concat("bsc:ustore:");
/**
* 平台商品标签信息
* {goblin:bsc:self_tag, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo>)}
*/
public static final String BASIC_SELF_TAG = PREFIX.concat("bsc:self_tag");
/**
* 平台专属标签信息
* {goblin:bsc:self_etag, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo>)}
*/
public static final String BASIC_SELF_EXTAG = PREFIX.concat("bsc:self_etag");
/**
* 平台商品分类信息
* {goblin:bsc:self_g_c, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinSelfGoodsCategoryVo>)}
*/
public static final String BASIC_SELF_GOODS_CATEGORY = PREFIX.concat("bsc:self_g_c");
/**
* 平台商品分类信息
* {goblin:bsc:self_g_c_s:${cate_id}, com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo}
*/
public static final String BASIC_SELF_GOODS_CATEGORY_SPEC = PREFIX.concat("bsc:self_g_c_s:");
/**
* 平台服务支持信息
* {goblin:bsc:sev_sup, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinServiceSupportVo>)}
*/
public static final String BASIC_SERVICE_SUPPORT = PREFIX.concat("bsc:sev_sup");
/**
* 店铺信息
* {goblin:bsc:store:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo}
*/
public static final String BASIC_STORE = PREFIX.concat("bsc:store:");
/**
* 店铺配置信息
* {goblin:bsc:store_cf:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo}
*/
public static final String BASIC_STORE_CONF = PREFIX.concat("bsc:store_cf:");
/**
* 店铺商品分类信息
* {goblin:bsc:store_g_c:${store_id}, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinStoreGoodsCategoryVo>)}
*/
public static final String BASIC_STORE_GOODS_CATEGORY = PREFIX.concat("bsc:store_g_c:");
/**
* SPU信息
* {goblin:bsc:goods:${spu_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo}
*/
public static final String BASIC_GOODS = PREFIX.concat("bsc:goods:");
public static final String BASIC_GOODS_UNSHELVES = PREFIX.concat("bsc:goods_unshelves:");
/**
* SKU信息
* {goblin:bsc:goods_sku:${sku_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo}
*/
public static final String BASIC_GOODS_SKU = PREFIX.concat("bsc:goods_sku:");
public static final String BASIC_GOODS_SKU_UNSHELVES = PREFIX.concat("bsc:goods_sku_unshelves:");
/* ----------------------------------------------------------------- */
/**
* 店铺公告
* {goblin:store_ntc:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo}
*/
public static final String STORE_NOTICE = PREFIX.concat("store_ntc:");
/* ----------------------------------------------------------------- */
public static final String FRONT_TOP_BANNER = PREFIX.concat("front_top_banner"); //前端顶部banner
public static final String FRONT_MIDDLE_BANNER = PREFIX.concat("front_middle_banner"); //前端中部banner
public static final String FRONT_NAVIGATION = PREFIX.concat("front_navigation"); //前端banner
public static final String FRONT_HOTWORD = PREFIX.concat("front_hot_word"); //前端banner
public static final String FRONT_HOTWORD_INDEX = PREFIX.concat("front_hot_word_index"); //前端banner index
public static final String FRONT_FRONT_SECKILL = PREFIX.concat("front_front_seckill"); //前端 首页秒杀
public static final String FRONT_SECKILL = PREFIX.concat("front_seckill"); //前端 秒杀列表
public static final String SELECT_GOODS = PREFIX.concat("select_goods"); //配置的精选商品
public static final String SELECT_GOODS_PAGE1 = PREFIX.concat("select_goods_page1"); //精选商品 第一页
public static final String SELECT_GOODS_SORT = PREFIX.concat("select_goods_sort"); //精选商品 排序规则
public static final String SELECT_GOODS_SPUIDS = PREFIX.concat("select_goods_SPUIDS"); //精选商品 spuids
public static final String MOUDLE_INDEX = PREFIX.concat("moudle_index"); //moudle_index 组件排序
public static final String COMPLIATIONS = PREFIX.concat("goblinFrontCompilations"); // 合集
public static final String FRONT_GOBLINFRONTCUBE = PREFIX.concat("goblinFrontCube"); // 魔方
public static final String FRONT_GOBLIN_RECOMMEND= PREFIX.concat("goblinFrontRECOMMMEND"); // 新品推荐
public static final String FRONT_SHOPCART = PREFIX.concat("goblin_shopcart:"); // 购物车
public static final String FRONT_SHOPCART_TWO = PREFIX.concat("goblin_shopcartTwo:"); // 购物车第二部
/* ----------------------------------------------------------------- */
public static final String REDIS_GOBLIN_MARKET_RELATION = PREFIX.concat("market:relation:");//商铺活动-商铺款式关联关系
public static final String REDIS_GOBLIN_SELF_MARKET = PREFIX.concat("self:market:");//官方活动
public static final String REDIS_GOBLIN_ZHENGZAI_RELATION = PREFIX.concat("zhengzai:market:");//活动-正在下单-可参加商户
public static final String REDIS_GOBLIN_STORE_SELF_RELATION = PREFIX.concat("zhengzai:storeId:");//活动-当前商铺能参与的官方活动id列表
public static final String REDIS_GOBLIN_STORE_MARKET = PREFIX.concat("store:market:");//商铺活动
public static final String REDIS_GOBLIN_ZHENGZAI_LIST = PREFIX.concat("zhengzai:list");//全部正在下单内容
public static final String REDIS_GOBLIN_STORE_MARKET_ISCONFIG = PREFIX.concat("store:is_config:");//商铺活动-该活动配置了款式的商品
public static final String REDIS_GOBLIN_BUY_COUNT = PREFIX.concat("uid:");//用户sku购买数量 key:uid:skuId:$skuId
public static final String REDIS_GOBLIN_SALE_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$skuId
public static final String REDIS_GOBLIN_SALE_SPU_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$spuId
public static final String REDIS_GOBLIN_ORDER = PREFIX.concat("order:");//用户sku购买数量 key:$orderId
public static final String REDIS_GOBLIN_ORDER_BACK = PREFIX.concat("order:back:");//用户sku购买数量 key:$backOrderId
public static final String REDIS_GOBLIN_ORDER_SKU = PREFIX.concat("orderSku:");//用户sku购买数量 key:$orderSkuId
public static final String REDIS_GOBLIN_ORDER_UN_PAY = PREFIX.concat("order:un:pay:");//未支付订单id列表 key:$randomKey
public static final String REDIS_GOBLIN_ORDER_LIST = PREFIX.concat("order:id:list:");//用户订单id列表 key:$uid
public static final String REDIS_GOBLIN_ORDER_ZHENGZAI_LIST = PREFIX.concat("order:zhengzai:list:");//用户订单id列表 key:$uid
public static final String REDIS_GOBLIN_ORDER_MASTER = PREFIX.concat("order:masterCode:");//用户订单id列表 key:$masterCode
public static final String REDIS_GOBLIN_ORDER_OFFCODE = PREFIX.concat("order:offCode:");//用户订单id列表 key:$wtrieOffCode
public static final String REDIS_GOBLIN_BACK_ORDER_ID = PREFIX.concat("order:backIds:");//用户订单下的退款订单id key:$orderId
public static final String REDIS_CAN_BUY = PREFIX.concat("canBuy:");//可以购买的用户 key:$skuId:$mobile
public static final String REDIS_ZZ_MUSIC_TAG = PREFIX.concat("music:tag:ZZ:");//根据场次音乐人标签搜索列表 key:$musicTag:$performanceId
public static final String REDIS_GOBLIN_MAIL = PREFIX.concat("mail:orderId:");//快递 $key:$orderId
public static final String REDIS_GOBLIN_TEMP_COUPON_MARKET = PREFIX.concat("temp:coupon:marketId:");//id 列表 $key:$marketId
public static final String REDIS_GOBLIN_TEMP_COUPON = PREFIX.concat("temp:coupon:");//详情 $key:$ucouponId
/* ----------------------------------------------------------------- */
/**
* SKU剩余库存
*/
public static final String REAL_STOCK_SKU = PREFIX.concat("real_stock_sku:");
public static final String SKU_RELATION = PREFIX.concat("sku:relation:");//$key:$skuId
/* ----------------------------------------------------------------- */
/**
* 商铺活动:优惠券基本信息
* {goblin:s_coupon:${store_coupon_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo}
*/
public static final String STORE_COUPON = PREFIX.concat("s_coupon:");
/**
* 商铺活动:优惠券适用商品ID集合
* {goblin:s_coupon_r:${store_coupon_id}, JsonUtils.toJson(List<String:spu_id>)}
*/
public static final String STORE_COUPON_RULE = PREFIX.concat("s_coupon_r:");
/**
* 商铺活动:优惠券剩余库存
*/
public static final String STORE_COUPON_STOCK = PREFIX.concat("s_coupon_stock:");
/* ----------------------------------------------------------------- */
/**
* 商铺活动ID集合
* {goblin:store_markets:${store_id}, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.GoblinGoodsMarketDto>)}
*/
public static final String STORE_MARKETS = PREFIX.concat("store_markets:");
/* ----------------------------------------------------------------- */
/**
* 商城用户券
* {golblin:user_coupon:${uid}, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo>)}
*/
public static final String USER_COUPON = PREFIX.concat("user_coupon:");
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
}
package com.liquidnet.service.goblin.constant;
public class GoblinStatusConst {
/* ----------------------------------------------------------------- */
public enum CommonStatus {
COMMON_LIMIT_UN(0, "不限购"),
COMMON_TYPE_ALL(0, "购买条件-全部用户"),
COMMON_TYPE_MEMBER(1, "购买条件-会员用户"),
COMMON_TYPE_CAN(2, "购买条件-指定用户"),
;
private final int value;
private final String desc;
CommonStatus(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum Status {
ORDER_STATUS_0(0, "待付款(用户刚下单)"),
ORDER_STATUS_2(2, "代发货(用户付完款 等待商城发货)"),
ORDER_STATUS_3(3, "代收货(商城已经发货 等待用户确认收货)"),
ORDER_STATUS_4(4, "已完成(用户已经确认收货 订单结束)"),
ORDER_STATUS_5(5, "取消订单(用户未付款前取消订单)"),
ORDER_STATUS_6(6, "退款通过(用户已经付款但是商城还未发货,用户发出退款申请,商城同意退款)"),
ORDER_STATUS_7(7, "退货通过(用户已经确认收货后用户发出退货申请,商城同意所有退货申请 ,一个订单可能有多个单品)"),
ORDER_STATUS_61(61, "发起-退款(用户已经付款但是商城还未发货,用户发出退款申请,商城同意退款)"),
ORDER_STATUS_71(71, "发起-退货(用户已经确认收货后用户发出退货申请,商城同意所有退货申请 ,一个订单可能有多个单品)"),
ORDER_LOG_STATUS_11(11, "确认付款"),
ORDER_LOG_STATUS_12(12, "修改金额"),
ORDER_LOG_STATUS_13(13, "发货"),
ORDER_LOG_STATUS_14(14, "取消订单"),
ORDER_LOG_STATUS_15(15, "修改物流单号"),
ORDER_LOG_STATUS_16(16, "核销虚拟商品订单"),
ORDER_LOG_STATUS_17(17, "修改收货地址"),
ORDER_LOG_STATUS_20(20, "商家发起退款"),
ORDER_LOG_STATUS_201(201, "商家同意退款"),
ORDER_LOG_STATUS_21(21, "退款申请"),
ORDER_LOG_STATUS_22(22, "退款成功"),
ORDER_LOG_STATUS_23(23, "退款拒绝"),
ORDER_LOG_STATUS_24(24, "退货申请"),
ORDER_LOG_STATUS_25(25, "退货拒绝"),
ORDER_LOG_STATUS_26(26, "退货审核通过等待用户填写物流"),
ORDER_LOG_STATUS_27(27, "待收货"),
ORDER_LOG_STATUS_28(28, "退货完成"),
ORDER_LOG_STATUS_29(29, "退款拒绝"),
ORDER_BACK_STATUS_0(0, "商家发起退款(退款中)"),
ORDER_BACK_STATUS_1(1, "退款申请(用户发送退款请求)"),
ORDER_BACK_STATUS_2(2, "退款成功(商家同意退款)"),
ORDER_BACK_STATUS_3(3, "退款拒绝(商家拒绝退款)"),
ORDER_BACK_STATUS_4(4, "退货申请(用户发起退货请求)"),
ORDER_BACK_STATUS_5(5, "退货拒绝(商家拒绝退货)"),
ORDER_BACK_STATUS_6(6, "退货审核通过等待用户填写物流"),
ORDER_BACK_STATUS_7(7, "待收货(退货中)"),
ORDER_BACK_STATUS_8(8, "退货完成"),
ORDER_BACK_STATUS_9(9, "退款拒绝"),
ORDER_BACK_STATUS_10(10, "退款失败"),
ORDER_BACK_STATUS_11(11, "取消退款"),
;
private final int value;
private final String desc;
Status(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum Type {
OPERATION_TYPE_1(1, "用户"),
OPERATION_TYPE_2(2, "商家"),
BACK_REASON_TYPE_1(1, "不想买了"),
BACK_REASON_TYPE_2(2, "收货人信息有误"),
BACK_REASON_TYPE_3(3, "未按指定时间发货"),
BACK_REASON_TYPE_4(4, "其他"),
BACK_REASON_TYPE_5(5, "不想买了"),
BACK_REASON_TYPE_6(6, "商品质量问题"),
BACK_REASON_TYPE_7(7, "收到商品与描述不符"),
BACK_REASON_TYPE_8(8, "商铺发起"),//todo
BACK_REASON_TYPE_9(9, "系统自动申请"),
BACK_TYPE_1(1, "退款"),
BACK_TYPE_2(2, "退货"),
;
private final int value;
private final String desc;
Type(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum MarketingStatus {
SELF_TYPE_ZHENGZAI(1, "正在下单"),
STORE_TYPE_PURCHASE(2, "限时秒杀"),
STORE_PURCHASE_STATUS_ALL(-1, "全部"),
STORE_PURCHASE_STATUS_UN_START(0, "等待开始"),
STORE_PURCHASE_STATUS_ING_START(1, "活动中"),
STORE_PURCHASE_STATUS_END_START(2, "活动结束"),
STORE_PURCHASE_STATUS_STOP(7, "停用"),
;
private final int value;
private final String desc;
MarketingStatus(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum MarketPreStatus {
MARKET_PRE_ZHENGZAI("ZZ", "正在下单前缀"),
MARKET_PRE_PURCHASE("PC", "限时秒杀前缀"),
;
private final String value;
private final String desc;
MarketPreStatus(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
public static String getPre(String goblinId) {
if (goblinId.contains(MARKET_PRE_ZHENGZAI.getValue())) {
return MARKET_PRE_ZHENGZAI.getValue();
} else if (goblinId.contains(MARKET_PRE_PURCHASE.getValue())) {
return MARKET_PRE_PURCHASE.getValue();
}
return null;
}
}
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
}
package com.liquidnet.service.goblin.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ApiModel(value = "GoblinGoodsSpecDto", description = "商品SKU规格")
@Data
public class GoblinGoodsSpecDto implements Serializable, Cloneable {
private static final long serialVersionUID = 8425727558228094904L;
@ApiModelProperty(position = 11, value = "规格名称")
@NotBlank(message = "规格名称不能为空")
private String specName;
@ApiModelProperty(position = 11, value = "规格值名称")
@NotBlank(message = "规格值不能为空")
private String specVname;
private static final GoblinGoodsSpecDto obj = new GoblinGoodsSpecDto();
public static GoblinGoodsSpecDto getNew() {
try {
return (GoblinGoodsSpecDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinGoodsSpecDto();
}
}
}
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@ApiModel(value = "AddressVo")
@Data
public class AddressVo {
@ApiModelProperty(value = "收货人姓名")
private String name;
@ApiModelProperty(value = "代理id")
private String province;
@ApiModelProperty(value = "省份行政编码")
private String county;
@ApiModelProperty(value = "城市")
private String city;
@ApiModelProperty(value = "收货地址")
private String address;
@ApiModelProperty(value = "区县")
private String phone;
@ApiModelProperty(value = "区县行政编码")
private String countyId;
}
package com.liquidnet.service.goblin.dto.manage.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ApiModel(value = "GoblinMgtCategorySpecVo", description = "分类关联的规格信息")
@Data
public class GoblinMgtCategorySpecVo implements Serializable, Cloneable {
private static final long serialVersionUID = -1807588898644126000L;
@ApiModelProperty(position = 11, value = "分类ID")
private String cateId;
@ApiModelProperty(position = 13, value = "规格名称List")
private List<String> specNameList;
public GoblinMgtCategorySpecVo setCateId(String cateId) {
this.cateId = cateId;
return this;
}
public GoblinMgtCategorySpecVo setSpecNameList(List<String> specNameList) {
this.specNameList = specNameList;
return this;
}
private static final GoblinMgtCategorySpecVo obj = new GoblinMgtCategorySpecVo();
public static GoblinMgtCategorySpecVo getNew() {
try {
return (GoblinMgtCategorySpecVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinMgtCategorySpecVo();
}
}
}
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
@Data
@EqualsAndHashCode
public class ArDataVo implements Cloneable {
@ApiModelProperty(position = 1, value = "Spuvo")
private List<GoblinGoodsInfoVo> goodsInfoVos;
@ApiModelProperty(position = 2, value = "券vo")
private List<TempCouponVo> tempCouponVos;
private static final ArDataVo obj = new ArDataVo();
public static ArDataVo getNew() {
try {
return (ArDataVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new ArDataVo();
}
}
}
package com.liquidnet.service.goblin.enums;
/**
* 店铺配置信息
*
* @author zhanggb
* Created by IntelliJ IDEA at 2022/1/12
*/
public enum GoblinStoreConf {
/**
* 状态:营业状态
* 同步`GoblinStoreInfoVo.status`
*/
BUSINESS_STATUS,
/**
* 开关:联系客服
*/
ONOFF_CUSTOMER_SEV,
/**
* 开关:售罄展示
*/
ONOFF_SOLD_OUT_SHOW,
/**
* 指标:库存不足
*/
LIMIT_WARNING_STOCK,
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Api
public class BackCouponParam implements Serializable, Cloneable {
@ApiModelProperty(dataType = "String", name = "uCouponIds", value = "券唯一表示id(逗号隔开的字符串)",example = "1",required = true)
@NotNull @NotBlank
private String uCouponIds;
@ApiModelProperty(dataType = "String", name = "uid", value = "用户id",example = "10",required = true)
@NotNull @NotBlank
private String uid;
private static final BackCouponParam obj = new BackCouponParam();
public static BackCouponParam getNew() {
try {
return (BackCouponParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new BackCouponParam();
}
public String getuCouponIds() {
return uCouponIds;
}
public void setuCouponIds(String uCouponIds) {
this.uCouponIds = uCouponIds;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}
package com.liquidnet.service.goblin.service;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public interface GoblinCouponService {
//根据spuId获取 该spu可参与的券活动
ArrayList<String> getSpuType(String spuId, String storeId);
//获取 类型券列表
ArrayList<GoblinStoreCouponVo> getSpuByType(String spuId, String storeId, String type);
//领取券
Boolean receiveCoupon(String uid, List<GoblinUserCouponVo> userCouponVoList, GoblinStoreCouponVo storeCouponVo);
//我的券列表 [类型 1可用 2过期/已使用]
List<GoblinUserCouponVo> getList(String type);
//是否可用券 [价格] [spuId逗号隔开] [uid]
GoblinUserCouponVo canUse(BigDecimal totalPrice, String spuId, String uid,String storeId);
//可用券列表 [价格] [spuId逗号隔开] [uid]
List<GoblinUserCouponVo> useList(BigDecimal totalPrice, String spuId, String uid);
//使用券 [券id] [消费内容] [价格] [spuId逗号隔开]
GoblinUseResultVo useCoupon(String ucouponId,String content, BigDecimal totalPrice, String spuId, String uid);
//回退券 [list<Data>] [券id , 用户id]
Boolean backCoupon(List<BackCouponParam> params);
}
package com.liquidnet.service.goblin.service.manage;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
import com.liquidnet.service.goblin.dto.vo.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.List;
public interface IGoblinInnerService {
ResponseDto<String> insertCoupon(MultipartFile file, String performanceId);
ResponseDto<ArDataVo> getArData(String tag, String performanceId);
ResponseDto<TempCouponVo> getTempCouponData(String ucouponId);
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-do</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-smile-do</artifactId>
</project>
\ No newline at end of file
......@@ -24,6 +24,7 @@
<module>liquidnet-service-slime-do</module>
<module>liquidnet-service-stone-do</module>
<module>liquidnet-service-goblin-do</module>
<module>liquidnet-service-smile-do</module>
</modules>
<dependencies>
......
package com.liquidnet.service;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
public class MybatisPlusCodeGenerator {
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param parentName 相当于业务模块名 com.liquidnet.service.adam 全限定类名
* @param tableNames 表名
*/
public static void doGenerator(String moduleRootPath,
DataSourceConfig dsc,
String parentName,
String[] tableNames) {
AutoGenerator mpg = new AutoGenerator();
// 全局配置BankMybatisPlusCodeGenerator
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(moduleRootPath + "/src/main/java");
gc.setAuthor("liquidnet");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(parentName);
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return moduleRootPath + "/src/main/resources/com/liquidnet/service/goblin/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(tableNames);
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
public static void main(String[] args) {
DataSourceConfig dsc = new DataSourceConfig();
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUrl("jdbc:mysql://39.107.71.112:3308/dev_ln_scene?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=CST");
dsc.setUsername("testmall");
dsc.setPassword("zhengzai!mYT");
String resourcePath = "/Users/hujiachen/Downloads/tmp";
String directory = "com.liquidnet.service.goblin";
String[] dbTableArray = new String[]{
"goblin_marketing_zhengzai_relation"
};
doGenerator(resourcePath, dsc, directory, dbTableArray);
}
}
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