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

Commit 65b18e18 authored by 张国柄's avatar 张国柄

样例,入场人mongo操作;

parent 449c62fd
...@@ -6,24 +6,24 @@ liquidnet: ...@@ -6,24 +6,24 @@ liquidnet:
username: user username: user
password: user123 password: user123
mysql: mysql:
urlHostAndPort: 192.168.31.205:3306 urlHostAndPort: 39.106.122.201:3308
username: liquidnet username: testmall
password: LiquidNet!@#4 password: zhengzai!mYT
rabbitmq: rabbitmq:
host: 192.168.31.205 host: 172.16.2.15
port: 5672 port: 5672
username: liquidnet username: bingbing
password: LiquidNet!@#4 password: 123456
knife4j: knife4j:
disable: false disable: false
redis: redis:
host: 192.168.31.205 host: r-2ze7002ckw5u75fgukpd.redis.rds.aliyuncs.com
port: 6379 port: 6380
password: LiquidNet!@#4 password: PO@B!Iud32
mongodb: mongodb:
host: 192.168.31.205 host: 172.16.3.11
port: 27017 port: 27017
gfsdatabasename: liquidnet_mgdb # gfsdatabasename: liquidnet_mgdb
#以下为各应用需要用到的ip及端口设置 #以下为各应用需要用到的ip及端口设置
#涉及到ip的地方尽量都放入公共变量,方便统一修改 #涉及到ip的地方尽量都放入公共变量,方便统一修改
#以下liquidnet.service.adam.conf.webUrl 对应liquidnet.conf.webUrl 依此类推 #以下liquidnet.service.adam.conf.webUrl 对应liquidnet.conf.webUrl 依此类推
......
...@@ -4,7 +4,8 @@ liquidnet: ...@@ -4,7 +4,8 @@ liquidnet:
switch: false switch: false
info: info:
port: 9001 port: 9001
context: /service-adam context:
# context: /service-adam
name: liquidnet-service-adam name: liquidnet-service-adam
logfile: logfile:
path: ./logs path: ./logs
...@@ -16,26 +17,26 @@ liquidnet: ...@@ -16,26 +17,26 @@ liquidnet:
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level-root: info level-root: info
mysql: mysql:
database-name: liquidnet_adam database-name: ln_adam
mybatis-plus: mybatis-plus:
log-level: debug log-level: debug
conf: # conf:
webUrl: ${liquidnet.service.adam.conf.webUrl} # webUrl: ${liquidnet.service.adam.conf.webUrl}
user: # user:
md5Prefix: liquid # md5Prefix: liquid
md5Suffix: net # md5Suffix: net
des: # des:
key: liquidnet # key: liquidnet
email: # email:
sender: # sender:
host: liquidnet@lightnet.io # host: liquidnet@lightnet.io
password: cbwcimjwiryrshjt # password: cbwcimjwiryrshjt
smtp: smtp.gmail.com # smtp: smtp.gmail.com
login: # login:
time-out: 6000 # time-out: 6000
token: # token:
key: user_token # key: user_token
expire-time: 3000 # expire-time: 3000
#以下为spring各环境个性配置 #以下为spring各环境个性配置
spring: spring:
...@@ -78,7 +79,7 @@ spring: ...@@ -78,7 +79,7 @@ spring:
transportMode: "NIO" transportMode: "NIO"
data: data:
mongodb: mongodb:
uri: mongodb://${liquidnet.mongodb.host}:${liquidnet.mongodb.port}/${liquidnet.mongodb.gfsdatabasename} uri: mongodb://${liquidnet.mongodb.host}:${liquidnet.mongodb.port}/ln_adam_mdb
#本地测试证书 #本地测试证书
sslEnabled: false sslEnabled: false
trustStore: trustStore:
......
...@@ -4,7 +4,8 @@ liquidnet: ...@@ -4,7 +4,8 @@ liquidnet:
switch: false switch: false
info: info:
port: 9001 port: 9001
context: /service-adam context:
# context: /service-adam
name: liquidnet-service-adam name: liquidnet-service-adam
logfile: logfile:
path: ./logs path: ./logs
...@@ -16,26 +17,26 @@ liquidnet: ...@@ -16,26 +17,26 @@ liquidnet:
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level-root: info level-root: info
mysql: mysql:
database-name: liquidnet_adam database-name: ln_adam
mybatis-plus: mybatis-plus:
log-level: debug log-level: info
conf: # conf:
webUrl: ${liquidnet.service.adam.conf.webUrl} # webUrl: ${liquidnet.service.adam.conf.webUrl}
user: # user:
md5Prefix: liquid # md5Prefix: liquid
md5Suffix: net # md5Suffix: net
des: # des:
key: liquidnet # key: liquidnet
email: # email:
sender: # sender:
host: liquidnet@lightnet.io # host: liquidnet@lightnet.io
password: cbwcimjwiryrshjt # password: cbwcimjwiryrshjt
smtp: smtp.gmail.com # smtp: smtp.gmail.com
login: # login:
time-out: 6000 # time-out: 6000
token: # token:
key: user_token # key: user_token
expire-time: 3000 # expire-time: 3000
#以下为spring各环境个性配置 #以下为spring各环境个性配置
spring: spring:
......
...@@ -4,7 +4,8 @@ liquidnet: ...@@ -4,7 +4,8 @@ liquidnet:
switch: false switch: false
info: info:
port: 9001 port: 9001
context: /service-adam context:
# context: /service-adam
name: liquidnet-service-adam name: liquidnet-service-adam
logfile: logfile:
path: ./logs path: ./logs
...@@ -16,26 +17,26 @@ liquidnet: ...@@ -16,26 +17,26 @@ liquidnet:
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level-root: info level-root: info
mysql: mysql:
database-name: liquidnet_adam database-name: ln_adam
mybatis-plus: mybatis-plus:
log-level: debug log-level: debug
conf: # conf:
webUrl: ${liquidnet.service.adam.conf.webUrl} # webUrl: ${liquidnet.service.adam.conf.webUrl}
user: # user:
md5Prefix: liquid # md5Prefix: liquid
md5Suffix: net # md5Suffix: net
des: # des:
key: liquidnet # key: liquidnet
email: # email:
sender: # sender:
host: liquidnet@lightnet.io # host: liquidnet@lightnet.io
password: cbwcimjwiryrshjt # password: cbwcimjwiryrshjt
smtp: smtp.gmail.com # smtp: smtp.gmail.com
login: # login:
time-out: 6000 # time-out: 6000
token: # token:
key: user_token # key: user_token
expire-time: 3000 # expire-time: 3000
#以下为spring各环境个性配置 #以下为spring各环境个性配置
spring: spring:
......
...@@ -13,23 +13,19 @@ knife4j: ...@@ -13,23 +13,19 @@ knife4j:
password: ${liquidnet.security.password} password: ${liquidnet.security.password}
# ----------------------------------------------------------- # -----------------------------------------------------------
logging: logging:
config: ${liquidnet.logfile.config} # config: ${liquidnet.logfile.config}
# file: file:
# name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
# max-size: 200MB max-size: 200MB
# pattern: pattern:
# file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
# console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
# rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
# level: level:
# root: info root: info
# #以下是为指定包设置日志级别 #以下是为指定包设置日志级别
# com: com:
# liquidnet: liquidnet: info
# service:
# adam:
# mapper: ${liquidnet.mybatis-plus.log-level}
# liquidnet: info
# ----------------------------------------------------------- # -----------------------------------------------------------
eureka: eureka:
# client: # client:
...@@ -60,17 +56,24 @@ mybatis-plus: ...@@ -60,17 +56,24 @@ mybatis-plus:
# ----------------------------------------------------------- # -----------------------------------------------------------
spring: spring:
application: application:
name: liquidnet-service-adam name: ${liquidnet.info.name}
servlet: servlet:
multipart: multipart:
max-file-size: 5MB max-file-size: 5MB
max-request-size: 10MB max-request-size: 10MB
profiles: profiles:
include: common-service #这里加载management相关公共配置 include: common-service #这里加载management相关公共配置
autoconfigure: rabbitmq:
exclude: org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,org.springframework.cloud.bus.BusAutoConfiguration addresses: ${liquidnet.rabbitmq.host}
port: ${liquidnet.rabbitmq.port}
username: ${liquidnet.rabbitmq.username}
password: ${liquidnet.rabbitmq.password}
data:
mongodb:
uri: mongodb://${liquidnet.mongodb.host}:${liquidnet.mongodb.port}/${liquidnet.mongodb.gfsdatabasename}
sslEnabled: false
datasource: datasource:
name: liquidnet_bus_db name: ${liquidnet.mysql.database-name}
url: jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false url: jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false
username: ${liquidnet.mysql.username} username: ${liquidnet.mysql.username}
password: ${liquidnet.mysql.password} password: ${liquidnet.mysql.password}
...@@ -89,14 +92,14 @@ spring: ...@@ -89,14 +92,14 @@ spring:
testOnReturn: false testOnReturn: false
poolPreparedStatements: true poolPreparedStatements: true
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
mvc: # mvc:
static-path-pattern: /templates/** # static-path-pattern: /templates/**
# 定位模板的目录 # # 定位模板的目录
view: # view:
prefix: classpath:/templates/ # prefix: classpath:/templates/
suffix: .html # suffix: .html
resources: # resources:
static-locations: classpath:/templates/,classpath:/static/page # static-locations: classpath:/templates/,classpath:/static/page
# ----------------------------------------------------------- # -----------------------------------------------------------
# ----------------------------------------------------------- # -----------------------------------------------------------
liquidnet:
system:
updating:
switch: false
info:
port: 9001
context:
# context: /service-kylin
name: liquidnet-service-kylin
logfile:
path: ./logs
name: service-kylin
config: classpath:logback-spring.xml
file-max-size: 200MB
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level-root: info
mysql:
database-name: ln_kylin
mybatis-plus:
log-level: debug
# conf:
# webUrl: ${liquidnet.service.kylin.conf.webUrl}
# user:
# md5Prefix: liquid
# md5Suffix: net
# des:
# key: liquidnet
# email:
# sender:
# host: liquidnet@lightnet.io
# password: cbwcimjwiryrshjt
# smtp: smtp.gmail.com
# login:
# time-out: 6000
# token:
# key: user_token
# expire-time: 3000
#以下为spring各环境个性配置
spring:
rabbitmq:
addresses: ${liquidnet.rabbitmq.host}
port: ${liquidnet.rabbitmq.port}
username: ${liquidnet.rabbitmq.username}
password: ${liquidnet.rabbitmq.password}
redis:
port: ${liquidnet.redis.port}
host: ${liquidnet.redis.host}
password: ${liquidnet.redis.password}
lettuce:
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
redisson:
singleServerConfig:
address: redis://${liquidnet.redis.host}:${liquidnet.redis.port}
password: ${liquidnet.redis.password}
clientName: null
database: 7 #选择使用哪个数据库0~15
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
subscriptionsPerConnection: 5
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
connectionMinimumIdleSize: 32
connectionPoolSize: 64
dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
codec:
class: "org.redisson.codec.JsonJacksonCodec"
transportMode: "NIO"
data:
mongodb:
uri: mongodb://${liquidnet.mongodb.host}:${liquidnet.mongodb.port}/ln_kylin_mdb
#本地测试证书
sslEnabled: false
trustStore:
trustStorePassword:
# uri: mongodb://smartnet:a43ljKmK8oqdOO902P@smartnet-nonprod-docdb-docdb.cluster-cgjsqu7tuka2.ap-southeast-1.docdb.amazonaws.com:27017/liquidnet_mgdb?ssl=true&ssl_ca_certs=/Users/anjiabin/Downloads/rds-combined-ca-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false
server:
port: ${liquidnet.info.port}
tomcat:
uri-encoding: UTF-8
servlet:
context-path: ${liquidnet.info.context}
# -----------------------------------------------------------
knife4j:
production: ${liquidnet.knife4j.disable}
basic:
enable: true
username: ${liquidnet.security.username}
password: ${liquidnet.security.password}
# -----------------------------------------------------------
logging:
# config: ${liquidnet.logfile.config}
file:
name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
max-size: 200MB
pattern:
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level:
root: info
#以下是为指定包设置日志级别
com:
liquidnet: info
# -----------------------------------------------------------
eureka:
# client:
# register-with-eureka: true
# fetch-registry: true
# serviceUrl:
# defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
instance:
hostname: ${spring.cloud.client.ip-address}
lease-expiration-duration-in-seconds: 15 #服务过期时间配置,超过这个时间没有接收到心跳EurekaServer就会将这个实例剔除
lease-renewal-interval-in-seconds: 5 #服务刷新时间配置,每隔这个时间会主动心跳一次
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}}
# -----------------------------------------------------------
#actuator/info
info:
app:
name: ${liquidnet.info.name}
company:
name: lightnet.io
build:
groupId: '@project.groupId@'
artifactId: '@project.artifactId@'
version: '@project.version@'
# -----------------------------------------------------------
mybatis-plus:
mapper-locations: classpath:com.liquidnet.service.kylin.mapper/*Mapper.xml
# -----------------------------------------------------------
spring:
application:
name: ${liquidnet.info.name}
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
profiles:
include: common-service #这里加载management相关公共配置
rabbitmq:
addresses: ${liquidnet.rabbitmq.host}
port: ${liquidnet.rabbitmq.port}
username: ${liquidnet.rabbitmq.username}
password: ${liquidnet.rabbitmq.password}
data:
mongodb:
uri: mongodb://${liquidnet.mongodb.host}:${liquidnet.mongodb.port}/ln_kylin_mdb
sslEnabled: false
datasource:
name: ${liquidnet.mysql.database-name}
url: jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false
username: ${liquidnet.mysql.username}
password: ${liquidnet.mysql.password}
# type: org.apache.tomcat.jdbc.pool.DataSource
driver-class-name: com.mysql.cj.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
# mvc:
# static-path-pattern: /templates/**
# # 定位模板的目录
# view:
# prefix: classpath:/templates/
# suffix: .html
# resources:
# static-locations: classpath:/templates/,classpath:/static/page
# -----------------------------------------------------------
# -----------------------------------------------------------
package com.liquidnet.service.adam.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "AdamEntersParam", description = "添加入场人参数")
@Data
public class AdamEntersParam implements java.io.Serializable {
private static final long serialVersionUID = 5940725094369061032L;
@ApiModelProperty(position = 10, required = true, value = "入场人名称[50]", example = "Swagger")
private String name;
@ApiModelProperty(position = 11, required = true, value = "入场人手机号[11]", example = "13100000000")
private String mobile;
@ApiModelProperty(position = 12, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5")
private Integer type;
@ApiModelProperty(position = 13, required = true, value = "入场人证件号[11]", example = "110101110001010111")
private String idCard;
@ApiModelProperty(position = 13, required = true, value = "是否是默认入场人:0-否,1-是", allowableValues = "0,1")
private Boolean isDefault;
}
package com.liquidnet.service.adam.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.adam.entity.AdamEnters;
/**
* <p>
* 入场人 服务类
* </p>
*
* @author liquidnet
* @since 2021-04-28
*/
public interface IAdamEntersService extends IService<AdamEnters> {
boolean add(AdamEnters info);
AdamEnters query(Integer id);
}
...@@ -93,7 +93,7 @@ public class MybatisPlusCodeGenerator { ...@@ -93,7 +93,7 @@ public class MybatisPlusCodeGenerator {
dsc.setUsername("testmall"); dsc.setUsername("testmall");
dsc.setPassword("zhengzai!mYT"); dsc.setPassword("zhengzai!mYT");
String resourcePath = "/Users/zhanggb/IdeaProjects/liquidnet-bus-v1/liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-do"; String resourcePath = "/Users/zhanggb/Downloads/tmp";
String directory = "com.liquidnet.service.adam"; String directory = "com.liquidnet.service.adam";
String[] dbTableArray = new String[]{"adam_enters"}; String[] dbTableArray = new String[]{"adam_enters"};
......
package com.liquidnet.service.adam.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 入场人
* </p>
*
* @author liquidnet
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class AdamEnters implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Integer mid;
/**
* 用户id
*/
private String uid;
/**
* 1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private Integer type;
/**
* 入场人名称
*/
private String name;
/**
* 入场人手机号
*/
private String mobile;
/**
* 入场人身份号码,或护照号码
*/
private String idCard;
/**
* 是否是默认入场人:0-否,1-是,客户第一个入场人默认1
*/
private Boolean isDefault;
/**
* 状态:0-INIT,1-NORMAL,2-INVALID
*/
private Integer state;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
private LocalDateTime deletedAt;
private String comment;
}
package com.liquidnet.service.adam.mapper;
import com.liquidnet.service.adam.entity.AdamEnters;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 入场人 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-04-28
*/
public interface AdamEntersMapper extends BaseMapper<AdamEnters> {
}
<?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="com.liquidnet.service.adam.mapper.AdamEntersMapper">
</mapper>
...@@ -5,7 +5,7 @@ use ln_adam; ...@@ -5,7 +5,7 @@ use ln_adam;
drop table if exists adam_third_party; drop table if exists adam_third_party;
create table adam_third_party create table adam_third_party
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) default '', uid varchar(64) default '',
open_id varchar(64) comment '第三方ID', open_id varchar(64) comment '第三方ID',
avatar varchar(255) comment '第三方头像', avatar varchar(255) comment '第三方头像',
...@@ -20,7 +20,7 @@ create index idx_adam_third_party_open_id on adam_third_party (uid); ...@@ -20,7 +20,7 @@ create index idx_adam_third_party_open_id on adam_third_party (uid);
drop table if exists adam_login; drop table if exists adam_login;
create table adam_login create table adam_login
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
mobile varchar(16), mobile varchar(16),
platform varchar(20) comment '平台名称', platform varchar(20) comment '平台名称',
entrance varchar(20) comment '入口标记:Wechat、H5、App', entrance varchar(20) comment '入口标记:Wechat、H5、App',
...@@ -35,7 +35,7 @@ create index idx_adam_login_mobile on adam_login (mobile); ...@@ -35,7 +35,7 @@ create index idx_adam_login_mobile on adam_login (mobile);
drop table if exists adam_device_tokens; drop table if exists adam_device_tokens;
create table adam_device_token create table adam_device_token
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) not null, uid varchar(64) not null,
# user_id varchar(255) null, # user_id varchar(255) null,
android varchar(255) null, android varchar(255) null,
...@@ -49,7 +49,7 @@ create table adam_device_token ...@@ -49,7 +49,7 @@ create table adam_device_token
drop table if exists adam_user; drop table if exists adam_user;
create table adam_user create table adam_user
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) not null, uid varchar(64) not null,
mobile varchar(16) not null, mobile varchar(16) not null,
passwd varchar(64), passwd varchar(64),
...@@ -66,7 +66,7 @@ create unique index uidx_adam_user_uid on adam_user (uid); ...@@ -66,7 +66,7 @@ create unique index uidx_adam_user_uid on adam_user (uid);
drop table if exists adam_user_info_zz; drop table if exists adam_user_info_zz;
create table adam_user_info_zz create table adam_user_info_zz
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) not null, uid varchar(64) not null,
nick_name varchar(32) comment '昵称', nick_name varchar(32) comment '昵称',
sex varchar(32) comment '性别', sex varchar(32) comment '性别',
...@@ -84,40 +84,43 @@ create unique index idx_adam_user_info_zz_uid on adam_user_info_zz (uid); ...@@ -84,40 +84,43 @@ create unique index idx_adam_user_info_zz_uid on adam_user_info_zz (uid);
drop table if exists adam_real_name; drop table if exists adam_real_name;
create table adam_real_name create table adam_real_name
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) not null, uid varchar(64) not null,
type enum ('1','2','3','4','5') not null default '1' comment '1大陆身份证 2港澳通行证 3台胞证 4护照 5军官证', type enum ('1','2','3','4','5') not null default '1' comment '1大陆身份证 2港澳通行证 3台胞证 4护照 5军官证',
name varchar(20) not null comment '真实姓名', name varchar(20) not null comment '真实姓名',
id_card varchar(30) not null comment '证件号码', id_card varchar(30) not null comment '证件号码',
state tinyint not null comment '0-INIT,1-NORMAL,2-INVALID', state tinyint not null comment '0-INIT,1-NORMAL,2-INVALID',
created_at datetime not null, created_at datetime not null,
updated_at datetime updated_at datetime,
comment text
) engine = InnoDB comment '实名信息'; ) engine = InnoDB comment '实名信息';
create unique index idx_adam_real_name_uid on adam_real_name (uid); create unique index idx_adam_real_name_uid on adam_real_name (uid);
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_enters; drop table if exists adam_enters;
create table adam_enters create table adam_enters
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
# `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id', # `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
uid varchar(64) not null comment '用户id', enters_id varchar(64) not null comment,
type enum ('1','2','3','4','5') not null default '1' comment '1大陆身份证 2港澳通行证 3台胞证 4护照 5军官证', uid varchar(64) not null comment '用户id',
name varchar(50) not null default '' comment '入场人名称', type tinyint not null default '1' comment '1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证',
mobile varchar(20) not null default '' comment '入场人手机', name varchar(50) not null default '' comment '入场人名称',
id_card varchar(20) not null default '' comment '入场人身份号码,或护照号码', mobile varchar(20) not null default '' comment '入场人手机号',
is_default enum ('yes','no') not null default 'no' comment '是否是默认入场人,客户的第一个入场人需默认yes', id_card varchar(20) not null default '' comment '入场人身份号码,或护照号码',
is_default boolean not null default false comment '是否是默认入场人:0-否,1-是,客户第一个入场人默认1',
# is_certification enum ('yes','no') not null default 'no' comment '入场人的身份证号是否认证', # is_certification enum ('yes','no') not null default 'no' comment '入场人的身份证号是否认证',
state tinyint not null comment '状态:0-INIT,1-NORMAL,2-INVALID', state tinyint not null comment '状态:0-INIT,1-NORMAL,2-INVALID',
created_at datetime not null, created_at datetime not null,
updated_at datetime, updated_at datetime,
deleted_at datetime deleted_at datetime,
comment text
) engine = InnoDB comment ='入场人'; ) engine = InnoDB comment ='入场人';
create index idx_adam_enters_uid on adam_enters (uid); create index idx_adam_enters_uid on adam_enters (uid);
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_addresses; drop table if exists adam_addresses;
create table adam_addresses create table adam_addresses
( (
id int unsigned auto_increment not null primary key, mid int unsigned auto_increment not null primary key,
# `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id关联', # `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id关联',
# `string_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '用户StringID', # `string_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '用户StringID',
uid varchar(64) not null, uid varchar(64) not null,
...@@ -137,7 +140,7 @@ create index idx_adam_addresses_uid on adam_addresses (uid); ...@@ -137,7 +140,7 @@ create index idx_adam_addresses_uid on adam_addresses (uid);
drop table if exists adam_feedback; drop table if exists adam_feedback;
create table adam_feedback create table adam_feedback
( (
id int unsigned auto_increment not null primary key, mid int unsigned auto_increment not null primary key,
uid varchar(64) not null, uid varchar(64) not null,
type enum ('complaints', 'bug', 'order', 'video', 'other') not null comment '反馈类型', type enum ('complaints', 'bug', 'order', 'video', 'other') not null comment '反馈类型',
comment varchar(255) not null comment '反馈内容', comment varchar(255) not null comment '反馈内容',
...@@ -157,7 +160,7 @@ create table adam_feedback ...@@ -157,7 +160,7 @@ create table adam_feedback
drop table if exists adam_collection; drop table if exists adam_collection;
create table adam_collection create table adam_collection
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) not null, uid varchar(64) not null,
duration bigint default 0 null, duration bigint default 0 null,
content_id int unsigned, content_id int unsigned,
...@@ -173,7 +176,7 @@ create index idx_adam_collection_uid on adam_collection (uid); ...@@ -173,7 +176,7 @@ create index idx_adam_collection_uid on adam_collection (uid);
drop table if exists adam_disposed; drop table if exists adam_disposed;
create table adam_disposed create table adam_disposed
( (
id int unsigned auto_increment not null primary key, mid int unsigned auto_increment not null primary key,
uid varchar(64) not null, uid varchar(64) not null,
# nickname varchar(32) default '', # nickname varchar(32) default '',
# avatar varchar(255) default '', # avatar varchar(255) default '',
...@@ -191,7 +194,7 @@ create index idx_adam_disposed_content on adam_disposed (content_id); ...@@ -191,7 +194,7 @@ create index idx_adam_disposed_content on adam_disposed (content_id);
drop table if exists adam_member; drop table if exists adam_member;
create table adam_member create table adam_member
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
name varchar(64), name varchar(64),
title varchar(100), title varchar(100),
icon varchar(255), icon varchar(255),
...@@ -213,7 +216,7 @@ create table adam_member ...@@ -213,7 +216,7 @@ create table adam_member
drop table if exists adam_member_order; drop table if exists adam_member_order;
create table adam_member_order create table adam_member_order
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
order_no varchar(64), order_no varchar(64),
uid varchar(64), uid varchar(64),
mode tinyint comment '购买方式:1-buy,2-code', mode tinyint comment '购买方式:1-buy,2-code',
...@@ -236,7 +239,7 @@ create table adam_member_order ...@@ -236,7 +239,7 @@ create table adam_member_order
drop table if exists adam_user_member; drop table if exists adam_user_member;
create table adam_user_member create table adam_user_member
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
uid varchar(64) not null, uid varchar(64) not null,
member_no int unsigned not null, member_no int unsigned not null,
state tinyint comment '1-NORMAL,2-INVALID', state tinyint comment '1-NORMAL,2-INVALID',
...@@ -248,7 +251,7 @@ create table adam_user_member ...@@ -248,7 +251,7 @@ create table adam_user_member
drop table if exists adam_member_code; drop table if exists adam_member_code;
create table adam_member_code create table adam_member_code
( (
id int unsigned auto_increment primary key, mid int unsigned auto_increment primary key,
code varchar(20) comment '会员码', code varchar(20) comment '会员码',
member_id int unsigned comment '会员ID', member_id int unsigned comment '会员ID',
member_no varchar(20) comment '预留会员号', member_no varchar(20) comment '预留会员号',
......
package com.liquidnet.service.adam.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.service.ResponseDto;
import com.liquidnet.service.adam.dto.AdamEntersParam;
import com.liquidnet.service.adam.entity.AdamEnters;
import com.liquidnet.service.adam.service.IAdamEntersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
/**
* <p>
* 入场人 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-04-28
*/
@Api(tags = "入场人")
@Slf4j
@RestController
@RequestMapping("/enters")
public class AdamEntersController {
@Autowired
IAdamEntersService adamEntersService;
@ApiOperationSupport(order = 1)
@ApiOperation(value = "添加入场人")
@PostMapping("add")
public ResponseDto<Object> add(@RequestBody AdamEntersParam parameter) {
// TODO: 2021/4/28 数据校验,身份认证
AdamEnters addInfo = new AdamEnters();
BeanUtils.copyProperties(parameter, addInfo);
addInfo.setCreatedAt(LocalDateTime.now());
addInfo.setState(1);
return adamEntersService.add(addInfo) ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 2)
@ApiOperation(value = "入场人详情")
@PostMapping("query/{id}")
public ResponseDto<Object> query(@PathVariable int id) {
// TODO: 2021/4/28 校验
return ResponseDto.success(adamEntersService.query(id));
}
}
package com.liquidnet.service.adam.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.service.adam.entity.AdamEnters;
import com.liquidnet.service.adam.mapper.AdamEntersMapper;
import com.liquidnet.service.adam.service.IAdamEntersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
/**
* <p>
* 入场人 服务实现类
* </p>
*
* @author liquidnet
* @since 2021-04-28
*/
@Service
public class AdamEntersServiceImpl extends ServiceImpl<AdamEntersMapper, AdamEnters> implements IAdamEntersService {
@Autowired
MongoTemplate mongoTemplate;
@Override
public boolean add(AdamEnters info) {
// TODO: 2021/4/28 同步REDIS
Collection<AdamEnters> insertRst = mongoTemplate.insert(Collections.singletonList(info), AdamEnters.class.getSimpleName());
// TODO: 2021/4/28 放入MQ
return true;
}
@Override
public AdamEnters query(Integer id) {
AdamEnters info = null;
// TODO: 2021/4/28 REDIS:QUERY
info = mongoTemplate.findOne(Query.query(Criteria.where("state").is(id)), AdamEnters.class, AdamEnters.class.getSimpleName());
return info;
}
}
...@@ -15,10 +15,10 @@ liquidnet: ...@@ -15,10 +15,10 @@ liquidnet:
rabbitmq: rabbitmq:
host: 127.0.0.1 host: 127.0.0.1
port: 5672 port: 5672
username: hujiachen username: admin
password: hujiachen123 password: admin
config: config:
location: /Users/hujiachen/JavaProject/liquidnet-bus-v1/liquidnet-bus-config/liquidnet-config location: /Users/zhanggb/IdeaProjects/liquidnet-bus-v1/liquidnet-bus-config/liquidnet-config
# end-dev-这里是配置信息基本值 # end-dev-这里是配置信息基本值
spring: spring:
......
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