parent
cd6ac9a0ac
commit
7ceadc3968
@ -0,0 +1,10 @@
|
||||
package com.luoo.user.dao;
|
||||
|
||||
import com.luoo.user.pojo.Lottery;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface LotteryDao extends JpaRepository<Lottery, String>,
|
||||
JpaSpecificationExecutor<Lottery> {
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.luoo.user.dao;
|
||||
|
||||
import com.luoo.user.pojo.LotteryRegion;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface LotteryRegionDao extends JpaRepository<LotteryRegion, String>,
|
||||
JpaSpecificationExecutor<LotteryRegion> {
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.luoo.user.dao;
|
||||
|
||||
import com.luoo.user.pojo.LotteryUser;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface LotteryUserDao extends JpaRepository<LotteryUser, String>,
|
||||
JpaSpecificationExecutor<LotteryUser> {
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.luoo.user.dao;
|
||||
|
||||
import com.luoo.user.pojo.Region;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface RegionDao extends JpaRepository<Region, String>,
|
||||
JpaSpecificationExecutor<Region> {
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.luoo.user.pojo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.Instant;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Builder
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tb_lottery")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class Lottery {
|
||||
|
||||
@Id
|
||||
@Size(max = 20)
|
||||
@Column(name = "id", nullable = false, length = 20)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "code", length = 50)
|
||||
@ApiModelProperty(value = "抽奖编码")
|
||||
private String code;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "title")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
@Column(name = "participant")
|
||||
@ApiModelProperty(value = "可参加人员 1-全部 2-全部会员 3-永久会员 4-贡献者")
|
||||
private Integer participant;
|
||||
|
||||
@Column(name = "point")
|
||||
@ApiModelProperty(value = "积分")
|
||||
private Integer point;
|
||||
|
||||
@Column(name = "apply_start_time")
|
||||
@ApiModelProperty(value = "报名开始时间")
|
||||
private Instant applyStartTime;
|
||||
|
||||
@Column(name = "apply_end_time")
|
||||
@ApiModelProperty(value = "报名结束时间")
|
||||
private Instant applyEndTime;
|
||||
|
||||
@Column(name = "way")
|
||||
@ApiModelProperty(value = "抽奖方式 1-自动抽奖 2-手动抽奖")
|
||||
private Integer way;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "image")
|
||||
@ApiModelProperty(value = "抽奖封面url")
|
||||
private String image;
|
||||
|
||||
@Lob
|
||||
@Column(name = "description")
|
||||
@ApiModelProperty(value = "抽奖描述")
|
||||
private String description;
|
||||
|
||||
@Column(name = "status")
|
||||
@ApiModelProperty(value = "抽奖状态 1-报名中 2-已抽奖 3-已停止")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "create_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Instant updateTime;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "create_user", length = 20)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createUser;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "update_user", length = 20)
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateUser;
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.luoo.user.pojo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.Instant;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Builder
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tb_lottery_region")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class LotteryRegion {
|
||||
|
||||
@Id
|
||||
@Size(max = 20)
|
||||
@Column(name = "id", nullable = false, length = 20)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@Size(max = 20)
|
||||
@NotNull
|
||||
@Column(name = "lottery_id", nullable = false, length = 20)
|
||||
@ApiModelProperty(value = "抽奖id")
|
||||
private String lotteryId;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "region_id", nullable = false)
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Integer regionId;
|
||||
|
||||
@Column(name = "num")
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer num;
|
||||
|
||||
@Column(name = "create_time")
|
||||
@ApiModelProperty("创建时间")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
@ApiModelProperty("修改时间")
|
||||
private Instant updateTime;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "create_user", length = 20)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createUser;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "update_user", length = 20)
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateUser;
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.luoo.user.pojo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.Instant;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Builder
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tb_lottery_user")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class LotteryUser {
|
||||
|
||||
@Id
|
||||
@Size(max = 20)
|
||||
@Column(name = "id", nullable = false, length = 20)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@Size(max = 20)
|
||||
@NotNull
|
||||
@Column(name = "lottery_id", nullable = false, length = 20)
|
||||
@ApiModelProperty(value = "抽奖id")
|
||||
private String lotteryId;
|
||||
|
||||
@Size(max = 20)
|
||||
@NotNull
|
||||
@Column(name = "user_id", nullable = false, length = 20)
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "region_id", nullable = false)
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Integer regionId;
|
||||
|
||||
@Column(name = "result")
|
||||
@ApiModelProperty(value = "抽奖结果 1-中奖 2-未中奖")
|
||||
private Integer result;
|
||||
|
||||
@Column(name = "create_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Instant updateTime;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "create_user", length = 20)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createUser;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "update_user", length = 20)
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateUser;
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.luoo.user.pojo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Builder
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tb_region")
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class Region {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "父id")
|
||||
@Column(name = "pid")
|
||||
private Integer pid;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "简称")
|
||||
@Column(name = "shortname", length = 100)
|
||||
private String shortname;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "名称")
|
||||
@Column(name = "name", length = 100)
|
||||
private String name;
|
||||
|
||||
@Size(max = 255)
|
||||
@ApiModelProperty(value = "全称")
|
||||
@Column(name = "merger_name")
|
||||
private String mergerName;
|
||||
|
||||
@Column(name = "level")
|
||||
@ApiModelProperty(value = "层级 1 2 3 省市区县")
|
||||
private Integer level;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "拼音")
|
||||
@Column(name = "pinyin", length = 100)
|
||||
private String pinyin;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "长途区号")
|
||||
@Column(name = "code", length = 100)
|
||||
private String code;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "邮编")
|
||||
@Column(name = "zip_code", length = 100)
|
||||
private String zipCode;
|
||||
|
||||
@Size(max = 50)
|
||||
@ApiModelProperty(value = "首字母")
|
||||
@Column(name = "first", length = 50)
|
||||
private String first;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "经度")
|
||||
@Column(name = "lng", length = 100)
|
||||
private String lng;
|
||||
|
||||
@Size(max = 100)
|
||||
@ApiModelProperty(value = "纬度")
|
||||
@Column(name = "lat", length = 100)
|
||||
private String lat;
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.luoo.user.service;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @program: luoo_parent
|
||||
* @description: 抽奖
|
||||
* @author: yawei.huang
|
||||
* @create: 2024-07-30 09:30
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LotteryService {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.luoo.user.service;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @program: luoo_parent
|
||||
* @description: 地区
|
||||
* @author: yawei.huang
|
||||
* @create: 2024-07-30 09:30
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RegionService {
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
create table tb_lottery
|
||||
(
|
||||
id varchar(20) not null comment 'id'
|
||||
primary key,
|
||||
code varchar(50) null comment '抽奖码',
|
||||
title varchar(255) null comment '抽奖标题',
|
||||
participant int null comment '可参加人员 1-全部 2-全部会员 3-永久会员 4-贡献者 5-音乐人',
|
||||
point int null comment '消耗积分',
|
||||
apply_start_time datetime null comment '报名开始时间',
|
||||
apply_end_time datetime null comment '报名结束时间',
|
||||
way tinyint null comment '抽奖方式 1-自动抽奖 2-手动抽奖',
|
||||
image varchar(255) null comment '抽奖封面url',
|
||||
description longtext null comment '演出详情',
|
||||
status tinyint null comment '抽奖状态 1-报名中 2-已抽奖 3-已停止',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_time datetime null comment '修改时间',
|
||||
create_user varchar(20) null comment '创建人',
|
||||
update_user varchar(20) null comment '修改人'
|
||||
) comment '抽奖表';
|
||||
|
||||
|
||||
create table tb_lottery_region
|
||||
(
|
||||
id varchar(20) not null comment 'id'
|
||||
primary key,
|
||||
lottery_id varchar(20) not null comment '抽奖id',
|
||||
region_id int not null comment '地区id',
|
||||
num int null comment '抽奖人数',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_time datetime null comment '修改时间',
|
||||
create_user varchar(20) null comment '创建人',
|
||||
update_user varchar(20) null comment '修改人'
|
||||
) comment '抽奖地区表';
|
||||
|
||||
|
||||
create table tb_lottery_user
|
||||
(
|
||||
id varchar(20) not null comment 'id'
|
||||
primary key,
|
||||
lottery_id varchar(20) not null comment '抽奖id',
|
||||
user_id varchar(20) not null comment '用户id',
|
||||
region_id int not null comment '地区id',
|
||||
result tinyint null comment '抽奖结果 0-未中奖 1-中奖',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_time datetime null comment '修改时间',
|
||||
create_user varchar(20) null comment '创建人',
|
||||
update_user varchar(20) null comment '修改人'
|
||||
) comment '抽奖用户表';
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue