Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
T
tongmeng-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
林海冰
tongmeng-app
Commits
bb8d7ed0
提交
bb8d7ed0
authored
1月 17, 2019
作者:
Mangostiffy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增分享记录接口
上级
1403ae66
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
0 行删除
+59
-0
ShareAPi.java
src/main/java/com/mall/controller/api/ShareAPi.java
+25
-0
ShareManager.java
...in/java/com/mall/service/mengbeng/share/ShareManager.java
+8
-0
ShareService.java
...va/com/mall/service/mengbeng/share/impl/ShareService.java
+5
-0
ShareMapper.xml
src/main/resources/mybatis1/tongmeng/ShareMapper.xml
+21
-0
没有找到文件。
src/main/java/com/mall/controller/api/ShareAPi.java
浏览文件 @
bb8d7ed0
...
@@ -12,6 +12,7 @@ import javax.annotation.Resource;
...
@@ -12,6 +12,7 @@ import javax.annotation.Resource;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
@Controller
@Controller
@RequestMapping
(
value
=
"/api/share"
,
produces
=
"application/json;charset=UTF-8"
)
@RequestMapping
(
value
=
"/api/share"
,
produces
=
"application/json;charset=UTF-8"
)
...
@@ -33,6 +34,9 @@ public class ShareAPi extends BaseController {
...
@@ -33,6 +34,9 @@ public class ShareAPi extends BaseController {
if
(
null
==
share_store_id
||
null
==
shared_store_id
){
if
(
null
==
share_store_id
||
null
==
shared_store_id
){
return
ResultOutDto
.
err
(
null
,
"缺少参数"
);
return
ResultOutDto
.
err
(
null
,
"缺少参数"
);
}
}
if
(
share_store_id
.
equals
(
shared_store_id
)){
return
ResultOutDto
.
err
(
null
,
"不能分享自己"
);
}
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
share_time
=
df
.
format
(
new
Date
());
String
share_time
=
df
.
format
(
new
Date
());
...
@@ -45,4 +49,25 @@ public class ShareAPi extends BaseController {
...
@@ -45,4 +49,25 @@ public class ShareAPi extends BaseController {
return
ResultOutDto
.
err
(
null
,
"错误"
);
return
ResultOutDto
.
err
(
null
,
"错误"
);
}
}
}
}
/**
* 列出分享详细内容
* @return
*/
@RequestMapping
(
"/listsharedetial"
)
@ResponseBody
public
ResultOutDto
listShareDetial
(){
try
{
PageData
pd
=
this
.
getPageData
();
String
shareed_store
=
pd
.
getString
(
"shareed_store"
);
if
(
null
==
shareed_store
){
return
ResultOutDto
.
err
(
null
,
"缺少参数"
);
}
List
<
PageData
>
list
=
shareService
.
listAll
(
pd
);
return
ResultOutDto
.
ok
(
list
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
ResultOutDto
.
err
(
null
,
"错误"
);
}
}
}
}
src/main/java/com/mall/service/mengbeng/share/ShareManager.java
浏览文件 @
bb8d7ed0
...
@@ -20,4 +20,12 @@ public interface ShareManager {
...
@@ -20,4 +20,12 @@ public interface ShareManager {
* @throws Exception
* @throws Exception
*/
*/
public
List
<
PageData
>
list
(
Page
page
)
throws
Exception
;
public
List
<
PageData
>
list
(
Page
page
)
throws
Exception
;
/**
* 列表全部
* @param pd
* @return
* @throws Exception
*/
public
List
<
PageData
>
listAll
(
PageData
pd
)
throws
Exception
;
}
}
src/main/java/com/mall/service/mengbeng/share/impl/ShareService.java
浏览文件 @
bb8d7ed0
...
@@ -30,4 +30,9 @@ public class ShareService implements ShareManager {
...
@@ -30,4 +30,9 @@ public class ShareService implements ShareManager {
public
List
<
PageData
>
list
(
Page
page
)
throws
Exception
{
public
List
<
PageData
>
list
(
Page
page
)
throws
Exception
{
return
(
List
<
PageData
>)
dao
.
findForList
(
"ShareMapper.DatalistPage"
,
page
);
return
(
List
<
PageData
>)
dao
.
findForList
(
"ShareMapper.DatalistPage"
,
page
);
}
}
@Override
public
List
<
PageData
>
listAll
(
PageData
pd
)
throws
Exception
{
return
(
List
<
PageData
>)
dao
.
findForList
(
"ShareMapper.listAll"
,
pd
);
}
}
}
src/main/resources/mybatis1/tongmeng/ShareMapper.xml
浏览文件 @
bb8d7ed0
...
@@ -38,4 +38,25 @@
...
@@ -38,4 +38,25 @@
order by share_time desc
order by share_time desc
</select>
</select>
<!--列表全部-->
<select
id=
"listAll"
parameterType=
"pd"
resultType=
"pd"
>
select
share_store,
share.store_name as share_store_name,
share.store_logo as share_store_logo,
shareed_store,
shared.store_name as shared_store_name,
shared.store_logo as shared_store_logo,
share_time
from
<include
refid=
"tableName"
></include>
inner join c_store as share on share.store_id=
<include
refid=
"tableName"
></include>
.share_store
inner join c_store as shared on shared.store_id=
<include
refid=
"tableName"
></include>
.shareed_store
where 1=1
<if
test=
"shareed_store!= null and shareed_store != ''"
>
and shareed_store = #{shareed_store}
</if>
order by share_time desc
</select>
</mapper>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论