Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KnowledgePlanet
road-map
xfg-frame-archetype-lite
提交
a75995b6
xfg-frame-archetype-lite
项目概览
KnowledgePlanet
/
road-map
/
xfg-frame-archetype-lite
通知
1157
Star
58
Fork
71
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
xfg-frame-archetype-lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a75995b6
编写于
11月 13, 2024
作者:
鲸落和鲨掉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
基础层 持久化搭建
上级
4b7910e3
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
329 addition
and
14 deletion
+329
-14
.idea/dataSources.xml
.idea/dataSources.xml
+17
-0
.idea/misc.xml
.idea/misc.xml
+1
-1
xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml
...archetype-lite-app/src/main/resources/application-dev.yml
+5
-5
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/award_mapper.xml
...te-app/src/main/resources/mybatis/mapper/award_mapper.xml
+23
-0
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_award_mapper.xml
...c/main/resources/mybatis/mapper/strategy_award_mapper.xml
+27
-0
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_mapper.xml
...app/src/main/resources/mybatis/mapper/strategy_mapper.xml
+20
-0
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_rule_mapper.xml
...rc/main/resources/mybatis/mapper/strategy_rule_mapper.xml
+24
-0
xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/infrastructure/AwardDaoTest.java
...st/java/cn/bugstack/test/infrastructure/AwardDaoTest.java
+34
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IAwardDao.java
...c/main/java/cn/bugstack/infrastructure/dao/IAwardDao.java
+11
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java
...ava/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java
+10
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyDao.java
...ain/java/cn/bugstack/infrastructure/dao/IStrategyDao.java
+10
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyRuleDao.java
...java/cn/bugstack/infrastructure/dao/IStrategyRuleDao.java
+10
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/package-info.java
...ain/java/cn/bugstack/infrastructure/dao/package-info.java
+0
-4
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Award.java
...rc/main/java/cn/bugstack/infrastructure/dao/po/Award.java
+31
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Strategy.java
...main/java/cn/bugstack/infrastructure/dao/po/Strategy.java
+31
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyAward.java
...java/cn/bugstack/infrastructure/dao/po/StrategyAward.java
+41
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyRule.java
.../java/cn/bugstack/infrastructure/dao/po/StrategyRule.java
+34
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/package-info.java
.../java/cn/bugstack/infrastructure/dao/po/package-info.java
+0
-4
未找到文件。
.idea/dataSources.xml
0 → 100644
浏览文件 @
a75995b6
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"DataSourceManagerImpl"
format=
"xml"
multifile-model=
"true"
>
<data-source
source=
"LOCAL"
name=
"@localhost"
uuid=
"89d79d04-f01a-429a-bc28-702ce779f991"
>
<driver-ref>
mysql.8
</driver-ref>
<synchronize>
true
</synchronize>
<jdbc-driver>
com.mysql.cj.jdbc.Driver
</jdbc-driver>
<jdbc-url>
jdbc:mysql://localhost:13306
</jdbc-url>
<jdbc-additional-properties>
<property
name=
"com.intellij.clouds.kubernetes.db.host.port"
/>
<property
name=
"com.intellij.clouds.kubernetes.db.enabled"
value=
"false"
/>
<property
name=
"com.intellij.clouds.kubernetes.db.container.port"
/>
</jdbc-additional-properties>
<working-dir>
$ProjectFileDir$
</working-dir>
</data-source>
</component>
</project>
\ No newline at end of file
.idea/misc.xml
浏览文件 @
a75995b6
...
...
@@ -8,5 +8,5 @@
</list>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_
21"
default=
"true"
project-jdk-name=
"21
"
project-jdk-type=
"JavaSDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_
1_8"
default=
"true"
project-jdk-name=
"1.8
"
project-jdk-type=
"JavaSDK"
/>
</project>
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml
浏览文件 @
a75995b6
...
...
@@ -17,7 +17,7 @@ spring:
datasource
:
username
:
root
password
:
123456
url
:
jdbc:mysql://127.0.0.1:
3306/xfg_frame_archetype
?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
url
:
jdbc:mysql://127.0.0.1:
13306/big_market
?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
driver-class-name
:
com.mysql.cj.jdbc.Driver
hikari
:
pool-name
:
Retail_HikariCP
...
...
@@ -29,10 +29,10 @@ spring:
connection-timeout
:
30000
#数据库连接超时时间,默认30秒,即30000
connection-test-query
:
SELECT
1
type
:
com.zaxxer.hikari.HikariDataSource
#
mybatis:
#
mapper-locations: classpath:/mybatis/mapper/*.xml
#
config-location: classpath:/mybatis/config/mybatis-config.xml
#Mybatis配置
mybatis
:
mapper-locations
:
classpath:/mybatis/mapper/*.xml
config-location
:
classpath:/mybatis/config/mybatis-config.xml
# 日志
logging
:
...
...
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/
frame_case
_mapper.xml
→
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/
award
_mapper.xml
浏览文件 @
a75995b6
<?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=
"cn.bugstack.infrastructure.
redis.dao.Xxx
"
>
<mapper
namespace=
"cn.bugstack.infrastructure.
dao.IAwardDao
"
>
<resultMap
id=
"
CaseMap"
type=
"cn.bugstack.infrastructure.redis.po.A
"
>
<resultMap
id=
"
dataMap"
type=
"cn.bugstack.infrastructure.dao.po.Award
"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"award_id"
property=
"awardId"
/>
<result
column=
"award_key"
property=
"awardKey"
/>
<result
column=
"award_config"
property=
"awardConfig"
/>
<result
column=
"award_desc"
property=
"awardDesc"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<insert
id=
"insert"
parameterType=
"cn.bugstack.infrastructure.redis.po.A"
>
INSERT INTO table(a,b,c) VALUES(#{a}, #{b}, #{c})
</insert>
<update
id=
"update"
parameterType=
"cn.bugstack.infrastructure.redis.po.A"
>
UPDATE table SET a = #{a} WHERE b = #{b}
</update>
</resultMap>
<select
id=
"query
EmployeeByEmployNumber"
parameterType=
"java.lang.String"
resultMap=
"Case
Map"
>
SELECT a, b,
c
FROM table
WHERE a = #{a}
<select
id=
"query
AwardList"
resultMap=
"data
Map"
>
select award_id, award_key, award_config, award_des
c
from award
limit 10
</select>
</mapper>
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_award_mapper.xml
0 → 100644
浏览文件 @
a75995b6
<?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=
"cn.bugstack.infrastructure.dao.IStrategyAwardDao"
>
<resultMap
id=
"dataMap"
type=
"cn.bugstack.infrastructure.dao.po.StrategyAward"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"strategy_id"
property=
"strategyId"
/>
<result
column=
"award_id"
property=
"awardId"
/>
<result
column=
"award_title"
property=
"awardTitle"
/>
<result
column=
"award_subtitle"
property=
"awardSubtitle"
/>
<result
column=
"award_count"
property=
"awardCount"
/>
<result
column=
"award_count_surplus"
property=
"awardCountSurplus"
/>
<result
column=
"award_rate"
property=
"awardRate"
/>
<result
column=
"rule_models"
property=
"ruleModels"
/>
<result
column=
"sort"
property=
"sort"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<select
id=
"queryStrategyAwardList"
resultMap=
"dataMap"
>
select strategy_id
from strategy_award
limit 10
</select>
</mapper>
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_mapper.xml
0 → 100644
浏览文件 @
a75995b6
<?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=
"cn.bugstack.infrastructure.dao.IStrategyDao"
>
<resultMap
id=
"dataMap"
type=
"cn.bugstack.infrastructure.dao.po.Strategy"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"strategy_id"
property=
"strategyId"
/>
<result
column=
"strategy_desc"
property=
"strategyDesc"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<select
id=
"queryStrategyList"
resultMap=
"dataMap"
>
select strategy_id
from strategy
limit 10
</select>
</mapper>
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_rule_mapper.xml
0 → 100644
浏览文件 @
a75995b6
<?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=
"cn.bugstack.infrastructure.dao.IStrategyRuleDao"
>
<resultMap
id=
"dataMap"
type=
"cn.bugstack.infrastructure.dao.po.StrategyRule"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"strategy_id"
property=
"strategyId"
/>
<result
column=
"award_id"
property=
"awardId"
/>
<result
column=
"rule_type"
property=
"ruleType"
/>
<result
column=
"rule_model"
property=
"ruleModel"
/>
<result
column=
"rule_value"
property=
"ruleValue"
/>
<result
column=
"rule_desc"
property=
"ruleDesc"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<select
id=
"queryStrategyRuleList"
resultMap=
"dataMap"
>
select strategy_id
from strategy_rule
limit 10
</select>
</mapper>
xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/infrastructure/AwardDaoTest.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.test.infrastructure
;
import
cn.bugstack.infrastructure.dao.IAwardDao
;
import
cn.bugstack.infrastructure.dao.po.Award
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @ClassName: AwardDaoTest
* @Description:
* @Author: zhaoyongfeng
* @Date: 2024/11/13 21:12
*/
@SpringBootTest
@Slf4j
@RunWith
(
SpringRunner
.
class
)
public
class
AwardDaoTest
{
@Resource
private
IAwardDao
awardDao
;
@Test
public
void
Test_queryAwardList
(){
List
<
Award
>
awards
=
awardDao
.
queryAwardList
();
log
.
info
(
"测试结果:{}"
,
awards
);
}
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IAwardDao.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao
;
import
cn.bugstack.infrastructure.dao.po.Award
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
IAwardDao
{
List
<
Award
>
queryAwardList
();
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao
;
import
cn.bugstack.infrastructure.dao.po.Award
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
IStrategyAwardDao
{
List
<
Award
>
queryStrategyAwardList
();
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyDao.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao
;
import
cn.bugstack.infrastructure.dao.po.Award
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
IStrategyDao
{
List
<
Award
>
queryStrategyList
();
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyRuleDao.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao
;
import
cn.bugstack.infrastructure.dao.po.Award
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
IStrategyRuleDao
{
List
<
Award
>
queryStrategyRuleList
();
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/package-info.java
已删除
100644 → 0
浏览文件 @
4b7910e3
/**
* DAO 接口;IXxxDao
*/
package
cn.bugstack.infrastructure.dao
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Award.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao.po
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName: Award
* @Description:
* @Author: zhaoyongfeng
* @Date: 2024/11/13 20:24
*/
@Data
public
class
Award
{
/** 自增ID */
private
Long
id
;
/** 抽奖奖品ID - 内部流转使用 */
private
Integer
awardId
;
/** 奖品对接标识 - 每一个都是一个对应的发奖策略 */
private
String
awardKey
;
/** 奖品配置信息 */
private
String
awardConfig
;
/** 奖品内容描述 */
private
String
awardDesc
;
/** 创建时间 */
private
Date
createTime
;
/** 更新时间 */
private
Date
updateTime
;
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Strategy.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao.po
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName: Strategy
* @Description:
* @Author: zhaoyongfeng
* @Date: 2024/11/13 20:26
*/
@Data
public
class
Strategy
{
/* ID*/
private
Long
id
;
/* 抽奖策略描述*/
private
Long
strategyId
;
/* 抽奖策略ID*/
private
String
strategyDesc
;
/* 创建时间*/
private
Date
createTime
;
/* 更新时间*/
private
Date
updateTime
;
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyAward.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao.po
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @ClassName: StrategyAward
* @Description:
* @Author: zhaoyongfeng
* @Date: 2024/11/13 20:46
*/
@Data
public
class
StrategyAward
{
/** 自增ID */
private
Long
id
;
/** 抽奖策略ID */
private
Long
strategyId
;
/** 抽奖奖品ID - 内部流转使用 */
private
Integer
awardId
;
/** 抽奖奖品标题 */
private
String
awardTitle
;
/** 抽奖奖品副标题 */
private
String
awardSubtitle
;
/** 奖品库存总量 */
private
Integer
awardCount
;
/** 奖品库存剩余 */
private
Integer
awardCountSurplus
;
/** 奖品中奖概率 */
private
BigDecimal
awardRate
;
/** 规则模型,rule配置的模型同步到此表,便于使用 */
private
String
ruleModels
;
/** 排序 */
private
Integer
sort
;
/** 创建时间 */
private
Date
createTime
;
/** 修改时间 */
private
Date
updateTime
;
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyRule.java
0 → 100644
浏览文件 @
a75995b6
package
cn.bugstack.infrastructure.dao.po
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName: StrategyRule
* @Description:
* @Author: zhaoyongfeng
* @Date: 2024/11/13 20:47
*/
@Data
public
class
StrategyRule
{
/** 自增ID */
private
Long
id
;
/** 抽奖策略ID */
private
Long
strategyId
;
/** 抽奖奖品ID【规则类型为策略,则不需要奖品ID】 */
private
Integer
awardId
;
/** 抽象规则类型;1-策略规则、2-奖品规则 */
private
Integer
ruleType
;
/** 抽奖规则类型【rule_random - 随机值计算、rule_lock - 抽奖几次后解锁、rule_luck_award - 幸运奖(兜底奖品)】 */
private
String
ruleModel
;
/** 抽奖规则比值 */
private
String
ruleValue
;
/** 抽奖规则描述 */
private
String
ruleDesc
;
/** 创建时间 */
private
Date
createTime
;
/** 更新时间 */
private
Date
updateTime
;
}
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/package-info.java
已删除
100644 → 0
浏览文件 @
4b7910e3
/**
* 持久化对象;XxxPO 最后的 PO 是大写,UserPO
*/
package
cn.bugstack.infrastructure.dao.po
;
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录