Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
662b8806
提交
662b8806
authored
1月 09, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加文件上传、删除接口;评论保存图片等
上级
c7d5f895
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
141 行增加
和
28 行删除
+141
-28
UploadController.java
...ava/com/diaoyun/zion/chinafrica/api/UploadController.java
+45
-0
ShopifyController.java
...diaoyun/zion/chinafrica/controller/ShopifyController.java
+2
-0
TbCfItemCommentEntity.java
...diaoyun/zion/chinafrica/entity/TbCfItemCommentEntity.java
+71
-21
TbCfItemCommentServiceImpl.java
...n/chinafrica/service/impl/TbCfItemCommentServiceImpl.java
+7
-0
TbCfUserInfoServiceImpl.java
...zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
+2
-6
TbCfItemCommentDao.xml
src/main/resources/mapper/TbCfItemCommentDao.xml
+14
-1
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/api/UploadController.java
0 → 100644
浏览文件 @
662b8806
package
com
.
diaoyun
.
zion
.
chinafrica
.
api
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.enums.ResultCodeEnum
;
import
com.diaoyun.zion.master.util.OssUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @Auther: wudepeng
* @Date: 2020/01/09
* @Description:文件上传API
*/
@Api
(
tags
=
"文件上传API"
)
@RestController
@RequestMapping
(
"/api/upload"
)
public
class
UploadController
{
@ApiOperation
(
"文件上传"
)
@PostMapping
(
"/uploadFile"
)
public
Result
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
Result
result
=
new
Result
();
Map
map
=
new
HashMap
();
String
url
=
OssUtil
.
upload
(
file
,
"Afrishop"
);
map
.
put
(
"url"
,
url
);
result
.
setData
(
map
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
return
result
;
}
@ApiOperation
(
"删除文件"
)
@DeleteMapping
(
"/delFile"
)
public
Result
delFile
(
@RequestParam
(
"url"
)
String
url
)
{
Result
result
=
new
Result
();
Map
map
=
new
HashMap
();
boolean
b
=
OssUtil
.
deleteFile
(
url
);
map
.
put
(
"isDeleted"
,
b
);
result
.
setData
(
map
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
return
result
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/controller/ShopifyController.java
浏览文件 @
662b8806
...
...
@@ -202,4 +202,6 @@ public class ShopifyController {
public
Result
giveLike
(
@ApiParam
(
"评论ID"
)
@PathVariable
String
commentId
)
{
return
tbCfItemCommentService
.
giveLike
(
commentId
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfItemCommentEntity.java
浏览文件 @
662b8806
...
...
@@ -8,7 +8,7 @@ import java.util.Date;
* 表名 tb_cf_item_comment
*
* @author lipengjun
* @date 20
19-11-18 14:31:39
* @date 20
20-01-09 10:17:03
*/
public
class
TbCfItemCommentEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -29,6 +29,14 @@ public class TbCfItemCommentEntity implements Serializable {
* 商品ID
*/
private
String
itemId
;
/**
* 类型 0: 只有文本内容 1:带图片
*/
private
Integer
type
;
/**
* 图片或视频的url
*/
private
String
urls
;
/**
* 商品评分
*/
...
...
@@ -62,19 +70,41 @@ public class TbCfItemCommentEntity implements Serializable {
*/
private
Date
createTime
;
/**
*
回复
时间
*
更新
时间
*/
private
Date
updateTime
;
private
String
username
;
private
String
userName
;
private
String
orderNo
;
private
String
itemName
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getOrderNo
()
{
return
orderNo
;
}
public
void
setOrderNo
(
String
orderNo
)
{
this
.
orderNo
=
orderNo
;
}
public
String
getItemName
()
{
return
itemName
;
}
public
String
getUsername
(
)
{
return
usern
ame
;
public
void
setItemName
(
String
itemName
)
{
this
.
itemName
=
itemN
ame
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
public
static
long
getSerialVersionUID
(
)
{
return
serialVersionUID
;
}
/**
...
...
@@ -90,7 +120,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
String
getId
()
{
return
id
;
}
/**
* 设置:评论人
*/
...
...
@@ -104,7 +133,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
String
getUserId
()
{
return
userId
;
}
/**
* 设置:订单ID
*/
...
...
@@ -118,7 +146,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
String
getOrderId
()
{
return
orderId
;
}
/**
* 设置:商品ID
*/
...
...
@@ -132,7 +159,32 @@ public class TbCfItemCommentEntity implements Serializable {
public
String
getItemId
()
{
return
itemId
;
}
/**
* 设置:类型 0: 只有文本内容 1:带图片
*/
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
/**
* 获取:类型 0: 只有文本内容 1:带图片
*/
public
Integer
getType
()
{
return
type
;
}
/**
* 设置:图片或视频的url
*/
public
void
setUrls
(
String
urls
)
{
this
.
urls
=
urls
;
}
/**
* 获取:图片或视频的url
*/
public
String
getUrls
()
{
return
urls
;
}
/**
* 设置:商品评分
*/
...
...
@@ -146,7 +198,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
Integer
getItemScore
()
{
return
itemScore
;
}
/**
* 设置:服务评分
*/
...
...
@@ -160,7 +211,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
Integer
getServiceScore
()
{
return
serviceScore
;
}
/**
* 设置:物流评分
*/
...
...
@@ -174,7 +224,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
Integer
getLogisticsScore
()
{
return
logisticsScore
;
}
/**
* 设置:价格评分
*/
...
...
@@ -188,7 +237,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
Integer
getPriceScore
()
{
return
priceScore
;
}
/**
* 设置:商品评论
*/
...
...
@@ -202,7 +250,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
String
getItemReview
()
{
return
itemReview
;
}
/**
* 设置:点赞人数
*/
...
...
@@ -216,7 +263,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
Long
getLikeNum
()
{
return
likeNum
;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
...
...
@@ -230,7 +276,6 @@ public class TbCfItemCommentEntity implements Serializable {
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
...
...
@@ -244,12 +289,17 @@ public class TbCfItemCommentEntity implements Serializable {
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfItemCommentServiceImpl.java
浏览文件 @
662b8806
...
...
@@ -9,6 +9,7 @@ import com.diaoyun.zion.master.base.Result;
import
com.diaoyun.zion.master.enums.ResultCodeEnum
;
import
com.diaoyun.zion.master.util.IdUtil
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -138,6 +139,10 @@ public class TbCfItemCommentServiceImpl implements TbCfItemCommentService {
comment
.
setLikeNum
(
0L
);
comment
.
setCreateTime
(
new
Date
());
comment
.
setUpdateTime
(
new
Date
());
comment
.
setType
(
0
);
if
(!
StringUtils
.
isBlank
(
comment
.
getUrls
()))
{
comment
.
setType
(
1
);
}
int
i
=
tbCfItemCommentDao
.
save
(
comment
);
if
(
i
>
0
)
{
result
.
setCode
(
ResultCodeEnum
.
SUCCESS
.
getCode
()).
setMessage
(
"Comment on success!"
);
...
...
@@ -193,4 +198,6 @@ public class TbCfItemCommentServiceImpl implements TbCfItemCommentService {
return
result
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
浏览文件 @
662b8806
...
...
@@ -297,13 +297,9 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
String
phone
=
"+"
+
phoneNum
.
trim
();
Result
result
=
new
Result
();
TbCfUserInfoEntity
user
=
tbCfUserInfoDao
.
checkUserByPhone
(
phone
);
if
(
user
==
null
)
{
result
.
setData
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
"You haven't registered yet, please register first!"
);
return
result
;
}
String
phoneCode
=
(
String
)
captchaRedisCache
.
get
(
KeyConstant
.
CAPTCHA_PHONE
+
phone
);
if
(
phoneCode
==
null
)
{
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
()).
setMessage
(
"Verification code failure"
);
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
()).
setMessage
(
"Verification code failure
!
"
);
return
result
;
}
if
(
user
!=
null
&&
phoneCode
.
equals
(
code
))
{
...
...
@@ -311,7 +307,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
captchaRedisCache
.
delete
(
KeyConstant
.
CAPTCHA_PHONE
+
phone
);
}
else
{
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
());
result
.
setMessage
(
"
Login failed
"
);
result
.
setMessage
(
"
You haven't registered yet, please register first!
"
);
}
return
result
;
}
...
...
src/main/resources/mapper/TbCfItemCommentDao.xml
浏览文件 @
662b8806
...
...
@@ -8,6 +8,8 @@
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"itemId"
column=
"item_id"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"urls"
column=
"urls"
/>
<result
property=
"itemScore"
column=
"item_score"
/>
<result
property=
"serviceScore"
column=
"service_score"
/>
<result
property=
"logisticsScore"
column=
"logistics_score"
/>
...
...
@@ -25,6 +27,8 @@
`user_id`,
`order_id`,
`item_id`,
`type`,
`urls`,
`item_score`,
`service_score`,
`logistics_score`,
...
...
@@ -72,6 +76,8 @@
`user_id`,
`order_id`,
`item_id`,
`type`,
`urls`,
`item_score`,
`service_score`,
`logistics_score`,
...
...
@@ -91,6 +97,8 @@
`order_id`,
`item_id`,
`item_score`,
`type`,
`urls`,
`service_score`,
`logistics_score`,
`price_score`,
...
...
@@ -118,7 +126,6 @@
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_item_comment
WHERE 1=1
...
...
@@ -133,6 +140,8 @@
`user_id`,
`order_id`,
`item_id`,
`type`,
`urls`,
`item_score`,
`service_score`,
`logistics_score`,
...
...
@@ -147,6 +156,8 @@
#{userId},
#{orderId},
#{itemId},
#{type},
#{urls},
#{itemScore},
#{serviceScore},
#{logisticsScore},
...
...
@@ -164,6 +175,8 @@
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"orderId != null"
>
`order_id` = #{orderId},
</if>
<if
test=
"itemId != null"
>
`item_id` = #{itemId},
</if>
<if
test=
"type != null"
>
`type` = #{type},
</if>
<if
test=
"urls != null"
>
`urls` = #{urls},
</if>
<if
test=
"itemScore != null"
>
`item_score` = #{itemScore},
</if>
<if
test=
"serviceScore != null"
>
`service_score` = #{serviceScore},
</if>
<if
test=
"logisticsScore != null"
>
`logistics_score` = #{logisticsScore},
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论